diff options
author | CaptTrews <capttrews@gmail.com> | 2020-01-16 15:50:24 +0000 |
---|---|---|
committer | CaptTrews <capttrews@gmail.com> | 2020-01-16 15:50:24 +0000 |
commit | 6b6166151faa3d811ae0ec3010a89e518a26287b (patch) | |
tree | 9cf59872c2ddc7e99595db4f47c72a7ce08b6c10 /tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml | |
parent | d31b74ba6c74a6e3cdebd80b9eb5272aeb9b0fb4 (diff) | |
download | vyos-ansible-collection-6b6166151faa3d811ae0ec3010a89e518a26287b.tar.gz vyos-ansible-collection-6b6166151faa3d811ae0ec3010a89e518a26287b.zip |
Updated from network content collector
Signed-off-by: CaptTrews <capttrews@gmail.com>
Diffstat (limited to 'tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml')
-rw-r--r-- | tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml b/tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml index f947513..f003c0b 100644 --- a/tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml +++ b/tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml @@ -1,35 +1,39 @@ --- - debug: - msg: "START vyos_interfaces round trip integration tests on connection={{ ansible_connection }}" + msg: START vyos_interfaces round trip integration tests on connection={{ ansible_connection + }} - include_tasks: _remove_config.yaml - block: + - name: Apply the provided configuration (base config) + register: base_config vyos.vyos.vyos_interfaces: config: + - name: eth0 enabled: true - duplex: "auto" - speed: "auto" + duplex: auto + speed: auto - name: eth1 - description: "Interface - 1" + description: Interface - 1 mtu: 1500 vifs: + - vlan_id: 100 - description: "Eth1 - VIF 100" + description: Eth1 - VIF 100 mtu: 200 - vlan_id: 101 enabled: false - name: eth2 - description: "Interface - 2" + description: Interface - 2 enabled: true mtu: 900 state: merged - register: base_config - name: Gather interfaces facts vyos.vyos.vyos_facts: @@ -39,40 +43,44 @@ - interfaces - name: Apply the provided configuration (config to be reverted) + register: result vyos.vyos.vyos_interfaces: config: + - name: eth1 - description: "Interface 1 - Description (WILL BE REVERTED)" + description: Interface 1 - Description (WILL BE REVERTED) mtu: 1200 vifs: + - vlan_id: 100 - description: "Eth1 - VIF 100 (WILL BE REVERTED)" + description: Eth1 - VIF 100 (WILL BE REVERTED) mtu: 400 - vlan_id: 101 - description: "Eth1 - VIF 101 (WILL BE REMOVED)" + description: Eth1 - VIF 101 (WILL BE REMOVED) enabled: true - name: eth2 - description: "Interface 2 (ADMIN DOWN) (WILL BE REVERTED)" + description: Interface 2 (ADMIN DOWN) (WILL BE REVERTED) mtu: 600 enabled: false state: merged - register: result - name: Assert that changes were applied assert: - that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length == 0 }}" + that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length\ + \ == 0 }}" - name: Revert back to base config using facts round trip + register: revert vyos.vyos.vyos_interfaces: config: "{{ ansible_facts['network_resources']['interfaces'] }}" state: replaced - register: revert - name: Assert that config was reverted assert: - that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length == 0 }}" - + that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length\ + \ == 0 }}" always: + - include_tasks: _remove_config.yaml |