aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/infra/suite_no_topo.go
diff options
context:
space:
mode:
authorAdrian Villin <avillin@cisco.com>2025-01-24 13:56:22 +0100
committerFlorin Coras <florin.coras@gmail.com>2025-02-11 20:14:07 +0000
commitc8174f3660d2577c3819b51d65a3f2836d8afe31 (patch)
treee7ee8aec9423fb1914b07c4680ee6d9d9f34231f /extras/hs-test/infra/suite_no_topo.go
parent29b1ece1d07477676e467e1b0f51987d47bd2997 (diff)
hsa: http client parallel sessions
- client is now able to use multiple workers to send requests (sometimes it uses multiple sessions on a single worker) Type: feature Change-Id: I2d83d47a9768011b3d8d05ed320852606841e4b8 Signed-off-by: Adrian Villin <avillin@cisco.com>
Diffstat (limited to 'extras/hs-test/infra/suite_no_topo.go')
-rw-r--r--extras/hs-test/infra/suite_no_topo.go37
1 files changed, 31 insertions, 6 deletions
diff --git a/extras/hs-test/infra/suite_no_topo.go b/extras/hs-test/infra/suite_no_topo.go
index 1c7b6fe91c3..d084413f7e6 100644
--- a/extras/hs-test/infra/suite_no_topo.go
+++ b/extras/hs-test/infra/suite_no_topo.go
@@ -18,13 +18,15 @@ type NoTopoSuite struct {
Tap *NetInterface
}
Containers struct {
- Vpp *Container
- Nginx *Container
- NginxHttp3 *Container
- Wrk *Container
- Curl *Container
- Ab *Container
+ Vpp *Container
+ Nginx *Container
+ NginxHttp3 *Container
+ NginxServer *Container
+ Wrk *Container
+ Curl *Container
+ Ab *Container
}
+ NginxServerPort string
}
func RegisterNoTopoTests(tests ...func(s *NoTopoSuite)) {
@@ -42,6 +44,7 @@ func (s *NoTopoSuite) SetupSuite() {
s.Containers.Vpp = s.GetContainerByName("vpp")
s.Containers.Nginx = s.GetContainerByName("nginx")
s.Containers.NginxHttp3 = s.GetContainerByName("nginx-http3")
+ s.Containers.NginxServer = s.GetTransientContainerByName("nginx-server")
s.Containers.Wrk = s.GetContainerByName("wrk")
s.Containers.Curl = s.GetContainerByName("curl")
s.Containers.Ab = s.GetContainerByName("ab")
@@ -101,6 +104,28 @@ func (s *NoTopoSuite) CreateNginxConfig(container *Container, multiThreadWorkers
)
}
+// Creates container and config.
+func (s *NoTopoSuite) CreateNginxServer() {
+ s.AssertNil(s.Containers.NginxServer.Create())
+ s.NginxServerPort = s.GetPortFromPpid()
+ nginxSettings := struct {
+ LogPrefix string
+ Address string
+ Port string
+ Timeout int
+ }{
+ LogPrefix: s.Containers.NginxServer.Name,
+ Address: s.Interfaces.Tap.Ip4AddressString(),
+ Port: s.NginxServerPort,
+ Timeout: 600,
+ }
+ s.Containers.NginxServer.CreateConfigFromTemplate(
+ "/nginx.conf",
+ "./resources/nginx/nginx_server.conf",
+ nginxSettings,
+ )
+}
+
func (s *NoTopoSuite) AddNginxVclConfig(multiThreadWorkers bool) {
vclFileName := s.Containers.Nginx.GetHostWorkDir() + "/vcl.conf"
appSocketApi := fmt.Sprintf("app-socket-api %s/var/run/app_ns_sockets/default",