summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNathaniel Case <this.is@nathanielca.se>2017-12-20 11:26:09 -0500
committerGitHub <noreply@github.com>2017-12-20 11:26:09 -0500
commit2e76c899104eb55cc56589927d3b7ee8fc1e6e30 (patch)
tree0edace460e20651d48c851bf1b7bc57174594cf4 /test
parent5db9ac23ee37dea480749bee4f3b7a96e1f60a4c (diff)
downloadansible-2e76c899104eb55cc56589927d3b7ee8fc1e6e30.tar.gz
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
Diffstat (limited to 'test')
-rw-r--r--test/integration/targets/iosxr_banner/tasks/cli.yaml10
-rw-r--r--test/integration/targets/iosxr_command/tasks/cli.yaml10
-rw-r--r--test/integration/targets/iosxr_command/tests/cli/bad_operator.yaml4
-rw-r--r--test/integration/targets/iosxr_command/tests/cli/contains.yaml4
-rw-r--r--test/integration/targets/iosxr_command/tests/cli/invalid.yaml4
-rw-r--r--test/integration/targets/iosxr_command/tests/cli/output.yaml4
-rw-r--r--test/integration/targets/iosxr_command/tests/cli/timeout.yaml4
-rw-r--r--test/integration/targets/iosxr_config/tasks/cli.yaml10
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/backup.yaml8
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml4
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/comment.yaml4
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/src_basic.yaml4
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/src_invalid.yaml4
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/src_match_none.yaml4
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/sublevel.yaml4
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/sublevel_block.yaml7
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/sublevel_exact.yaml7
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/sublevel_strict.yaml7
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/toplevel.yaml4
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/toplevel_after.yaml4
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/toplevel_before.yaml4
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/toplevel_nonidempotent.yaml4
-rw-r--r--test/integration/targets/iosxr_facts/tasks/cli.yaml10
-rw-r--r--test/integration/targets/iosxr_facts/tests/cli/all_facts.yaml4
-rw-r--r--test/integration/targets/iosxr_facts/tests/cli/default_facts.yaml4
-rw-r--r--test/integration/targets/iosxr_facts/tests/cli/invalid_subset.yaml4
-rw-r--r--test/integration/targets/iosxr_facts/tests/cli/not_hardware.yaml4
-rw-r--r--test/integration/targets/iosxr_interface/tasks/cli.yaml10
-rw-r--r--test/integration/targets/iosxr_interface/tests/cli/basic.yaml4
-rw-r--r--test/integration/targets/iosxr_interface/tests/cli/intent.yaml2
-rw-r--r--test/integration/targets/iosxr_logging/tasks/cli.yaml10
-rw-r--r--test/integration/targets/iosxr_netconf/tasks/cli.yaml10
-rw-r--r--test/integration/targets/iosxr_netconf/tests/cli/basic.yaml4
-rw-r--r--test/integration/targets/iosxr_system/tasks/cli.yaml10
-rw-r--r--test/integration/targets/iosxr_system/tests/cli/set_domain_list.yaml4
-rw-r--r--test/integration/targets/iosxr_system/tests/cli/set_domain_name.yaml4
-rw-r--r--test/integration/targets/iosxr_system/tests/cli/set_hostname.yaml4
-rw-r--r--test/integration/targets/iosxr_system/tests/cli/set_lookup_source.yaml4
-rw-r--r--test/integration/targets/iosxr_system/tests/cli/set_name_servers.yaml4
-rw-r--r--test/integration/targets/iosxr_user/tasks/cli.yaml10
-rw-r--r--test/integration/targets/iosxr_user/tests/cli/auth.yaml12
-rw-r--r--test/integration/targets/prepare_iosxr_tests/tasks/main.yml1
42 files changed, 142 insertions, 96 deletions
diff --git a/test/integration/targets/iosxr_banner/tasks/cli.yaml b/test/integration/targets/iosxr_banner/tasks/cli.yaml
index 46d86dd698..890d3acf3e 100644
--- a/test/integration/targets/iosxr_banner/tasks/cli.yaml
+++ b/test/integration/targets/iosxr_banner/tasks/cli.yaml
@@ -9,8 +9,14 @@
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-- name: run test case
- include: "{{ test_case_to_run }}"
+- name: run test case (connection=network_cli)
+ include: "{{ test_case_to_run }} ansible_connection=network_cli"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
+
+- name: run test case (connection=local)
+ include: "{{ test_case_to_run }} ansible_connection=local"
+ with_first_found: "{{ test_items }}"
+ loop_control:
+ loop_var: test_case_to_run
diff --git a/test/integration/targets/iosxr_command/tasks/cli.yaml b/test/integration/targets/iosxr_command/tasks/cli.yaml
index 46d86dd698..890d3acf3e 100644
--- a/test/integration/targets/iosxr_command/tasks/cli.yaml
+++ b/test/integration/targets/iosxr_command/tasks/cli.yaml
@@ -9,8 +9,14 @@
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-- name: run test case
- include: "{{ test_case_to_run }}"
+- name: run test case (connection=network_cli)
+ include: "{{ test_case_to_run }} ansible_connection=network_cli"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
+
+- name: run test case (connection=local)
+ include: "{{ test_case_to_run }} ansible_connection=local"
+ with_first_found: "{{ test_items }}"
+ loop_control:
+ loop_var: test_case_to_run
diff --git a/test/integration/targets/iosxr_command/tests/cli/bad_operator.yaml b/test/integration/targets/iosxr_command/tests/cli/bad_operator.yaml
index 84aa658796..28e359ab7c 100644
--- a/test/integration/targets/iosxr_command/tests/cli/bad_operator.yaml
+++ b/test/integration/targets/iosxr_command/tests/cli/bad_operator.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/bad_operator.yaml"
+- debug: msg="START cli/bad_operator.yaml on connection={{ ansible_connection }}"
- name: test bad operator
iosxr_command:
@@ -16,4 +16,4 @@
- "result.failed == true"
- "result.msg is defined"
-- debug: msg="END cli/bad_operator.yaml"
+- debug: msg="END cli/bad_operator.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_command/tests/cli/contains.yaml b/test/integration/targets/iosxr_command/tests/cli/contains.yaml
index b6f7b2f14c..55dd302dc0 100644
--- a/test/integration/targets/iosxr_command/tests/cli/contains.yaml
+++ b/test/integration/targets/iosxr_command/tests/cli/contains.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/contains.yaml"
+- debug: msg="START cli/contains.yaml on connection={{ ansible_connection }}"
- name: test contains operator
iosxr_command:
@@ -16,4 +16,4 @@
- "result.changed == false"
- "result.stdout is defined"
-- debug: msg="END cli/contains.yaml"
+- debug: msg="END cli/contains.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_command/tests/cli/invalid.yaml b/test/integration/targets/iosxr_command/tests/cli/invalid.yaml
index c128c0c100..d26b9ec18f 100644
--- a/test/integration/targets/iosxr_command/tests/cli/invalid.yaml
+++ b/test/integration/targets/iosxr_command/tests/cli/invalid.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/invalid.yaml"
+- debug: msg="START cli/invalid.yaml on connection={{ ansible_connection }}"
- name: run invalid command
iosxr_command:
@@ -23,4 +23,4 @@
that:
- "result.failed"
-- debug: msg="END cli/invalid.yaml"
+- debug: msg="END cli/invalid.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_command/tests/cli/output.yaml b/test/integration/targets/iosxr_command/tests/cli/output.yaml
index 5c803e7fad..3057d58c49 100644
--- a/test/integration/targets/iosxr_command/tests/cli/output.yaml
+++ b/test/integration/targets/iosxr_command/tests/cli/output.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/output.yaml"
+- debug: msg="START cli/output.yaml on connection={{ ansible_connection }}"
- name: get output for single command
iosxr_command:
@@ -24,4 +24,4 @@
- "result.stdout is defined"
- "result.stdout | length == 2"
-- debug: msg="END cli/output.yaml"
+- debug: msg="END cli/output.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_command/tests/cli/timeout.yaml b/test/integration/targets/iosxr_command/tests/cli/timeout.yaml
index 00533d785e..bbad3ecaf5 100644
--- a/test/integration/targets/iosxr_command/tests/cli/timeout.yaml
+++ b/test/integration/targets/iosxr_command/tests/cli/timeout.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/timeout.yaml"
+- debug: msg="START cli/timeout.yaml on connection={{ ansible_connection }}"
- name: test bad condition
iosxr_command:
@@ -15,4 +15,4 @@
- "result.failed == true"
- "result.msg is defined"
-- debug: msg="END cli/timeout.yaml"
+- debug: msg="END cli/timeout.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tasks/cli.yaml b/test/integration/targets/iosxr_config/tasks/cli.yaml
index 46d86dd698..890d3acf3e 100644
--- a/test/integration/targets/iosxr_config/tasks/cli.yaml
+++ b/test/integration/targets/iosxr_config/tasks/cli.yaml
@@ -9,8 +9,14 @@
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-- name: run test case
- include: "{{ test_case_to_run }}"
+- name: run test case (connection=network_cli)
+ include: "{{ test_case_to_run }} ansible_connection=network_cli"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
+
+- name: run test case (connection=local)
+ include: "{{ test_case_to_run }} ansible_connection=local"
+ with_first_found: "{{ test_items }}"
+ loop_control:
+ loop_var: test_case_to_run
diff --git a/test/integration/targets/iosxr_config/tests/cli/backup.yaml b/test/integration/targets/iosxr_config/tests/cli/backup.yaml
index 4c9056b83a..272063d6c1 100644
--- a/test/integration/targets/iosxr_config/tests/cli/backup.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/backup.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml b/test/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml
index ebf44f464f..856f9ef386 100644
--- a/test/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/comment.yaml b/test/integration/targets/iosxr_config/tests/cli/comment.yaml
index e6dc9f0037..38f0dd98cf 100644
--- a/test/integration/targets/iosxr_config/tests/cli/comment.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/comment.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/src_basic.yaml b/test/integration/targets/iosxr_config/tests/cli/src_basic.yaml
index cb5f666826..7dae193d66 100644
--- a/test/integration/targets/iosxr_config/tests/cli/src_basic.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/src_basic.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/src_invalid.yaml b/test/integration/targets/iosxr_config/tests/cli/src_invalid.yaml
index 362f22586a..5f7b6f2dd1 100644
--- a/test/integration/targets/iosxr_config/tests/cli/src_invalid.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/src_invalid.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/src_match_none.yaml b/test/integration/targets/iosxr_config/tests/cli/src_match_none.yaml
index fd817aa988..dc3b269992 100644
--- a/test/integration/targets/iosxr_config/tests/cli/src_match_none.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/src_match_none.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/sublevel.yaml b/test/integration/targets/iosxr_config/tests/cli/sublevel.yaml
index 750c49d459..6d27a23149 100644
--- a/test/integration/targets/iosxr_config/tests/cli/sublevel.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/sublevel.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/sublevel_block.yaml b/test/integration/targets/iosxr_config/tests/cli/sublevel_block.yaml
index d4d7fc6add..88b5e76e99 100644
--- a/test/integration/targets/iosxr_config/tests/cli/sublevel_block.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/sublevel_block.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/sublevel_exact.yaml b/test/integration/targets/iosxr_config/tests/cli/sublevel_exact.yaml
index d2b4121aec..8c031b50ec 100644
--- a/test/integration/targets/iosxr_config/tests/cli/sublevel_exact.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/sublevel_exact.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/sublevel_strict.yaml b/test/integration/targets/iosxr_config/tests/cli/sublevel_strict.yaml
index 9d752f409a..801fb60375 100644
--- a/test/integration/targets/iosxr_config/tests/cli/sublevel_strict.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/sublevel_strict.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/toplevel.yaml b/test/integration/targets/iosxr_config/tests/cli/toplevel.yaml
index 6e880c2b93..01f9665fc9 100644
--- a/test/integration/targets/iosxr_config/tests/cli/toplevel.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/toplevel.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/toplevel_after.yaml b/test/integration/targets/iosxr_config/tests/cli/toplevel_after.yaml
index 0c8b676ec1..7fcb78a7e3 100644
--- a/test/integration/targets/iosxr_config/tests/cli/toplevel_after.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/toplevel_after.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/toplevel_before.yaml b/test/integration/targets/iosxr_config/tests/cli/toplevel_before.yaml
index 7d7fb41171..4c264269cf 100644
--- a/test/integration/targets/iosxr_config/tests/cli/toplevel_before.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/toplevel_before.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/toplevel_nonidempotent.yaml b/test/integration/targets/iosxr_config/tests/cli/toplevel_nonidempotent.yaml
index 45d2060d85..084a38cc24 100644
--- a/test/integration/targets/iosxr_config/tests/cli/toplevel_nonidempotent.yaml
+++ b/test/integration/targets/iosxr_config/tests/cli/toplevel_nonidempotent.yaml
@@ -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 }}"
diff --git a/test/integration/targets/iosxr_facts/tasks/cli.yaml b/test/integration/targets/iosxr_facts/tasks/cli.yaml
index 46d86dd698..890d3acf3e 100644
--- a/test/integration/targets/iosxr_facts/tasks/cli.yaml
+++ b/test/integration/targets/iosxr_facts/tasks/cli.yaml
@@ -9,8 +9,14 @@
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-- name: run test case
- include: "{{ test_case_to_run }}"
+- name: run test case (connection=network_cli)
+ include: "{{ test_case_to_run }} ansible_connection=network_cli"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
+
+- name: run test case (connection=local)
+ include: "{{ test_case_to_run }} ansible_connection=local"
+ with_first_found: "{{ test_items }}"
+ loop_control:
+ loop_var: test_case_to_run
diff --git a/test/integration/targets/iosxr_facts/tests/cli/all_facts.yaml b/test/integration/targets/iosxr_facts/tests/cli/all_facts.yaml
index 3eeb8c0ed3..2522c49b7b 100644
--- a/test/integration/targets/iosxr_facts/tests/cli/all_facts.yaml
+++ b/test/integration/targets/iosxr_facts/tests/cli/all_facts.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/all_facts.yaml"
+- debug: msg="START cli/all_facts.yaml on connection={{ ansible_connection }}"
- name: test getting all facts
@@ -25,4 +25,4 @@
# Items from those subsets are present
- "result.ansible_facts.ansible_net_filesystems is defined"
-- debug: msg="END cli/all_facts.yaml"
+- debug: msg="END cli/all_facts.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_facts/tests/cli/default_facts.yaml b/test/integration/targets/iosxr_facts/tests/cli/default_facts.yaml
index ebf9aa2652..d56132b734 100644
--- a/test/integration/targets/iosxr_facts/tests/cli/default_facts.yaml
+++ b/test/integration/targets/iosxr_facts/tests/cli/default_facts.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/default_facts.yaml"
+- debug: msg="START cli/default_facts.yaml on connection={{ ansible_connection }}"
- name: test getting default facts
@@ -27,4 +27,4 @@
# ... and not present
- "result.ansible_facts.ansible_net_config is not defined" # config
-- debug: msg="END cli/default.yaml"
+- debug: msg="END cli/default.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_facts/tests/cli/invalid_subset.yaml b/test/integration/targets/iosxr_facts/tests/cli/invalid_subset.yaml
index 5bfd68708b..5064a86a68 100644
--- a/test/integration/targets/iosxr_facts/tests/cli/invalid_subset.yaml
+++ b/test/integration/targets/iosxr_facts/tests/cli/invalid_subset.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/invalid_subset.yaml"
+- debug: msg="START cli/invalid_subset.yaml on connection={{ ansible_connection }}"
- name: test invalid subset (foobar)
@@ -45,4 +45,4 @@
-- debug: msg="END cli/invalid_subset.yaml"
+- debug: msg="END cli/invalid_subset.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_facts/tests/cli/not_hardware.yaml b/test/integration/targets/iosxr_facts/tests/cli/not_hardware.yaml
index cd9c60e29c..325d07be99 100644
--- a/test/integration/targets/iosxr_facts/tests/cli/not_hardware.yaml
+++ b/test/integration/targets/iosxr_facts/tests/cli/not_hardware.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/not_hardware_facts.yaml"
+- debug: msg="START cli/not_hardware_facts.yaml on connection={{ ansible_connection }}"
- name: test not hardware
@@ -27,4 +27,4 @@
# ... and not present
- "result.ansible_facts.ansible_net_filesystems is not defined"
-- debug: msg="END cli/not_hardware_facts.yaml"
+- debug: msg="END cli/not_hardware_facts.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_interface/tasks/cli.yaml b/test/integration/targets/iosxr_interface/tasks/cli.yaml
index 46d86dd698..890d3acf3e 100644
--- a/test/integration/targets/iosxr_interface/tasks/cli.yaml
+++ b/test/integration/targets/iosxr_interface/tasks/cli.yaml
@@ -9,8 +9,14 @@
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-- name: run test case
- include: "{{ test_case_to_run }}"
+- name: run test case (connection=network_cli)
+ include: "{{ test_case_to_run }} ansible_connection=network_cli"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
+
+- name: run test case (connection=local)
+ include: "{{ test_case_to_run }} ansible_connection=local"
+ with_first_found: "{{ test_items }}"
+ loop_control:
+ loop_var: test_case_to_run
diff --git a/test/integration/targets/iosxr_interface/tests/cli/basic.yaml b/test/integration/targets/iosxr_interface/tests/cli/basic.yaml
index a1cb2b6301..05ca4f2980 100644
--- a/test/integration/targets/iosxr_interface/tests/cli/basic.yaml
+++ b/test/integration/targets/iosxr_interface/tests/cli/basic.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START iosxr_interface cli/basic.yaml"
+- debug: msg="START iosxr_interface cli/basic.yaml on connection={{ ansible_connection }}"
- name: Setup interface
iosxr_interface:
@@ -256,4 +256,4 @@
that:
- 'result.changed == false'
-- debug: msg="END iosxr_interface cli/basic.yaml"
+- debug: msg="END iosxr_interface cli/basic.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_interface/tests/cli/intent.yaml b/test/integration/targets/iosxr_interface/tests/cli/intent.yaml
index c134428b4c..3227bad78c 100644
--- a/test/integration/targets/iosxr_interface/tests/cli/intent.yaml
+++ b/test/integration/targets/iosxr_interface/tests/cli/intent.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START iosxr_interface cli/intent.yaml"
+- debug: msg="START iosxr_interface cli/intent.yaml on connection={{ ansible_connection }}"
- name: Setup (interface is up)
iosxr_interface:
diff --git a/test/integration/targets/iosxr_logging/tasks/cli.yaml b/test/integration/targets/iosxr_logging/tasks/cli.yaml
index 46d86dd698..890d3acf3e 100644
--- a/test/integration/targets/iosxr_logging/tasks/cli.yaml
+++ b/test/integration/targets/iosxr_logging/tasks/cli.yaml
@@ -9,8 +9,14 @@
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-- name: run test case
- include: "{{ test_case_to_run }}"
+- name: run test case (connection=network_cli)
+ include: "{{ test_case_to_run }} ansible_connection=network_cli"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
+
+- name: run test case (connection=local)
+ include: "{{ test_case_to_run }} ansible_connection=local"
+ with_first_found: "{{ test_items }}"
+ loop_control:
+ loop_var: test_case_to_run
diff --git a/test/integration/targets/iosxr_netconf/tasks/cli.yaml b/test/integration/targets/iosxr_netconf/tasks/cli.yaml
index 46d86dd698..890d3acf3e 100644
--- a/test/integration/targets/iosxr_netconf/tasks/cli.yaml
+++ b/test/integration/targets/iosxr_netconf/tasks/cli.yaml
@@ -9,8 +9,14 @@
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-- name: run test case
- include: "{{ test_case_to_run }}"
+- name: run test case (connection=network_cli)
+ include: "{{ test_case_to_run }} ansible_connection=network_cli"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
+
+- name: run test case (connection=local)
+ include: "{{ test_case_to_run }} ansible_connection=local"
+ with_first_found: "{{ test_items }}"
+ loop_control:
+ loop_var: test_case_to_run
diff --git a/test/integration/targets/iosxr_netconf/tests/cli/basic.yaml b/test/integration/targets/iosxr_netconf/tests/cli/basic.yaml
index 43af3aacf8..c1eae2e6d7 100644
--- a/test/integration/targets/iosxr_netconf/tests/cli/basic.yaml
+++ b/test/integration/targets/iosxr_netconf/tests/cli/basic.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START iosxr_netconf cli/basic.yaml"
+- debug: msg="START iosxr_netconf cli/basic.yaml on connection={{ ansible_connection }}"
- name: Disable NetConf service
iosxr_netconf: &disable_netconf
@@ -66,4 +66,4 @@
- name: Disable Netconf service
iosxr_netconf: *disable_netconf
-- debug: msg="END iosxr_netconf cli/basic.yaml"
+- debug: msg="END iosxr_netconf cli/basic.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_system/tasks/cli.yaml b/test/integration/targets/iosxr_system/tasks/cli.yaml
index 46d86dd698..890d3acf3e 100644
--- a/test/integration/targets/iosxr_system/tasks/cli.yaml
+++ b/test/integration/targets/iosxr_system/tasks/cli.yaml
@@ -9,8 +9,14 @@
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-- name: run test case
- include: "{{ test_case_to_run }}"
+- name: run test case (connection=network_cli)
+ include: "{{ test_case_to_run }} ansible_connection=network_cli"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
+
+- name: run test case (connection=local)
+ include: "{{ test_case_to_run }} ansible_connection=local"
+ with_first_found: "{{ test_items }}"
+ loop_control:
+ loop_var: test_case_to_run
diff --git a/test/integration/targets/iosxr_system/tests/cli/set_domain_list.yaml b/test/integration/targets/iosxr_system/tests/cli/set_domain_list.yaml
index 6b3db147c5..4462b6e4b3 100644
--- a/test/integration/targets/iosxr_system/tests/cli/set_domain_list.yaml
+++ b/test/integration/targets/iosxr_system/tests/cli/set_domain_list.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/set_domain_search.yaml"
+- debug: msg="START cli/set_domain_search.yaml on connection={{ ansible_connection }}"
- name: setup
iosxr_config:
@@ -119,4 +119,4 @@
match: none
provider: "{{ cli }}"
-- debug: msg="END cli/set_domain_search.yaml"
+- debug: msg="END cli/set_domain_search.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_system/tests/cli/set_domain_name.yaml b/test/integration/targets/iosxr_system/tests/cli/set_domain_name.yaml
index fc14aaaa00..abbbcab4f9 100644
--- a/test/integration/targets/iosxr_system/tests/cli/set_domain_name.yaml
+++ b/test/integration/targets/iosxr_system/tests/cli/set_domain_name.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/set_domain_name.yaml"
+- debug: msg="START cli/set_domain_name.yaml on connection={{ ansible_connection }}"
- name: setup
iosxr_config:
@@ -33,4 +33,4 @@
match: none
provider: "{{ cli }}"
-- debug: msg="END cli/set_domain_name.yaml"
+- debug: msg="END cli/set_domain_name.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_system/tests/cli/set_hostname.yaml b/test/integration/targets/iosxr_system/tests/cli/set_hostname.yaml
index d9fd02212b..69f8ee114e 100644
--- a/test/integration/targets/iosxr_system/tests/cli/set_hostname.yaml
+++ b/test/integration/targets/iosxr_system/tests/cli/set_hostname.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/set_hostname.yaml"
+- debug: msg="START cli/set_hostname.yaml on connection={{ ansible_connection }}"
- name: setup
iosxr_config:
@@ -33,4 +33,4 @@
match: none
provider: "{{ cli }}"
-- debug: msg="END cli/set_hostname.yaml"
+- debug: msg="END cli/set_hostname.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_system/tests/cli/set_lookup_source.yaml b/test/integration/targets/iosxr_system/tests/cli/set_lookup_source.yaml
index dffe137358..793d722c9b 100644
--- a/test/integration/targets/iosxr_system/tests/cli/set_lookup_source.yaml
+++ b/test/integration/targets/iosxr_system/tests/cli/set_lookup_source.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/set_lookup_source.yaml"
+- debug: msg="START cli/set_lookup_source.yaml on connection={{ ansible_connection }}"
- name: setup
iosxr_config:
@@ -63,4 +63,4 @@
match: none
provider: "{{ cli }}"
-- debug: msg="END cli/set_lookup_source.yaml"
+- debug: msg="END cli/set_lookup_source.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_system/tests/cli/set_name_servers.yaml b/test/integration/targets/iosxr_system/tests/cli/set_name_servers.yaml
index bed28f6394..22b186e7a5 100644
--- a/test/integration/targets/iosxr_system/tests/cli/set_name_servers.yaml
+++ b/test/integration/targets/iosxr_system/tests/cli/set_name_servers.yaml
@@ -1,5 +1,5 @@
---
-- debug: msg="START cli/set_name_servers.yaml"
+- debug: msg="START cli/set_name_servers.yaml on connection={{ ansible_connection }}"
- name: setup
iosxr_config:
@@ -83,4 +83,4 @@
# FIXME: No teardown
#
-- debug: msg="END cli/set_name_servers.yaml"
+- debug: msg="END cli/set_name_servers.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_user/tasks/cli.yaml b/test/integration/targets/iosxr_user/tasks/cli.yaml
index 46d86dd698..890d3acf3e 100644
--- a/test/integration/targets/iosxr_user/tasks/cli.yaml
+++ b/test/integration/targets/iosxr_user/tasks/cli.yaml
@@ -9,8 +9,14 @@
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-- name: run test case
- include: "{{ test_case_to_run }}"
+- name: run test case (connection=network_cli)
+ include: "{{ test_case_to_run }} ansible_connection=network_cli"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
+
+- name: run test case (connection=local)
+ include: "{{ test_case_to_run }} ansible_connection=local"
+ with_first_found: "{{ test_items }}"
+ loop_control:
+ loop_var: test_case_to_run
diff --git a/test/integration/targets/iosxr_user/tests/cli/auth.yaml b/test/integration/targets/iosxr_user/tests/cli/auth.yaml
index 4aa4adfe25..b8c55eadb9 100644
--- a/test/integration/targets/iosxr_user/tests/cli/auth.yaml
+++ b/test/integration/targets/iosxr_user/tests/cli/auth.yaml
@@ -9,13 +9,13 @@
- name: test login
expect:
- command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no show version"
+ command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no show version"
responses:
(?i)password: "pass123"
- name: test login with invalid password (should fail)
expect:
- command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no show version"
+ command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no show version"
responses:
(?i)password: "badpass"
ignore_errors: yes
@@ -35,7 +35,7 @@
- name: test login with private key
expect:
- command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
+ command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
responses:
(?i)password: 'pass123'
@@ -47,7 +47,7 @@
- name: test login with private key (should fail, no user)
expect:
- command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
+ command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
responses:
(?i)password: 'pass123'
ignore_errors: yes
@@ -62,7 +62,7 @@
- name: test login with private key
expect:
- command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
+ command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
responses:
(?i)password: 'pass123'
ignore_errors: yes
@@ -77,7 +77,7 @@
# FIXME: pexpect fails with OSError: [Errno 5] Input/output error
- name: test login with invalid private key (should fail)
expect:
- command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
+ command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
responses:
(?i)password: "pass123"
ignore_errors: yes
diff --git a/test/integration/targets/prepare_iosxr_tests/tasks/main.yml b/test/integration/targets/prepare_iosxr_tests/tasks/main.yml
index 8e47a3db0d..4a57bfe392 100644
--- a/test/integration/targets/prepare_iosxr_tests/tasks/main.yml
+++ b/test/integration/targets/prepare_iosxr_tests/tasks/main.yml
@@ -3,6 +3,7 @@
- name: Ensure we have loopback 888 for testing
iosxr_config:
src: config.j2
+ connection: network_cli
# Some AWS hostnames can be longer than those allowed by the system we are testing
# Truncate the hostname