Add CI test for escaping

Test both escaping variables passed into debos and the new escaping
template function

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
This commit is contained in:
Sjoerd Simons
2023-11-10 21:02:43 +01:00
parent ddaf2edb99
commit 659acaa0b5
2 changed files with 21 additions and 0 deletions

View File

@@ -125,6 +125,7 @@ jobs:
- { name: "uml", backend: "--fakemachine-backend=uml" }
test:
- { name: "recipes", case: "recipes" }
- { name: "escaping", case: "escaping", variables: " -t escaped:\\$ba\\'d\\$gers\\ snakes" }
- { name: "debian (amd64)", case: "debian", variables: "-t architecture:amd64" }
- { name: "debian (arm64)", case: "debian", variables: "-t architecture:arm64" }
- { name: "debian (armhf)", case: "debian", variables: "-t architecture:armhf" }

20
tests/escaping/test.yaml Normal file
View File

@@ -0,0 +1,20 @@
# expected to be run with -t escaled:\$bad\'ge\$rs or similar to verify passing
# variables onwards
{{ $escaped := or .escaped "$mu'room$" }}
architecture: amd64
actions:
- action: run
description: test escaping
chroot: false
command: echo {{ escape $escaped }} > test.a
- action: run
description: test escaping
chroot: false
command: |-
cat << 'EOF' > test.b
{{ $escaped }}
EOF
- action: run
chroot: false
command: diff -u test.a test.b