ansible/test/integration/targets/rabbitmq_binding/tasks/tests.yml
Jon Bergli Heier 9c02ade536 rabbitmq_binding: Add support for state=absent (#48599)
* rabbitmq_binding: Add support for state=absent

* Add integration tests for rabbitmq_binding

* Update testcases

* Add changelog fragment
2018-12-04 12:42:18 +00:00

132 lines
3 KiB
YAML

---
- name: Add test requisites
block:
- name: Add exchange
rabbitmq_exchange:
name: "{{ item }}"
type: direct
with_items:
- exchange-foo
- exchange-bar
- name: Add queue
rabbitmq_queue:
name: queue-foo
- name: Test add binding in check mode
block:
- name: Add binding
rabbitmq_binding:
source: exchange-foo
destination: queue-foo
type: queue
check_mode: true
register: add_binding
- name: Check that binding succeeds with a change
assert:
that:
- add_binding.changed == true
- name: Test add binding
block:
- name: Add binding
rabbitmq_binding:
source: exchange-foo
destination: queue-foo
type: queue
register: add_binding
- name: Check that binding succeeds with a change
assert:
that:
- add_binding.changed == true
- name: Test add binding idempotence
block:
- name: Add binding
rabbitmq_binding:
source: exchange-foo
destination: queue-foo
type: queue
register: add_binding
- name: Check that binding succeeds without a change
assert:
that:
- add_binding.changed == false
- name: Test remove binding in check mode
block:
- name: Remove binding
rabbitmq_binding:
source: exchange-foo
destination: queue-foo
type: queue
state: absent
check_mode: true
register: remove_binding
- name: Check that binding succeeds with a change
assert:
that:
- remove_binding.changed == true
- name: Test remove binding
block:
- name: Remove binding
rabbitmq_binding:
source: exchange-foo
destination: queue-foo
type: queue
state: absent
register: remove_binding
- name: Check that binding succeeds with a change
assert:
that:
- remove_binding.changed == true
- name: Test remove binding idempotence
block:
- name: Remove binding
rabbitmq_binding:
source: exchange-foo
destination: queue-foo
type: queue
state: absent
register: remove_binding
- name: Check that binding succeeds with a change
assert:
that:
- remove_binding.changed == false
- name: Test add exchange to exchange binding
block:
- name: Add binding
rabbitmq_binding:
source: exchange-foo
destination: exchange-bar
type: exchange
register: add_binding
- name: Check that binding succeeds with a change
assert:
that:
- add_binding.changed == true
- name: Test remove exchange to exchange binding
block:
- name: Remove binding
rabbitmq_binding:
source: exchange-foo
destination: exchange-bar
type: exchange
state: absent
register: remove_binding
- name: Check that binding succeeds with a change
assert:
that:
- remove_binding.changed == true