diff --git a/test/integration/targets/ios_config/tasks/cli.yaml b/test/integration/targets/ios_config/tasks/cli.yaml index 303af407622..ea5c8c3742f 100644 --- a/test/integration/targets/ios_config/tasks/cli.yaml +++ b/test/integration/targets/ios_config/tasks/cli.yaml @@ -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 diff --git a/test/integration/targets/ios_config/tests/cli/backup.yaml b/test/integration/targets/ios_config/tests/cli/backup.yaml index 1d1142aaa7e..15e0cb3bd67 100644 --- a/test/integration/targets/ios_config/tests/cli/backup.yaml +++ b/test/integration/targets/ios_config/tests/cli/backup.yaml @@ -9,7 +9,6 @@ parents: - interface Loopback999 match: none - provider: "{{ cli }}" - name: collect any backup files find: @@ -28,7 +27,6 @@ ios_config: src: basic/config.j2 backup: yes - provider: "{{ cli }}" register: result - assert: diff --git a/test/integration/targets/ios_config/tests/cli/defaults.yaml b/test/integration/targets/ios_config/tests/cli/defaults.yaml index 5f07cb29d03..3792a9eb6ad 100644 --- a/test/integration/targets/ios_config/tests/cli/defaults.yaml +++ b/test/integration/targets/ios_config/tests/cli/defaults.yaml @@ -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 @@ -30,7 +28,6 @@ ios_config: src: defaults/config.j2 defaults: yes - provider: "{{ cli }}" register: result - debug: var=result @@ -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: diff --git a/test/integration/targets/ios_config/tests/cli/diff.yaml b/test/integration/targets/ios_config/tests/cli/diff.yaml index 9121f55fba2..dbdd033a894 100644 --- a/test/integration/targets/ios_config/tests/cli/diff.yaml +++ b/test/integration/targets/ios_config/tests/cli/diff.yaml @@ -1,6 +1,10 @@ --- - debug: msg="START cli/diff.yaml on connection={{ ansible_connection }}" +- name: Ensure hostname is preset + ios_system: + hostname: "{{ shorter_hostname }}" + - name: ios_config diff against retrieved config ios_config: diff_against: intended diff --git a/test/integration/targets/ios_config/tests/cli/save.yaml b/test/integration/targets/ios_config/tests/cli/save.yaml index 805ce6a3277..70aedb3489d 100644 --- a/test/integration/targets/ios_config/tests/cli/save.yaml +++ b/test/integration/targets/ios_config/tests/cli/save.yaml @@ -9,13 +9,11 @@ parents: - interface Loopback999 match: none - provider: "{{ cli }}" - name: save config ios_config: save: true - provider: "{{ cli }}" register: result - assert: @@ -25,7 +23,6 @@ - name: save should always run ios_config: save: true - provider: "{{ cli }}" register: result - name: delete config (setup) @@ -34,7 +31,6 @@ lines: - "no ip http server" save_when: modified - provider: "{{ cli }}" register: result - name: save should always run @@ -43,7 +39,6 @@ lines: - "ip http server" save_when: modified - provider: "{{ cli }}" register: result - assert: @@ -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 }}" diff --git a/test/integration/targets/ios_config/tests/cli/src_basic.yaml b/test/integration/targets/ios_config/tests/cli/src_basic.yaml index d0a951ff0b5..b203e1a49eb 100644 --- a/test/integration/targets/ios_config/tests/cli/src_basic.yaml +++ b/test/integration/targets/ios_config/tests/cli/src_basic.yaml @@ -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 @@ -30,7 +28,6 @@ - name: check device with config ios_config: src: basic/config.j2 - provider: "{{ cli }}" register: result - assert: diff --git a/test/integration/targets/ios_config/tests/cli/src_invalid.yaml b/test/integration/targets/ios_config/tests/cli/src_invalid.yaml index f53acf837b4..07443240376 100644 --- a/test/integration/targets/ios_config/tests/cli/src_invalid.yaml +++ b/test/integration/targets/ios_config/tests/cli/src_invalid.yaml @@ -6,7 +6,6 @@ - name: configure with invalid src ios_config: src: basic/foobar.j2 - provider: "{{ cli }}" register: result ignore_errors: yes diff --git a/test/integration/targets/ios_config/tests/cli/src_match_none.yaml b/test/integration/targets/ios_config/tests/cli/src_match_none.yaml index 0c06e063eaf..4300a37d286 100644 --- a/test/integration/targets/ios_config/tests/cli/src_match_none.yaml +++ b/test/integration/targets/ios_config/tests/cli/src_match_none.yaml @@ -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: @@ -28,7 +26,6 @@ - name: check device with config ios_config: src: basic/config.j2 - provider: "{{ cli }}" register: result - assert: diff --git a/test/integration/targets/ios_config/tests/cli/sublevel.yaml b/test/integration/targets/ios_config/tests/cli/sublevel.yaml index 13c03a9153b..7442cd9c2bb 100644 --- a/test/integration/targets/ios_config/tests/cli/sublevel.yaml +++ b/test/integration/targets/ios_config/tests/cli/sublevel.yaml @@ -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: @@ -26,7 +24,6 @@ ios_config: lines: ['permit ip any any log'] parents: ['ip access-list extended test'] - provider: "{{ cli }}" register: result - assert: @@ -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 }}" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel_block.yaml b/test/integration/targets/ios_config/tests/cli/sublevel_block.yaml index 92704624cd1..af53e344be1 100644 --- a/test/integration/targets/ios_config/tests/cli/sublevel_block.yaml +++ b/test/integration/targets/ios_config/tests/cli/sublevel_block.yaml @@ -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 @@ -23,7 +22,6 @@ parents: ['ip access-list extended test'] replace: block after: ['exit'] - provider: "{{ cli }}" register: result - assert: @@ -45,7 +43,6 @@ parents: ['ip access-list extended test'] replace: block after: ['exit'] - provider: "{{ cli }}" register: result - assert: @@ -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 }}" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel_exact.yaml b/test/integration/targets/ios_config/tests/cli/sublevel_exact.yaml index 91541280db5..d5eec3c3774 100644 --- a/test/integration/targets/ios_config/tests/cli/sublevel_exact.yaml +++ b/test/integration/targets/ios_config/tests/cli/sublevel_exact.yaml @@ -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: @@ -26,7 +25,6 @@ before: no ip access-list extended test after: exit match: exact - provider: "{{ cli }}" register: result - assert: @@ -48,7 +46,6 @@ - permit ip host 4.4.4.4 any log parents: ip access-list extended test match: exact - provider: "{{ cli }}" register: result - assert: @@ -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 }}" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel_strict.yaml b/test/integration/targets/ios_config/tests/cli/sublevel_strict.yaml index a2fb69abed7..f5eb687a5bc 100644 --- a/test/integration/targets/ios_config/tests/cli/sublevel_strict.yaml +++ b/test/integration/targets/ios_config/tests/cli/sublevel_strict.yaml @@ -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: @@ -23,7 +22,6 @@ - permit ip host 4.4.4.4 any log parents: ip access-list extended test match: strict - provider: "{{ cli }}" register: result - assert: @@ -39,7 +37,6 @@ parents: ip access-list extended test after: exit match: strict - provider: "{{ cli }}" register: result - assert: @@ -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 }}" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel.yaml b/test/integration/targets/ios_config/tests/cli/toplevel.yaml index f3b3697f0cd..0408c8202a6 100644 --- a/test/integration/targets/ios_config/tests/cli/toplevel.yaml +++ b/test/integration/targets/ios_config/tests/cli/toplevel.yaml @@ -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: @@ -21,7 +19,6 @@ - name: configure top level command idempotent check ios_config: lines: ['hostname foo'] - provider: "{{ cli }}" register: result - assert: @@ -32,6 +29,5 @@ ios_config: lines: ['hostname {{ shorter_hostname }}'] match: none - provider: "{{ cli }}" - debug: msg="END cli/toplevel.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel_after.yaml b/test/integration/targets/ios_config/tests/cli/toplevel_after.yaml index 793eeccb994..26039e06a34 100644 --- a/test/integration/targets/ios_config/tests/cli/toplevel_after.yaml +++ b/test/integration/targets/ios_config/tests/cli/toplevel_after.yaml @@ -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: @@ -26,7 +24,6 @@ ios_config: lines: ['hostname foo'] after: ['snmp-server contact foo'] - provider: "{{ cli }}" register: result - assert: @@ -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 }}" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel_before.yaml b/test/integration/targets/ios_config/tests/cli/toplevel_before.yaml index 45361e957da..ab210be8c8b 100644 --- a/test/integration/targets/ios_config/tests/cli/toplevel_before.yaml +++ b/test/integration/targets/ios_config/tests/cli/toplevel_before.yaml @@ -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: @@ -26,7 +24,6 @@ ios_config: lines: ['hostname foo'] before: ['snmp-server contact foo'] - provider: "{{ cli }}" register: result - assert: @@ -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 }}" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel_nonidempotent.yaml b/test/integration/targets/ios_config/tests/cli/toplevel_nonidempotent.yaml index c5e981cfe46..06aa8384813 100644 --- a/test/integration/targets/ios_config/tests/cli/toplevel_nonidempotent.yaml +++ b/test/integration/targets/ios_config/tests/cli/toplevel_nonidempotent.yaml @@ -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: @@ -23,7 +21,6 @@ ios_config: lines: ['hostname foo'] match: strict - provider: "{{ cli }}" register: result - assert: @@ -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 }}" diff --git a/test/integration/targets/ios_smoke/tasks/cli.yaml b/test/integration/targets/ios_smoke/tasks/cli.yaml index 303af407622..826f6a844fe 100644 --- a/test/integration/targets/ios_smoke/tasks/cli.yaml +++ b/test/integration/targets/ios_smoke/tasks/cli.yaml @@ -17,6 +17,6 @@ - name: run test case (connection=local) include: "{{ test_case_to_run }} ansible_connection=local" - with_first_found: "{{ test_items }}" + with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/test/integration/targets/ios_smoke/tests/cli/common_utils.yaml b/test/integration/targets/ios_smoke/tests/cli/common_utils.yaml index e53dff31cc0..6b1f6b4e9de 100644 --- a/test/integration/targets/ios_smoke/tests/cli/common_utils.yaml +++ b/test/integration/targets/ios_smoke/tests/cli/common_utils.yaml @@ -30,7 +30,7 @@ - name: Configure interface ipv4 address ios_l3_interface: name: "{{ test_interface }}" - ipv4: 192.168.0.1/24 + ipv4: 192.168.20.1/24 state: present provider: "{{ cli }}" register: result @@ -39,12 +39,12 @@ that: - 'result.changed == true' - '"interface {{ test_interface }}" in result.commands' - - '"ip address 192.168.0.1 255.255.255.0" in result.commands' + - '"ip address 192.168.20.1 255.255.255.0" in result.commands' - name: test invalid subnet ios_l3_interface: name: "{{ test_interface }}" - ipv4: 192.168.0.1/45 + ipv4: 192.168.20.1/45 state: present provider: "{{ cli }}" register: result