5e200f2d0a
* Model->Role->Module. Yet to import modules/exos_facts.py * exos_facts refactor * future-import and metaclass * Fix unit tests * Fix openconfig-lldp word and send_request API from Httpapi class idempotent, json.dumps in base class, send_requests from base exos class * action file for exos_lldp_global * Add intergration tests for exos_lldp_global * Test data field of the request
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
---
|
|
- debug:
|
|
msg: "START exos_lldp_global merged integration tests on connection={{ ansible_connection }}"
|
|
|
|
- include_tasks: _reset_config.yaml
|
|
|
|
- block:
|
|
- name: Merge the provided configuration with the exisiting running configuration
|
|
exos_lldp_global: &merged
|
|
config:
|
|
interval: 10
|
|
tlv_select:
|
|
system_description: false
|
|
system_capabilities: false
|
|
state: merged
|
|
register: result
|
|
|
|
- name: Assert that before dicts were correctly generated
|
|
assert:
|
|
that: "{{ merged['before'] == result['before'] }}"
|
|
|
|
- name: Assert that correct set of requests were generated
|
|
assert:
|
|
that:
|
|
- "{{ merged['requests'][0]['method'] == result['requests'][0]['method'] }}"
|
|
- "{{ merged['requests'][0]['path'] == result['requests'][0]['path'] }}"
|
|
- "{{ merged['requests'][0]['data'] == result['requests'][0]['data'] }}"
|
|
|
|
- name: Assert that after dicts was correctly generated
|
|
assert:
|
|
that:
|
|
- "{{ merged['after'] == result['after'] }}"
|
|
|
|
- name: Merge the provided configuration with the existing running configuration (IDEMPOTENT)
|
|
exos_lldp_global: *merged
|
|
register: result
|
|
|
|
- name: Assert that the previous task was idempotent
|
|
assert:
|
|
that:
|
|
- " result['changed'] == false"
|
|
|
|
- name: Assert that before dicts were correctly generated
|
|
assert:
|
|
that:
|
|
- "{{ merged['after'] == result['before'] }}"
|
|
|
|
always:
|
|
- include_tasks: _reset_config.yaml
|