ansible/test/integration/targets/net_interface/tests/vyos/intent.yaml
Ganesh Nalawade 5d1ed1fc25
Fix platform agnostic network integration test cases (#32378)
* Fix platform agnostic network test cases

* Fix vyos_interface CI failure
2017-10-31 15:21:27 +05:30

137 lines
2.8 KiB
YAML

---
- debug: msg="START net_interface vyos/intent.yaml"
- name: Run vyos lsmod command
vyos_command:
commands:
- lsmod
register: lsmod_out
- name: Setup (interface is up)
net_interface:
name: eth1
enabled: True
state: present
register: result
- name: Check intent arguments
net_interface:
name: eth1
state: up
register: result
- assert:
that:
- "result.failed == false"
- name: Check lldp neighbors intent arguments
net_interface:
name: eth0
neighbors:
- port: eth0
when: "'virtio_net' not in lsmod_out.stdout[0]"
register: result
- assert:
that:
- "result.failed == false"
when: "'virtio_net' not in lsmod_out.stdout[0]"
- name: Check intent arguments (failed condition)
net_interface:
name: eth1
state: down
ignore_errors: yes
register: result
- assert:
that:
- "result.failed == true"
- "'state eq(down)' in result.failed_conditions"
- name: Check lldp neighbors intent arguments (failed)
net_interface:
name: eth0
neighbors:
- port: dummy_port
host: dummy_host
ignore_errors: yes
when: "'virtio_net' not in lsmod_out.stdout[0]"
register: result
- assert:
that:
- "result.failed == true"
- "'host dummy_host' in result.failed_conditions"
- "'port dummy_port' in result.failed_conditions"
when: "'virtio_net' not in lsmod_out.stdout[0]"
- name: Config + intent
net_interface:
name: eth1
enabled: False
state: down
register: result
- assert:
that:
- "result.failed == false"
- name: Config + intent (fail)
net_interface:
name: eth1
enabled: False
state: up
ignore_errors: yes
register: result
- assert:
that:
- "result.failed == true"
- "'state eq(up)' in result.failed_conditions"
- name: Aggregate config + intent (pass)
net_interface:
aggregate:
- name: eth1
enabled: True
state: up
ignore_errors: yes
register: result
- assert:
that:
- "result.failed == false"
- name: Check lldp neighbors intent aggregate arguments
net_interface:
aggregate:
- name: eth0
neighbors:
- port: eth0
when: "'virtio_net' not in lsmod_out.stdout[0]"
register: result
- assert:
that:
- "result.failed == false"
when: "'virtio_net' not in lsmod_out.stdout[0]"
- name: Check lldp neighbors intent aggregate arguments (failed)
net_interface:
aggregate:
- name: eth0
neighbors:
- port: eth0
- port: dummy_port
host: dummy_host
ignore_errors: yes
when: "'virtio_net' not in lsmod_out.stdout[0]"
register: result
- assert:
that:
- "result.failed == true"
- "'host dummy_host' in result.failed_conditions"
- "'port dummy_port' in result.failed_conditions"
when: "'virtio_net' not in lsmod_out.stdout[0]"