diff options
author | Nathaniel Case <this.is@nathanielca.se> | 2017-12-20 15:03:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-20 15:03:29 +0100 |
commit | cb1b7052182d675d24bbf0f815587165f0cf6f0a (patch) | |
tree | 259c429d72d7dfa8af3c7349ef5010dcae2397f4 /test/integration/targets/ios_command | |
parent | VMware: Add support for cpuHotRemoveEnabled (#33962) (diff) | |
download | ansible-cb1b7052182d675d24bbf0f815587165f0cf6f0a.tar.xz ansible-cb1b7052182d675d24bbf0f815587165f0cf6f0a.zip |
ios integration tests to network_cli (#33920)
* Preliminary steps
* Fix Python3 network_cli ios
* Add connection to debug strings
* Fix ios confirm prompt by way of optional newline
Also update ios_user delete tests
Diffstat (limited to 'test/integration/targets/ios_command')
6 files changed, 25 insertions, 12 deletions
diff --git a/test/integration/targets/ios_command/tasks/cli.yaml b/test/integration/targets/ios_command/tasks/cli.yaml index 46d86dd698..a6f7ae0351 100644 --- a/test/integration/targets/ios_command/tasks/cli.yaml +++ b/test/integration/targets/ios_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 cases (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 ansible_become=no" + with_first_found: "{{ test_items }}" + loop_control: + loop_var: test_case_to_run diff --git a/test/integration/targets/ios_command/tests/cli/bad_operator.yaml b/test/integration/targets/ios_command/tests/cli/bad_operator.yaml index 5563afaf65..66757a6644 100644 --- a/test/integration/targets/ios_command/tests/cli/bad_operator.yaml +++ b/test/integration/targets/ios_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 ios_command: @@ -9,6 +9,7 @@ authorize: yes wait_for: - "result[0] contains 'Description: Foo'" + become: yes register: result ignore_errors: yes @@ -17,4 +18,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/ios_command/tests/cli/contains.yaml b/test/integration/targets/ios_command/tests/cli/contains.yaml index 6f1b67cb23..3ab19fa500 100644 --- a/test/integration/targets/ios_command/tests/cli/contains.yaml +++ b/test/integration/targets/ios_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 ios_command: @@ -10,6 +10,7 @@ wait_for: - "result[0] contains Cisco" - "result[1] contains Loopback888" + become: yes register: result - assert: @@ -17,4 +18,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/ios_command/tests/cli/invalid.yaml b/test/integration/targets/ios_command/tests/cli/invalid.yaml index fb147226bd..b5a63b1e7f 100644 --- a/test/integration/targets/ios_command/tests/cli/invalid.yaml +++ b/test/integration/targets/ios_command/tests/cli/invalid.yaml @@ -1,10 +1,11 @@ --- -- debug: msg="START cli/invalid.yaml" +- debug: msg="START cli/invalid.yaml on connection={{ ansible_connection }}" - name: run invalid command ios_command: commands: show foo authorize: yes + become: yes register: result ignore_errors: yes @@ -18,6 +19,7 @@ - show version - show foo authorize: yes + become: yes register: result ignore_errors: yes @@ -25,4 +27,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/ios_command/tests/cli/output.yaml b/test/integration/targets/ios_command/tests/cli/output.yaml index 2471eb85d8..5052625801 100644 --- a/test/integration/targets/ios_command/tests/cli/output.yaml +++ b/test/integration/targets/ios_command/tests/cli/output.yaml @@ -1,11 +1,12 @@ --- -- debug: msg="START cli/output.yaml" +- debug: msg="START cli/output.yaml on connection={{ ansible_connection }}" - name: get output for single command ios_command: commands: - show version authorize: yes + become: yes register: result - assert: @@ -19,6 +20,7 @@ - show version - show interfaces authorize: yes + become: yes register: result - assert: @@ -27,4 +29,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/ios_command/tests/cli/timeout.yaml b/test/integration/targets/ios_command/tests/cli/timeout.yaml index 183be11fd3..b92882dff9 100644 --- a/test/integration/targets/ios_command/tests/cli/timeout.yaml +++ b/test/integration/targets/ios_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 ios_command: @@ -8,6 +8,7 @@ authorize: yes wait_for: - "result[0] contains bad_value_string" + become: yes register: result ignore_errors: yes @@ -16,4 +17,4 @@ - "result.failed == true" - "result.msg is defined" -- debug: msg="END cli/timeout.yaml" +- debug: msg="END cli/timeout.yaml on connection={{ ansible_connection }}" |