summaryrefslogtreecommitdiff
path: root/test/integration/targets/exos_vlans/tests/httpapi/replaced.yaml
diff options
context:
space:
mode:
authorJayalakshmiV <53187249+JayalakshmiV@users.noreply.github.com>2019-10-10 06:50:04 -0400
committeransibot <ansibot@users.noreply.github.com>2019-10-10 06:50:04 -0400
commit45acdb41d2ac81216c5d8e26b095c767bc5054d0 (patch)
tree8d4b4e9dfdcedf26718d8ea22372b0a5d2d1d627 /test/integration/targets/exos_vlans/tests/httpapi/replaced.yaml
parenteca33b80f02473d548095b9449eb907573c5770d (diff)
downloadansible-45acdb41d2ac81216c5d8e26b095c767bc5054d0.tar.gz
Added Exos vlan resource module (#61865)
* EXOS_VLAN resource module * EXOS_VLAN resource module * EXOS_VLAN resource module * EXOS_VLAN resource module * EXOS_VLAN resource module * Fix exos_vlans resource module and integration test * Move exos_vlan folder to exos_vlans folder * Fix exos->config->vlans and exos->utils * Fix version_added * Improve exos_vlans module and integration tests * Fix exos_vlans.py * exos_vlan resource module
Diffstat (limited to 'test/integration/targets/exos_vlans/tests/httpapi/replaced.yaml')
-rw-r--r--test/integration/targets/exos_vlans/tests/httpapi/replaced.yaml49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/integration/targets/exos_vlans/tests/httpapi/replaced.yaml b/test/integration/targets/exos_vlans/tests/httpapi/replaced.yaml
new file mode 100644
index 0000000000..1949ec7992
--- /dev/null
+++ b/test/integration/targets/exos_vlans/tests/httpapi/replaced.yaml
@@ -0,0 +1,49 @@
+---
+- 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'] }}"