ansible/test/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml
Rohit 8b3ff933af
Vyos lldp interfaces (#60931)
* module_utils checkin

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* vyos lldp_interfaces merging

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* shippable fix

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* merge changes

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* failure added in ignore list

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* comments incorporated

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* comments incorporated

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* test cases updated

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>

* remove global commands

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
2019-08-21 12:30:13 +05:30

57 lines
1.5 KiB
YAML

---
- debug:
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)
vyos_lldp_interfaces:
config:
- name: 'eth1'
location:
civic_based:
country_code: 'US'
ca_info:
- ca_type: 0
ca_value: 'ENGLISH'
state: merged
register: base_config
- name: Gather lldp_interfaces facts
vyos_facts:
gather_subset:
- default
gather_network_resources:
- lldp_interfaces
- name: Apply the provided configuration (config to be reverted)
vyos_lldp_interfaces:
config:
- name: 'eth2'
location:
coordinate_based:
altitude: 2200
datum: 'WGS84'
longitude: '222.267255W'
latitude: '33.524449N'
state: merged
register: result
- name: Assert that changes were applied
assert:
that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length == 0 }}"
- name: Revert back to base config using facts round trip
vyos_lldp_interfaces:
config: "{{ ansible_facts['network_resources']['lldp_interfaces'] }}"
state: overridden
register: revert
- name: Assert that config was reverted
assert:
that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length == 0 }}"
always:
- include_tasks: _remove_config.yaml