summaryrefslogtreecommitdiff
path: root/contrib/cirrus/lib.sh
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2019-05-23 10:29:50 -0400
committerChris Evich <cevich@redhat.com>2019-06-25 15:45:12 -0400
commitcd78825be7e5006140a49a26146f9123aeafd1d3 (patch)
treeb2391e5bd28656403e7165e32bc5afaff0636135 /contrib/cirrus/lib.sh
parent21978c99088c04bcc847eb12f829876708c0b9e2 (diff)
downloadpodman-cd78825be7e5006140a49a26146f9123aeafd1d3.tar.gz
podman-cd78825be7e5006140a49a26146f9123aeafd1d3.tar.bz2
podman-cd78825be7e5006140a49a26146f9123aeafd1d3.zip
Cirrus: More tests to verify cache_images
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus/lib.sh')
-rw-r--r--contrib/cirrus/lib.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index 30141db67..36751fbd7 100644
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -114,6 +114,30 @@ req_env_var() {
done
}
+item_test() {
+ ITEM="$1"
+ shift
+ TEST_ARGS="$@"
+ req_env_var ITEM TEST_ARGS
+
+ if ERR=$(test "$@" 2>&1)
+ then
+ echo "ok $ITEM"
+ return 0
+ else
+ RET=$?
+ echo -n "not ok $ITEM: $TEST_ARGS"
+ if [[ -z "$ERR" ]]
+ then
+ echo ""
+ else # test command itself failed
+ echo -n ":" # space follows :'s in $ERR
+ echo "$ERR" | cut -d : -f 4- # omit filename, line number, and command
+ fi
+ return $RET
+ fi
+}
+
show_env_vars() {
echo "Showing selection of environment variable definitions:"
_ENV_VAR_NAMES=$(awk 'BEGIN{for(v in ENVIRON) print v}' | \