vyos_interface integration test fix (#26976)

pull/26980/merge
Ganesh Nalawade 7 years ago committed by Ricardo Carrillo Cruz
parent 15eb0d463d
commit 58dc6c7882

@ -4,7 +4,7 @@
- name: Run vyos lsmod command - name: Run vyos lsmod command
vyos_command: vyos_command:
commands: commands:
- lsmod | grep virtio - lsmod
register: lsmod_out register: lsmod_out
- name: Set up - delete interface - name: Set up - delete interface
@ -20,8 +20,7 @@
speed: 100 speed: 100
duplex: half duplex: half
mtu: 256 mtu: 256
when: "'virtio' not in lsmod_out.stdout" when: "'virtio_net' not in lsmod_out.stdout[0]"
register: result register: result
- assert: - assert:
@ -31,7 +30,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" when: "'virtio_net' not in lsmod_out.stdout[0]"
- name: Configure interface params (idempotent) - name: Configure interface params (idempotent)
vyos_interface: vyos_interface:
@ -42,12 +41,12 @@
duplex: half duplex: half
mtu: 256 mtu: 256
register: result register: result
when: "'virtio' not in lsmod_out.stdout" when: "'virtio_net' not in lsmod_out.stdout[0]"
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
when: "'virtio' not in lsmod_out.stdout" when: "'virtio' not in lsmod_out.stdout[0]"
- name: Change interface params - name: Change interface params
vyos_interface: vyos_interface:
@ -58,7 +57,7 @@
duplex: full duplex: full
mtu: 512 mtu: 512
register: result register: result
when: "'virtio' not in lsmod_out.stdout" when: "'virtio_net' not in lsmod_out.stdout[0]"
- assert: - assert:
that: that:
@ -67,7 +66,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" when: "'virtio_net' not in lsmod_out.stdout[0]"
- name: Disable interface - name: Disable interface
vyos_interface: vyos_interface:
@ -124,7 +123,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" when: "'virtio_net' not in lsmod_out.stdout[0]"
- assert: - assert:
that: that:
@ -137,7 +136,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" when: "'virtio_net' not in lsmod_out.stdout[0]"
- name: Set interface on aggregate (idempotent) - name: Set interface on aggregate (idempotent)
vyos_interface: vyos_interface:
@ -145,12 +144,12 @@
- { 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" when: "'virtio_net' not in lsmod_out.stdout[0]"
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
when: "'virtio' not in lsmod_out.stdout" when: "'virtio_net' not in lsmod_out.stdout[0]"
- name: Disable interface on aggregate - name: Disable interface on aggregate
vyos_interface: vyos_interface:

Loading…
Cancel
Save