ansible/test/integration/targets/nxos_command/tests/cli/sanity.yaml
Nathaniel Case 82dfa542c2
Replace bogus (but routeable) ip addresses with RFC 5737 example addresses (#40554)
* Remove 1.1.1.1 from *_config tests

* remove from *_smoke and *_system

* Miscellaneous other tests

* Remove from module documentation as well

* Remove from unit tests as well

* Remove accidental duplication from rebase
2018-05-30 13:03:20 -04:00

66 lines
1.3 KiB
YAML

---
- debug: msg="START cli/sanity.yaml on connection={{ ansible_connection }}"
- name: "Disable feature BGP"
nxos_feature:
feature: bgp
state: disabled
- block:
- name: "Run show running-config bgp - should fail"
nxos_command:
commands:
- sh running-config bgp
ignore_errors: yes
register: result
- assert: &fail
that:
- "result.failed == true"
- name: "Enable feature BGP"
nxos_feature:
feature: bgp
state: enabled
- name: "Configure BGP defaults"
nxos_bgp: &configure_default
asn: 65535
router_id: 192.0.2.1
state: present
register: result
- assert: &true
that:
- "result.changed == true"
- name: "Run show running-config bgp - should pass"
nxos_command:
commands:
- sh running-config bgp
register: result
- assert:
that:
- "result.failed == false"
- "'65535' in result.stdout[0]"
- name: "Run an invalid command - should fail"
nxos_command:
commands:
- show interface bief
ignore_errors: yes
register: result
- assert: *fail
rescue:
- debug: msg="nxos_command sanity test failure detected"
always:
- name: "Disable feature bgp"
nxos_feature:
feature: bgp
state: disabled
- debug: msg="END cli/sanity.yaml on connection={{ ansible_connection }}"