summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRohit Thakur <rohitthakur2590@outlook.com>2020-05-08 11:15:31 +0530
committerRohit Thakur <rohitthakur2590@outlook.com>2020-05-08 11:15:31 +0530
commiteb0b2da9decdedffb669f53aeb0517b2b07c6748 (patch)
tree38121418775a143e2fff85783f8934b08dfa185e /tests
parent3314d6619c34636f19444031ef65c612a4c4d06f (diff)
downloadvyos.vyos-eb0b2da9decdedffb669f53aeb0517b2b07c6748.tar.gz
vyos.vyos-eb0b2da9decdedffb669f53aeb0517b2b07c6748.zip
parsed test case updated
Signed-off-by: Rohit Thakur <rohitthakur2590@outlook.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/targets/vyos_lldp_global/tests/cli/_parsed_config.cfg1
-rw-r--r--tests/integration/targets/vyos_lldp_global/tests/cli/parsed.yaml38
-rw-r--r--tests/integration/targets/vyos_lldp_global/tests/cli/rendered.yaml2
-rw-r--r--tests/integration/targets/vyos_lldp_global/vars/main.yaml7
4 files changed, 18 insertions, 30 deletions
diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/_parsed_config.cfg b/tests/integration/targets/vyos_lldp_global/tests/cli/_parsed_config.cfg
index 4eedf01..9c9f66c 100644
--- a/tests/integration/targets/vyos_lldp_global/tests/cli/_parsed_config.cfg
+++ b/tests/integration/targets/vyos_lldp_global/tests/cli/_parsed_config.cfg
@@ -1,2 +1,3 @@
+set service lldp legacy-protocols 'fdp'
set service lldp legacy-protocols 'cdp'
set service lldp management-address '192.0.2.17'
diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/parsed.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/parsed.yaml
index 173e3a6..b9c3abf 100644
--- a/tests/integration/targets/vyos_lldp_global/tests/cli/parsed.yaml
+++ b/tests/integration/targets/vyos_lldp_global/tests/cli/parsed.yaml
@@ -3,31 +3,13 @@
msg: START vyos_lldp_global parsed integration tests on connection={{ ansible_connection
}}
-- include_tasks: _remove_config.yaml
-
-- include_tasks: _populate.yaml
-
-- block:
-
- - name: Gather lldp_global facts
- register: lldp_global_facts
- vyos.vyos.vyos_facts:
- gather_subset:
- - default
- gather_network_resources:
- - lldp_global
-
- - name: Provide the running configuration for parsing (config to be parsed)
- register: result
- vyos.vyos.vyos_lldp_global:
- running_config: "{{ lookup('file', '_parsed_config.cfg') }}"
- state: parsed
-
- - name: Assert that correct parsing done
- assert:
- that: "{{ ansible_facts['network_resources']['lldp_global'] == result['parsed']\
- \ }}"
-
- always:
-
- - include_tasks: _remove_config.yaml
+- name: Parse externally provided LLDP global config to agnostic model
+ register: result
+ vyos.vyos.vyos_lldp_global:
+ running_config: "{{ lookup('file', '_parsed_config.cfg') }}"
+ state: parsed
+
+- name: Assert that config was correctly parsed
+ assert:
+ that:
+ - "{{ parsed['after'] == result['parsed'] }}"
diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/rendered.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/rendered.yaml
index 620fb78..5e9f4c5 100644
--- a/tests/integration/targets/vyos_lldp_global/tests/cli/rendered.yaml
+++ b/tests/integration/targets/vyos_lldp_global/tests/cli/rendered.yaml
@@ -5,8 +5,6 @@
- include_tasks: _remove_config.yaml
-- include_tasks: _populate.yaml
-
- block:
- name: Structure provided configuration into device specific commands
diff --git a/tests/integration/targets/vyos_lldp_global/vars/main.yaml b/tests/integration/targets/vyos_lldp_global/vars/main.yaml
index fb4b31e..622b8e4 100644
--- a/tests/integration/targets/vyos_lldp_global/vars/main.yaml
+++ b/tests/integration/targets/vyos_lldp_global/vars/main.yaml
@@ -31,6 +31,13 @@ replaced:
- cdp
- edp
- sonmp
+parsed:
+ after:
+ address: 192.0.2.17
+ enable: true
+ legacy_protocols:
+ - fdp
+ - cdp
rendered:
commands:
- set service lldp legacy-protocols 'cdp'