summaryrefslogtreecommitdiff
path: root/test/integration/targets
diff options
context:
space:
mode:
authorMatt Martz <matt@sivel.net>2021-03-08 00:44:33 -0600
committerGitHub <noreply@github.com>2021-03-08 00:44:33 -0600
commit4c503fe3b13a0913960824ef6ef54e10d7e374a9 (patch)
treea89b3763dce171709272e334ade0a864bea9bc85 /test/integration/targets
parentfc4c154a8e70003deb080135493e689e9fe6ca92 (diff)
downloadansible-4c503fe3b13a0913960824ef6ef54e10d7e374a9.tar.gz
[stable-2.9] Don't treat host_pinned as lockstep (#73484) (#73513)
* [stable-2.9] Don't treat host_pinned as lockstep (#73484) * Don't treat host_pinned as lockstep. Fixes #73364 * Add intg tests. (cherry picked from commit d3f3784b86789b7b55782b0af4fba6d6bb935f19) Co-authored-by: Matt Martz <matt@sivel.net> * Make non-lockstep callback tests more deterministic (#73511) (cherry picked from commit 125c220343deb60ad64f4a412e6f670ddb511f4c)
Diffstat (limited to 'test/integration/targets')
-rw-r--r--test/integration/targets/callback_default/callback_default.out.free.stdout35
-rw-r--r--test/integration/targets/callback_default/callback_default.out.host_pinned.stdout35
-rw-r--r--test/integration/targets/callback_default/inventory5
-rwxr-xr-xtest/integration/targets/callback_default/runme.sh4
-rw-r--r--test/integration/targets/callback_default/test_non_lockstep.yml7
5 files changed, 86 insertions, 0 deletions
diff --git a/test/integration/targets/callback_default/callback_default.out.free.stdout b/test/integration/targets/callback_default/callback_default.out.free.stdout
new file mode 100644
index 0000000000..0ec0447978
--- /dev/null
+++ b/test/integration/targets/callback_default/callback_default.out.free.stdout
@@ -0,0 +1,35 @@
+
+PLAY [nonlockstep] *************************************************************
+
+TASK [command] *****************************************************************
+changed: [testhost10]
+
+TASK [command] *****************************************************************
+changed: [testhost10]
+
+TASK [command] *****************************************************************
+changed: [testhost10]
+
+TASK [command] *****************************************************************
+changed: [testhost11]
+
+TASK [command] *****************************************************************
+changed: [testhost11]
+
+TASK [command] *****************************************************************
+changed: [testhost11]
+
+TASK [command] *****************************************************************
+changed: [testhost12]
+
+TASK [command] *****************************************************************
+changed: [testhost12]
+
+TASK [command] *****************************************************************
+changed: [testhost12]
+
+PLAY RECAP *********************************************************************
+testhost10 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
+testhost11 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
+testhost12 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
+
diff --git a/test/integration/targets/callback_default/callback_default.out.host_pinned.stdout b/test/integration/targets/callback_default/callback_default.out.host_pinned.stdout
new file mode 100644
index 0000000000..0ec0447978
--- /dev/null
+++ b/test/integration/targets/callback_default/callback_default.out.host_pinned.stdout
@@ -0,0 +1,35 @@
+
+PLAY [nonlockstep] *************************************************************
+
+TASK [command] *****************************************************************
+changed: [testhost10]
+
+TASK [command] *****************************************************************
+changed: [testhost10]
+
+TASK [command] *****************************************************************
+changed: [testhost10]
+
+TASK [command] *****************************************************************
+changed: [testhost11]
+
+TASK [command] *****************************************************************
+changed: [testhost11]
+
+TASK [command] *****************************************************************
+changed: [testhost11]
+
+TASK [command] *****************************************************************
+changed: [testhost12]
+
+TASK [command] *****************************************************************
+changed: [testhost12]
+
+TASK [command] *****************************************************************
+changed: [testhost12]
+
+PLAY RECAP *********************************************************************
+testhost10 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
+testhost11 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
+testhost12 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
+
diff --git a/test/integration/targets/callback_default/inventory b/test/integration/targets/callback_default/inventory
index e75c585dc0..6d9b302898 100644
--- a/test/integration/targets/callback_default/inventory
+++ b/test/integration/targets/callback_default/inventory
@@ -3,3 +3,8 @@ testhost ansible_connection=local ansible_python_interpreter="{{ ansible_playboo
[nonexistent]
testhost5 ansible_host=169.254.199.200 # no connection is ever established with this host
+
+[nonlockstep]
+testhost10 i=0.5 ansible_connection=local ansible_python_interpreter="{{ ansible_playbook_python }}"
+testhost11 i=3.0 ansible_connection=local ansible_python_interpreter="{{ ansible_playbook_python }}"
+testhost12 i=12.0 ansible_connection=local ansible_python_interpreter="{{ ansible_playbook_python }}"
diff --git a/test/integration/targets/callback_default/runme.sh b/test/integration/targets/callback_default/runme.sh
index 60c0f4231d..88a7734489 100755
--- a/test/integration/targets/callback_default/runme.sh
+++ b/test/integration/targets/callback_default/runme.sh
@@ -182,3 +182,7 @@ run_test_dryrun check_nomarkers_wet
# Test the dry run without check markers
run_test_dryrun check_nomarkers_dry --check
+
+# Ensure free/host_pinned non-lockstep strategies display correctly
+diff -u callback_default.out.free.stdout <(ANSIBLE_STRATEGY=free ansible-playbook -i inventory test_non_lockstep.yml 2>/dev/null)
+diff -u callback_default.out.host_pinned.stdout <(ANSIBLE_STRATEGY=host_pinned ansible-playbook -i inventory test_non_lockstep.yml 2>/dev/null)
diff --git a/test/integration/targets/callback_default/test_non_lockstep.yml b/test/integration/targets/callback_default/test_non_lockstep.yml
new file mode 100644
index 0000000000..b656ee91bf
--- /dev/null
+++ b/test/integration/targets/callback_default/test_non_lockstep.yml
@@ -0,0 +1,7 @@
+---
+- hosts: nonlockstep
+ gather_facts: false
+ tasks:
+ - command: sleep {{ i }}
+ - command: sleep {{ i }}
+ - command: sleep {{ i }}