diff options
Diffstat (limited to 'test/integration/targets/eos_user')
8 files changed, 0 insertions, 216 deletions
diff --git a/test/integration/targets/eos_user/defaults/main.yaml b/test/integration/targets/eos_user/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/eos_user/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/eos_user/meta/main.yaml b/test/integration/targets/eos_user/meta/main.yaml deleted file mode 100644 index e5c8cd02f0..0000000000 --- a/test/integration/targets/eos_user/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_eos_tests diff --git a/test/integration/targets/eos_user/tasks/cli.yaml b/test/integration/targets/eos_user/tasks/cli.yaml deleted file mode 100644 index 82d196e4ed..0000000000 --- a/test/integration/targets/eos_user/tasks/cli.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: collect all cli test cases - find: - 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 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 - tags: connection_network_cli diff --git a/test/integration/targets/eos_user/tasks/eapi.yaml b/test/integration/targets/eos_user/tasks/eapi.yaml deleted file mode 100644 index 2cf18b6b53..0000000000 --- a/test/integration/targets/eos_user/tasks/eapi.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: collect all eapi test cases - 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: run test cases (connection=httpapi) - include: "{{ test_case_to_run }} ansible_connection=httpapi" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - tags: connection_httpapi diff --git a/test/integration/targets/eos_user/tasks/main.yaml b/test/integration/targets/eos_user/tasks/main.yaml deleted file mode 100644 index 970e74171e..0000000000 --- a/test/integration/targets/eos_user/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: eapi.yaml, tags: ['eapi'] } diff --git a/test/integration/targets/eos_user/tests/cli/auth.yaml b/test/integration/targets/eos_user/tests/cli/auth.yaml deleted file mode 100644 index bb7e022e51..0000000000 --- a/test/integration/targets/eos_user/tests/cli/auth.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- block: - - name: Create user with password - eos_user: - name: auth_user - privilege: 15 - role: network-operator - state: present - provider: "{{ cli }}" - configured_password: pass123 - become: yes - - - name: test login - expect: - command: "ssh auth_user@{{ ansible_ssh_host }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no show version" - responses: - (?i)password: "pass123" - - - name: test login with invalid password (should fail) - expect: - command: "ssh auth_user@{{ ansible_ssh_host }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no show version" - responses: - (?i)password: "badpass" - ignore_errors: yes - register: results - - - name: check that attempt failed - assert: - that: - - results.failed - - always: - - name: delete user - eos_user: - name: auth_user - state: absent - provider: "{{ cli }}" - become: yes - register: result diff --git a/test/integration/targets/eos_user/tests/cli/basic.yaml b/test/integration/targets/eos_user/tests/cli/basic.yaml deleted file mode 100644 index cc12ab88fd..0000000000 --- a/test/integration/targets/eos_user/tests/cli/basic.yaml +++ /dev/null @@ -1,96 +0,0 @@ ---- -- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}" - -- name: Set Up - eos_config: - lines: - - no username ansibletest1 - - no username ansibletest2 - - no username ansibletest3 - - no username ansibletest4 - provider: "{{ cli }}" - become: yes - -- name: Create user with role - eos_user: - name: ansibletest1 - privilege: 15 - role: network-operator - state: present - configured_password: test1 - provider: "{{ cli }}" - become: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"username" in result.commands[0]' - - '"secret" in result.commands[0]' - - '"role network-operator" in result.commands[1]' - - '"privilege 15" in result.commands[2]' - -- name: Create user with priv level and update_password - eos_user: - name: ansibletest4 - privilege: 15 - state: present - configured_password: test1 - update_password: on_create - provider: "{{ cli }}" - become: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"username" in result.commands[0]' - - '"secret" in result.commands[0]' - - '"privilege 15" in result.commands[1]' - -- name: Collection of users - eos_user: - aggregate: - - { name: ansibletest2, configured_password: test2 } - - { name: ansibletest3, configured_password: test3 } - state: present - role: network-operator - provider: "{{ cli }}" - become: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"username" in result.commands[0]' - - '"role network-operator" in result.commands[1]' - - '"secret" in result.commands[0]' - - '"username" in result.commands[2]' - - '"role network-operator" in result.commands[3]' - - '"secret" in result.commands[2]' - -- name: Add user without password or nopassword arg(Should fail) - eos_user: - name: faileduser1 - privilege: 15 - state: present - provider: "{{ cli }}" - become: yes - ignore_errors: yes - register: result - -- assert: - that: - - 'result.changed == false' - - 'result.failed == true' - - 'result.msg == "configured_password, sshkey or nopassword should be provided"' - -- name: tearDown - eos_config: - lines: - - no username ansibletest1 - - no username ansibletest2 - - no username ansibletest3 - - no username ansibletest4 - provider: "{{ cli }}" - become: yes diff --git a/test/integration/targets/eos_user/tests/cli/net_user.yaml b/test/integration/targets/eos_user/tests/cli/net_user.yaml deleted file mode 100644 index e5eeb5c181..0000000000 --- a/test/integration/targets/eos_user/tests/cli/net_user.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- debug: msg="START eos cli/net_user.yaml on connection={{ ansible_connection }}" - -# Add minimal testcase to check args are passed correctly to -# implementation module and module run is successful. - -- name: Set Up - eos_config: - lines: - - no username ansibletest1 - provider: "{{ cli }}" - become: yes - -- name: Create user with role using platform agnostic module - net_user: - name: ansibletest1 - privilege: 15 - role: network-operator - state: present - configured_password: test1 - provider: "{{ cli }}" - become: yes - register: result - -- assert: - that: - - 'result.changed == true' - - '"username" in result.commands[0]' - - '"secret" in result.commands[0]' - - '"role network-operator" in result.commands[1]' - - '"privilege 15" in result.commands[2]' - -- name: Teardown - eos_config: - lines: - - no username ansibletest1 - provider: "{{ cli }}" - become: yes - -- debug: msg="END eos cli/net_user.yaml on connection={{ ansible_connection }}"
\ No newline at end of file |