aboutsummaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorMaros Ondrejicka <mondreji@cisco.com>2023-02-15 17:44:46 +0100
committerFlorin Coras <florin.coras@gmail.com>2023-02-16 16:26:42 +0000
commit2ddb2fdaaf1233248c236cbe3d617c90f7fae20e (patch)
treebbf60e507660a6e285638cb894b609987e34fa4f /extras
parentedd28a4102949a6f91280dd7d2fd0d0139de8198 (diff)
hs-test: check for missing output in nginx tests
Type: test Signed-off-by: Maros Ondrejicka <mondreji@cisco.com> Change-Id: I08cd492fff4b9d50a1761a29c2b231cc8544313b
Diffstat (limited to 'extras')
-rw-r--r--extras/hs-test/Makefile3
-rw-r--r--extras/hs-test/hst_suite.go6
-rw-r--r--extras/hs-test/http_test.go1
-rwxr-xr-xextras/hs-test/script/build.sh12
4 files changed, 22 insertions, 0 deletions
diff --git a/extras/hs-test/Makefile b/extras/hs-test/Makefile
index 2bb6db951cb..f9c111eed56 100644
--- a/extras/hs-test/Makefile
+++ b/extras/hs-test/Makefile
@@ -1,5 +1,8 @@
all: build docker
+install-dep:
+ apt update -y && apt install -y apache2-utils wrk
+
build:
go build ./tools/http_server
diff --git a/extras/hs-test/hst_suite.go b/extras/hs-test/hst_suite.go
index 286536da305..9cd9aea5f24 100644
--- a/extras/hs-test/hst_suite.go
+++ b/extras/hs-test/hst_suite.go
@@ -105,6 +105,12 @@ func (s *HstSuite) assertNotContains(testString, contains interface{}, msgAndArg
}
}
+func (s *HstSuite) assertNotEmpty(object interface{}, msgAndArgs ...interface{}) {
+ if !assert.NotEmpty(s.T(), object, msgAndArgs...) {
+ s.hstFail()
+ }
+}
+
func (s *HstSuite) log(args ...any) {
if IsVerbose() {
s.T().Log(args...)
diff --git a/extras/hs-test/http_test.go b/extras/hs-test/http_test.go
index 5e88fe00cc6..df4b0126a23 100644
--- a/extras/hs-test/http_test.go
+++ b/extras/hs-test/http_test.go
@@ -93,6 +93,7 @@ func runNginxPerf(s *NoTopoSuite, mode, ab_or_wrk string) error {
s.log(cmd)
o, _ := cmd.CombinedOutput()
s.log(string(o))
+ s.assertNotEmpty(o)
return nil
}
diff --git a/extras/hs-test/script/build.sh b/extras/hs-test/script/build.sh
index f52025c9092..0fc49bbf7d0 100755
--- a/extras/hs-test/script/build.sh
+++ b/extras/hs-test/script/build.sh
@@ -5,6 +5,18 @@ if [ $(lsb_release -is) != Ubuntu ]; then
exit 1
fi
+if [ -z $(which ab) ]; then
+ echo "Host stack test framework requires apache2-utils to be installed"
+ echo "It is recommended to run 'sudo make install-dep'"
+ exit 1
+fi
+
+if [ -z $(which wrk) ]; then
+ echo "Host stack test framework requires wrk to be installed"
+ echo "It is recommended to run 'sudo make install-dep'"
+ exit 1
+fi
+
source vars
bin=vpp-data/bin