Fix vyos intergration test issue (#26947)

* Fix vyos intergration test issue

* Fix review comment
pull/26939/merge
Ganesh Nalawade 7 years ago committed by Ricardo Carrillo Cruz
parent 3f567d5295
commit 33ac35c68d

@ -1,6 +1,12 @@
--- ---
- debug: msg="START vyos_interface cli/basic.yaml" - debug: msg="START vyos_interface cli/basic.yaml"
- name: Run vyos lsmod command
vyos_command:
commands:
- lsmod | grep virtio
register: lsmod_out
- name: Set up - delete interface - name: Set up - delete interface
vyos_interface: vyos_interface:
name: eth1 name: eth1
@ -14,6 +20,8 @@
speed: 100 speed: 100
duplex: half duplex: half
mtu: 256 mtu: 256
when: "'virtio' not in lsmod_out.stdout"
register: result register: result
- assert: - assert:
@ -23,6 +31,7 @@
- '"set interfaces ethernet eth1 speed 100" in result.commands' - '"set interfaces ethernet eth1 speed 100" in result.commands'
- '"set interfaces ethernet eth1 duplex half" in result.commands' - '"set interfaces ethernet eth1 duplex half" in result.commands'
- '"set interfaces ethernet eth1 mtu 256" in result.commands' - '"set interfaces ethernet eth1 mtu 256" in result.commands'
when: "'virtio' not in lsmod_out.stdout"
- name: Configure interface params (idempotent) - name: Configure interface params (idempotent)
vyos_interface: vyos_interface:
@ -33,10 +42,12 @@
duplex: half duplex: half
mtu: 256 mtu: 256
register: result register: result
when: "'virtio' not in lsmod_out.stdout"
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
when: "'virtio' not in lsmod_out.stdout"
- name: Change interface params - name: Change interface params
vyos_interface: vyos_interface:
@ -47,6 +58,7 @@
duplex: full duplex: full
mtu: 512 mtu: 512
register: result register: result
when: "'virtio' not in lsmod_out.stdout"
- assert: - assert:
that: that:
@ -55,6 +67,7 @@
- '"set interfaces ethernet eth1 speed 1000" in result.commands' - '"set interfaces ethernet eth1 speed 1000" in result.commands'
- '"set interfaces ethernet eth1 duplex full" in result.commands' - '"set interfaces ethernet eth1 duplex full" in result.commands'
- '"set interfaces ethernet eth1 mtu 512" in result.commands' - '"set interfaces ethernet eth1 mtu 512" in result.commands'
when: "'virtio' not in lsmod_out.stdout"
- name: Disable interface - name: Disable interface
vyos_interface: vyos_interface:
@ -111,6 +124,7 @@
- { name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512} - { name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512}
- { name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256} - { name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256}
register: result register: result
when: "'virtio' not in lsmod_out.stdout"
- assert: - assert:
that: that:
@ -123,6 +137,7 @@
- '"set interfaces ethernet eth2 speed 1000" in result.commands' - '"set interfaces ethernet eth2 speed 1000" in result.commands'
- '"set interfaces ethernet eth2 duplex full" in result.commands' - '"set interfaces ethernet eth2 duplex full" in result.commands'
- '"set interfaces ethernet eth2 mtu 256" in result.commands' - '"set interfaces ethernet eth2 mtu 256" in result.commands'
when: "'virtio' not in lsmod_out.stdout"
- name: Set interface on aggregate (idempotent) - name: Set interface on aggregate (idempotent)
vyos_interface: vyos_interface:
@ -130,16 +145,18 @@
- { name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512} - { name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512}
- { name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256} - { name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256}
register: result register: result
when: "'virtio' not in lsmod_out.stdout"
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
when: "'virtio' not in lsmod_out.stdout"
- name: Disable interface on aggregate - name: Disable interface on aggregate
vyos_interface: vyos_interface:
aggregate: aggregate:
- { name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512, state: down} - { name: eth1, description: test-interface-1, state: down}
- { name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256, state: down} - { name: eth2, description: test-interface-2, state: down}
register: result register: result
- assert: - assert:
@ -151,8 +168,8 @@
- name: Enable interface on aggregate - name: Enable interface on aggregate
vyos_interface: vyos_interface:
aggregate: aggregate:
- { name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512, state: present} - { name: eth1, description: test-interface-1, state: present}
- { name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256, state: present} - { name: eth2, description: test-interface-2, state: present}
register: result register: result
- assert: - assert:

Loading…
Cancel
Save