Browse Source

new: test: added a test to ensure ``$COMPOSE_YML_FILE`` is correctly accessible from actions.

test
Valentin Lab 6 years ago
parent
commit
ed8bdc3599
  1. 21
      test/action

21
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 EOF
tear_test tear_test

Loading…
Cancel
Save