diff options
author | Rohit Thakur <rohitthakur2590@outlook.com> | 2020-05-08 12:35:18 +0530 |
---|---|---|
committer | Rohit Thakur <rohitthakur2590@outlook.com> | 2020-05-08 12:35:18 +0530 |
commit | bd128df488162da0691596560ce9b395d707a503 (patch) | |
tree | e61fd6e29e98e26517bf1f762a79f45d0af87ac6 /tests/integration | |
parent | df5f503a3603164cc4ba74723aa39e7f33be6605 (diff) | |
download | vyos.vyos-bd128df488162da0691596560ce9b395d707a503.tar.gz vyos.vyos-bd128df488162da0691596560ce9b395d707a503.zip |
parsed test updated
Signed-off-by: Rohit Thakur <rohitthakur2590@outlook.com>
Diffstat (limited to 'tests/integration')
4 files changed, 29 insertions, 32 deletions
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/gathered.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/gathered.yaml index 30b804a..180b62f 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/gathered.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/gathered.yaml @@ -11,7 +11,7 @@ - name: Gather the provided configuration with the exisiting running configuration register: result - vyos.vyos.vyos_lldp_interfaces: &id001 + vyos.vyos.vyos_lldp_interfaces: config: state: gathered 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 c549ce7..0ca52be 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/parsed.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/parsed.yaml @@ -1,33 +1,16 @@ --- - debug: - msg: START vyos_lldp_interfaces parsed integration tests on connection={{ ansible_connection + msg: START vyos_lldp_nterfaces parsed integration tests on connection={{ ansible_connection }} -- include_tasks: _remove_config.yaml - -- include_tasks: _populate.yaml - -- block: - - - name: Gather lldp_interfaces facts - register: lldp_interfaces_facts - vyos.vyos.vyos_facts: - gather_subset: - - default - gather_network_resources: - - lldp_interfaces - - - name: Provide the running configuration for parsing (config to be parsed) - register: result - vyos.vyos.vyos_lldp_interfaces: - running_config: "{{ lookup('file', '_parsed_config.cfg') }}" - state: parsed - - - name: Assert that correct parsing done - assert: - that: "{{ ansible_facts['network_resources']['lldp_interfaces'] | symmetric_difference(result['parsed'])\ - \ |length == 0 }}" - - always: - - - include_tasks: _remove_config.yaml +- name: Parse externally provided interfaces config to agnostic model + register: result + vyos.vyos.vyos_lldp_interfaces: + running_config: "{{ lookup('file', '_parsed_config.cfg') }}" + state: parsed + +- name: Assert that config was correctly parsed + assert: + that: + - "{{ parsed['after'] | symmetric_difference(result['parsed']) |length ==\ + \ 0 }}" 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 d69e1c5..342e64b 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rendered.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/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_interfaces/vars/main.yaml b/tests/integration/targets/vyos_lldp_interfaces/vars/main.yaml index 506bdf7..092f653 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/vars/main.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/vars/main.yaml @@ -97,6 +97,22 @@ overridden: - name: eth2 location: elin: 0000000911 +parsed: + after: + - name: eth1 + location: + civic_based: + country_code: US + ca_info: + - ca_type: 0 + ca_value: ENGLISH + - name: eth2 + location: + coordinate_based: + altitude: 2200 + datum: WGS84 + longitude: 222.267255W + latitude: 33.524449N deleted: commands: - delete service lldp interface eth1 |