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
2 changes: 1 addition & 1 deletion ansible/roles/test/tasks/base_sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

when:
- ({{ ps_out.stdout_lines | length }} <= 0) or ({{ orch_out.stdout_lines | length }} <= 0)
- recover == "true"
- recover is defined and recover == "true"

- name: Get syslog error information
shell: cat /var/log/syslog |tail -n 5000 |grep -i error
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/test/tasks/interface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

when:
- ansible_interface_link_down_ports | length > 0
- recover == "true"
- recover is defined and recover == "true"

- debug: msg="Found link down ports {{ansible_interface_link_down_ports}}"
when: ansible_interface_link_down_ports | length > 0
Expand Down
29 changes: 29 additions & 0 deletions ansible/roles/test/tasks/port_toggle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- name: build shell command string
debug: msg="PORTS={{minigraph_ports.keys() | join(' ')}}; for port in $PORTS; do config interface shutdown $port; done"

- name: turn off all ports on device
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you only consider all ports on/off or more like link_flap validate per port so you won't turn off wrong port?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed, we rely on the link_flap test to check individual link. This test is to stress the DUT.

shell: PORTS="{{minigraph_ports.keys() | join(' ')}}"; for port in $PORTS; do config interface shutdown $port; done
become: yes

- name: Get interface facts
interface_facts: up_ports={{minigraph_ports}}

- name: Verify interfaces are all down
assert: { that: "{{ ansible_interface_link_down_ports | length }} == {{ minigraph_ports | length }}" }

- always:
- name: build shell command string
debug: msg="PORTS={{minigraph_ports.keys() | join(' ')}}; for port in $PORTS; do config interface startup $port; done"

- name: turn off all ports on device
shell: PORTS="{{minigraph_ports.keys() | join(' ')}}"; for port in $PORTS; do config interface startup $port; done
become: yes

- name: wait 1 minute for ports to come up
pause: seconds=60

- name: Get interface facts
interface_facts: up_ports={{minigraph_ports}}

- name: Verify interfaces are up correctly
assert: { that: "{{ ansible_interface_link_down_ports | length }} == 0" }
4 changes: 4 additions & 0 deletions ansible/roles/test/vars/testcases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ testcases:
filename: pfc_wd.yml
topologies: [t0, t0-64, t0-64-32, t0-116, t1, t1-lag, t1-64-lag, ptf32, ptf64]

port_toggle:
filename: port_toggle.yml
topologies: [t0, t0-64, t0-64-32, t0-116, t1, t1-lag, t1-64-lag, ptf32, ptf64]

qos:
filename: qos.yml
topologies: [ptf32, ptf64]
Expand Down