adds integration tests cases for nxos_feature (#21966)

This commit is contained in:
Peter Sprygada
2017-02-26 08:12:57 -05:00
committed by GitHub
parent 10b23f3a00
commit 4c354c9c70
10 changed files with 224 additions and 63 deletions

View File

@@ -0,0 +1,60 @@
---
- debug: msg="START cli/configure.yaml"
- name: setup
nxos_config:
lines: no feature vn-segment-vlan-based
match: none
provider: "{{ cli }}"
- name: enable vn-segment-vlan-based
nxos_feature:
feature: vn-segment-vlan-based
state: enabled
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- name: verify vn-segment-vlan-based
nxos_feature:
feature: vn-segment-vlan-based
state: enabled
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- name: disable vn-segment-vlan-based
nxos_feature:
feature: vn-segment-vlan-based
state: disabled
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- name: verify vn-segment-vlan-based
nxos_feature:
feature: vn-segment-vlan-based
state: disabled
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
nxos_config:
lines: no feature vn-segment-vlan-based
match: none
provider: "{{ cli }}"
- debug: msg="END cli/configure.yaml"

View File

@@ -0,0 +1,15 @@
---
- debug: msg="START cli/invalid.yaml"
- name: configure invalid feature name
nxos_feature:
feature: invalid
provider: "{{ cli }}"
register: result
ignore_errors: yes
- assert:
that:
- result.failed == true
- debug: msg="END cli/invalid.yaml"