mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Swap how become is specified for ios integration tests (#34107)
This commit is contained in:
parent
427479ae48
commit
5f215337c9
49 changed files with 28 additions and 202 deletions
|
@ -10,13 +10,13 @@
|
|||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: run test cases (connection=network_cli)
|
||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
||||
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||
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 ansible_become=no"
|
||||
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||
with_first_found: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
- interface Loopback999
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
|
@ -30,7 +29,6 @@
|
|||
src: basic/config.j2
|
||||
backup: yes
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
|
@ -10,14 +10,12 @@
|
|||
- interface Loopback999
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- name: configure device with defaults included
|
||||
ios_config:
|
||||
src: defaults/config.j2
|
||||
defaults: yes
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- debug: var=result
|
||||
|
@ -33,7 +31,6 @@
|
|||
src: defaults/config.j2
|
||||
defaults: yes
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- debug: var=result
|
||||
|
@ -48,7 +45,6 @@
|
|||
lines:
|
||||
- mac-address-table notification mac-move
|
||||
authorize: yes
|
||||
become: yes
|
||||
ignore_errors: yes
|
||||
|
||||
- name: show interfaces brief to ensure deivce goes to valid prompt
|
||||
|
@ -56,7 +52,6 @@
|
|||
commands:
|
||||
- show interfaces
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
|
@ -10,14 +10,12 @@
|
|||
- interface Loopback999
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
|
||||
- name: save config
|
||||
ios_config:
|
||||
save: true
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
# FIXME https://github.com/ansible/ansible-modules-core/issues/5008
|
||||
ignore_errors: true
|
||||
|
@ -32,7 +30,6 @@
|
|||
ios_config:
|
||||
save: true
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
# FIXME https://github.com/ansible/ansible-modules-core/issues/5008
|
||||
ignore_errors: true
|
||||
|
@ -44,7 +41,6 @@
|
|||
- "no ip http server"
|
||||
save_when: modified
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- name: save should always run
|
||||
|
@ -54,7 +50,6 @@
|
|||
- "ip http server"
|
||||
save_when: modified
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -66,7 +61,6 @@
|
|||
lines:
|
||||
- "no ip http server"
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- debug: msg="END cli/save.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -10,13 +10,11 @@
|
|||
- interface Loopback999
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- name: configure device with config
|
||||
ios_config:
|
||||
src: basic/config.j2
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- name: debug, remove me
|
||||
|
@ -33,7 +31,6 @@
|
|||
ios_config:
|
||||
src: basic/config.j2
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
ios_config:
|
||||
src: basic/foobar.j2
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
|
|
|
@ -10,14 +10,12 @@
|
|||
- interface Loopback999
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- name: configure device with config
|
||||
ios_config:
|
||||
src: basic/config.j2
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -31,7 +29,6 @@
|
|||
ios_config:
|
||||
src: basic/config.j2
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
- 'no ip access-list standard test'
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- name: configure sub level command
|
||||
ios_config:
|
||||
lines: ['permit ip any any log']
|
||||
parents: ['ip access-list extended test']
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -29,7 +27,6 @@
|
|||
lines: ['permit ip any any log']
|
||||
parents: ['ip access-list extended test']
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -42,6 +39,5 @@
|
|||
- 'no ip access-list extended test'
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/sublevel.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
after: ['exit']
|
||||
authorize: yes
|
||||
match: none
|
||||
become: yes
|
||||
|
||||
- name: configure sub level command using block resplace
|
||||
ios_config:
|
||||
|
@ -25,7 +24,6 @@
|
|||
replace: block
|
||||
after: ['exit']
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -48,7 +46,6 @@
|
|||
replace: block
|
||||
after: ['exit']
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -61,6 +58,5 @@
|
|||
- no ip access-list extended test
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/sublevel_block.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
after: exit
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- name: configure sub level command using exact match
|
||||
ios_config:
|
||||
|
@ -28,7 +27,6 @@
|
|||
after: exit
|
||||
match: exact
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -51,7 +49,6 @@
|
|||
parents: ip access-list extended test
|
||||
match: exact
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -64,6 +61,5 @@
|
|||
- no ip access-list extended test
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
before: no ip access-list extended test
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- name: configure sub level command using strict match
|
||||
ios_config:
|
||||
|
@ -25,7 +24,6 @@
|
|||
parents: ip access-list extended test
|
||||
match: strict
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -42,7 +40,6 @@
|
|||
after: exit
|
||||
match: strict
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -60,6 +57,5 @@
|
|||
lines: no ip access-list extended test
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/sublevel_strict.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -6,13 +6,11 @@
|
|||
lines: ['hostname {{ shorter_hostname }}']
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- name: configure top level command
|
||||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -24,7 +22,6 @@
|
|||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -36,6 +33,5 @@
|
|||
lines: ['hostname {{ shorter_hostname }}']
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/toplevel.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
- "hostname {{ shorter_hostname }}"
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- name: configure top level command with before
|
||||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
after: ['snmp-server contact bar']
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -29,7 +27,6 @@
|
|||
lines: ['hostname foo']
|
||||
after: ['snmp-server contact foo']
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -43,6 +40,5 @@
|
|||
- "hostname {{ shorter_hostname }}"
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/toplevel_after.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
- "hostname {{ shorter_hostname }}"
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- name: configure top level command with before
|
||||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
before: ['snmp-server contact bar']
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -29,7 +27,6 @@
|
|||
lines: ['hostname foo']
|
||||
before: ['snmp-server contact foo']
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -43,6 +40,5 @@
|
|||
- "hostname {{ shorter_hostname }}"
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/toplevel_before.yaml on connection={{ ansible_connection }}"
|
||||
|
|
|
@ -6,14 +6,12 @@
|
|||
lines: ['hostname {{ shorter_hostname }}']
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- name: configure top level command
|
||||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
match: strict
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -26,7 +24,6 @@
|
|||
lines: ['hostname foo']
|
||||
match: strict
|
||||
authorize: yes
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -38,6 +35,5 @@
|
|||
lines: ['hostname {{ shorter_hostname }}']
|
||||
match: none
|
||||
authorize: yes
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/toplevel_nonidempotent.yaml on connection={{ ansible_connection }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue