ansible/test/integration/targets/nxos_vpc/tests/common/sanity.yaml
Nathaniel Case a197125954
Nxos restore provider to nxapi tests (#41818)
* Quick and dirty sed to add provider

* Manually verify the rest of the cases

* Add missing provider
2018-07-02 09:43:51 -04:00

194 lines
3.8 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} nxos_vpc sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- block:
- name: enable feature vpc
nxos_feature:
feature: vpc
provider: "{{ connection }}"
state: enabled
- name: Ensure ntc VRF exists on switch
nxos_vrf:
vrf: ntc
provider: "{{ connection }}"
- name: Configure vpc
nxos_vpc: &conf_vpc
provider: "{{ connection }}"
state: present
domain: 100
pkl_dest: 192.168.100.4
pkl_src: 10.1.100.20
pkl_vrf: ntc
register: result
- assert: &true
that:
- "result.changed == true"
- name: "Conf Idempotence"
nxos_vpc: *conf_vpc
register: result
- assert: &false
that:
- "result.changed == false"
- name: Configure vpc1
nxos_vpc: &conf_vpc1
provider: "{{ connection }}"
state: present
domain: 100
role_priority: 500
system_priority: 2000
peer_gw: True
delay_restore: 5
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *conf_vpc1
register: result
- assert: *false
- block:
- name: Configure auto1
nxos_vpc: &auto_false
provider: "{{ connection }}"
state: present
domain: 100
auto_recovery: False
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *auto_false
register: result
- assert: *false
- name: Configure auto2
nxos_vpc: &auto_true
provider: "{{ connection }}"
state: present
domain: 100
auto_recovery: True
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *auto_true
register: result
- assert: *false
when: (platform is search("N7K|N9K-F"))
- block:
- name: Configure auto1
nxos_vpc: &auto_true1
provider: "{{ connection }}"
state: present
domain: 100
auto_recovery: True
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *auto_true1
register: result
- assert: *false
- name: Configure auto2
nxos_vpc: &auto_false1
provider: "{{ connection }}"
state: present
domain: 100
auto_recovery: False
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *auto_false1
register: result
- assert: *false
when: not (platform is search("N7K|N9K-F"))
- name: Configure vpc2
nxos_vpc: &conf_vpc2
provider: "{{ connection }}"
state: present
domain: 100
role_priority: default
system_priority: default
peer_gw: True
delay_restore: default
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *conf_vpc2
register: result
- assert: *false
- name: Configure vpc3
nxos_vpc: &conf_vpc3
provider: "{{ connection }}"
state: present
domain: 100
peer_gw: False
register: result
- assert: *true
- name: "Conf Idempotence"
nxos_vpc: *conf_vpc3
register: result
- assert: *false
- name: remove vpc
nxos_vpc: &rem_vpc
provider: "{{ connection }}"
state: absent
domain: 100
register: result
- assert: *true
- name: "Remove Idempotence"
nxos_vpc: *rem_vpc
register: result
- assert: *false
always:
- name: remove vrf
nxos_vrf:
vrf: ntc
provider: "{{ connection }}"
state: absent
ignore_errors: yes
- name: disable feature vpc
nxos_feature:
feature: vpc
provider: "{{ connection }}"
state: disabled
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_vpc sanity test"