Fix multiple issues in junos integration test (#27624)

This commit is contained in:
Ganesh Nalawade 2017-08-02 14:11:10 +05:30 committed by GitHub
parent 2233d9aeb2
commit 505f3bfcac
6 changed files with 56 additions and 90 deletions

View file

@ -79,7 +79,6 @@
- assert:
that:
- "result.changed == true"
- "'<interface>' in config.xml"
- "'<name>ge-0/0/1</name>' in config.xml"
- name: Configure interface attributes
@ -116,17 +115,10 @@
provider: "{{ netconf }}"
register: result
- name: Get running configuration
junos_rpc:
rpc: get-configuration
provider: "{{ netconf }}"
register: config
- assert:
that:
- "result.changed == true"
- "'<disable/>' in config.xml"
- "'<name>ge-0/0/1</name>' in config.xml"
- result.diff.prepared | search("\+ *disable")
- name: Enable interface
junos_interface:
@ -136,17 +128,10 @@
provider: "{{ netconf }}"
register: result
- name: Get running configuration
junos_rpc:
rpc: get-configuration
provider: "{{ netconf }}"
register: config
- assert:
that:
- "result.changed == true"
- "'[edit interfaces ge-0/0/1]\n- disable;' in result.diff.prepared"
- "'<name>ge-0/0/1</name>' in config.xml"
- result.diff.prepared | search("\- *disable")
- name: Delete interface
junos_interface:

View file

@ -29,8 +29,8 @@
- "result.changed == true"
- "'<name>1.1.1.1/32</name>' in config.xml"
- "'<name>fd5d:12c9:2201:1::1/128</name>' in config.xml"
- "'+ address 1.1.1.1/32;' in result.diff.prepared"
- "'+ address fd5d:12c9:2201:1::1/128;' in result.diff.prepared"
- result.diff.prepared | search("\+ *address 1.1.1.1/32")
- result.diff.prepared | search("\+ *address fd5d:12c9:2201:1::1/128")
- name: Configure interface address (idempotent)
junos_l3_interface:
@ -65,8 +65,8 @@
that:
- "result.changed == true"
- "'<address inactive=\"inactive\">' in config.xml"
- "'! inactive: address 1.1.1.1/32' in result.diff.prepared"
- "'! inactive: address fd5d:12c9:2201:1::1/128' in result.diff.prepared"
- result.diff.prepared | search("! *inactive[:] address 1.1.1.1/32")
- result.diff.prepared | search("! *inactive[:] address fd5d:12c9:2201:1::1/128")
- name: Activate interface address
junos_l3_interface:
@ -78,19 +78,11 @@
provider: "{{ netconf }}"
register: result
- name: Get running configuration
junos_rpc:
rpc: get-configuration
provider: "{{ netconf }}"
register: config
- assert:
that:
- "result.changed == true"
- "'<name>1.1.1.1/32</name>' in config.xml"
- "'<name>fd5d:12c9:2201:1::1/128</name>' in config.xml"
- "'! active: address 1.1.1.1/32' in result.diff.prepared"
- "'! active: address fd5d:12c9:2201:1::1/128' in result.diff.prepared"
- result.diff.prepared | search("! *active[:] address 1.1.1.1/32")
- result.diff.prepared | search("! *active[:] address fd5d:12c9:2201:1::1/128")
- name: Delete interface address
junos_l3_interface:
@ -101,19 +93,10 @@
provider: "{{ netconf }}"
register: result
- name: Get running configuration
junos_rpc:
rpc: get-configuration
provider: "{{ netconf }}"
register: config
- assert:
that:
- "result.changed == true"
- "'<name>1.1.1.1/32</name>' not in config.xml"
- "'<name>fd5d:12c9:2201:1::1/128</name>' not in config.xml"
- "'- address 1.1.1.1/32;' in result.diff.prepared"
- "'- address fd5d:12c9:2201:1::1/128;' in result.diff.prepared"
- result.diff.prepared | search("\- *address 1.1.1.1/32")
- result.diff.prepared | search("\- *address fd5d:12c9:2201:1::1/128")
- name: Delete interface address (idempotent)
junos_l3_interface:

View file

@ -38,9 +38,9 @@
- assert:
that:
- "result.changed == true"
- "'+ advertisement-interval 10;' in result.diff.prepared"
- "'+ transmit-delay 30;' in result.diff.prepared"
- "'+ hold-multiplier 5;' in result.diff.prepared"
- result.diff.prepared | search("\+ *advertisement-interval 10")
- result.diff.prepared | search("\+ *transmit-delay 30")
- result.diff.prepared | search("\+ *hold-multiplier 5")
- name: configure lldp parameters and enable lldp(idempotent)
junos_lldp:
@ -67,7 +67,7 @@
- assert:
that:
- "result.changed == true"
- "'+ disable;' in result.diff.prepared"
- result.diff.prepared | search("\+ *disable")
- "'advertisement-interval 10;' not in result.diff.prepared"
- "'transmit-delay 30;' not in result.diff.prepared"
- "'hold-multiplier 5;' not in result.diff.prepared"
@ -84,7 +84,7 @@
- assert:
that:
- "result.changed == true"
- "'- disable;' in result.diff.prepared"
- result.diff.prepared | search("\- *disable")
- "'advertisement-interval 10;' not in result.diff.prepared"
- "'transmit-delay 30;' not in result.diff.prepared"
- "'hold-multiplier 5;' not in result.diff.prepared"
@ -101,10 +101,10 @@
- assert:
that:
- "result.changed == true"
- "'+ disable;' in result.diff.prepared"
- "'- advertisement-interval 10;' in result.diff.prepared"
- "'- transmit-delay 30;' in result.diff.prepared"
- "'- hold-multiplier 5;' in result.diff.prepared"
- result.diff.prepared | search("\+ *disable")
- result.diff.prepared | search("\- *advertisement-interval 10")
- result.diff.prepared | search("\- *transmit-delay 30")
- result.diff.prepared | search("\- *hold-multiplier 5")
- name: Remove lldp (idempotent)
junos_lldp:

View file

@ -17,7 +17,7 @@
- assert:
that:
- "result.changed == true"
- "'+ interface ge-0/0/5;' in result.diff.prepared"
- result.diff.prepared | search("\+ *interface ge-0/0/5")
- name: lldp interface configuration (idempotent)
junos_lldp_interface:
@ -41,7 +41,7 @@
- assert:
that:
- "result.changed == true"
- "'! inactive: interface ge-0/0/5' in result.diff.prepared"
- result.diff.prepared | search("! *inactive[:] interface ge-0/0/5")
- name: Activate lldp interface configuration
junos_lldp_interface:
@ -54,7 +54,7 @@
- assert:
that:
- "result.changed == true"
- "'! active: interface ge-0/0/5' in result.diff.prepared"
- result.diff.prepared | search("! *active[:] interface ge-0/0/5")
- name: Disable lldp on particular interface
junos_lldp_interface:

View file

@ -27,7 +27,7 @@
- "result.changed == true"
- "'<name>test_user</name>' in config.xml"
- "'<full-name>test_user</full-name>' in config.xml"
- "'<class>read-only</class>' in config.xml"
- "'<class>operator</class>' in config.xml"
- name: Create user again (idempotent)
junos_user:
@ -85,7 +85,7 @@
- "result.changed == true"
- "'<name>test_user</name>' in config.xml"
- "'<full-name>test_user</full-name>' in config.xml"
- "'<class>read-only</class>' in config.xml"
- "'<class>operator</class>' in config.xml"
- name: Delete user
junos_user:

View file

@ -23,13 +23,13 @@
- assert:
that:
- "result.changed == true"
- "'+ test-1' in result.diff.prepared"
- "'+ description test-vrf-1;' in result.diff.prepared"
- "'+ instance-type vrf;' in result.diff.prepared"
- "'+ interface ge-0/0/5.0;' in result.diff.prepared"
- "'+ interface ge-0/0/6.0;' in result.diff.prepared"
- "'+ route-distinguisher 3.3.3.3:10;' in result.diff.prepared"
- "'+ vrf-target target:65513:111;' in result.diff.prepared"
- result.diff.prepared | search("\+ *test-1")
- result.diff.prepared | search("\+ *description test-vrf-1")
- result.diff.prepared | search("\+ *instance-type vrf")
- result.diff.prepared | search("\+ *interface ge-0/0/5.0")
- result.diff.prepared | search("\+ *interface ge-0/0/6.0")
- result.diff.prepared | search("\+ *route-distinguisher 3.3.3.3:10")
- result.diff.prepared | search("\+ *vrf-target target:65513:111")
- name: Configure vrf and its parameter (idempotent)
junos_vrf:
@ -65,16 +65,15 @@
that:
- "result.changed == true"
- "'[edit routing-instances test-1]' in result.diff.prepared"
- "'+ interface ge-0/0/2.0;' in result.diff.prepared"
- "'+ interface ge-0/0/3.0;' in result.diff.prepared"
- "'- interface ge-0/0/5.0;' in result.diff.prepared"
- "'- interface ge-0/0/6.0;' in result.diff.prepared"
- result.diff.prepared | search("\+ *interface ge-0/0/2.0")
- result.diff.prepared | search("\+ *interface ge-0/0/3.0")
- result.diff.prepared | search("\- *interface ge-0/0/5.0")
- result.diff.prepared | search("\- *interface ge-0/0/6.0")
- "'[edit routing-instances test-1]' in result.diff.prepared"
- "'- route-distinguisher 3.3.3.3:10;' in result.diff.prepared"
- "'+ route-distinguisher 1.1.1.1:10;' in result.diff.prepared"
- "'- vrf-target target:65513:111;' in result.diff.prepared"
- "'+ vrf-target target:65514:113;' in result.diff.prepared"
- result.diff.prepared | search("\- *route-distinguisher 3.3.3.3:10")
- result.diff.prepared | search("\+ *route-distinguisher 1.1.1.1:10")
- result.diff.prepared | search("\- *vrf-target target:65513:111")
- result.diff.prepared | search("\+ *vrf-target target:65514:113")
- name: Deactivate vrf
junos_vrf:
@ -94,13 +93,13 @@
that:
- "result.changed == true"
- "'[edit routing-instances]' in result.diff.prepared"
- "'! inactive: test-1' in result.diff.prepared"
- result.diff.prepared | search("! *inactive[:] test-1")
- "'[edit routing-instances test-1]' in result.diff.prepared"
- "'! inactive: interface ge-0/0/2.0' in result.diff.prepared"
- "'! inactive: interface ge-0/0/3.0' in result.diff.prepared"
- result.diff.prepared | search("! *inactive[:] interface ge-0/0/2.0")
- result.diff.prepared | search("! *inactive[:] interface ge-0/0/3.0")
- "'[edit routing-instances test-1]' in result.diff.prepared"
- "'! inactive: route-distinguisher' in result.diff.prepared"
- "'! inactive: vrf-target' in result.diff.prepared"
- result.diff.prepared | search("! *inactive[:] route-distinguisher")
- result.diff.prepared | search("! *inactive[:] vrf-target")
- name: Activate vrf
junos_vrf:
@ -120,13 +119,13 @@
that:
- "result.changed == true"
- "'[edit routing-instances]' in result.diff.prepared"
- "'! active: test-1' in result.diff.prepared"
- result.diff.prepared | search("! *active[:] test-1")
- "'[edit routing-instances test-1]' in result.diff.prepared"
- "'! active: interface ge-0/0/2.0' in result.diff.prepared"
- "'! active: interface ge-0/0/3.0' in result.diff.prepared"
- result.diff.prepared | search("! *active[:] interface ge-0/0/2.0")
- result.diff.prepared | search("! *active[:] interface ge-0/0/3.0")
- "'[edit routing-instances test-1]' in result.diff.prepared"
- "'! active: route-distinguisher' in result.diff.prepared"
- "'! active: vrf-target' in result.diff.prepared"
- result.diff.prepared | search("! *active[:] route-distinguisher")
- result.diff.prepared | search("! *active[:] vrf-target")
- name: Delete vrf
junos_vrf:
@ -144,14 +143,13 @@
- assert:
that:
- "result.changed == true"
- "'[edit routing-instances]' in result.diff.prepared"
- "'- test-1' in result.diff.prepared"
- "'- description test-vrf-1;' in result.diff.prepared"
- "'- instance-type vrf;' in result.diff.prepared"
- "'- interface ge-0/0/2.0;' in result.diff.prepared"
- "'- interface ge-0/0/3.0;' in result.diff.prepared"
- "'- route-distinguisher 1.1.1.1:10;' in result.diff.prepared"
- "'- vrf-target target:65514:113;' in result.diff.prepared"
- result.diff.prepared | search("\- *test-1")
- result.diff.prepared | search("\- *description test-vrf-1")
- result.diff.prepared | search("\- *instance-type vrf")
- result.diff.prepared | search("\- *interface ge-0/0/2.0")
- result.diff.prepared | search("\- *interface ge-0/0/3.0")
- result.diff.prepared | search("\- *route-distinguisher 1.1.1.1:10")
- result.diff.prepared | search("\- *vrf-target target:65514:113")
- name: Delete vrf (idempotent)
junos_vrf: