Remove unnecessary absolute paths from tests.

This commit is contained in:
Matt Clay 2019-01-16 22:34:09 -08:00
parent d2a9b16f7e
commit f06474ae4f
8 changed files with 20 additions and 22 deletions

View file

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

View file

@ -2,4 +2,4 @@
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 "$@"

View file

@ -6,25 +6,25 @@ set -eux
ansible-playbook modules_test.yml -i ../../inventory -v "$@"
# Library path ping module
ANSIBLE_LIBRARY=$(pwd)/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_with_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
ANSIBLE_ROLES_PATH=$(pwd)/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_with_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
ANSIBLE_LIBRARY=$(pwd)/lib_no_extension ANSIBLE_ROLES_PATH=$(pwd)/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=$(pwd)/lib_no_extension ANSIBLE_ROLES_PATH=$(pwd)/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_no_extension ANSIBLE_ROLES_PATH=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=lib_no_extension ANSIBLE_ROLES_PATH=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
# 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=$(pwd)/lib_with_extension ANSIBLE_ROLES_PATH=$(pwd)/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=$(pwd)/lib_with_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=lib_with_extension ANSIBLE_ROLES_PATH=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=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
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 "$@"

View file

@ -3,4 +3,4 @@
set -eux
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 "$@"

View file

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

View file

@ -25,7 +25,7 @@ echo "$PB_OUT" | grep -F "assert works (True)" || exit 1
set -e
# 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)"
# ensure module.ansible_version is defined when using test-module

View file

@ -4,10 +4,7 @@
set -euo pipefail
# Get Current test directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
contrib_dir=$(pwd)/../../../../contrib/inventory
contrib_dir=../../../../contrib/inventory
echo "DEBUG: using ${contrib_dir}"
@ -57,6 +54,6 @@ echo "Debugging new instances"
curl "http://${vcenter_host}:5000/govc_find"
# 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"