mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Fix multiple issues in junos integration test (#27624)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user