1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/openvswitch_db/tests/basic.yaml
Deepak Agrawal 8eaebf86b6
openvswitch_db : Handle column value conversion and idempotency in no_key case (#43869)
* change column value to string. handle idempotency in no key case

* fix unit test failures in baseline
2018-08-10 10:31:03 +05:30

140 lines
2.4 KiB
YAML

---
- name: Make sure test bridge does not exist before tests
command: ovs-vsctl del-br br-test
become: yes
ignore_errors: yes
- name: Create test bridge
command: ovs-vsctl add-br br-test
become: yes
- name: Create bridge
openvswitch_db:
table: Bridge
record: br-test
col: other_config
key: disable-in-band
value: true
become: yes
register: result
- assert:
that:
- "result.changed == true"
- name: Create bridge again (idempotent)
openvswitch_db:
table: Bridge
record: br-test
col: other_config
key: disable-in-band
value: true
become: yes
register: result
- assert:
that:
- "result.changed == false"
- name: Change column value in a map
openvswitch_db:
table: Bridge
record: br-test
col: other_config
key: disable-in-band
value: false
become: yes
register: result
- assert:
that:
- "result.changed == true"
- name: Change column value in a map again (idempotent)
openvswitch_db:
table: Bridge
record: br-test
col: other_config
key: disable-in-band
value: false
become: yes
register: result
- assert:
that:
- "result.changed == false"
- name: Change column value
openvswitch_db:
table: Bridge
record: br-test
col: stp_enable
value: 'true'
become: yes
register: result
- assert:
that:
- "result.changed == true"
- name: Change column value again (idempotent)
openvswitch_db:
table: Bridge
record: br-test
col: stp_enable
value: 'true'
become: yes
register: result
- assert:
that:
- "result.changed == false"
- name: Try to set value on a map type without a key (negative)
ignore_errors: true
openvswitch_db:
table: Bridge
record: br-test
col: other_config
value: true
become: yes
register: result
- assert:
that:
- "result.failed == true"
- name: Remove bridge
openvswitch_db:
table: Bridge
record: br-test
col: other_config
key: disable-in-band
value: false
state: absent
become: yes
register: result
- assert:
that:
- "result.changed == true"
- name: Remove bridge again (idempotent)
openvswitch_db:
table: Bridge
record: br-test
col: other_config
key: disable-in-band
value: false
state: absent
become: yes
register: result
- assert:
that:
- "result.changed == false"
- name: Tear down test bridge
command: ovs-vsctl del-br br-test
become: yes