mirror of
https://github.com/outbackdingo/debos.git
synced 2026-01-27 18:18:45 +00:00
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:
1
.github/workflows/ci.yaml
vendored
1
.github/workflows/ci.yaml
vendored
@@ -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
20
tests/escaping/test.yaml
Normal 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
|
||||
Reference in New Issue
Block a user