summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/vyos_interface
diff options
context:
space:
mode:
authorGanesh Nalawade <ganesh634@gmail.com>2017-09-08 04:58:43 +0200
committerGitHub <noreply@github.com>2017-09-08 04:58:43 +0200
commit0b2619ff2b4dd28cb5e6557ac1c7c7d162f5e6f2 (patch)
tree514e8c4a973d2208f28147269f53cf877d9bf661 /test/integration/targets/vyos_interface
parentdocument the required variables for using Windows certificates (#29112) (diff)
downloadansible-0b2619ff2b4dd28cb5e6557ac1c7c7d162f5e6f2.tar.xz
ansible-0b2619ff2b4dd28cb5e6557ac1c7c7d162f5e6f2.zip
Add lldp neighbor intent argument for vyos_interface (#29092)
* Add lldp neighbor intent argument for vyos_interface * Add version_added info for neighbor argument * Fix CI issue
Diffstat (limited to 'test/integration/targets/vyos_interface')
-rw-r--r--test/integration/targets/vyos_interface/tests/cli/intent.yaml73
1 files changed, 73 insertions, 0 deletions
diff --git a/test/integration/targets/vyos_interface/tests/cli/intent.yaml b/test/integration/targets/vyos_interface/tests/cli/intent.yaml
index 69afb7e2ee..d93ccf2567 100644
--- a/test/integration/targets/vyos_interface/tests/cli/intent.yaml
+++ b/test/integration/targets/vyos_interface/tests/cli/intent.yaml
@@ -1,6 +1,12 @@
---
- debug: msg="START vyos_interface cli/intent.yaml"
+- name: Run vyos lsmod command
+ vyos_command:
+ commands:
+ - lsmod
+ register: lsmod_out
+
- name: Setup (interface is up)
vyos_interface:
name: eth1
@@ -20,6 +26,20 @@
that:
- "result.failed == false"
+- name: Check lldp neighbors intent arguments
+ vyos_interface:
+ name: eth0
+ neighbors:
+ - port: eth0
+ provider: "{{ cli }}"
+ 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)
vyos_interface:
name: eth1
@@ -33,6 +53,24 @@
- "result.failed == true"
- "'state eq(down)' in result.failed_conditions"
+- name: Check lldp neighbors intent arguments (failed)
+ vyos_interface:
+ name: eth0
+ neighbors:
+ - port: dummy_port
+ host: dummy_host
+ provider: "{{ cli }}"
+ 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
vyos_interface:
name: eth1
@@ -72,3 +110,38 @@
- assert:
that:
- "result.failed == false"
+
+- name: Check lldp neighbors intent aggregate arguments
+ vyos_interface:
+ aggregate:
+ - name: eth0
+ neighbors:
+ - port: eth0
+ provider: "{{ cli }}"
+ 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)
+ vyos_interface:
+ aggregate:
+ - name: eth0
+ neighbors:
+ - port: eth0
+ - port: dummy_port
+ host: dummy_host
+ provider: "{{ cli }}"
+ 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]"