ansible/test/integration/targets/nxos_command/tests/nxapi/sanity.yaml
nkshrishail 01e4c41be4 nxos: Removing local-nxapi plugin and related parameters' usage from the integration tests. (#65068)
* nxos_integration_tests: Removing obsolete provider parameter

* nxos: removing support for local-nxapi plugin

* nxos: removing LocalNxapi plugin implementation

* nxos_nxapi: removing local plugin usage

* REVERT - nxos: removing LocalNxapi plugin implementation

* Addressing yamllint issues

* Removing the condition on the debug messages

* Restoring changes done to nxos_nxapi* tests

* Retaining timeout of 500 on nxos_smoke test

* Some cleanup

* Addressing latest comments

* Restoring the nxos_smoke and removing timeout from nxos_config and nxos_rollback
2020-01-08 13:43:23 +05:30

66 lines
1.4 KiB
YAML

---
- debug: msg="START nxapi/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]|to_json"
- 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 nxapi/sanity.yaml on connection={{ ansible_connection }}"