Fix iosxr copy and delete tasks (#44083)
* Fix iosxr copy and delete tasks * Drop local from non-smoke tasks
This commit is contained in:
parent
bb85bbceeb
commit
5a49567c71
12 changed files with 19 additions and 86 deletions
|
@ -14,11 +14,3 @@
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
# Only one of the Testcase would be run to check if `connection: local`
|
|
||||||
# is established. Full suite is run with `connection:network_cli` or `connection:netconf`
|
|
||||||
- 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
|
|
||||||
|
|
|
@ -14,9 +14,3 @@
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
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
|
|
||||||
|
|
|
@ -23,31 +23,23 @@
|
||||||
- "result.failed == true"
|
- "result.failed == true"
|
||||||
- "result.msg is defined"
|
- "result.msg is defined"
|
||||||
|
|
||||||
- name: Remove existing file if any
|
- name: delete config file on disk to prevent failure of copy task for duplicate
|
||||||
cli_command:
|
cli_command:
|
||||||
command: 'delete harddisk:ansible_tmp.txt'
|
command: 'delete harddisk:ansible_tmp.txt'
|
||||||
prompt: 'Delete harddisk\:ansible_tmp\.txt\[confirm\]'
|
prompt: 'Delete harddisk\:/?ansible_tmp\.txt\[confirm\]'
|
||||||
answer: "\r\n"
|
answer: ""
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- block:
|
- name: Run command with prompt
|
||||||
- name: Run command with prompt
|
cli_command:
|
||||||
cli_command:
|
command: 'copy running-config harddisk:ansible_tmp.txt'
|
||||||
command: 'copy running-config harddisk:ansible_tmp.txt'
|
prompt: 'Destination file name \(control-c to abort\)\: \[\/ansible_tmp.txt\]\?'
|
||||||
prompt: 'Destination file name \(control-c to abort\)\: \[\/ansible_tmp.txt\]\?'
|
answer: 'ansible_tmp.txt'
|
||||||
answer: 'ansible_tmp.txt'
|
register: result
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "result.stdout is defined"
|
- "result.stdout is defined"
|
||||||
- "'ansible_tmp' in result.stdout"
|
- "'ansible_tmp' in result.stdout"
|
||||||
always:
|
|
||||||
- name: Remove copied file
|
|
||||||
cli_command:
|
|
||||||
command: 'delete harddisk:ansible_tmp.txt'
|
|
||||||
prompt: 'Delete harddisk\:ansible_tmp\.txt\[confirm\]'
|
|
||||||
answer: "\r\n"
|
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/cli_command.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/cli_command.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
---
|
---
|
||||||
- debug: msg="START cli/prompt.yaml on connection={{ ansible_connection }}"
|
- debug:
|
||||||
|
msg: "START cli/prompt.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
||||||
- name: delete config file on disk to prevent failure of copy task for duplicate
|
- name: delete config file on disk to prevent failure of copy task for duplicate
|
||||||
iosxr_command:
|
iosxr_command:
|
||||||
commands:
|
commands:
|
||||||
- command: 'delete harddisk:ansible_tmp.txt'
|
- command: 'delete harddisk:ansible_tmp.txt'
|
||||||
prompt: 'Delete harddisk\:ansible_tmp\.txt\[confirm\]'
|
prompt: 'Delete harddisk\:/?ansible_tmp\.txt\[confirm\]'
|
||||||
answer: "\r\n"
|
answer: ""
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: copy
|
- name: copy
|
||||||
|
|
|
@ -14,9 +14,3 @@
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
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
|
|
||||||
|
|
|
@ -14,9 +14,3 @@
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
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
|
|
||||||
|
|
|
@ -14,11 +14,3 @@
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
# Only one of the Testcase would be run to check if `connection: local`
|
|
||||||
# is established. Full suite is run with `connection:network_cli` or `connection:netconf`
|
|
||||||
- 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
|
|
||||||
|
|
|
@ -15,13 +15,5 @@
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
# Only one of the Testcase would be run to check if `connection: local`
|
|
||||||
# is established. Full suite is run with `connection:network_cli` or `connection:netconf`
|
|
||||||
- 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
|
|
||||||
|
|
||||||
- name: reset connection
|
- name: reset connection
|
||||||
meta: reset_connection
|
meta: reset_connection
|
||||||
|
|
|
@ -14,9 +14,3 @@
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
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
|
|
||||||
|
|
|
@ -15,10 +15,8 @@
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
# Only one of the Testcase would be run to check if `connection: local`
|
|
||||||
# is established. Full suite is run with `connection:network_cli` or `connection:netconf`
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -15,10 +15,8 @@
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
# Only one of the Testcase would be run to check if `connection: local`
|
|
||||||
# is established. Full suite is run with `connection:network_cli` or `connection:netconf`
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -25,11 +25,3 @@
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
# Only one of the Testcase would be run to check if `connection: local`
|
|
||||||
# is established. Full suite is run with `connection:network_cli` or `connection:netconf`
|
|
||||||
- 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
|
|
||||||
|
|
Loading…
Reference in a new issue