nxos: merge nxapi/cli tests - interface, interface_ospf, logging, mtu (#28239)

* refactor nxos_interface

* refactor nxos_interface_ospf

* refactor nxos_logging

* refactor nxos_mtu
This commit is contained in:
David Newswanger 2017-08-17 04:39:13 -04:00 committed by Trishna Guha
commit 2f7f23c9ab
20 changed files with 137 additions and 344 deletions

View file

@ -0,0 +1,32 @@
---
- debug: msg="START {{ connection.transport }}/set_state_absent.yaml"
- name: setup
nxos_config:
lines:
- interface Loopback1
provider: "{{ connection }}"
- name: set state=absent
nxos_interface:
interface: Loopback1
state: absent
provider: "{{ connection }}"
register: result
- assert:
that:
- "result.changed == true"
- name: verify state=absent
nxos_interface:
interface: Loopback1
state: absent
provider: "{{ connection }}"
register: result
- assert:
that:
- "result.changed == false"
- debug: msg="END {{ connection.transport }}/set_state_absent.yaml"

View file

@ -0,0 +1,33 @@
---
- debug: msg="START {{ connection.transport }}/set_state_present.yaml"
- name: setup
nxos_config:
lines:
- no interface Loopback1
provider: "{{ connection }}"
ignore_errors: yes # Fails if the interface is already absent
- name: set state=present
nxos_interface:
interface: Loopback1
state: present
provider: "{{ connection }}"
register: result
- assert:
that:
- "result.changed == true"
- name: verify state=present
nxos_interface:
interface: Loopback1
state: present
provider: "{{ connection }}"
register: result
- assert:
that:
- "result.changed == false"
- debug: msg="END {{ connection.transport }}/set_state_present.yaml"