Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
27 changes: 27 additions & 0 deletions ansible/roles/test/tasks/port_toggle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- name: turn off all ports on device
Copy link
Copy Markdown
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
Copy Markdown
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: config interface shutdown {{item}}
become: yes
with_items:
- "{{minigraph_ports.keys()}}"

- 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: turn on all ports on device
shell: config interface startup {{item}}
become: yes
with_items:
- "{{minigraph_ports.keys()}}"

- 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