From d36919856f0e9b09a80509b2aa6bef0eb200d309 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 12 Aug 2019 16:23:47 -0700 Subject: [PATCH] Update integration tests. (#60447) * Remove unnecessary ANSIBLE_CONFIG override. * Fix pull integration test. * Fix inventory_foreman integration test. --- test/integration/targets/inventory_foreman/runme.sh | 6 ++++++ .../integration/targets/lookup_hashi_vault/runme.sh | 2 -- test/integration/targets/pull/runme.sh | 13 +++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/test/integration/targets/inventory_foreman/runme.sh b/test/integration/targets/inventory_foreman/runme.sh index 57f4c452820..ba94a9360f5 100755 --- a/test/integration/targets/inventory_foreman/runme.sh +++ b/test/integration/targets/inventory_foreman/runme.sh @@ -4,6 +4,12 @@ set -euo pipefail +export ANSIBLE_INVENTORY +export ANSIBLE_PYTHON_INTERPRETER + +unset ANSIBLE_INVENTORY +unset ANSIBLE_PYTHON_INTERPRETER + export ANSIBLE_CONFIG=ansible.cfg export FOREMAN_HOST="${FOREMAN_HOST:-localhost}" export FOREMAN_PORT="${FOREMAN_PORT:-8080}" diff --git a/test/integration/targets/lookup_hashi_vault/runme.sh b/test/integration/targets/lookup_hashi_vault/runme.sh index a757e8940a7..40a2b22912f 100755 --- a/test/integration/targets/lookup_hashi_vault/runme.sh +++ b/test/integration/targets/lookup_hashi_vault/runme.sh @@ -17,9 +17,7 @@ set -eux # fatal: [testhost]: FAILED! => { "msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a , original message: HTTPSConnectionPool(host='localhost', port=8201): Max retries exceeded with url: /v1/auth/token/lookup-self (Caused by SSLError(SSLError(\"bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)\",),))"} ANSIBLE_ROLES_PATH=../ \ -ANSIBLE_CONFIG=../../integration.cfg \ ansible-playbook -e@../../integration_config.yml playbooks/install_dependencies.yml -v "$@" ANSIBLE_ROLES_PATH=../ \ -ANSIBLE_CONFIG=../../integration.cfg \ ansible-playbook -e@../../integration_config.yml playbooks/test_lookup_hashi_vault.yml -v "$@" diff --git a/test/integration/targets/pull/runme.sh b/test/integration/targets/pull/runme.sh index 93877b1ccb1..dcadc495e85 100755 --- a/test/integration/targets/pull/runme.sh +++ b/test/integration/targets/pull/runme.sh @@ -11,11 +11,11 @@ repo_dir="${temp_dir}/repo" pull_dir="${temp_dir}/pull" temp_log="${temp_dir}/pull.log" -ansible-playbook setup.yml +ansible-playbook setup.yml -i ../../inventory cleanup="$(pwd)/cleanup.yml" -trap 'ansible-playbook "${cleanup}"' EXIT +trap 'ansible-playbook "${cleanup}" -i ../../inventory' EXIT cp -av "pull-integration-test" "${repo_dir}" cd "${repo_dir}" @@ -30,22 +30,31 @@ cd "${repo_dir}" function pass_tests { # test for https://github.com/ansible/ansible/issues/13688 if ! grep MAGICKEYWORD "${temp_log}"; then + cat "${temp_log}" echo "Missing MAGICKEYWORD in output." exit 1 fi # test for https://github.com/ansible/ansible/issues/13681 if grep -E '127\.0\.0\.1.*ok' "${temp_log}"; then + cat "${temp_log}" echo "Found host 127.0.0.1 in output. Only localhost should be present." exit 1 fi # make sure one host was run if ! grep -E 'localhost.*ok' "${temp_log}"; then + cat "${temp_log}" echo "Did not find host localhost in output." exit 1 fi } +export ANSIBLE_INVENTORY +export ANSIBLE_HOST_PATTERN_MISMATCH + +unset ANSIBLE_INVENTORY +unset ANSIBLE_HOST_PATTERN_MISMATCH + ANSIBLE_CONFIG='' ansible-pull -d "${pull_dir}" -U "${repo_dir}" "$@" | tee "${temp_log}" pass_tests