Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions ansible/roles/test/tasks/lag_minlink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,27 @@
login: "{{switch_login[hwsku_map[peer_hwsku]]}}"
connection: switch

- pause:
seconds: "{{ wait_down_time }}"
- name: Set delay
set_fact:
delay: 5

- name: Set retries
set_fact:
retries: "{{ (wait_down_time | int / delay | float) | round(0, 'ceil') }}"

- name: Let portchannel react to neighbor interface shutdown
pause:
seconds: "{{ deselect_time }}"

- name: "Verify PortChannel interfaces are up correctly"
shell: bash -c "teamdctl {{ po }} state dump" | python -c "import sys, json; print json.load(sys.stdin)['ports']['{{ item }}']['runner']['selected']"
register: out
until: out.stdout == "True"
with_items: "{{ po_interfaces.keys() }}"
when: item != "{{ flap_intf }}"
become: "yes"
retries: "{{ retries | int }}"
delay: "{{ delay }}"

- lag_facts: host={{ inventory_hostname }}

Expand Down Expand Up @@ -44,8 +63,14 @@
login: "{{switch_login[hwsku_map[peer_hwsku]]}}"
connection: switch

- pause:
seconds: 35
- name: "Verify PortChannel interfaces are up correctly"
shell: bash -c "teamdctl {{ po }} state dump" | python -c "import sys, json; print json.load(sys.stdin)['ports']['{{ item }}']['link']['up']"
register: out
until: out.stdout == "True"
with_items: "{{ po_interfaces.keys() }}"
become: "yes"
retries: "{{ retries | int }}"
delay: "{{ delay }}"

- lag_facts: host={{ inventory_hostname }}

Expand Down
12 changes: 10 additions & 2 deletions ansible/roles/test/tasks/single_lag_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
### This playbook test one single port channel minimum link feature of one member interface shutdown
### and portchannel member interfaces sending ACP DU rate

# Set maximum value of "smart" timeout to be the same as before,
# user can now set own value outside the test, for example by passing '-e wait_timeout=5'
- set_fact:
wait_timeout: 30
when: "wait_timeout is not defined"

# Gather information of port channel ports, minimum links and total interface member numbers
- set_fact:
po: "{{ item }}"
Expand Down Expand Up @@ -31,7 +37,8 @@
- name: test fanout interface (physical) flap and lacp keep correct po status follow minimum links requirement
include: lag_minlink.yml
vars:
wait_down_time: 35
deselect_time: 5
wait_down_time: "{{ wait_timeout | int }}"

### Now figure out remote VM and interface info for the flapping lag member and run minlink test
- set_fact:
Expand All @@ -45,4 +52,5 @@
- name: test vm interface flap (no physical port down, more like remote port lock) that lag interface can change to correct po status follow minimum links requirement
include: lag_minlink.yml
vars:
wait_down_time: 120
deselect_time: 95
wait_down_time: "{{ wait_timeout | int }}"