diff options
author | Nathaniel Case <this.is@nathanielca.se> | 2017-12-13 14:30:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-13 14:30:24 -0500 |
commit | 2425374fddb5ba5f4f1b5ac8f3ed31ed1144f43b (patch) | |
tree | 1b05625a5fda13e4a947f0c6a488119122e6acf7 /test/integration/targets/vyos_command | |
parent | cfb15b0272c7aa6e26657fe8f7f13fc6a02866d7 (diff) | |
download | ansible-2425374fddb5ba5f4f1b5ac8f3ed31ed1144f43b.tar.gz |
Actually move vyos tests to network_cli (#33710)
* Fix vyos on network_cli on python3
bytes do not have format() in Python3
* Push connection to tasks, with bonus connection=local test
* Run tests without explicit connection set
* Add/update START messages where appropriate
Diffstat (limited to 'test/integration/targets/vyos_command')
6 files changed, 19 insertions, 12 deletions
diff --git a/test/integration/targets/vyos_command/tasks/cli.yaml b/test/integration/targets/vyos_command/tasks/cli.yaml index d675462dd0..890d3acf3e 100644 --- a/test/integration/targets/vyos_command/tasks/cli.yaml +++ b/test/integration/targets/vyos_command/tasks/cli.yaml @@ -4,12 +4,19 @@ paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" register: test_cases + delegate_to: localhost - 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 case (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" + with_first_found: "{{ test_items }}" + loop_control: + loop_var: test_case_to_run diff --git a/test/integration/targets/vyos_command/tests/cli/bad_operator.yaml b/test/integration/targets/vyos_command/tests/cli/bad_operator.yaml index b72cb94a22..9e9de9f7b6 100644 --- a/test/integration/targets/vyos_command/tests/cli/bad_operator.yaml +++ b/test/integration/targets/vyos_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 vyos_command: @@ -16,4 +16,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/vyos_command/tests/cli/contains.yaml b/test/integration/targets/vyos_command/tests/cli/contains.yaml index 56c8879084..85c6e86a18 100644 --- a/test/integration/targets/vyos_command/tests/cli/contains.yaml +++ b/test/integration/targets/vyos_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 vyos_command: @@ -17,4 +17,4 @@ - result.stdout is defined - result.stdout_lines is defined -- debug: msg="END cli/contains.yaml" +- debug: msg="END cli/contains.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/vyos_command/tests/cli/invalid.yaml b/test/integration/targets/vyos_command/tests/cli/invalid.yaml index 961fda2292..e6d25e411f 100644 --- a/test/integration/targets/vyos_command/tests/cli/invalid.yaml +++ b/test/integration/targets/vyos_command/tests/cli/invalid.yaml @@ -1,5 +1,5 @@ --- -- debug: msg="START cli/invalid.yaml" +- debug: msg="START cli/invalid.yaml on connection={{ ansible_connection }}" - name: run invalid command vyos_command: @@ -19,4 +19,4 @@ - assert: { 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/vyos_command/tests/cli/output.yaml b/test/integration/targets/vyos_command/tests/cli/output.yaml index 764c6e180c..e3644b7878 100644 --- a/test/integration/targets/vyos_command/tests/cli/output.yaml +++ b/test/integration/targets/vyos_command/tests/cli/output.yaml @@ -1,5 +1,5 @@ --- -- debug: msg="START cli/output.yaml" +- debug: msg="START cli/output.yaml on connection={{ ansible_connection }}" - name: get output for single command vyos_command: @@ -41,4 +41,4 @@ - result.stdout_lines is defined - result.stdout_lines[2] | length >= 20 -- debug: msg="END cli/output.yaml" +- debug: msg="END cli/output.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/vyos_command/tests/cli/timeout.yaml b/test/integration/targets/vyos_command/tests/cli/timeout.yaml index fecae8aed7..4994ebff80 100644 --- a/test/integration/targets/vyos_command/tests/cli/timeout.yaml +++ b/test/integration/targets/vyos_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 vyos_command: @@ -15,4 +15,4 @@ - result.failed == true - result.msg is defined -- debug: msg="END cli/timeout.yaml" +- debug: msg="END cli/timeout.yaml on connection={{ ansible_connection }}" |