ansible/test/integration/targets/nxos_interface/tests/common/intent.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

63 lines
1.6 KiB
YAML

- debug: msg="START connection={{ ansible_connection }} nxos_interface intent test"
- set_fact: testint1="{{ nxos_int1 }}"
- set_fact: testint2="{{ nxos_int2 }}"
- name: "Setup: Put interfaces into a default state"
nxos_config:
lines:
- "default interface {{ testint1 }}"
- "default interface {{ testint2 }}"
ignore_errors: yes
- name: Check intent arguments
nxos_interface:
name: "{{ testint2 }}"
admin_state: up
tx_rate: ge(0)
rx_rate: ge(0)
register: result
- assert:
that:
- "result.failed == false"
- name: "Clear interface {{ testint2 }} counters before next task"
nxos_command:
commands: "clear counters interface {{ testint2 }}"
ignore_errors: yes
- name: Check intent arguments (failed condition)
nxos_interface:
name: "{{ testint2 }}"
admin_state: down
tx_rate: gt(10000)
rx_rate: lt(0)
ignore_errors: yes
register: result
- assert:
that:
- "result.failed == true"
- "'tx_rate gt(10000)' in result.failed_conditions"
- "'rx_rate lt(0)' in result.failed_conditions"
- name: aggregate definition of interface
nxos_interface:
aggregate:
- { name: "{{ testint1 }}", description: "Test aggregation on first interface" }
- { name: "{{ testint2 }}", mode: layer3 }
register: result
- assert:
that:
- "result.changed == true"
- name: "TearDown: Put interfaces into a default state"
nxos_config:
lines:
- "default interface {{ testint1 }}"
- "default interface {{ testint2 }}"
ignore_errors: yes
- debug: msg="END connection={{ ansible_connection }} nxos_interface intent test"