Update integration tests. (#60447)

* Remove unnecessary ANSIBLE_CONFIG override.
* Fix pull integration test.
* Fix inventory_foreman integration test.
This commit is contained in:
Matt Clay 2019-08-12 16:23:47 -07:00 committed by GitHub
parent 262d2a6837
commit d36919856f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 4 deletions

View file

@ -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}"

View file

@ -17,9 +17,7 @@ set -eux
# fatal: [testhost]: FAILED! => { "msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'requests.exceptions.SSLError'>, 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 "$@"

View file

@ -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