Debian Codegraph @

test/integration/targets/ansible-test-vendoring/runme.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 set -eux
4
5 # Run import sanity tests which require modifications to the source directory.
6
7 vendor_dir="$(python -c 'import pathlib, ansible._vendor; print(pathlib.Path(ansible._vendor.__file__).parent)')"
8
9 mkdirscip-shell system . . mkdir. "${vendor_dir}/packaging/" # intended to fail if packaging is already present (to avoid deleting it later)
10
11 cleanupscip-shell shell shell-project 0.0.0 cleanup().() {
12 rmscip-shell system . . rm. -rf "${vendor_dir}/packaging/"
13 }
14
15 trap cleanup EXIT
16
17 # Verify that packages installed in the vendor directory are loaded by ansible-test.
18 # This is done by injecting a broken `packaging` package, which should cause ansible-test to fail.
19
20 echoscip-shell system . . echo. 'raise Exception("intentional failure from ansible-test-vendoring integration test")' > "${vendor_dir}/packaging/__init__.py"
21
22 if ansible-test sanity --test import --color --truncate 0 "${@}" > output.log 2>&1; then
23 echoscip-shell system . . echo. "ansible-test did not exit with a non-zero status"
24 catscip-shell system . . cat. output.log
25 exit 1
26 fi
27
28 if ! grepscip-shell system . . grep. '^Exception: intentional failure from ansible-test-vendoring integration test$' output.log; then
29 echoscip-shell system . . echo. "ansible-test did not fail with the expected output"
30 catscip-shell system . . cat. output.log
31 exit 1
32 fi
33