mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
IOS XR cli tests move to network_cli (#34007)
* Update task definitions for network_cli * Add connection to debug messages * Specify connection for prepare task * pc won't be around for connection=network_cli * Assorted Python 3 fixes * Give default port if ansible_ssh_port missing * delegate -> connection * Extend error regex
This commit is contained in:
parent
5db9ac23ee
commit
2e76c89910
48 changed files with 154 additions and 107 deletions
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/backup.yaml"
|
||||
- debug: msg="START cli/backup.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -14,8 +14,8 @@
|
|||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
connection: local
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- name: delete backup files
|
||||
file:
|
||||
|
@ -38,11 +38,11 @@
|
|||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
connection: local
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "backup_files.files is defined"
|
||||
|
||||
- debug: msg="END cli/backup.yaml"
|
||||
- debug: msg="END cli/backup.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/comment-too-long.yaml"
|
||||
- debug: msg="START cli/comment-too-long.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -27,4 +27,4 @@
|
|||
# Check for the correct error message (and not a generic "Invalid input detected") once fixed
|
||||
|
||||
|
||||
- debug: msg="END cli/comment-too-long.yaml"
|
||||
- debug: msg="END cli/comment-too-long.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/comment.yaml"
|
||||
- debug: msg="START cli/comment.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -31,4 +31,4 @@
|
|||
- "result.changed == false"
|
||||
- "result.updates is not defined"
|
||||
|
||||
- debug: msg="END cli/comment.yaml"
|
||||
- debug: msg="END cli/comment.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/src_basic.yaml"
|
||||
- debug: msg="START cli/src_basic.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -32,4 +32,4 @@
|
|||
# https://github.com/ansible/ansible-modules-core/issues/4807
|
||||
- "result.updates is not defined"
|
||||
|
||||
- debug: msg="END cli/src_basic.yaml"
|
||||
- debug: msg="END cli/src_basic.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/src_invalid.yaml"
|
||||
- debug: msg="START cli/src_invalid.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
|
||||
# Defend https://github.com/ansible/ansible-modules-core/issues/4797
|
||||
|
@ -15,4 +15,4 @@
|
|||
- "result.failed == true"
|
||||
- "result.msg == 'path specified in src not found'"
|
||||
|
||||
- debug: msg="END cli/src_invalid.yaml"
|
||||
- debug: msg="END cli/src_invalid.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/src_match_none.yaml"
|
||||
- debug: msg="START cli/src_match_none.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -34,4 +34,4 @@
|
|||
- "result.changed == false"
|
||||
- "result.updates is not defined"
|
||||
|
||||
- debug: msg="END cli/src_match_none.yaml"
|
||||
- debug: msg="END cli/src_match_none.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/sublevel.yaml"
|
||||
- debug: msg="START cli/sublevel.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -34,4 +34,4 @@
|
|||
commands: ['no ipv4 access-list test']
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/sublevel.yaml"
|
||||
- debug: msg="END cli/sublevel.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/sublevel_block.yaml"
|
||||
- debug: msg="START cli/sublevel_block.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -9,7 +9,6 @@
|
|||
- 30 permit ipv4 host 3.3.3.3 any log
|
||||
parents: ['ipv4 access-list test']
|
||||
before: ['no ipv4 access-list test']
|
||||
after: ['exit']
|
||||
match: none
|
||||
|
||||
- name: configure sub level command using block resplace
|
||||
|
@ -21,7 +20,6 @@
|
|||
- 40 permit ipv4 host 4.4.4.4 any log
|
||||
parents: ['ipv4 access-list test']
|
||||
replace: block
|
||||
after: ['exit']
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -42,7 +40,6 @@
|
|||
- 40 permit ipv4 host 4.4.4.4 any log
|
||||
parents: ['ipv4 access-list test']
|
||||
replace: block
|
||||
after: ['exit']
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -54,4 +51,4 @@
|
|||
commands: ['no ipv4 access-list test']
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/sublevel_block.yaml"
|
||||
- debug: msg="END cli/sublevel_block.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/sublevel_exact.yaml"
|
||||
- debug: msg="START cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -11,7 +11,6 @@
|
|||
- 50 permit ipv4 host 5.5.5.5 any log
|
||||
parents: ['ipv4 access-list test']
|
||||
before: ['no ipv4 access-list test']
|
||||
after: ['exit']
|
||||
match: none
|
||||
|
||||
- name: configure sub level command using exact match
|
||||
|
@ -22,7 +21,6 @@
|
|||
- 30 permit ipv4 host 3.3.3.3 any log
|
||||
- 40 permit ipv4 host 4.4.4.4 any log
|
||||
parents: ['ipv4 access-list test']
|
||||
after: ['exit']
|
||||
match: exact
|
||||
register: result
|
||||
|
||||
|
@ -45,7 +43,6 @@
|
|||
- 40 permit ipv4 host 4.4.4.4 any log
|
||||
- 50 permit ipv4 host 5.5.5.5 any log
|
||||
parents: ['ipv4 access-list test']
|
||||
after: ['exit']
|
||||
match: exact
|
||||
register: result
|
||||
|
||||
|
@ -58,4 +55,4 @@
|
|||
commands: ['no ipv4 access-list test']
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/sublevel_exact.yaml"
|
||||
- debug: msg="END cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/sublevel_strict.yaml"
|
||||
- debug: msg="START cli/sublevel_strict.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -11,7 +11,6 @@
|
|||
- 50 permit ipv4 host 5.5.5.5 any log
|
||||
parents: ['ipv4 access-list test']
|
||||
before: ['no ipv4 access-list test']
|
||||
after: ['exit']
|
||||
match: none
|
||||
|
||||
- name: configure sub level command using strict match
|
||||
|
@ -23,7 +22,6 @@
|
|||
- 40 permit ipv4 host 4.4.4.4 any log
|
||||
parents: ['ipv4 access-list test']
|
||||
before: ['no ipv4 access-list test']
|
||||
after: ['exit']
|
||||
match: strict
|
||||
replace: block
|
||||
register: result
|
||||
|
@ -46,7 +44,6 @@
|
|||
- 30 permit ipv4 host 3.3.3.3 any log
|
||||
- 40 permit ipv4 host 4.4.4.4 any log
|
||||
parents: ['ipv4 access-list test']
|
||||
after: ['exit']
|
||||
match: strict
|
||||
register: result
|
||||
|
||||
|
@ -59,4 +56,4 @@
|
|||
commands: ['no ipv4 access-list test']
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/sublevel_strict.yaml"
|
||||
- debug: msg="END cli/sublevel_strict.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/toplevel.yaml"
|
||||
- debug: msg="START cli/toplevel.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -30,4 +30,4 @@
|
|||
commands: ['hostname {{ inventory_hostname_short }}']
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/toplevel.yaml"
|
||||
- debug: msg="END cli/toplevel.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/toplevel_after.yaml"
|
||||
- debug: msg="START cli/toplevel_after.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -37,4 +37,4 @@
|
|||
- "hostname {{ inventory_hostname_short }}"
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/toplevel_after.yaml"
|
||||
- debug: msg="END cli/toplevel_after.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/toplevel_before.yaml"
|
||||
- debug: msg="START cli/toplevel_before.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -37,4 +37,4 @@
|
|||
- "hostname {{ inventory_hostname_short }}"
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/toplevel_before.yaml"
|
||||
- debug: msg="END cli/toplevel_before.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- debug: msg="START cli/toplevel_nonidempotent.yaml"
|
||||
- debug: msg="START cli/toplevel_nonidempotent.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
|
@ -33,4 +33,4 @@
|
|||
commands: ['hostname {{ inventory_hostname_short }}']
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/toplevel_nonidempotent.yaml"
|
||||
- debug: msg="END cli/toplevel_nonidempotent.yaml on connection={{ ansible_connection }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue