diff options
author | Nathaniel Case <this.is@nathanielca.se> | 2017-12-19 15:49:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 15:49:49 -0500 |
commit | 513c75079edbe3d51702f87697efface2ce91236 (patch) | |
tree | b096264e86ea4ec10ee037a1e747070b72eec967 /test/integration/targets/eos_logging | |
parent | f64b276f6ab2cc5bc85f7ad929aaca59a9e6e53e (diff) | |
download | ansible-513c75079edbe3d51702f87697efface2ce91236.tar.gz |
Port eos tests to network_cli (#33586)
* Add eos and fix tests to run multiple connections
* Update tests to report connection
* Add missing START messages
* Fix unspecified connection
* Python 3 updates
Exceptions don't have `.message` in Python 3
* Override `become` when using `connection=local`
* Slight restructuring to make eapi easier later on
* Move eapi toggle to prepare_eos
* Pull out connection on eapi tasks
Diffstat (limited to 'test/integration/targets/eos_logging')
-rw-r--r-- | test/integration/targets/eos_logging/tasks/cli.yaml | 11 | ||||
-rw-r--r-- | test/integration/targets/eos_logging/tasks/eapi.yaml | 18 | ||||
-rw-r--r-- | test/integration/targets/eos_logging/tests/cli/basic.yaml | 9 |
3 files changed, 21 insertions, 17 deletions
diff --git a/test/integration/targets/eos_logging/tasks/cli.yaml b/test/integration/targets/eos_logging/tasks/cli.yaml index d675462dd0..a6f7ae0351 100644 --- a/test/integration/targets/eos_logging/tasks/cli.yaml +++ b/test/integration/targets/eos_logging/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 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/eos_logging/tasks/eapi.yaml b/test/integration/targets/eos_logging/tasks/eapi.yaml index 00a159a98e..bda1df677a 100644 --- a/test/integration/targets/eos_logging/tasks/eapi.yaml +++ b/test/integration/targets/eos_logging/tasks/eapi.yaml @@ -3,26 +3,14 @@ find: paths: "{{ role_path }}/tests/eapi" patterns: "{{ testcase }}.yaml" + delegate_to: localhost register: test_cases - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" -- name: enable eapi - eos_eapi: - http: yes - https: yes - local_http: no - enable_socket: yes - provider: "{{ cli }}" - -- name: run test case - include: "{{ test_case_to_run }}" +- name: run test case (connection=local) + include: "{{ test_case_to_run }} ansible_connection=local" with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run - -- name: disable eapi - eos_eapi: - state: stopped - provider: "{{ cli }}" diff --git a/test/integration/targets/eos_logging/tests/cli/basic.yaml b/test/integration/targets/eos_logging/tests/cli/basic.yaml index 8a0b7fa156..9dd6efca40 100644 --- a/test/integration/targets/eos_logging/tests/cli/basic.yaml +++ b/test/integration/targets/eos_logging/tests/cli/basic.yaml @@ -1,4 +1,6 @@ --- +- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}" + - name: Set up host logging eos_logging: dest: host @@ -6,6 +8,7 @@ state: present authorize: yes provider: "{{ cli }}" + become: yes register: result - assert: @@ -20,6 +23,7 @@ state: present authorize: yes provider: "{{ cli }}" + become: yes register: result - assert: @@ -33,6 +37,7 @@ state: absent authorize: yes provider: "{{ cli }}" + become: yes register: result - assert: @@ -47,6 +52,7 @@ state: absent authorize: yes provider: "{{ cli }}" + become: yes register: result - assert: @@ -60,6 +66,7 @@ state: present authorize: yes provider: "{{ cli }}" + become: yes register: result - assert: @@ -73,6 +80,7 @@ size: 480000 authorize: yes provider: "{{ cli }}" + become: yes register: result - assert: @@ -87,6 +95,7 @@ - { dest: buffered, size: 480000, state: absent } authorize: yes provider: "{{ cli }}" + become: yes register: result - assert: |