summaryrefslogtreecommitdiff
path: root/tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml
diff options
context:
space:
mode:
authoransible-zuul[bot] <48994755+ansible-zuul[bot]@users.noreply.github.com>2020-01-16 18:56:16 +0000
committerGitHub <noreply@github.com>2020-01-16 18:56:16 +0000
commit03addce56012d4bd360e18612d2eb3af04d8f01a (patch)
tree9cf59872c2ddc7e99595db4f47c72a7ce08b6c10 /tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml
parentd31b74ba6c74a6e3cdebd80b9eb5272aeb9b0fb4 (diff)
parent6b6166151faa3d811ae0ec3010a89e518a26287b (diff)
downloadvyos-ansible-collection-03addce56012d4bd360e18612d2eb3af04d8f01a.tar.gz
vyos-ansible-collection-03addce56012d4bd360e18612d2eb3af04d8f01a.zip
Merge pull request #59 from CaptTrews/master
Updated from network content collector Reviewed-by: https://github.com/apps/ansible-zuul
Diffstat (limited to 'tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml')
-rw-r--r--tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml40
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