summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/http_test.go
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2024-05-02 11:17:15 +0200
committerMatus Fabian <matfabia@cisco.com>2024-05-03 08:17:16 +0200
commit616201abe273afb3712791f5b2b8799b5b01a58d (patch)
treebbed379a72a4bfc6d81603e43c8cb126c0196022 /extras/hs-test/http_test.go
parent7b3339efffb25eacea89d1fb7673bb3647e952f2 (diff)
http: fix http server in response
App name is used in HTTP response Server header. Type: fix Change-Id: Ie3b2d985dd7d554a0352f7e602891f878bebd031 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'extras/hs-test/http_test.go')
-rw-r--r--extras/hs-test/http_test.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/extras/hs-test/http_test.go b/extras/hs-test/http_test.go
index acd026d484f..fe12f5a2f65 100644
--- a/extras/hs-test/http_test.go
+++ b/extras/hs-test/http_test.go
@@ -13,7 +13,7 @@ func init() {
registerNsTests(HttpTpsTest)
registerVethTests(HttpCliTest)
registerNoTopoTests(NginxHttp3Test, NginxAsServerTest,
- NginxPerfCpsTest, NginxPerfRpsTest, NginxPerfWrkTest)
+ NginxPerfCpsTest, NginxPerfRpsTest, NginxPerfWrkTest, HeaderServerTest)
registerNoTopoSoloTests(HttpStaticPromTest)
}
@@ -91,6 +91,21 @@ func HttpStaticPromTest(s *NoTopoSuite) {
s.assertNil(err)
}
+func HeaderServerTest(s *NoTopoSuite) {
+ query := "show/version"
+ vpp := s.getContainerByName("vpp").vppInstance
+ serverAddress := s.getInterfaceByName(tapInterfaceName).peer.ip4AddressString()
+ vpp.vppctl("http cli server")
+
+ curlCont := s.getContainerByName("curl")
+ args := fmt.Sprintf("curl -i -s http://%s:80/%s", serverAddress, query)
+ curlCont.extraRunningArgs = args
+ o, err := curlCont.combinedOutput()
+ s.assertNil(err, fmt.Sprint(err))
+ s.log(o)
+ s.assertContains(o, "Server: http_cli_server")
+}
+
func NginxAsServerTest(s *NoTopoSuite) {
query := "return_ok"
finished := make(chan error, 1)