ansible/test/integration/targets/nxos_linkagg/tests/common/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

190 lines
4.3 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} nxos_linkagg sanity test"
- set_fact: testint1="{{ nxos_int1 }}"
- set_fact: testint2="{{ nxos_int2 }}"
- name: "Enable feature LACP"
nxos_feature:
feature: lacp
state: enabled
ignore_errors: yes
- name: setup - remove config used in test(part1)
nxos_config:
lines:
- no interface port-channel 20
- no interface port-channel 100
- name: setup - remove config used in test(part2)
nxos_config:
lines:
- no channel-group 20
parents: "{{ item }}"
ignore_errors: yes
loop:
- "interface {{ testint1 }}"
- "interface {{ testint2 }}"
- name: Put interface in L2 mode
nxos_interface:
aggregate:
- { name: "{{testint1}}" }
- { name: "{{testint2}}" }
mode: layer2
when: platform is match("N35")
- name: create linkagg
nxos_linkagg: &create
group: 20
state: present
register: result
- assert:
that:
- 'result.changed == true'
- '"interface port-channel 20" in result.commands'
- name: create linkagg(Idempotence)
nxos_linkagg: *create
register: result
- assert:
that:
- 'result.changed == false'
- name: set link aggregation group to members declaratively
nxos_linkagg: &configure_member
group: 20
mode: active
force: True
members:
- "{{ testint1 }}"
- "{{ testint2 }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"interface {{ testint1 }}" in result.commands'
- '"channel-group 20 force mode active" in result.commands'
- '"interface {{ testint2 }}" in result.commands'
- '"channel-group 20 force mode active" in result.commands'
- name: set link aggregation group to members(Idempotence)
nxos_linkagg: *configure_member
register: result
- assert:
that:
- 'result.changed == false'
- name: remove link aggregation group from member declaratively
nxos_linkagg: &remove_member
group: 20
mode: active
force: True
members:
- "{{ testint2 }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"interface {{ testint1 }}" in result.commands'
- '"no channel-group 20" in result.commands'
- name: remove link aggregation group from member(Idempotence)
nxos_linkagg: *remove_member
register: result
- assert:
that:
- 'result.changed == false'
- name: remove linkagg
nxos_linkagg: &remove
group: 20
state: absent
register: result
- assert:
that:
- 'result.changed == true'
- '"no interface port-channel 20" in result.commands'
- name: remove linkagg(Idempotence)
nxos_linkagg: *remove
register: result
- assert:
that:
- 'result.changed == false'
- name: create aggregate of linkagg definitions
nxos_linkagg: &create_agg
aggregate:
- { group: 20, min_links: 3 }
- { group: 100, min_links: 4 }
register: result
- assert:
that:
- 'result.changed == true'
- '"interface port-channel 20" in result.commands'
- '"lacp min-links 3" in result.commands'
- '"interface port-channel 100" in result.commands'
- '"lacp min-links 4" in result.commands'
- name: create aggregate of linkagg definitions(Idempotence)
nxos_linkagg: *create_agg
register: result
- assert:
that:
- 'result.changed == false'
- name: remove aggregate of linkagg definitions
nxos_linkagg: &remove_agg
aggregate:
- { group: 20, min_links: 3 }
- { group: 100, min_links: 4 }
state: absent
register: result
- assert:
that:
- 'result.changed == true'
- '"no interface port-channel 20" in result.commands'
- '"no interface port-channel 100" in result.commands'
- name: remove aggregate of linkagg definitions(Idempotence)
nxos_linkagg: *remove_agg
register: result
- assert:
that:
- 'result.changed == false'
- name: teardown - remove config used in test(part1)
nxos_config:
lines:
- no interface port-channel 20
- no interface port-channel 100
- name: teardown - remove config used in test(part2)
nxos_config:
lines:
- no channel-group 20
parents: "{{ item }}"
ignore_errors: yes
loop:
- "interface {{ testint1 }}"
- "interface {{ testint2 }}"
- name: "Disable feature LACP"
nxos_feature:
feature: lacp
state: disabled
- debug: msg="END connection={{ ansible_connection }} nxos_linkagg sanity test"