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
14 changes: 14 additions & 0 deletions ansible/roles/test/tasks/continuous_reboot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
##########################################################################
# Repeat reboot test case <repeat_count> times #
##########################################################################

- name: set default value for repeat_count
set_fact:
repeat_count: 3
when: repeat_count is not defined

- debug:
msg: "Execute reboot.yml {{ repeat_count }} time(s)"

- include: reboot.yml
with_sequence: end={{repeat_count}}
19 changes: 8 additions & 11 deletions ansible/roles/test/tasks/repeat_harness.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
##########################################################################
# Repeat harness is used to repeat a list of tasks, for single test case #
# repeatation, we can use repeat_count in test by testcase name #
# infrastructure. This test case is the template for repeat a list #
# of test cases, or run a test with delay between iterations. etc. #
# Repeat harness is used to repeat a list of tasks, the list of the #
# tasks should be defined in repeat_tasks.yml #
##########################################################################

- debug:
msg: "===================== Repeating starts ======================"
- name: Default test repeat count
set_fact: repeat_count=3
when: repeat_count is not defined

# Add tasks here to be repeated:
# e.g. - include: reboot.yml
- debug: msg="Execute repeat_tasks.yml {{ repeat_count }} time(s)"


- debug:
msg: "===================== Repeating ends ======================"
- include: repeat_tasks.yml
with_sequence: end={{repeat_count}}
13 changes: 13 additions & 0 deletions ansible/roles/test/tasks/repeat_tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
##########################################################################
# Repeat task is used to specify a list of tasks to repeat. #
##########################################################################

- debug:
msg: "===================== Repeating starts ======================"

# Add tasks here to be repeated:
# e.g. - include: reboot.yml


- debug:
msg: "===================== Repeating ends ======================"
8 changes: 1 addition & 7 deletions ansible/roles/test/tasks/test_sonic_by_testname.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,11 @@
- sonic_hwsku in mellanox_hwskus
- dscp_mode is not defined

- name: Set test repeat count
set_fact:
repeat_count: 1
when: repeat_count is not defined

- debug: var=testcases[testcase_name]['execvars']
when: testcases[testcase_name]['execvars'] is defined

- name: run test case {{ testcases[testcase_name]['filename'] }} file {{ repeat_count }} time(s)
- name: run test case {{ testcases[testcase_name]['filename'] }} file
include: "{{ testcases[testcase_name]['filename'] }}"
with_sequence: end={{ repeat_count }}

- debug: msg="!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- debug: msg="!!!!!!!!!!!!!!!!!!!! end running test {{ testcase_name }} !!!!!!!!!!!!!!!!!!!!"
Expand Down
12 changes: 8 additions & 4 deletions ansible/roles/test/vars/testcases.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
testcases:
repeat_harness:
filename: repeat_harness.yml
topologies: [t0, t0-64, t0-64-32,t0-116, t1, t1-lag, t1-64-lag, ptf32, ptf64]

acl:
filename: acl.yml
topologies: [t1, t1-lag, t1-64-lag]
Expand Down Expand Up @@ -35,6 +31,10 @@ testcases:
ptf_host:
testbed_type:

continuous_reboot:
filename: continuous_reboot.yml
topologies: [t0, t0-64, t0-64-32, t0-116, t1, t1-lag, t1-64-lag]

copp:
filename: copp.yml
topologies: [ptf32, ptf64]
Expand Down Expand Up @@ -126,6 +126,10 @@ testcases:
filename: reboot.yml
topologies: [t0, t0-64, t0-64-32, t0-116, t1, t1-lag, t1-64-lag, ptf32, ptf64]

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

restart_swss:
filename: run_config_cleanup.yml
topologies: [t0, t0-64, t0-64-32, t0-116, t1, t1-lag, t1-64-lag, ptf32, ptf64]
Expand Down