summaryrefslogtreecommitdiff
path: root/tests/integration/targets/vyos_lldp_interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/targets/vyos_lldp_interfaces')
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/defaults/main.yaml2
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tasks/cli.yaml8
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tasks/redirection.yaml8
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate.yaml5
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate_intf.yaml5
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tests/cli/_remove_config.yaml2
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml6
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml3
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml6
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tests/cli/parsed.yaml3
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tests/cli/rendered.yaml5
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml10
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml14
-rw-r--r--tests/integration/targets/vyos_lldp_interfaces/tests/redirection/cli/shortname.yaml1
14 files changed, 36 insertions, 42 deletions
diff --git a/tests/integration/targets/vyos_lldp_interfaces/defaults/main.yaml b/tests/integration/targets/vyos_lldp_interfaces/defaults/main.yaml
index 852a6be..164afea 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/defaults/main.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/defaults/main.yaml
@@ -1,3 +1,3 @@
---
-testcase: '[^_].*'
+testcase: "[^_].*"
test_items: []
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tasks/cli.yaml b/tests/integration/targets/vyos_lldp_interfaces/tasks/cli.yaml
index 93eb2fe..83496e0 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tasks/cli.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tasks/cli.yaml
@@ -1,8 +1,8 @@
---
- name: Collect all cli test cases
find:
- paths: '{{ role_path }}/tests/cli'
- patterns: '{{ testcase }}.yaml'
+ paths: "{{ role_path }}/tests/cli"
+ patterns: "{{ testcase }}.yaml"
use_regex: true
register: test_cases
delegate_to: localhost
@@ -11,9 +11,9 @@
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: Run test case (connection=ansible.netcommon.network_cli)
- include: '{{ test_case_to_run }}'
+ include: "{{ test_case_to_run }}"
vars:
ansible_connection: ansible.netcommon.network_cli
- with_items: '{{ test_items }}'
+ with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tasks/redirection.yaml b/tests/integration/targets/vyos_lldp_interfaces/tasks/redirection.yaml
index 5564a3e..48ad53a 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tasks/redirection.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tasks/redirection.yaml
@@ -1,8 +1,8 @@
---
- name: collect all redirection cli test cases
find:
- paths: '{{ role_path }}/tests/redirection/cli'
- patterns: '{{ testcase }}.yaml'
+ paths: "{{ role_path }}/tests/redirection/cli"
+ patterns: "{{ testcase }}.yaml"
register: shortname_test_cases
delegate_to: localhost
@@ -10,7 +10,7 @@
set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}"
- name: run test case (connection=ansible.netcommon.network_cli)
- include: '{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli'
- with_items: '{{ test_items }}'
+ include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli"
+ with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate.yaml
index 4353cec..406d30b 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate.yaml
@@ -1,7 +1,8 @@
---
- name: Setup
vars:
- lines: "set service lldp interface eth1\nset service lldp interface eth1 location\
+ lines:
+ "set service lldp interface eth1\nset service lldp interface eth1 location\
\ civic-based country-code US\nset service lldp interface eth1 location civic-based\
\ ca-type 0 ca-value ENGLISH\nset service lldp interface eth2\nset service\
\ lldp interface eth2 location coordinate-based latitude 33.524449N\nset service\
@@ -9,4 +10,4 @@
\ lldp interface eth2 location coordinate-based datum WGS84\nset service lldp\
\ interface eth2 location coordinate-based longitude 222.267255W\n"
ansible.netcommon.cli_config:
- config: '{{ lines }}'
+ config: "{{ lines }}"
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate_intf.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate_intf.yaml
index 11e2940..208f21e 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate_intf.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate_intf.yaml
@@ -1,8 +1,9 @@
---
- name: Setup
vars:
- lines: "set service lldp interface eth2\nset service lldp interface eth2 location\
+ lines:
+ "set service lldp interface eth2\nset service lldp interface eth2 location\
\ civic-based country-code US\nset service lldp interface eth2 location civic-based\
\ ca-type 0 ca-value ENGLISH\nset service lldp interface eth2 disable\n"
ansible.netcommon.cli_config:
- config: '{{ lines }}'
+ config: "{{ lines }}"
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_remove_config.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_remove_config.yaml
index a885f01..c8ab352 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_remove_config.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_remove_config.yaml
@@ -3,4 +3,4 @@
vars:
lines: "delete service lldp interface\ndelete service lldp\n"
ansible.netcommon.cli_config:
- config: '{{ lines }}'
+ config: "{{ lines }}"
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml
index 21bf96d..c5b30af 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml
@@ -1,17 +1,16 @@
---
- debug:
- msg: Start vyos_lldp_interfaces deleted integration tests ansible_connection={{
+ msg:
+ Start vyos_lldp_interfaces deleted integration tests ansible_connection={{
ansible_connection }}
- include_tasks: _populate.yaml
- block:
-
- name: Delete attributes of given LLDP interfaces.
register: result
vyos.vyos.vyos_lldp_interfaces: &id001
config:
-
- name: eth1
- name: eth2
@@ -50,5 +49,4 @@
- "{{ deleted['after'] | symmetric_difference(result['before']) |length\
\ == 0 }}"
always:
-
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml
index 4ef40c9..6c097e3 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml
@@ -1,6 +1,7 @@
---
- debug:
- msg: START vyos_lldp_interfaces empty_config integration tests on connection={{
+ msg:
+ START vyos_lldp_interfaces empty_config integration tests on connection={{
ansible_connection }}
- name: Merged with empty config should give appropriate error message
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml
index 3e6ce40..e077e01 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml
@@ -1,6 +1,7 @@
---
- debug:
- msg: START vyos_lldp_interfaces overridden integration tests on connection={{
+ msg:
+ START vyos_lldp_interfaces overridden integration tests on connection={{
ansible_connection }}
- include_tasks: _remove_config.yaml
@@ -8,12 +9,10 @@
- include_tasks: _populate_intf.yaml
- block:
-
- name: Overrides all device configuration with provided configuration
register: result
vyos.vyos.vyos_lldp_interfaces: &id001
config:
-
- name: eth2
location:
elin: 0000000911
@@ -52,5 +51,4 @@
- "{{ overridden['after'] | symmetric_difference(result['before']) |length\
\ == 0 }}"
always:
-
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/parsed.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/parsed.yaml
index 0ca52be..a32e9d5 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/parsed.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/parsed.yaml
@@ -1,6 +1,7 @@
---
- debug:
- msg: START vyos_lldp_nterfaces parsed integration tests on connection={{ ansible_connection
+ msg:
+ START vyos_lldp_nterfaces parsed integration tests on connection={{ ansible_connection
}}
- name: Parse externally provided interfaces config to agnostic model
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rendered.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rendered.yaml
index 342e64b..87bed90 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rendered.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rendered.yaml
@@ -1,12 +1,12 @@
---
- debug:
- msg: START vyos_lldp_interfaces rendered integration tests on connection={{ ansible_connection
+ msg:
+ START vyos_lldp_interfaces rendered integration tests on connection={{ ansible_connection
}}
- include_tasks: _remove_config.yaml
- block:
-
- name: Structure provided configuration into device specific commands
register: result
vyos.vyos.vyos_lldp_interfaces:
@@ -33,5 +33,4 @@
- "{{ rendered['commands'] | symmetric_difference(result['rendered'])\
\ |length == 0 }}"
always:
-
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml
index 3218e80..e76e3b2 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml
@@ -8,20 +8,18 @@
- include_tasks: _populate.yaml
- block:
-
- - name: Replace device configurations of listed LLDP interfaces with provided
+ - name:
+ Replace device configurations of listed LLDP interfaces with provided
configurations
register: result
vyos.vyos.vyos_lldp_interfaces: &id001
config:
-
- name: eth2
enable: false
location:
civic_based:
country_code: US
ca_info:
-
- ca_type: 0
ca_value: ENGLISH
@@ -52,7 +50,8 @@
- "{{ replaced['after'] | symmetric_difference(result['after']) |length\
\ == 0 }}"
- - name: Replace device configurations of listed LLDP interfaces with provided
+ - name:
+ Replace device configurations of listed LLDP interfaces with provided
configurarions (IDEMPOTENT)
register: result
vyos.vyos.vyos_lldp_interfaces: *id001
@@ -68,5 +67,4 @@
- "{{ replaced['after'] | symmetric_difference(result['before']) |length\
\ == 0 }}"
always:
-
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml
index e6189a3..e23253b 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml
@@ -1,23 +1,21 @@
---
- debug:
- msg: START vyos_lldp_interfaces round trip integration tests on connection={{
+ msg:
+ START vyos_lldp_interfaces round trip integration tests on connection={{
ansible_connection }}
- include_tasks: _remove_config.yaml
- block:
-
- name: Apply the provided configuration (base config)
register: base_config
vyos.vyos.vyos_lldp_interfaces:
config:
-
- name: eth1
location:
civic_based:
country_code: US
ca_info:
-
- ca_type: 0
ca_value: ENGLISH
state: merged
@@ -33,7 +31,6 @@
register: result
vyos.vyos.vyos_lldp_interfaces:
config:
-
- name: eth2
location:
coordinate_based:
@@ -45,7 +42,8 @@
- name: Assert that changes were applied
assert:
- that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length\
+ that:
+ "{{ round_trip['after'] | symmetric_difference(result['after']) |length\
\ == 0 }}"
- name: Revert back to base config using facts round trip
@@ -56,8 +54,8 @@
- name: Assert that config was reverted
assert:
- that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length\
+ that:
+ "{{ base_config['after'] | symmetric_difference(revert['after']) |length\
\ == 0 }}"
always:
-
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/redirection/cli/shortname.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/redirection/cli/shortname.yaml
index f43a8e8..0b06a74 100644
--- a/tests/integration/targets/vyos_lldp_interfaces/tests/redirection/cli/shortname.yaml
+++ b/tests/integration/targets/vyos_lldp_interfaces/tests/redirection/cli/shortname.yaml
@@ -12,7 +12,6 @@
register: result
vyos.vyos.lldp_interfaces: &id001
config:
-
- name: eth2
location:
elin: 0000000911