summaryrefslogtreecommitdiff
path: root/test/integration/targets/vyos_vlan/tests/cli/multiple.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/vyos_vlan/tests/cli/multiple.yaml')
-rw-r--r--test/integration/targets/vyos_vlan/tests/cli/multiple.yaml60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/integration/targets/vyos_vlan/tests/cli/multiple.yaml b/test/integration/targets/vyos_vlan/tests/cli/multiple.yaml
new file mode 100644
index 0000000..53e93fd
--- /dev/null
+++ b/test/integration/targets/vyos_vlan/tests/cli/multiple.yaml
@@ -0,0 +1,60 @@
+---
+- debug: msg="START cli/multiple.yaml on connection={{ ansible_connection }}"
+
+- name: setup - remove vlan used in test
+ vyos.vyos.vyos_config:
+ lines:
+ - delete interfaces ethernet eth0 vif 5
+ - delete interfaces ethernet eth0 vif 100
+ - delete interfaces ethernet eth1 vif 100
+
+- name: Add multiple interfaces to vlan
+ vyos.vyos.vyos_vlan: &multiple
+ vlan_id: 100
+ interfaces:
+ - eth0
+ - eth1
+ register: result
+
+- assert:
+ that:
+ - "result.changed == true"
+ - "'set interfaces ethernet eth0 vif 100' in result.commands"
+ - "'set interfaces ethernet eth1 vif 100' in result.commands"
+
+- name: Add multiple interfaces to vlan(idempotence)
+ vyos.vyos.vyos_vlan: *multiple
+ register: result
+
+- assert:
+ that:
+ - "result.changed == false"
+
+- name: delete vlan with multiple interfaces
+ vyos.vyos.vyos_vlan: &delete_multiple
+ vlan_id: 100
+ interfaces:
+ - eth0
+ - eth1
+ state: absent
+ register: result
+
+- assert:
+ that:
+ - "result.changed == true"
+ - "'delete interfaces ethernet eth0 vif 100' in result.commands"
+ - "'delete interfaces ethernet eth1 vif 100' in result.commands"
+
+- name: delete vlan with multiple interfaces(idempotence)
+ vyos.vyos.vyos_vlan: *delete_multiple
+ register: result
+
+- assert:
+ that:
+ - "result.changed == false"
+
+- name: teardown
+ vyos.vyos.vyos_config:
+ lines:
+ - delete interfaces ethernet eth0 vif 100
+ - delete interfaces ethernet eth1 vif 100