summaryrefslogtreecommitdiff
path: root/test/integration/targets/junos_vlan
diff options
context:
space:
mode:
authorGanesh Nalawade <ganesh634@gmail.com>2017-06-29 10:18:35 +0530
committerGitHub <noreply@github.com>2017-06-29 10:18:35 +0530
commit911a7e085ec5d545bbec08573a6224e5981edac4 (patch)
treecd587c33f93daf4d02646e313e63c8fc90078618 /test/integration/targets/junos_vlan
parent15e78d107364a8d1fe85298331b4e9da9648b13d (diff)
downloadansible-911a7e085ec5d545bbec08573a6224e5981edac4.tar.gz
Add active param to junos declarative modules (#26222)
* active/deactivate configuration capability * integration test refactor
Diffstat (limited to 'test/integration/targets/junos_vlan')
-rw-r--r--test/integration/targets/junos_vlan/tests/netconf/basic.yaml45
1 files changed, 33 insertions, 12 deletions
diff --git a/test/integration/targets/junos_vlan/tests/netconf/basic.yaml b/test/integration/targets/junos_vlan/tests/netconf/basic.yaml
index a090b84c05..e154e93e85 100644
--- a/test/integration/targets/junos_vlan/tests/netconf/basic.yaml
+++ b/test/integration/targets/junos_vlan/tests/netconf/basic.yaml
@@ -18,14 +18,17 @@
provider: "{{ netconf }}"
register: result
-- debug:
- msg: "{{ result }}"
+- name: Get running configuration
+ junos_rpc:
+ rpc: get-configuration
+ provider: "{{ netconf }}"
+ register: config
- assert:
that:
- "result.changed == true"
- - "'<name>test-vlan</name>' in result.rpc"
- - "'<vlan-id>100</vlan-id>' in result.rpc"
+ - "'<name>test-vlan</name>' in config.xml"
+ - "'<vlan-id>100</vlan-id>' in config.xml"
- name: Create vlan again (idempotent)
junos_vlan:
@@ -44,29 +47,42 @@
junos_vlan:
vlan_id: 100
name: test-vlan
- state: suspend
+ state: present
+ active: False
provider: "{{ netconf }}"
register: result
+- name: Get running configuration
+ junos_rpc:
+ rpc: get-configuration
+ provider: "{{ netconf }}"
+ register: config
+
- assert:
that:
- "result.changed == true"
- - "'<vlan inactive=\"inactive\">' in result.rpc"
- - "'<name>test-vlan</name>' in result.rpc"
+ - "'<vlan inactive=\"inactive\">' in config.xml"
+ - "'<name>test-vlan</name>' in config.xml"
- name: Activate vlan
junos_vlan:
vlan_id: 100
name: test-vlan
- state: active
+ state: present
+ active: True
provider: "{{ netconf }}"
register: result
+- name: Get running configuration
+ junos_rpc:
+ rpc: get-configuration
+ provider: "{{ netconf }}"
+ register: config
+
- assert:
that:
- "result.changed == true"
- - "'<vlan active=\"active\">' in result.rpc"
- - "'<name>test-vlan</name>' in result.rpc"
+ - "'<name>test-vlan</name>' in config.xml"
- name: Delete vlan
junos_vlan:
@@ -76,8 +92,13 @@
provider: "{{ netconf }}"
register: result
+- name: Get running configuration
+ junos_rpc:
+ rpc: get-configuration
+ provider: "{{ netconf }}"
+ register: config
+
- assert:
that:
- "result.changed == true"
- - "'<vlan delete=\"delete\">' in result.rpc"
- - "'<name>test-vlan</name>' in result.rpc"
+ - "'<name>test-vlan</name>' not in config.xml"