tests/cli-extensions: tweak test logic

This updates the test logic for CLI extensions, actually checking
for functional output from the subcommand.
It also cleans up some environmental leftover.
This commit is contained in:
Luca BRUNO committed 2021-12-21 10:18:30 +00:00
1 parent 7c6719995d
commit 5dbe37ce78
1 file changed
+6 -2
+6 -2
View File
@@ -10,10 +10,14 @@ set -euo pipefail
echo '1..2'
mkdir -p ./localbin
ORIG_PATH="${PATH}"
export PATH="./localbin/:${PATH}"
ln -s /usr/bin/env ./localbin/ostree-env
${CMD_PREFIX} ostree env --help >out.txt
assert_file_has_content out.txt "with an empty environment"
export A_CUSTOM_TEST_FLAG="myvalue"
${CMD_PREFIX} ostree env >out.txt
assert_file_has_content out.txt "^A_CUSTOM_TEST_FLAG=myvalue"
PATH="${ORIG_PATH}"
export -n A_CUSTOM_TEST_FLAG
rm -rf -- localbin
echo 'ok CLI extension localbin ostree-env'