hs-test: check for missing output in nginx tests

Type: test
Signed-off-by: Maros Ondrejicka <mondreji@cisco.com>
Change-Id: I08cd492fff4b9d50a1761a29c2b231cc8544313b
This commit is contained in:
Maros Ondrejicka
2023-02-15 17:44:46 +01:00
committed by Florin Coras
parent edd28a4102
commit 2ddb2fdaaf
4 changed files with 22 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
all: build docker
install-dep:
apt update -y && apt install -y apache2-utils wrk
build:
go build ./tools/http_server

View File

@@ -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...)

View File

@@ -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
}

View File

@@ -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