summaryrefslogtreecommitdiff
path: root/test/integration/targets/nxos_user/tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/nxos_user/tests')
-rw-r--r--test/integration/targets/nxos_user/tests/common/auth.yaml34
-rw-r--r--test/integration/targets/nxos_user/tests/common/basic.yaml55
-rw-r--r--test/integration/targets/nxos_user/tests/common/net_user.yaml31
-rw-r--r--test/integration/targets/nxos_user/tests/common/sanity.yaml110
4 files changed, 0 insertions, 230 deletions
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"