diff options
author | Matus Fabian <matfabia@cisco.com> | 2024-08-08 12:50:32 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2024-08-09 20:08:59 +0000 |
commit | d58177c50bb36a712c645fe8c13d126ebadbdc7f (patch) | |
tree | 00bfe91f7b98b9aa8b753123e5dc6883c2c4a676 /extras | |
parent | 0ce93ae744453139aa6a6ba8f55415c214f0d972 (diff) |
http: authority-form target parsing/serializing
Type: improvement
Change-Id: Ifb90818a3526d3d4030a66b1ef7eebedfe97978f
Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'extras')
-rw-r--r-- | extras/hs-test/http_test.go | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/extras/hs-test/http_test.go b/extras/hs-test/http_test.go index c45f7c2d57c..8f8946fa32e 100644 --- a/extras/hs-test/http_test.go +++ b/extras/hs-test/http_test.go @@ -29,7 +29,7 @@ func init() { HttpStaticMacTimeTest, HttpStaticBuildInUrlGetVersionVerboseTest, HttpVersionNotSupportedTest, HttpInvalidContentLengthTest, HttpInvalidTargetSyntaxTest, HttpStaticPathTraversalTest, HttpUriDecodeTest, HttpHeadersTest, HttpStaticFileHandlerTest, HttpClientTest, HttpClientErrRespTest, HttpClientPostFormTest, - HttpClientPostFileTest, HttpClientPostFilePtrTest) + HttpClientPostFileTest, HttpClientPostFilePtrTest, AuthorityFormTargetTest) RegisterNoTopoSoloTests(HttpStaticPromTest, HttpTpsTest, HttpTpsInterruptModeTest, PromConcurrentConnectionsTest, PromMemLeakTest, HttpClientPostMemLeakTest) } @@ -305,6 +305,26 @@ func HttpClientPostFilePtrTest(s *NoTopoSuite) { httpClientPostFile(s, true, 131072) } +func cliTestAuthority(s *NoTopoSuite, authority string) { + o := s.GetContainerByName("vpp").VppInstance.Vppctl("test http authority-form " + authority) + s.AssertNotContains(o, "error") + s.AssertContains(o, authority) +} + +func cliTestAuthorityError(s *NoTopoSuite, authority string) { + o := s.GetContainerByName("vpp").VppInstance.Vppctl("test http authority-form " + authority) + s.AssertContains(o, "error") +} + +func AuthorityFormTargetTest(s *NoTopoSuite) { + cliTestAuthority(s, "10.10.2.45:20") + cliTestAuthority(s, "[dead:beef::1234]:443") + cliTestAuthorityError(s, "example.com:80") + cliTestAuthorityError(s, "10.10.2.45") + cliTestAuthorityError(s, "1000.10.2.45:20") + cliTestAuthorityError(s, "[xyz0::1234]:443") +} + func HttpStaticPromTest(s *NoTopoSuite) { query := "stats.prom" vpp := s.GetContainerByName("vpp").VppInstance |