hs-test: add tests repeat option 74/40774/2
authorMatus Fabian <matfabia@cisco.com>
Mon, 22 Apr 2024 17:47:27 +0000 (19:47 +0200)
committerDave Wallace <dwallacelf@gmail.com>
Tue, 23 Apr 2024 00:37:23 +0000 (00:37 +0000)
Type: test

Change-Id: I0143d26d929f6408a5399d7ca536e48cbd9d46bb
Signed-off-by: Matus Fabian <matfabia@cisco.com>
extras/hs-test/Makefile
extras/hs-test/test

index 9c4d345..196bca5 100644 (file)
@@ -27,6 +27,10 @@ ifeq ($(PARALLEL),)
 PARALLEL=1
 endif
 
+ifeq ($(REPEAT),)
+REPEAT=0
+endif
+
 ifeq ($(VPPSRC),)
 VPPSRC=$(shell pwd)/../..
 endif
@@ -64,7 +68,8 @@ help:
        @echo " TEST=[test-name]         - specific test to run"
        @echo " CPUS=[n-cpus]            - number of cpus to run with vpp"
        @echo " VPPSRC=[path-to-vpp-src] - path to vpp source files (for gdb)"
-       @echo " PARALLEL=[n-cpus]"               - number of test processes to spawn to run in parallel
+       @echo " PARALLEL=[n-cpus]        - number of test processes to spawn to run in parallel"
+       @echo " REPEAT=[n]               - repeat tests up to N times or until a failure occurs"
        @echo
        @echo "List of all tests:"
        $(call list_tests)
@@ -83,7 +88,7 @@ build-vpp-debug:
 test: .deps.ok .build.vpp
        @bash ./test --persist=$(PERSIST) --verbose=$(VERBOSE) \
                --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \
-               --vppsrc=$(VPPSRC) --parallel=$(PARALLEL)
+               --vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT)
 
 build-go:
        go build ./tools/http_server
index 9b18e1b..58f08bd 100755 (executable)
@@ -59,6 +59,10 @@ case "${i}" in
         ;;
     --parallel=*)
         ginkgo_args="$ginkgo_args -procs=${i#*=}"
+        ;;
+    --repeat=*)
+        ginkgo_args="$ginkgo_args --repeat=${i#*=}"
+        ;;
 esac
 done