summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/handlers/runme.sh
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2022-08-16 18:37:14 +0200
committerGitHub <noreply@github.com>2022-08-16 18:37:14 +0200
commit811093f0225caa4dd33890933150a81c6a6d5226 (patch)
tree51b0c10b51f06381da6bf9b11f43a21aeefcfc3c /test/integration/targets/handlers/runme.sh
parentTemplar: deprecate shared_loader_obj option (#78540) (diff)
downloadansible-811093f0225caa4dd33890933150a81c6a6d5226.tar.xz
ansible-811093f0225caa4dd33890933150a81c6a6d5226.zip
Move handler processing into new PlayIterator state (#77955)
Fixes #46447 Fixes #52561 Fixes #54991 Fixes #64611 Fixes #64999 Fixes #65067 Fixes #72725 Fixes #72781 Fixes #77616
Diffstat (limited to 'test/integration/targets/handlers/runme.sh')
-rwxr-xr-xtest/integration/targets/handlers/runme.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/integration/targets/handlers/runme.sh b/test/integration/targets/handlers/runme.sh
index ce6af63a64..1c597c6622 100755
--- a/test/integration/targets/handlers/runme.sh
+++ b/test/integration/targets/handlers/runme.sh
@@ -123,3 +123,46 @@ grep out.txt -e "ERROR! Using 'include_role' as a handler is not supported."
ansible-playbook test_notify_included.yml "$@" 2>&1 | tee out.txt
[ "$(grep out.txt -ce 'I was included')" = "1" ]
grep out.txt -e "ERROR! The requested handler 'handler_from_include' was not found in either the main handlers list nor in the listening handlers list"
+
+ansible-playbook test_handlers_meta.yml -i inventory.handlers -vv "$@" | tee out.txt
+[ "$(grep out.txt -ce 'RUNNING HANDLER \[noop_handler\]')" = "1" ]
+[ "$(grep out.txt -ce 'META: noop')" = "1" ]
+
+# https://github.com/ansible/ansible/issues/46447
+set +e
+test "$(ansible-playbook 46447.yml -i inventory.handlers -vv "$@" 2>&1 | grep -c 'SHOULD NOT GET HERE')"
+set -e
+
+# https://github.com/ansible/ansible/issues/52561
+ansible-playbook 52561.yml -i inventory.handlers "$@" 2>&1 | tee out.txt
+[ "$(grep out.txt -ce 'handler1 ran')" = "1" ]
+
+# Test flush_handlers meta task does not imply any_errors_fatal
+ansible-playbook 54991.yml -i inventory.handlers "$@" 2>&1 | tee out.txt
+[ "$(grep out.txt -ce 'handler ran')" = "4" ]
+
+ansible-playbook order.yml -i inventory.handlers "$@" 2>&1
+set +e
+ansible-playbook order.yml --force-handlers -e test_force_handlers=true -i inventory.handlers "$@" 2>&1
+set -e
+
+ansible-playbook include_handlers_fail_force.yml --force-handlers -i inventory.handlers "$@" 2>&1 | tee out.txt
+[ "$(grep out.txt -ce 'included handler ran')" = "1" ]
+
+ansible-playbook test_flush_handlers_as_handler.yml -i inventory.handlers "$@" 2>&1 | tee out.txt
+grep out.txt -e "ERROR! flush_handlers cannot be used as a handler"
+
+ansible-playbook test_skip_flush.yml -i inventory.handlers "$@" 2>&1 | tee out.txt
+[ "$(grep out.txt -ce 'handler ran')" = "0" ]
+
+ansible-playbook test_flush_in_rescue_always.yml -i inventory.handlers "$@" 2>&1 | tee out.txt
+[ "$(grep out.txt -ce 'handler ran in rescue')" = "1" ]
+[ "$(grep out.txt -ce 'handler ran in always')" = "2" ]
+[ "$(grep out.txt -ce 'lockstep works')" = "2" ]
+
+ansible-playbook test_handlers_infinite_loop.yml -i inventory.handlers "$@" 2>&1
+
+ansible-playbook test_flush_handlers_rescue_always.yml -i inventory.handlers "$@" 2>&1 | tee out.txt
+[ "$(grep out.txt -ce 'rescue ran')" = "1" ]
+[ "$(grep out.txt -ce 'always ran')" = "2" ]
+[ "$(grep out.txt -ce 'should run for both hosts')" = "2" ]