ansible/test/integration/targets/exos_vlans/tests/httpapi/replaced.yaml

50 lines
1.3 KiB
YAML
Raw Normal View History

---
- debug:
msg: "START exos_vlans replaced integration tests on connection={{ ansible_connection }}"
- include_tasks: _reset_config.yaml
- include_tasks: _populate_config.yaml
- block:
- name: Replace existing VLAN configurations with provided configurations
exos_vlans: &replaced
config:
- name: Test_VLAN20
vlan_id: 20
state: active
- name: vlan_40
vlan_id: 40
state: suspend
state: replaced
register: result
- name: Assert that correct set of requests are correctly generated
assert:
that:
- "{{ replaced['requests'] == result['requests'] }}"
- name: Assert that before dicts were correctly generated
assert:
that:
- "{{ initial_state == result['before'] }}"
- name: Assert that after dicts were correctly generated
assert:
that:
- "{{ replaced['after'] == result['after'] }}"
- name: Replace existing VLAN configuration with provided configurations (IDEMPOTENT)
exos_vlans: *replaced
register: result
- name: Assert that task was idempotent
assert:
that:
- "result.changed == false"
- name: Assert that before dict was correctly generated
assert:
that:
- "{{ replaced['after'] == result['before'] }}"