summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/nginx_test.go
diff options
context:
space:
mode:
authorAdrian Villin <avillin@cisco.com>2024-07-09 15:31:36 +0200
committerAdrian Villin <avillin@cisco.com>2024-07-17 18:20:54 +0200
commit25140013770d219db1b4044d78b72199d372b61b (patch)
tree67e373ede69a3411dfc0db1a29e99d9c904f097b /extras/hs-test/nginx_test.go
parentb69ee00c34ede374dad78f33106b39cf75087d5a (diff)
hs-test: use docker sdk
Type: test Change-Id: I9d6b15ca6a9aac3343e10f480dec43c4c538f1b7 Signed-off-by: Adrian Villin <avillin@cisco.com>
Diffstat (limited to 'extras/hs-test/nginx_test.go')
-rw-r--r--extras/hs-test/nginx_test.go23
1 files changed, 13 insertions, 10 deletions
diff --git a/extras/hs-test/nginx_test.go b/extras/hs-test/nginx_test.go
index 00869b0c9b4..45358435546 100644
--- a/extras/hs-test/nginx_test.go
+++ b/extras/hs-test/nginx_test.go
@@ -37,7 +37,7 @@ func NginxHttp3Test(s *NoTopoSuite) {
query := "index.html"
nginxCont := s.GetContainerByName("nginx-http3")
- s.AssertNil(nginxCont.Run())
+ nginxCont.Run()
vpp := s.GetContainerByName("vpp").VppInstance
vpp.WaitForApp("nginx-", 5)
@@ -47,9 +47,10 @@ func NginxHttp3Test(s *NoTopoSuite) {
curlCont := s.GetContainerByName("curl")
args := fmt.Sprintf("curl --noproxy '*' --local-port 55444 --http3-only -k https://%s:8443/%s", serverAddress, query)
curlCont.ExtraRunningArgs = args
- o, err := curlCont.CombinedOutput()
+ curlCont.Run()
+ o, err := curlCont.GetOutput()
s.Log(o)
- s.AssertNil(err, fmt.Sprint(err))
+ s.AssertEmpty(err)
s.AssertContains(o, "<http>", "<http> not found in the result!")
}
func NginxAsServerTest(s *NoTopoSuite) {
@@ -57,7 +58,7 @@ func NginxAsServerTest(s *NoTopoSuite) {
finished := make(chan error, 1)
nginxCont := s.GetContainerByName("nginx")
- s.AssertNil(nginxCont.Run())
+ nginxCont.Run()
vpp := s.GetContainerByName("vpp").VppInstance
vpp.WaitForApp("nginx-", 5)
@@ -91,7 +92,7 @@ func runNginxPerf(s *NoTopoSuite, mode, ab_or_wrk string) error {
vpp := s.GetContainerByName("vpp").VppInstance
nginxCont := s.GetContainerByName(SingleTopoContainerNginx)
- s.AssertNil(nginxCont.Run())
+ nginxCont.Run()
vpp.WaitForApp("nginx-", 5)
if ab_or_wrk == "ab" {
@@ -106,21 +107,23 @@ func runNginxPerf(s *NoTopoSuite, mode, ab_or_wrk string) error {
args += " -r"
args += " http://" + serverAddress + ":80/64B.json"
abCont.ExtraRunningArgs = args
- o, err := abCont.CombinedOutput()
+ abCont.Run()
+ o, err := abCont.GetOutput()
rps := parseString(o, "Requests per second:")
s.Log(rps)
- s.Log(err)
- s.AssertNil(err, "err: '%s', output: '%s'", err, o)
+ s.AssertContains(err, "Finished "+fmt.Sprint(nRequests))
} else {
wrkCont := s.GetContainerByName("wrk")
args := fmt.Sprintf("-c %d -t 2 -d 30 http://%s:80/64B.json", nClients,
serverAddress)
wrkCont.ExtraRunningArgs = args
- o, err := wrkCont.CombinedOutput()
+ wrkCont.Run()
+ s.Log("Please wait for 30s, test is running.")
+ o, err := wrkCont.GetOutput()
rps := parseString(o, "requests")
s.Log(rps)
s.Log(err)
- s.AssertNil(err, "err: '%s', output: '%s'", err, o)
+ s.AssertEmpty(err, "err: '%s', output: '%s'", err, o)
}
return nil
}