From 6179f2f51c574ffddfcfe997917930b7c404b692 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 9 Jan 2019 18:00:17 -0800 Subject: [PATCH] Merge pull request #50735 from mattclay/callback-inv Move callback_default test inventory into test. --- test/integration/inventory | 3 --- test/integration/targets/callback_default/aliases | 1 + .../callback_default/callback_default.out.default.stderr | 2 +- .../callback_default.out.failed_to_stderr.stderr | 2 +- .../callback_default/callback_default.out.hide_ok.stderr | 2 +- .../callback_default.out.hide_skipped.stderr | 2 +- .../callback_default.out.hide_skipped_ok.stderr | 2 +- test/integration/targets/callback_default/inventory | 5 +++++ test/integration/targets/callback_default/runme.sh | 4 ++-- 9 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 test/integration/targets/callback_default/inventory diff --git a/test/integration/inventory b/test/integration/inventory index b92f8613009..11a709dee0a 100644 --- a/test/integration/inventory +++ b/test/integration/inventory @@ -75,6 +75,3 @@ localhost ansible_ssh_host=127.0.0.1 ansible_connection=local [azure] localhost ansible_ssh_host=127.0.0.1 ansible_connection=local - -[nonexistent] -testhost5 ansible_host=169.254.199.200 diff --git a/test/integration/targets/callback_default/aliases b/test/integration/targets/callback_default/aliases index b59832142f2..1bf9c0dc226 100644 --- a/test/integration/targets/callback_default/aliases +++ b/test/integration/targets/callback_default/aliases @@ -1 +1,2 @@ shippable/posix/group3 +needs/ssh diff --git a/test/integration/targets/callback_default/callback_default.out.default.stderr b/test/integration/targets/callback_default/callback_default.out.default.stderr index 0cbea93f20d..d3e07d472db 100644 --- a/test/integration/targets/callback_default/callback_default.out.default.stderr +++ b/test/integration/targets/callback_default/callback_default.out.default.stderr @@ -1,2 +1,2 @@ -+ ansible-playbook -i ../../inventory test.yml ++ ansible-playbook -i inventory test.yml ++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.failed_to_stderr.stderr b/test/integration/targets/callback_default/callback_default.out.failed_to_stderr.stderr index ac6e7d5e1f2..8f287b1ed24 100644 --- a/test/integration/targets/callback_default/callback_default.out.failed_to_stderr.stderr +++ b/test/integration/targets/callback_default/callback_default.out.failed_to_stderr.stderr @@ -1,3 +1,3 @@ -+ ansible-playbook -i ../../inventory test.yml ++ ansible-playbook -i inventory test.yml ++ set +x fatal: [testhost]: FAILED! => {"changed": false, "msg": "no reason"} diff --git a/test/integration/targets/callback_default/callback_default.out.hide_ok.stderr b/test/integration/targets/callback_default/callback_default.out.hide_ok.stderr index 0cbea93f20d..d3e07d472db 100644 --- a/test/integration/targets/callback_default/callback_default.out.hide_ok.stderr +++ b/test/integration/targets/callback_default/callback_default.out.hide_ok.stderr @@ -1,2 +1,2 @@ -+ ansible-playbook -i ../../inventory test.yml ++ ansible-playbook -i inventory test.yml ++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.hide_skipped.stderr b/test/integration/targets/callback_default/callback_default.out.hide_skipped.stderr index 0cbea93f20d..d3e07d472db 100644 --- a/test/integration/targets/callback_default/callback_default.out.hide_skipped.stderr +++ b/test/integration/targets/callback_default/callback_default.out.hide_skipped.stderr @@ -1,2 +1,2 @@ -+ ansible-playbook -i ../../inventory test.yml ++ ansible-playbook -i inventory test.yml ++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.hide_skipped_ok.stderr b/test/integration/targets/callback_default/callback_default.out.hide_skipped_ok.stderr index 0cbea93f20d..d3e07d472db 100644 --- a/test/integration/targets/callback_default/callback_default.out.hide_skipped_ok.stderr +++ b/test/integration/targets/callback_default/callback_default.out.hide_skipped_ok.stderr @@ -1,2 +1,2 @@ -+ ansible-playbook -i ../../inventory test.yml ++ ansible-playbook -i inventory test.yml ++ set +x diff --git a/test/integration/targets/callback_default/inventory b/test/integration/targets/callback_default/inventory new file mode 100644 index 00000000000..25fcc295ec5 --- /dev/null +++ b/test/integration/targets/callback_default/inventory @@ -0,0 +1,5 @@ +[local] +testhost ansible_connection=local + +[nonexistent] +testhost5 ansible_host=169.254.199.200 diff --git a/test/integration/targets/callback_default/runme.sh b/test/integration/targets/callback_default/runme.sh index 40e7b0615a0..d6a72407b68 100755 --- a/test/integration/targets/callback_default/runme.sh +++ b/test/integration/targets/callback_default/runme.sh @@ -18,7 +18,7 @@ run_test() { # The shenanigans with redirection and 'tee' are to capture STDOUT and # STDERR separately while still displaying both to the console - { ansible-playbook -i ../../inventory test.yml \ + { ansible-playbook -i inventory test.yml \ > >(set +x; tee "${OUTFILE}.${testname}.stdout"); } \ 2> >(set +x; tee "${OUTFILE}.${testname}.stderr" >&2) diff -u "${ORIGFILE}.${testname}.stdout" "${OUTFILE}.${testname}.stdout" || diff_failure @@ -122,7 +122,7 @@ export ANSIBLE_DISPLAY_FAILED_STDERR=1 # Check if UNREACHBLE is available in stderr set +e -ansible-playbook -i ../../inventory test_2.yml > >(set +x; tee "${BASEFILE}.unreachable.stdout";) 2> >(set +x; tee "${BASEFILE}.unreachable.stderr" >&2) || true +ansible-playbook -i inventory test_2.yml > >(set +x; tee "${BASEFILE}.unreachable.stdout";) 2> >(set +x; tee "${BASEFILE}.unreachable.stderr" >&2) || true set -e if test "$(grep -c 'UNREACHABLE' "${BASEFILE}.unreachable.stderr")" -ne 1; then echo "Test failed"