Skip to content
Closed
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
18 changes: 18 additions & 0 deletions ansible/roles/test/tasks/repeat_harness.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#-------------------------------------------------------------------
# Repeat harness: Repeat a list of taks defined in repeat_tasks.yml,
# by default, 10 times.
# repeat count can be set by
# --extra-vars 'test_iterations=<num>'
#-------------------------------------------------------------------

- name: Default test count
set_fact:
test_count=10

- name: Update test count
set_fact:
test_count={{test_iterations}}
when: test_iterations is defined

- include: repeat_tasks.yml iteration={{item}}
with_sequence: start=1 end={{test_count}}
9 changes: 9 additions & 0 deletions ansible/roles/test/tasks/repeat_tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- debug:
msg: "Repeat harness: iteration {{ iteration }} starts"

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

- debug:
msg: "Repeat harness: iteration {{ iteration }} ends"

4 changes: 4 additions & 0 deletions ansible/roles/test/tasks/test_sonic_by_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@
include: reboot.yml
tags: reboot

- name: Test case repeat harness
include: repeat_harness.yml
tags: repeat_harness

### When calling the following tests, please add command line of what testbed_type and which PTF docker to test against
### -e "testbed_type=t1-lag ptf_host=10.0.0.200"
- name: Fib test
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/test/vars/testcases.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
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