summaryrefslogtreecommitdiff
path: root/contrib/cirrus/lib.sh.t
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-05-21 22:08:00 +0200
committerGitHub <noreply@github.com>2019-05-21 22:08:00 +0200
commit8f43d08d966b9519011cb8ca86e2db9f1f18dfcb (patch)
treee436080eb7b9659b71e03df367d1ea87cfac8c76 /contrib/cirrus/lib.sh.t
parentcec56b0075eeec6a8cdfba3138dec32fdcd36b47 (diff)
parentbd0ac639bf1100c268d436bd44032b8fa46b9cc6 (diff)
downloadpodman-8f43d08d966b9519011cb8ca86e2db9f1f18dfcb.tar.gz
podman-8f43d08d966b9519011cb8ca86e2db9f1f18dfcb.tar.bz2
podman-8f43d08d966b9519011cb8ca86e2db9f1f18dfcb.zip
Merge pull request #2561 from cevich/cirrus_test_images
Cirrus: Support testing of VM cache-image changes
Diffstat (limited to 'contrib/cirrus/lib.sh.t')
-rwxr-xr-xcontrib/cirrus/lib.sh.t17
1 files changed, 12 insertions, 5 deletions
diff --git a/contrib/cirrus/lib.sh.t b/contrib/cirrus/lib.sh.t
index ce51f8ad2..1f05b3bb5 100755
--- a/contrib/cirrus/lib.sh.t
+++ b/contrib/cirrus/lib.sh.t
@@ -10,12 +10,13 @@ rc=0
function check_result {
testnum=$(expr $testnum + 1)
- if [ "$1" = "$2" ]; then
- echo "ok $testnum $3 = $1"
+ MSG=$(echo "$1" | tr -d '*>\012'|sed -e 's/^ \+//')
+ if [ "$MSG" = "$2" ]; then
+ echo "ok $testnum $3 = $MSG"
else
echo "not ok $testnum $3"
echo "# expected: $2"
- echo "# actual: $1"
+ echo "# actual: $MSG"
rc=1
fi
}
@@ -64,11 +65,17 @@ test_rev '' 1 'FATAL: req_env_var: invoked without arguments'
unset FOO BAR
test_rev FOO 9 'FATAL: test_rev() requires $FOO to be non-empty'
test_rev BAR 9 'FATAL: test_rev() requires $BAR to be non-empty'
-
-# OK if desired envariable is unset
+# OK if desired envariable was unset
FOO=1
test_rev FOO 0 ''
+# OK if multiple vars are non-empty
+FOO="stuff"
+BAR="things"
+ENV_VARS="FOO BAR"
+test_rev "$ENV_VARS" 0 ''
+unset BAR
+
# ...but error if any single desired one is unset
test_rev "FOO BAR" 9 'FATAL: test_rev() requires $BAR to be non-empty'