From cd78825be7e5006140a49a26146f9123aeafd1d3 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Thu, 23 May 2019 10:29:50 -0400 Subject: Cirrus: More tests to verify cache_images Signed-off-by: Chris Evich --- contrib/cirrus/lib.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'contrib/cirrus/lib.sh') 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}' | \ -- cgit v1.2.3-54-g00ecf