diff options
Diffstat (limited to 'test/integration/targets/nxos_user')
9 files changed, 0 insertions, 291 deletions
diff --git a/test/integration/targets/nxos_user/defaults/main.yaml b/test/integration/targets/nxos_user/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/nxos_user/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/nxos_user/meta/main.yaml b/test/integration/targets/nxos_user/meta/main.yaml deleted file mode 100644 index ae741cbdc7..0000000000 --- a/test/integration/targets/nxos_user/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_nxos_tests diff --git a/test/integration/targets/nxos_user/tasks/cli.yaml b/test/integration/targets/nxos_user/tasks/cli.yaml deleted file mode 100644 index 9b62eaba65..0000000000 --- a/test/integration/targets/nxos_user/tasks/cli.yaml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: collect common test cases - find: - paths: "{{ role_path }}/tests/common" - patterns: "{{ testcase }}.yaml" - connection: local - register: test_cases - -- name: collect cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - connection: local - register: cli_cases - -- set_fact: - test_cases: - files: "{{ test_cases.files }} + {{ cli_cases.files }}" - -- 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 connection={{ cli }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_user/tasks/main.yaml b/test/integration/targets/nxos_user/tasks/main.yaml deleted file mode 100644 index 4b0f8c64d9..0000000000 --- a/test/integration/targets/nxos_user/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } -- { include: nxapi.yaml, tags: ['nxapi'] } diff --git a/test/integration/targets/nxos_user/tasks/nxapi.yaml b/test/integration/targets/nxos_user/tasks/nxapi.yaml deleted file mode 100644 index cbf41b9294..0000000000 --- a/test/integration/targets/nxos_user/tasks/nxapi.yaml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: collect common test cases - find: - paths: "{{ role_path }}/tests/common" - patterns: "{{ testcase }}.yaml" - connection: local - register: test_cases - -- name: collect nxapi test cases - find: - paths: "{{ role_path }}/tests/nxapi" - patterns: "{{ testcase }}.yaml" - connection: local - register: nxapi_cases - -- set_fact: - test_cases: - files: "{{ test_cases.files }} + {{ nxapi_cases.files }}" - -- 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 connection={{ nxapi }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/nxos_user/tests/common/auth.yaml b/test/integration/targets/nxos_user/tests/common/auth.yaml deleted file mode 100644 index a05b1aa5ff..0000000000 --- a/test/integration/targets/nxos_user/tests/common/auth.yaml +++ /dev/null @@ -1,34 +0,0 @@ ---- -- block: - - name: Create user with password - nxos_user: - name: auth_user - role: network-operator - state: present - configured_password: pasS!123 - - - name: test login - expect: - command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PubkeyAuthentication=no show version" - responses: - (?i)password: "pasS!123" - - - name: test login with invalid password (should fail) - expect: - command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PubkeyAuthentication=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 - nxos_user: - name: auth_user - state: absent - register: result diff --git a/test/integration/targets/nxos_user/tests/common/basic.yaml b/test/integration/targets/nxos_user/tests/common/basic.yaml deleted file mode 100644 index cf77ed3870..0000000000 --- a/test/integration/targets/nxos_user/tests/common/basic.yaml +++ /dev/null @@ -1,55 +0,0 @@ ---- -- debug: msg="START connection={{ ansible_connection }} nxos_user basic test" - -- name: Remove old entries of user - nxos_user: - aggregate: - - { name: ansibletest1 } - - { name: ansibletest2 } - - { name: ansibletest3 } - state: absent - -# Start tests -- name: Create user - nxos_user: - name: ansibletest1 - roles: network-operator - state: present - register: result - -- debug: msg="{{result}}" - -- assert: - that: - - 'result.changed == true' - - '"username" in result.commands[0]' - - '"role network-operator" in result.commands[0]' - -- name: Collection of users - nxos_user: - aggregate: - - { name: ansibletest2 } - - { name: ansibletest3 } - state: present - roles: network-admin - register: result - -- assert: - that: - - 'result.changed == true' - -- name: tearDown - nxos_user: - aggregate: - - { name: ansibletest1 } - - { name: ansibletest2 } - - { name: ansibletest3 } - state: absent - register: result - -- assert: - that: - - 'result.changed == true' - - '"no username" in result.commands[0]' - -- debug: msg="END connection={{ ansible_connection }} nxos_user basic test" diff --git a/test/integration/targets/nxos_user/tests/common/net_user.yaml b/test/integration/targets/nxos_user/tests/common/net_user.yaml deleted file mode 100644 index 4676577d29..0000000000 --- a/test/integration/targets/nxos_user/tests/common/net_user.yaml +++ /dev/null @@ -1,31 +0,0 @@ ---- -- debug: msg="START connection={{ ansible_connection }} nxos common/net_user.yaml" - -# Add minimal testcase to check args are passed correctly to -# implementation module and module run is successful. - -- name: "Remove old entries of user - setup" - net_user: - name: ansibletest1 - state: absent - -# Start tests -- name: Create user with platform agnostic module - net_user: - name: ansibletest1 - roles: network-operator - state: present - register: result - -- assert: - that: - - 'result.changed == true' - - '"username" in result.commands[0]' - - '"role network-operator" in result.commands[0]' - -- name: teardown - net_user: - name: ansibletest1 - state: absent - -- debug: msg="END connection={{ ansible_connection }} nxos common/net_user.yaml" diff --git a/test/integration/targets/nxos_user/tests/common/sanity.yaml b/test/integration/targets/nxos_user/tests/common/sanity.yaml deleted file mode 100644 index 86b7e4e7fb..0000000000 --- a/test/integration/targets/nxos_user/tests/common/sanity.yaml +++ /dev/null @@ -1,110 +0,0 @@ ---- -- debug: msg="START connection={{ ansible_connection }} nxos_user parameter test" - -- set_fact: idem="true" -- set_fact: idem="false" - when: ((platform is search('N7K')) and (imagetag and (imagetag is version_compare('D1', 'eq')))) - -- block: - - name: Create user - nxos_user: &configure - name: netend - configured_password: Hello!23$ - update_password: on_create - roles: network-operator - state: present - register: result - - - assert: &true - that: - - 'result.changed == true' - - - block: - - name: conf idempotency - nxos_user: *configure - register: result - - - assert: &false - that: - - 'result.changed == false' - when: idem - - - name: Remove user - nxos_user: &remove - name: netend - state: absent - register: result - - - assert: *true - - - name: remove idempotency - nxos_user: *remove - register: result - - - assert: *false - - - debug: msg="skipping sshkey test as the key needs to be created on the server first" - -# - name: create a new user -# nxos_user: &conf1 -# name: ansible -# sshkey: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" -# state: present -# register: result -# -# - assert: *true - -# - block: -# - name: user idempotency -# nxos_user: *conf1 -# register: result -# -# - assert: *false -# -# when: idem - - - name: Collection of users - nxos_user: &coll - users: - - name: test1 - - name: test2 - configured_password: Hello!23$ - update_password: on_create - state: present - roles: - - network-admin - - network-operator - register: result - - - assert: *true - - - block: - - name: users idempotency - nxos_user: *coll - register: result - - - assert: *false - - when: idem - - - name: tearDown - nxos_user: &tear - name: "{{ ansible_user }}" - purge: yes - register: result - - - assert: *true - - - name: teardown idempotency - nxos_user: *tear - register: result - - - assert: *false - - always: - - name: tearDown - nxos_user: *tear - register: result - ignore_errors: yes - -- debug: msg="END connection={{ ansible_connection }} nxos_user parameter test" |