Fix vyos_vlan aggregate issue & added tests (#41638)

* Fix vyos_vlan aggregate issue & Added tests

* Fix #2 for vyos_vlan aggregate issue
This commit is contained in:
Nilashish Chakraborty 2018-06-19 18:50:28 +05:30 committed by GitHub
commit 837c216587
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 2 deletions

View file

@ -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