1 export HS_ROOT=$(CURDIR)
11 ifeq ($(UNCONFIGURE),)
36 VPPSRC=$(shell pwd)/../..
39 ifeq ($(UBUNTU_CODENAME),)
40 UBUNTU_CODENAME=$(shell grep '^UBUNTU_CODENAME=' /etc/os-release | cut -f2- -d=)
44 ARCH=$(shell dpkg --print-architecture)
47 list_tests = @go run github.com/onsi/ginkgo/v2/ginkgo --dry-run -v --no-color --seed=2 | head -n -1 | grep 'Test' | \
48 sed 's/^/* /; s/\(Suite\) /\1\//g'
53 @echo " test - run tests"
54 @echo " test-debug - run tests (vpp debug image)"
55 @echo " build - build test infra"
56 @echo " build-debug - build test infra (vpp debug image)"
57 @echo " build-go - just build golang files"
58 @echo " fixstyle - format .go source files"
59 @echo " list-tests - list all tests"
61 @echo "make build arguments:"
62 @echo " UBUNTU_VERSION - ubuntu version for docker image"
63 @echo " HST_EXTENDED_TESTS - build extended tests"
65 @echo "make test arguments:"
66 @echo " PERSIST=[true|false] - whether clean up topology and dockers after test"
67 @echo " VERBOSE=[true|false] - verbose output"
68 @echo " UNCONFIGURE=[true|false] - unconfigure selected test"
69 @echo " DEBUG=[true|false] - attach VPP to GDB"
70 @echo " TEST=[test-name] - specific test to run"
71 @echo " CPUS=[n-cpus] - number of cpus to allocate to VPP and containers"
72 @echo " VPPSRC=[path-to-vpp-src] - path to vpp source files (for gdb)"
73 @echo " PARALLEL=[n-cpus] - number of test processes to spawn to run in parallel"
74 @echo " REPEAT=[n] - repeat tests up to N times or until a failure occurs"
76 @echo "List of all tests:"
83 .PHONY: build-vpp-release
85 @make -C ../.. build-release
87 .PHONY: build-vpp-debug
94 .build_debug.ok: build-debug
98 test: .deps.ok .build.ok
99 # '-' ignores the exit status, it is set in compress.sh
100 # necessary so gmake won't skip executing the bash script
101 -bash ./test --persist=$(PERSIST) --verbose=$(VERBOSE) \
102 --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \
103 --vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT)
104 @bash ./script/compress.sh
107 test-debug: .deps.ok .build_debug.ok
108 # '-' ignores the exit status, it is set in compress.sh
109 # necessary so gmake won't skip executing the bash script
110 -bash ./test --persist=$(PERSIST) --verbose=$(VERBOSE) \
111 --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \
112 --vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT)
113 @bash ./script/compress.sh
117 go build ./tools/http_server
120 build: .deps.ok build-vpp-release build-go
122 bash ./script/build_hst.sh release
126 build-debug: .deps.ok build-vpp-debug build-go
128 bash ./script/build_hst.sh debug
132 @sudo make install-deps
138 && apt-get install -y apt-transport-https ca-certificates curl software-properties-common \
139 apache2-utils wrk bridge-utils
140 @if [ ! -f /usr/share/keyrings/docker-archive-keyring.gpg ] ; then \
141 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg; \
142 echo "deb [arch=$(ARCH) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(UBUNTU_CODENAME) stable" \
143 | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null ; \