summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/ansible-test-unsupported-directory/runme.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/ansible-test-unsupported-directory/runme.sh')
-rwxr-xr-xtest/integration/targets/ansible-test-unsupported-directory/runme.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/integration/targets/ansible-test-unsupported-directory/runme.sh b/test/integration/targets/ansible-test-unsupported-directory/runme.sh
new file mode 100755
index 0000000..087177c
--- /dev/null
+++ b/test/integration/targets/ansible-test-unsupported-directory/runme.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+source ../collection/setup.sh
+
+set -eux
+
+cd "${WORK_DIR}"
+
+# some options should succeed even in an unsupported directory
+ansible-test --help
+ansible-test --version
+
+# the --help option should show the current working directory when it is unsupported
+ansible-test --help 2>&1 | grep '^Current working directory: '
+
+# some shell commands also work without a supported directory
+ansible-test shell pwd
+
+if ansible-test sanity 1>stdout 2>stderr; then
+ echo "ansible-test did not fail"
+ exit 1
+fi
+
+grep '^Current working directory: ' stderr
+
+if grep raise stderr; then
+ echo "ansible-test failed with a traceback instead of an error message"
+ exit 2
+fi