Remove unnecessary absolute paths from tests.

pull/50728/head
Matt Clay 6 years ago
parent d2a9b16f7e
commit f06474ae4f

@ -16,4 +16,5 @@
- assert: - assert:
that: that:
- result is failed - result is failed
- "'an error with' in result.msg" # makes sure plugin was found
- debug_task is success - debug_task is success

@ -2,4 +2,4 @@
set -o nounset -o errexit -o xtrace set -o nounset -o errexit -o xtrace
ANSIBLE_CONNECTION_PLUGINS="$(pwd)/plugin" ansible-playbook -i inventory "$(pwd)/play.yml" -v "$@" ansible-playbook -i inventory "play.yml" -v "$@"

@ -6,25 +6,25 @@ set -eux
ansible-playbook modules_test.yml -i ../../inventory -v "$@" ansible-playbook modules_test.yml -i ../../inventory -v "$@"
# Library path ping module # Library path ping module
ANSIBLE_LIBRARY=$(pwd)/lib_with_extension ansible-playbook modules_test_envvar.yml -i ../../inventory -v "$@" ANSIBLE_LIBRARY=lib_with_extension ansible-playbook modules_test_envvar.yml -i ../../inventory -v "$@"
ANSIBLE_LIBRARY=$(pwd)/lib_no_extension ansible-playbook modules_test_envvar.yml -i ../../inventory -v "$@" ANSIBLE_LIBRARY=lib_no_extension ansible-playbook modules_test_envvar.yml -i ../../inventory -v "$@"
# ping module from role # ping module from role
ANSIBLE_ROLES_PATH=$(pwd)/roles_with_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@" ANSIBLE_ROLES_PATH=roles_with_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
ANSIBLE_ROLES_PATH=$(pwd)/roles_no_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@" ANSIBLE_ROLES_PATH=roles_no_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
# ping module from role when there's a library path module too # ping module from role when there's a library path module too
ANSIBLE_LIBRARY=$(pwd)/lib_no_extension ANSIBLE_ROLES_PATH=$(pwd)/roles_with_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@" ANSIBLE_LIBRARY=lib_no_extension ANSIBLE_ROLES_PATH=roles_with_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
ANSIBLE_LIBRARY=$(pwd)/lib_with_extension ANSIBLE_ROLES_PATH=$(pwd)/roles_with_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@" ANSIBLE_LIBRARY=lib_with_extension ANSIBLE_ROLES_PATH=roles_with_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
ANSIBLE_LIBRARY=$(pwd)/lib_no_extension ANSIBLE_ROLES_PATH=$(pwd)/roles_no_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@" ANSIBLE_LIBRARY=lib_no_extension ANSIBLE_ROLES_PATH=roles_no_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
ANSIBLE_LIBRARY=$(pwd)/lib_with_extension ANSIBLE_ROLES_PATH=$(pwd)/roles_no_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@" ANSIBLE_LIBRARY=lib_with_extension ANSIBLE_ROLES_PATH=roles_no_extension ansible-playbook modules_test_role.yml -i ../../inventory -v "$@"
# ping module in multiple roles: Note that this will use the first module found # ping module in multiple roles: Note that this will use the first module found
# which is the current way things work but may not be the best way # which is the current way things work but may not be the best way
ANSIBLE_LIBRARY=$(pwd)/lib_no_extension ANSIBLE_ROLES_PATH=$(pwd)/multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@" ANSIBLE_LIBRARY=lib_no_extension ANSIBLE_ROLES_PATH=multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@"
ANSIBLE_LIBRARY=$(pwd)/lib_with_extension ANSIBLE_ROLES_PATH=$(pwd)/multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@" ANSIBLE_LIBRARY=lib_with_extension ANSIBLE_ROLES_PATH=multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@"
ANSIBLE_LIBRARY=$(pwd)/lib_no_extension ANSIBLE_ROLES_PATH=$(pwd)/multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@" ANSIBLE_LIBRARY=lib_no_extension ANSIBLE_ROLES_PATH=multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@"
ANSIBLE_LIBRARY=$(pwd)/lib_with_extension ANSIBLE_ROLES_PATH=$(pwd)/multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@" ANSIBLE_LIBRARY=lib_with_extension ANSIBLE_ROLES_PATH=multiple_roles ansible-playbook modules_test_multiple_roles.yml -i ../../inventory -v "$@"
# And prove that with multiple roles, it's the order the roles are listed in the play that matters # And prove that with multiple roles, it's the order the roles are listed in the play that matters
ANSIBLE_LIBRARY=$(pwd)/lib_with_extension ANSIBLE_ROLES_PATH=$(pwd)/multiple_roles ansible-playbook modules_test_multiple_roles_reverse_order.yml -i ../../inventory -v "$@" ANSIBLE_LIBRARY=lib_with_extension ANSIBLE_ROLES_PATH=multiple_roles ansible-playbook modules_test_multiple_roles_reverse_order.yml -i ../../inventory -v "$@"

@ -3,4 +3,4 @@
set -eux set -eux
ansible-playbook module_utils_test.yml -i ../../inventory -v "$@" ansible-playbook module_utils_test.yml -i ../../inventory -v "$@"
ANSIBLE_MODULE_UTILS=$(pwd)/other_mu_dir ansible-playbook module_utils_envvar.yml -i ../../inventory -v "$@" ANSIBLE_MODULE_UTILS=other_mu_dir ansible-playbook module_utils_envvar.yml -i ../../inventory -v "$@"

@ -18,7 +18,7 @@ source "${MYTMPDIR}/jinja2/bin/activate"
pip install -U jinja2 pip install -U jinja2
ANSIBLE_ROLES_PATH="$(dirname "$(pwd)")" ANSIBLE_ROLES_PATH=../
export ANSIBLE_ROLES_PATH export ANSIBLE_ROLES_PATH
ansible-playbook -i ../../inventory main.yml -e @../../integration_config.yml -v "$@" ansible-playbook -i ../../inventory main.yml -e @../../integration_config.yml -v "$@"

@ -25,7 +25,7 @@ echo "$PB_OUT" | grep -F "assert works (True)" || exit 1
set -e set -e
# ensure test-module script works well # ensure test-module script works well
PING_MODULE_PATH="$(pwd)/../../../../lib/ansible/modules/system/ping.py" PING_MODULE_PATH="../../../../lib/ansible/modules/system/ping.py"
../../../../hacking/test-module -m "$PING_MODULE_PATH" -I ansible_python_interpreter="$(which python)" ../../../../hacking/test-module -m "$PING_MODULE_PATH" -I ansible_python_interpreter="$(which python)"
# ensure module.ansible_version is defined when using test-module # ensure module.ansible_version is defined when using test-module

@ -4,10 +4,7 @@
set -euo pipefail set -euo pipefail
# Get Current test directory contrib_dir=../../../../contrib/inventory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
contrib_dir=$(pwd)/../../../../contrib/inventory
echo "DEBUG: using ${contrib_dir}" echo "DEBUG: using ${contrib_dir}"
@ -57,6 +54,6 @@ echo "Debugging new instances"
curl "http://${vcenter_host}:5000/govc_find" curl "http://${vcenter_host}:5000/govc_find"
# Get inventory # Get inventory
ansible-playbook -i ./vmware_inventory.sh "${DIR}/test_vmware_inventory.yml" --connection=local "$@" ansible-playbook -i ./vmware_inventory.sh "./test_vmware_inventory.yml" --connection=local "$@"
echo "DEBUG: Done" echo "DEBUG: Done"

Loading…
Cancel
Save