2017-06-12 13:13:41 +02:00
|
|
|
---
|
|
|
|
|
2017-11-21 13:34:27 +01:00
|
|
|
- name: Make sure test bridge does not exist before tests
|
|
|
|
command: ovs-vsctl del-br br-test
|
2018-07-10 15:55:09 +02:00
|
|
|
become: yes
|
2017-11-21 13:34:27 +01:00
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: Create test bridge
|
|
|
|
command: ovs-vsctl add-br br-test
|
2018-07-10 15:55:09 +02:00
|
|
|
become: yes
|
2017-06-12 13:13:41 +02:00
|
|
|
|
2017-06-12 17:41:10 +02:00
|
|
|
- name: Create bridge
|
|
|
|
openvswitch_db:
|
2017-06-12 13:13:41 +02:00
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: true
|
2018-07-10 15:55:09 +02:00
|
|
|
become: yes
|
2017-06-12 17:48:59 +02:00
|
|
|
register: result
|
2017-06-12 13:13:41 +02:00
|
|
|
|
2017-06-12 17:41:10 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
2019-06-26 16:48:46 +02:00
|
|
|
- result is changed
|
2017-06-12 17:41:10 +02:00
|
|
|
|
|
|
|
- name: Create bridge again (idempotent)
|
|
|
|
openvswitch_db:
|
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: true
|
2018-07-10 15:55:09 +02:00
|
|
|
become: yes
|
2017-06-12 17:48:59 +02:00
|
|
|
register: result
|
2017-06-12 17:41:10 +02:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2019-06-26 16:48:46 +02:00
|
|
|
- result is not changed
|
|
|
|
|
|
|
|
- name: Change key value with quotes
|
|
|
|
openvswitch_db:
|
|
|
|
table: open_vswitch
|
|
|
|
record: .
|
|
|
|
col: other_config
|
|
|
|
key: pmd-cpu-mask
|
|
|
|
value: "0xaaa00000000"
|
|
|
|
become: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result is changed
|
|
|
|
|
|
|
|
- name: Change keyvalue with quotes(idempotent)
|
|
|
|
openvswitch_db:
|
|
|
|
table: open_vswitch
|
|
|
|
record: .
|
|
|
|
col: other_config
|
|
|
|
key: pmd-cpu-mask
|
|
|
|
value: "0xaaa00000000"
|
|
|
|
become: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result is not changed
|
|
|
|
|
|
|
|
- name: Remove key value with quotes
|
|
|
|
openvswitch_db:
|
|
|
|
table: open_vswitch
|
|
|
|
record: .
|
|
|
|
col: other_config
|
|
|
|
key: pmd-cpu-mask
|
|
|
|
value: "0xaaa00000000"
|
|
|
|
state: absent
|
|
|
|
become: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result is changed
|
2017-06-12 17:41:10 +02:00
|
|
|
|
2018-07-09 15:42:41 +02:00
|
|
|
- name: Change column value in a map
|
2017-06-12 17:41:10 +02:00
|
|
|
openvswitch_db:
|
2017-06-12 13:13:41 +02:00
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: false
|
2018-07-10 15:55:09 +02:00
|
|
|
become: yes
|
2017-06-12 17:48:59 +02:00
|
|
|
register: result
|
2017-06-12 13:13:41 +02:00
|
|
|
|
2017-06-12 17:41:10 +02:00
|
|
|
- assert:
|
|
|
|
that:
|
2019-06-26 16:48:46 +02:00
|
|
|
- result is changed
|
2017-06-12 17:41:10 +02:00
|
|
|
|
2018-07-09 15:42:41 +02:00
|
|
|
- name: Change column value in a map again (idempotent)
|
2017-06-12 17:41:10 +02:00
|
|
|
openvswitch_db:
|
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: false
|
2018-07-10 15:55:09 +02:00
|
|
|
become: yes
|
2017-06-12 17:48:59 +02:00
|
|
|
register: result
|
2017-06-12 17:41:10 +02:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2019-06-26 16:48:46 +02:00
|
|
|
- result is not changed
|
2017-06-12 17:41:10 +02:00
|
|
|
|
2018-07-09 15:42:41 +02:00
|
|
|
- name: Change column value
|
|
|
|
openvswitch_db:
|
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: stp_enable
|
2019-06-26 16:48:46 +02:00
|
|
|
value: true
|
2018-08-10 07:01:03 +02:00
|
|
|
become: yes
|
2018-07-09 15:42:41 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2019-06-26 16:48:46 +02:00
|
|
|
- result is changed
|
2018-07-09 15:42:41 +02:00
|
|
|
|
|
|
|
- name: Change column value again (idempotent)
|
|
|
|
openvswitch_db:
|
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: stp_enable
|
2019-06-26 16:48:46 +02:00
|
|
|
value: true
|
2018-08-10 07:01:03 +02:00
|
|
|
become: yes
|
2018-07-09 15:42:41 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2019-06-26 16:48:46 +02:00
|
|
|
- result is not changed
|
2018-07-09 15:42:41 +02:00
|
|
|
|
|
|
|
- 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
|
2018-08-10 07:01:03 +02:00
|
|
|
become: yes
|
2018-07-09 15:42:41 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2019-06-26 16:48:46 +02:00
|
|
|
- result is failed
|
2018-07-09 15:42:41 +02:00
|
|
|
|
2017-06-12 17:41:10 +02:00
|
|
|
- name: Remove bridge
|
|
|
|
openvswitch_db:
|
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: false
|
|
|
|
state: absent
|
2018-07-10 15:55:09 +02:00
|
|
|
become: yes
|
2017-06-12 17:48:59 +02:00
|
|
|
register: result
|
2017-06-12 17:41:10 +02:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2019-06-26 16:48:46 +02:00
|
|
|
- result is changed
|
2017-06-12 17:41:10 +02:00
|
|
|
|
|
|
|
- name: Remove bridge again (idempotent)
|
|
|
|
openvswitch_db:
|
2017-06-12 13:13:41 +02:00
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: false
|
|
|
|
state: absent
|
2018-07-10 15:55:09 +02:00
|
|
|
become: yes
|
2017-06-12 17:48:59 +02:00
|
|
|
register: result
|
2017-06-12 17:41:10 +02:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2019-06-26 16:48:46 +02:00
|
|
|
- result is not changed
|
2017-11-21 13:34:27 +01:00
|
|
|
|
|
|
|
- name: Tear down test bridge
|
|
|
|
command: ovs-vsctl del-br br-test
|
2018-07-10 15:55:09 +02:00
|
|
|
become: yes
|