Skip to content

Commit

Permalink
Adding test case for 80880
Browse files Browse the repository at this point in the history
Test case is based on reproducer given in ansible#80880, with some minor
adjustments and assertions.
  • Loading branch information
jimi-c committed May 26, 2023
1 parent d129943 commit f47348f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/integration/targets/handlers/80880.yml
@@ -0,0 +1,34 @@
---
- name: Test notification of handlers from other handlers
hosts: localhost
gather_facts: no
handlers:
- name: Handler 1
debug:
msg: Handler 1
changed_when: true
notify: Handler 2
register: handler1_res
- name: Handler 2
debug:
msg: Handler 2
changed_when: true
notify: Handler 3
register: handler2_res
- name: Handler 3
debug:
msg: Handler 3
register: handler3_res
tasks:
- name: Trigger handlers
ansible.builtin.debug:
msg: Task 1
changed_when: true
notify: Handler 1
post_tasks:
- name: Assert results
ansible.builtin.assert:
that:
- "handler1_res is defined and handler1_res is success"
- "handler2_res is defined and handler2_res is success"
- "handler3_res is defined and handler3_res is success"
3 changes: 3 additions & 0 deletions test/integration/targets/handlers/runme.sh
Expand Up @@ -50,6 +50,9 @@ for strategy in linear free; do
[ "$(ansible-playbook test_force_handlers.yml -i inventory.handlers -v "$@" --tags force_false_in_play --force-handlers \
| grep -E -o CALLED_HANDLER_. | sort | uniq | xargs)" = "CALLED_HANDLER_B" ]

# https://github.com/ansible/ansible/pull/80898
[ "$(ansible-playbook 80880.yml -i inventory.handlers -vv "$@" 2>&1)" ]

unset ANSIBLE_STRATEGY

done
Expand Down

0 comments on commit f47348f

Please sign in to comment.