ansible/test/integration/targets/nxos_user/tests/common/sanity.yaml

118 lines
2.4 KiB
YAML
Raw Normal View History

nxos bugfixes cherry-pick (#38091) * Fix nxos_switchport (#37328) (cherry picked from commit ff57fd0bb49a12d7a59deb05e488228725f73417) * Fix nxos_l2_interface and test typo (#37336) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit ba5e562c76464c3fde7c6a285576a286c7e6d523) * fix ios_l2_interface (#37389) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit dd37857884b4b7c6eb393135a1ceac725b60e6d6) * fix required args for nxos_snapshot and docs improvement (#37232) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit a10df8b0b5a81aad096d1c7299edddfd0f4e3d14) * add nxos_snapshot test for missing required param (#37248) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit 2501834c422f1b7a1349003fed33fa9a04e135f5) * Ensure network_cli nxos test is run only once - remove unnecessary files (#37462) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit 957ab02e524631a237a8ff9f22b0637aaa063e9d) * Integration Tests only: nxos_user (#37852) * add new integration file to nxos_user * fix shippable error * change nxapi to connection * review comments (cherry picked from commit 63da50e1d8fe61bbcdae645bf72a8482383e6a83) * fix UnboundLocalError nxos_bgp_af module (#37610) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit 00abe6dbe7e8670d53741df0fc3eaded84b2d080) * Fix nxos_vrf issues (#37092) * fix nxos_vrf issues * fix doc (cherry picked from commit dc61f4c6b1588c854f45d7267bc68b63b03a93bf) * fix nxos_vrf_af issues (#37211) (cherry picked from commit 74e79d9f5e3da3767f8d32a6fac7a047439d1e8f) * fix nxos_udld issues (#37418) (cherry picked from commit 05b266cc667ada2cb56ad04c6428284e35fe3f3b) * fix nxos_vlan issues (#38008) (cherry picked from commit 6f2cb28bb9e06293232a92b949b39fe80f8dbaa5) * add changelog Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-29 12:47:32 +00:00
---
- debug: msg="START connection={{ ansible_connection }} nxos_user parameter test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- 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
provider: "{{ connection }}"
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
provider: "{{ connection }}"
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
# provider: "{{ connection }}"
# 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
provider: "{{ connection }}"
register: result
- assert: *true
- block:
- name: users idempotency
nxos_user: *coll
register: result
- assert: *false
when: idem
- name: tearDown
nxos_user: &tear
name: ansible
purge: yes
provider: "{{ connection }}"
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"