summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extras/hs-test/Makefile8
-rw-r--r--extras/hs-test/container.go3
-rw-r--r--extras/hs-test/hst_suite.go1
-rwxr-xr-xextras/hs-test/test4
4 files changed, 15 insertions, 1 deletions
diff --git a/extras/hs-test/Makefile b/extras/hs-test/Makefile
index 7a5fb138397..f0ec755afb2 100644
--- a/extras/hs-test/Makefile
+++ b/extras/hs-test/Makefile
@@ -23,6 +23,10 @@ ifeq ($(CPUS),)
CPUS=1
endif
+ifeq ($(VPPSRC),)
+VPPSRC=$(shell pwd)/../..
+endif
+
ifeq ($(UBUNTU_CODENAME),)
UBUNTU_CODENAME=$(shell grep '^UBUNTU_CODENAME=' /etc/os-release | cut -f2- -d=)
endif
@@ -55,6 +59,7 @@ help:
@echo " DEBUG=[true|false] - attach VPP to GDB"
@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
@echo "List of all tests:"
$(call list_tests)
@@ -72,7 +77,8 @@ build-vpp-debug:
.PHONY: test
test: .deps.ok .build.vpp
@bash ./test --persist=$(PERSIST) --verbose=$(VERBOSE) \
- --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS)
+ --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \
+ --vppsrc=$(VPPSRC)
build-go:
go build ./tools/http_server
diff --git a/extras/hs-test/container.go b/extras/hs-test/container.go
index fd3aa47b21b..76d08c7d2d6 100644
--- a/extras/hs-test/container.go
+++ b/extras/hs-test/container.go
@@ -129,6 +129,9 @@ func (c *Container) getContainerArguments() string {
args := "--ulimit nofile=90000:90000 --cap-add=all --privileged --network host --rm"
args += c.getVolumesAsCliOption()
args += c.getEnvVarsAsCliOption()
+ if *vppSourceFileDir != "" {
+ args += fmt.Sprintf(" -v %s:%s", *vppSourceFileDir, *vppSourceFileDir)
+ }
args += " --name " + c.name + " " + c.image
args += " " + c.extraRunningArgs
return args
diff --git a/extras/hs-test/hst_suite.go b/extras/hs-test/hst_suite.go
index d74934ae62c..f0ebdca5919 100644
--- a/extras/hs-test/hst_suite.go
+++ b/extras/hs-test/hst_suite.go
@@ -25,6 +25,7 @@ var isVerbose = flag.Bool("verbose", false, "verbose test output")
var isUnconfiguring = flag.Bool("unconfigure", false, "remove topology")
var isVppDebug = flag.Bool("debug", false, "attach gdb to vpp")
var nConfiguredCpus = flag.Int("cpus", 1, "number of CPUs assigned to vpp")
+var vppSourceFileDir = flag.String("vppsrc", "", "vpp source file directory")
type HstSuite struct {
suite.Suite
diff --git a/extras/hs-test/test b/extras/hs-test/test
index ae99f879841..c3b9eaef145 100755
--- a/extras/hs-test/test
+++ b/extras/hs-test/test
@@ -7,6 +7,7 @@ single_test=0
persist_set=0
unconfigure_set=0
debug_set=0
+vppsrc=
for i in "$@"
do
@@ -41,6 +42,9 @@ case "${i}" in
--cpus=*)
args="$args -cpus ${i#*=}"
;;
+ --vppsrc=*)
+ args="$args -vppsrc ${i#*=}"
+ ;;
--test=*)
tc_name="${i#*=}"
if [ $tc_name != "all" ]; then