summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/vyos_vlan/tests
diff options
context:
space:
mode:
authorNilashish Chakraborty <nilashishchakraborty8@gmail.com>2018-06-19 15:20:28 +0200
committerGitHub <noreply@github.com>2018-06-19 15:20:28 +0200
commit837c2165872422d6b7ec51a6320f78065647dedb (patch)
treeb601875e736d2f76fb79164700ed90f8f2e92692 /test/integration/targets/vyos_vlan/tests
parentFix aws_config_aggregator argument count error (#41686) (diff)
downloadansible-837c2165872422d6b7ec51a6320f78065647dedb.tar.xz
ansible-837c2165872422d6b7ec51a6320f78065647dedb.zip
Fix vyos_vlan aggregate issue & added tests (#41638)
* Fix vyos_vlan aggregate issue & Added tests * Fix #2 for vyos_vlan aggregate issue
Diffstat (limited to 'test/integration/targets/vyos_vlan/tests')
-rw-r--r--test/integration/targets/vyos_vlan/tests/cli/basic.yaml26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/integration/targets/vyos_vlan/tests/cli/basic.yaml b/test/integration/targets/vyos_vlan/tests/cli/basic.yaml
index 249d36ad97..a47f6b9ca4 100644
--- a/test/integration/targets/vyos_vlan/tests/cli/basic.yaml
+++ b/test/integration/targets/vyos_vlan/tests/cli/basic.yaml
@@ -7,6 +7,8 @@
- delete interfaces ethernet eth1 vif 100
- delete interfaces ethernet eth0 vif 5
- delete interfaces ethernet eth0 vif 100
+ - delete interfaces ethernet eth0 vif 101
+ - delete interfaces ethernet eth1 vif 201
- name: set vlan with name
vyos_vlan: &name
@@ -68,8 +70,32 @@
that:
- "result.changed == false"
+- name: Create VLANs using aggregate
+ vyos_vlan: &agg_vlan
+ aggregate:
+ - { vlan_id: 101, name: voice, interfaces: "eth0" }
+ - { vlan_id: 201, name: mgm, interfaces: "eth1" }
+ state: present
+ register: result
+
+- assert:
+ that:
+ - "result.changed == true"
+ - "'set interfaces ethernet eth0 vif 101 description voice' in result.commands"
+ - "'set interfaces ethernet eth1 vif 201 description mgm' in result.commands"
+
+- name: Create VLANs using aggregate (idempotent)
+ vyos_vlan: *agg_vlan
+ register: result
+
+- assert:
+ that:
+ - "result.changed == false"
+
- name: teardown
vyos_config:
lines:
- delete interfaces ethernet eth1 vif 100
- delete interfaces ethernet eth0 vif 5
+ - delete interfaces ethernet eth0 vif 101
+ - delete interfaces ethernet eth1 vif 201