Fix multiple issues in junos integration test (#27624)

pull/27627/head
Ganesh Nalawade 7 years ago committed by GitHub
parent 2233d9aeb2
commit 505f3bfcac

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

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

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

@ -17,7 +17,7 @@
- assert: - assert:
that: that:
- "result.changed == true" - "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) - name: lldp interface configuration (idempotent)
junos_lldp_interface: junos_lldp_interface:
@ -41,7 +41,7 @@
- assert: - assert:
that: that:
- "result.changed == true" - "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 - name: Activate lldp interface configuration
junos_lldp_interface: junos_lldp_interface:
@ -54,7 +54,7 @@
- assert: - assert:
that: that:
- "result.changed == true" - "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 - name: Disable lldp on particular interface
junos_lldp_interface: junos_lldp_interface:

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

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

Loading…
Cancel
Save