Debian Codegraph @

test/integration/targets/plugin_loader/runme.sh

raw
1 #!/usr/bin/env bash
2
3 set -eux
4
5 cleanup() {
6 unlink normal/library/_symlink.py
7
8 rm "$core_module_path/modules/deprecated_core_module.py"
9 rm "$core_module_path/plugins/connection/deprecated_core_connection.py"
10 }
11
12 pushd normal/library
13 ln -s _underscore.py _symlink.py
14 popd
15
16 # inject a couple of phony deprecated core plugins
17 core_module_path=$(dirname "$(python -c 'from importlib.util import find_spec; print(find_spec("ansible").origin)')")
18
19 cp deprecated_core_plugins/deprecated_core_module.py "$core_module_path/modules"
20 cp deprecated_core_plugins/deprecated_core_connection.py "$core_module_path/plugins/connection"
21
22 trap 'cleanup' EXIT
23
24
25 # check normal execution
26 for myplay in normal/*.yml
27 do
28 ansible-playbook "${myplay}" -i ../../inventory -vvv "$@"
29 if test $? != 0 ; then
30 echo "### Failed to run ${myplay} normally"
31 exit 1
32 fi
33 done
34
35 # check overrides
36 for myplay in override/*.yml
37 do
38 ansible-playbook "${myplay}" -i ../../inventory -vvv "$@"
39 if test $? != 0 ; then
40 echo "### Failed to run ${myplay} override"
41 exit 1
42 fi
43 done
44
45 # test config loading
46 ansible-playbook use_coll_name.yml -i ../../inventory -e 'ansible_connection=ansible.builtin.ssh' "$@"
47
48 # test filter loading ignoring duplicate file basename
49 ansible-playbook file_collision/play.yml "$@"
50
51 # validate warnings from deprecated core plugins
52 unset ANSIBLE_DEPRECATION_WARNINGS
53 ansible-playbook deprecated_core_plugins.yml