Skip to content

Commit

Permalink
ios test cleanup pt 2 (#42570)
Browse files Browse the repository at this point in the history
* Remove local from ios_config to avoid needing to add provider

* ios_smoke should test all with local to pick up the slack
  • Loading branch information
Qalthos committed Jul 10, 2018
1 parent a65d925 commit 381263a
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 59 deletions.
6 changes: 0 additions & 6 deletions test/integration/targets/ios_config/tasks/cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,3 @@
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
2 changes: 0 additions & 2 deletions test/integration/targets/ios_config/tests/cli/backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
parents:
- interface Loopback999
match: none
provider: "{{ cli }}"

- name: collect any backup files
find:
Expand All @@ -28,7 +27,6 @@
ios_config:
src: basic/config.j2
backup: yes
provider: "{{ cli }}"
register: result

- assert:
Expand Down
5 changes: 0 additions & 5 deletions test/integration/targets/ios_config/tests/cli/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
parents:
- interface Loopback999
match: none
provider: "{{ cli }}"

- name: configure device with defaults included
ios_config:
src: defaults/config.j2
defaults: yes
provider: "{{ cli }}"
register: result

- debug: var=result
Expand All @@ -30,7 +28,6 @@
ios_config:
src: defaults/config.j2
defaults: yes
provider: "{{ cli }}"
register: result

- debug: var=result
Expand All @@ -44,14 +41,12 @@
ios_config:
lines:
- mac-address-table notification mac-move
provider: "{{ cli }}"
ignore_errors: yes

- name: show interfaces brief to ensure deivce goes to valid prompt
ios_command:
commands:
- show interfaces
provider: "{{ cli }}"
register: result

- assert:
Expand Down
6 changes: 0 additions & 6 deletions test/integration/targets/ios_config/tests/cli/save.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
parents:
- interface Loopback999
match: none
provider: "{{ cli }}"


- name: save config
ios_config:
save: true
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -25,7 +23,6 @@
- name: save should always run
ios_config:
save: true
provider: "{{ cli }}"
register: result

- name: delete config (setup)
Expand All @@ -34,7 +31,6 @@
lines:
- "no ip http server"
save_when: modified
provider: "{{ cli }}"
register: result

- name: save should always run
Expand All @@ -43,7 +39,6 @@
lines:
- "ip http server"
save_when: modified
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -54,7 +49,6 @@
ios_config:
lines:
- "no ip http server"
provider: "{{ cli }}"
register: result

- debug: msg="END cli/save.yaml on connection={{ ansible_connection }}"
3 changes: 0 additions & 3 deletions test/integration/targets/ios_config/tests/cli/src_basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
parents:
- interface Loopback999
match: none
provider: "{{ cli }}"

- name: configure device with config
ios_config:
src: basic/config.j2
provider: "{{ cli }}"
register: result

- name: debug, remove me
Expand All @@ -30,7 +28,6 @@
- name: check device with config
ios_config:
src: basic/config.j2
provider: "{{ cli }}"
register: result

- assert:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- name: configure with invalid src
ios_config:
src: basic/foobar.j2
provider: "{{ cli }}"
register: result
ignore_errors: yes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
parents:
- interface Loopback999
match: none
provider: "{{ cli }}"

- name: configure device with config
ios_config:
src: basic/config.j2
match: none
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -28,7 +26,6 @@
- name: check device with config
ios_config:
src: basic/config.j2
provider: "{{ cli }}"
register: result

- assert:
Expand Down
4 changes: 0 additions & 4 deletions test/integration/targets/ios_config/tests/cli/sublevel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
- 'no ip access-list extended test'
- 'no ip access-list standard test'
match: none
provider: "{{ cli }}"

- name: configure sub level command
ios_config:
lines: ['permit ip any any log']
parents: ['ip access-list extended test']
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -26,7 +24,6 @@
ios_config:
lines: ['permit ip any any log']
parents: ['ip access-list extended test']
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -38,6 +35,5 @@
lines:
- 'no ip access-list extended test'
match: none
provider: "{{ cli }}"

- debug: msg="END cli/sublevel.yaml on connection={{ ansible_connection }}"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
parents: ['ip access-list extended test']
before: ['no ip access-list extended test']
after: ['exit']
provider: "{{ cli }}"
match: none

- name: configure sub level command using block resplace
Expand All @@ -23,7 +22,6 @@
parents: ['ip access-list extended test']
replace: block
after: ['exit']
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -45,7 +43,6 @@
parents: ['ip access-list extended test']
replace: block
after: ['exit']
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -57,6 +54,5 @@
lines:
- no ip access-list extended test
match: none
provider: "{{ cli }}"

- debug: msg="END cli/sublevel_block.yaml on connection={{ ansible_connection }}"
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
before: no ip access-list extended test
after: exit
match: none
provider: "{{ cli }}"

- name: configure sub level command using exact match
ios_config:
Expand All @@ -26,7 +25,6 @@
before: no ip access-list extended test
after: exit
match: exact
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -48,7 +46,6 @@
- permit ip host 192.0.2.4 any log
parents: ip access-list extended test
match: exact
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -60,6 +57,5 @@
lines:
- no ip access-list extended test
match: none
provider: "{{ cli }}"

- debug: msg="END cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
parents: ip access-list extended test
before: no ip access-list extended test
match: none
provider: "{{ cli }}"

- name: configure sub level command using strict match
ios_config:
Expand All @@ -23,7 +22,6 @@
- permit ip host 192.0.2.4 any log
parents: ip access-list extended test
match: strict
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -39,7 +37,6 @@
parents: ip access-list extended test
after: exit
match: strict
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -56,6 +53,5 @@
ios_config:
lines: no ip access-list extended test
match: none
provider: "{{ cli }}"

- debug: msg="END cli/sublevel_strict.yaml on connection={{ ansible_connection }}"
4 changes: 0 additions & 4 deletions test/integration/targets/ios_config/tests/cli/toplevel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
ios_config:
lines: ['hostname {{ shorter_hostname }}']
match: none
provider: "{{ cli }}"

- name: configure top level command
ios_config:
lines: ['hostname foo']
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -21,7 +19,6 @@
- name: configure top level command idempotent check
ios_config:
lines: ['hostname foo']
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -32,6 +29,5 @@
ios_config:
lines: ['hostname {{ shorter_hostname }}']
match: none
provider: "{{ cli }}"

- debug: msg="END cli/toplevel.yaml on connection={{ ansible_connection }}"
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
- "snmp-server contact ansible"
- "hostname {{ shorter_hostname }}"
match: none
provider: "{{ cli }}"

- name: configure top level command with before
ios_config:
lines: ['hostname foo']
after: ['snmp-server contact bar']
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -26,7 +24,6 @@
ios_config:
lines: ['hostname foo']
after: ['snmp-server contact foo']
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -39,6 +36,5 @@
- "no snmp-server contact"
- "hostname {{ shorter_hostname }}"
match: none
provider: "{{ cli }}"

- debug: msg="END cli/toplevel_after.yaml on connection={{ ansible_connection }}"
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
- "snmp-server contact ansible"
- "hostname {{ shorter_hostname }}"
match: none
provider: "{{ cli }}"

- name: configure top level command with before
ios_config:
lines: ['hostname foo']
before: ['snmp-server contact bar']
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -26,7 +24,6 @@
ios_config:
lines: ['hostname foo']
before: ['snmp-server contact foo']
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -39,6 +36,5 @@
- "no snmp-server contact"
- "hostname {{ shorter_hostname }}"
match: none
provider: "{{ cli }}"

- debug: msg="END cli/toplevel_before.yaml on connection={{ ansible_connection }}"
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
ios_config:
lines: ['hostname {{ shorter_hostname }}']
match: none
provider: "{{ cli }}"

- name: configure top level command
ios_config:
lines: ['hostname foo']
match: strict
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -23,7 +21,6 @@
ios_config:
lines: ['hostname foo']
match: strict
provider: "{{ cli }}"
register: result

- assert:
Expand All @@ -34,6 +31,5 @@
ios_config:
lines: ['hostname {{ shorter_hostname }}']
match: none
provider: "{{ cli }}"

- debug: msg="END cli/toplevel_nonidempotent.yaml on connection={{ ansible_connection }}"

0 comments on commit 381263a

Please sign in to comment.