From ed8bdc3599efb5ef4a3fbd032fdba9cf62c4590f Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 14 Nov 2018 11:24:18 +0100 Subject: [PATCH] new: test: added a test to ensure ``$COMPOSE_YML_FILE`` is correctly accessible from actions. --- test/action | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/action b/test/action index 38c0f60..19651e1 100755 --- a/test/action +++ b/test/action @@ -81,6 +81,27 @@ expected="hello from foo: a b c -y -z j --help" } +## -- direct charm access to \$COMPOSE_YML_FILE + + + cat <<'EOF2' > $test_tmpdir/www/actions/foo +#!/bin/bash + +printf "COMPOSE_YML_FILE: '%s'" "\$COMPOSE_YML_FILE" +EOF2 + +cd "$test_tmpdir" +out=\$("$tprog" foo web_site a b c -y -z j --help 2>&1 >/dev/null ) || exit 1 +expected="COMPOSE_YML_FILE: '$test_tmpdir/compose.yml'" + +[[ "\$out" == *"\$expected" ]] || { + echo "doesn't end with: \$expected" >&2 + echo "\$out" + exit 1 +} + + + EOF tear_test