mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
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
This commit is contained in:
committed by
John R Barker
parent
6291efd4ea
commit
9c02ade536
5
test/integration/targets/rabbitmq_binding/aliases
Normal file
5
test/integration/targets/rabbitmq_binding/aliases
Normal file
@@ -0,0 +1,5 @@
|
||||
destructive
|
||||
shippable/posix/group1
|
||||
skip/osx
|
||||
skip/freebsd
|
||||
skip/rhel
|
||||
2
test/integration/targets/rabbitmq_binding/meta/main.yml
Normal file
2
test/integration/targets/rabbitmq_binding/meta/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
- setup_rabbitmq
|
||||
3
test/integration/targets/rabbitmq_binding/tasks/main.yml
Normal file
3
test/integration/targets/rabbitmq_binding/tasks/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- import_tasks: tests.yml
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
132
test/integration/targets/rabbitmq_binding/tasks/tests.yml
Normal file
132
test/integration/targets/rabbitmq_binding/tasks/tests.yml
Normal file
@@ -0,0 +1,132 @@
|
||||
---
|
||||
- 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
|
||||
Reference in New Issue
Block a user