ansible/test/integration/targets/nxos_ip_interface/tests/nxapi/sanity.yaml
Nathaniel Case c371ed8d30
nxos tests to use network_cli (#34474)
* Fix over-byte

* Fix nxos_l2_interface docs

* Update connections for tasks

* Add default ssh port

* Only report provider when using connection=local

* Send empty provider when connection=network_cli

* Fix find tasks
2018-01-05 12:39:04 -05:00

101 lines
2.3 KiB
YAML

---
- debug: msg="START TRANSPORT:NXAPI nxos_ip_interface sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: testint1="{{ nxos_int1 }}"
- set_fact: testint2="{{ nxos_int2 }}"
- name: "Put interface {{testint1}} into default state"
nxos_config: &intdefault1
lines:
- "default interface {{ testint1 }}"
provider: "{{ nxapi }}"
ignore_errors: yes
- name: "Put interface {{testint2}} into default state"
nxos_config: &intdefault2
lines:
- "default interface {{ testint2 }}"
provider: "{{ nxapi }}"
ignore_errors: yes
- name: "Make {{testint1}} a layer3 interface"
nxos_interface: &l3int1
interface: "{{ testint1 }}"
mode: layer3
description: 'Configured by Ansible - Layer3'
admin_state: 'up'
state: present
provider: "{{ nxapi }}"
- name: "Make {{testint2}} a layer3 interface"
nxos_interface: &l3int2
interface: "{{ testint2 }}"
mode: layer3
description: 'Configured by Ansible - Layer3'
admin_state: 'up'
state: present
provider: "{{ nxapi }}"
# For titanium
- name: Clear interface v4
nxos_ip_interface:
interface: "{{ testint1 }}"
version: v4
state: absent
addr: 20.20.20.20
mask: 24
provider: "{{ nxapi }}"
# For titanium
- name: Clear interface v6
nxos_ip_interface:
interface: "{{ testint2 }}"
version: v6
state: absent
addr: 'fd56:31f7:e4ad:5585::1'
mask: 64
provider: "{{ nxapi }}"
- name: Ensure ipv4 address is configured
nxos_ip_interface: &ipv4
interface: "{{ testint1 }}"
version: v4
state: present
addr: 20.20.20.20
mask: 24
provider: "{{ nxapi }}"
register: result
- assert: &true
that:
- "result.changed == true"
- name: "Check Idempotence"
nxos_ip_interface: *ipv4
register: result
- assert: &false
that:
- "result.changed == false"
- name: Ensure ipv6 address is configured
nxos_ip_interface: &ipv6
interface: "{{ testint2 }}"
version: v6
state: present
addr: 'fd56:31f7:e4ad:5585::1'
mask: 64
provider: "{{ nxapi }}"
register: result
- assert: *true
- name: "Check Idempotence"
nxos_ip_interface: *ipv6
register: result
- assert: *false
- debug: msg="END TRANSPORT:NXAPI nxos_ip_interface sanity test"