Skip to content

Commit

Permalink
Add CI test for escaping
Browse files Browse the repository at this point in the history
Test both escaping variables passed into debos and the new escaping
template function

Signed-off-by: Sjoerd Simons <[email protected]>
  • Loading branch information
sjoerdsimons committed Nov 10, 2023
1 parent 5cae218 commit 20a384d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
20 changes: 20 additions & 0 deletions tests/escaping/test.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 20a384d

Please sign in to comment.