Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vyos_interface require multiple network nodes to run #39670

Merged
merged 4 commits into from
May 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 32 additions & 12 deletions test/integration/targets/vyos_interface/tests/cli/intent.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
---
- debug: msg="START cli/intent.yaml on connection={{ ansible_connection }}"
- debug: msg="START cli/intent.yaml on connection={{ ansible_connection }}" #"

- name: Run vyos lsmod command
# To be able to run the lldp test we need to have a neighbor configured to talk to
# In DCI & Zuul we (currently) only spin up a single network VM, so we can't configure a neighbor
# In the future when we have multi-network-nodes running we can run these tests again
# https://github.com/ansible/ansible/issues/39667

- name: Detect if we have existing lldp neighbors configured
vyos_command:
commands:
- lsmod
register: lsmod_out
- show lldp neighbors detail
register: neighbors_out

- name: Should we run lldp tests?
set_fact:
run_lldp_tests: "'PortDescr: eth0' in neighbors_out.stdout[0]"

- name: Enable LLDP service
vyos_lldp:
state: present
when: run_lldp_tests

- name: Create LLDP configuration
vyos_lldp_interface:
name: eth1
state: present
when: run_lldp_tests

- name: Setup (interface is up)
vyos_interface:
Expand All @@ -29,13 +49,13 @@
name: eth0
neighbors:
- port: eth0
when: "'virtio_net' not in lsmod_out.stdout[0]"
when: run_lldp_tests
register: result

- assert:
that:
- "result.failed == false"
when: "'virtio_net' not in lsmod_out.stdout[0]"
when: run_lldp_tests

- name: Check intent arguments (failed condition)
vyos_interface:
Expand All @@ -56,15 +76,15 @@
- port: dummy_port
host: dummy_host
ignore_errors: yes
when: "'virtio_net' not in lsmod_out.stdout[0]"
when: run_lldp_tests
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]"
when: run_lldp_tests

- name: Config + intent
vyos_interface:
Expand Down Expand Up @@ -109,13 +129,13 @@
- name: eth0
neighbors:
- port: eth0
when: "'virtio_net' not in lsmod_out.stdout[0]"
when: run_lldp_tests
register: result

- assert:
that:
- "result.failed == false"
when: "'virtio_net' not in lsmod_out.stdout[0]"
when: run_lldp_tests

- name: Check lldp neighbors intent aggregate arguments (failed)
vyos_interface:
Expand All @@ -126,12 +146,12 @@
- port: dummy_port
host: dummy_host
ignore_errors: yes
when: "'virtio_net' not in lsmod_out.stdout[0]"
when: run_lldp_tests
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]"
when: run_lldp_tests