ansible/test/integration/targets/nxos_vrf/tests/common/sanity.yaml
Trishna Guha 5e6b2495c0
Convert nxos_vrf to DI module (#34274)
* Convert nxos_vrf to DI module

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add purge example and improve logic

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* revert version_added for rd param

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* update test to use network_cli

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-01-08 10:10:34 +05:30

65 lines
1.4 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} nxos_vrf sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- block:
- name: 'Setup: Delete VRF before test'
nxos_config:
lines:
- no vrf context ntc
provider: "{{ connection }}"
ignore_errors: yes
- name: Ensure ntc VRF exists on switch
nxos_vrf: &configure
vrf: ntc
admin_state: down
description: testing
#vni: 5000
#rd: auto
provider: "{{ connection }}"
register: result
- assert: &true
that:
- "result.changed == true"
- name: "Conf Idempotence"
nxos_vrf: *configure
register: result
- assert: &false
that:
- "result.changed == false"
- name: Ensure ntc VRF does not exist on switch
nxos_vrf: &remove
vrf: ntc
admin_state: down
description: testing
#vni: 5000
#rd: auto
state: absent
provider: "{{ connection }}"
register: result
- assert: *true
- pause:
seconds: 30
- name: "Remove Idempotence"
nxos_vrf: *remove
register: result
- assert: *false
- name: 'Teardown: Delete VRF after test'
nxos_config:
lines:
- no vrf context ntc
provider: "{{ connection }}"
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_vrf sanity test"