ansible/test/integration/targets/nxos_devicealias/tests/common/sanity.yaml
Suhas Bharadwaj 0a04a5efc2 adding the modules to /nxos/storage/ folder (#64269)
* adding the modules to /nxos/storage/ folder

* fix pep8 stuff

* fixed provider specific information from doc

* Fix integration tests

* Added tested against note

* Review comments

* added assertions for the commands sent in the integration tests
2019-12-16 14:44:33 +05:30

42 lines
1.3 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} nxos_devicealias sanity test"
- name: Setup - Remove device alias if configured
nxos_devicealias: &remove
da:
- { name: 'ansible_test1_add', remove: True}
- { name: 'ansible_test2_add', remove: True}
ignore_errors: yes
- block:
- name: Configure device alias
nxos_devicealias: &config
da:
- { name: 'ansible_test1_add', pwwn: '57:bb:cc:dd:ee:ff:11:67'}
- { name: 'ansible_test2_add', pwwn: '65:22:21:20:19:18:1a:0d'}
register: result
- assert: &true
that:
- result.changed == true
- assert:
that:
- result.commands == ["terminal dont-ask", "device-alias database", "device-alias name ansible_test1_add pwwn 57:bb:cc:dd:ee:ff:11:67", "device-alias name ansible_test2_add pwwn 65:22:21:20:19:18:1a:0d", "device-alias commit", "no terminal dont-ask"]
- name: Idempotence Check
nxos_devicealias: *config
register: result
- assert: &false
that:
- result.changed == false
- assert:
that:
- result.commands == []
always:
- name: Remove device alias config
nxos_devicealias: *remove
- debug: msg="END connection={{ ansible_connection }} nxos_devicealias sanity test"