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:

committed by
Florin Coras

parent
edd28a4102
commit
2ddb2fdaaf
@@ -1,5 +1,8 @@
|
||||
all: build docker
|
||||
|
||||
install-dep:
|
||||
apt update -y && apt install -y apache2-utils wrk
|
||||
|
||||
build:
|
||||
go build ./tools/http_server
|
||||
|
||||
|
@@ -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...)
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user