ansible/test/integration/targets/exos_lldp_interfaces/tests/httpapi/overridden.yaml
JayalakshmiV 1a384a61fb exos_lldp_interfaces resource module (#62108)
* exos_lldp_interfaces resource module

* Fix exos_lldp_interfaces and add integration tests

* Fix deleted testcase for integration test
2019-10-17 13:40:17 -04:00

56 lines
1.7 KiB
YAML

---
- debug:
msg: "Start exos_lldp_interfaces overridden integration tests ansible_connection={{ ansible_connection }}"
- include_tasks: _reset_config.yaml
- include_tasks: _populate_config.yaml
- set_fact:
config:
- enabled: true
name: '5'
- enabled: false
name: '6'
- exos_facts:
gather_network_resources: lldp_interfaces
- block:
- name: Override device LLDP interface configuration with provided configurations
exos_lldp_interfaces: &overridden
config: "{{ config }}"
state: overridden
register: result
- name: Assert that correct set of results were generated
assert:
that:
- "overridden['requests']|symmetric_difference(result['requests']) == []"
- "ansible_facts.network_resources.lldp_interfaces|symmetric_difference(result.before) == []"
- exos_facts:
gather_network_resources: lldp_interfaces
- name: Assert that after dicts were correctly generated
assert:
that:
- "ansible_facts.network_resources.lldp_interfaces|symmetric_difference(result.after) == []"
- "config|difference(ansible_facts.network_resources.lldp_interfaces) == []"
- name: Override device LLDP interface configuration with provided configurations (IDEMPOTENT)
exos_lldp_interfaces: *overridden
register: result
- name: Assert that task was idempotent
assert:
that:
- "result['changed'] == false"
- exos_facts:
gather_network_resources: lldp_interfaces
- name: Assert that the before dicts were correctly generated
assert:
that:
- "ansible_facts.network_resources.lldp_interfaces|symmetric_difference(result.before) == []"
- "config|difference(ansible_facts.network_resources.lldp_interfaces) == []"