diff options
author | 2024-11-21 12:21:24 +0100 | |
---|---|---|
committer | 2024-11-21 19:03:12 +0000 | |
commit | ff36307b5b9ce6e3d1d56aff8b6c6097ab1e0b6d (patch) | |
tree | b0482703d22a14d19e37b59ad8b7f05dff35961b /extras/hs-test | |
parent | ca9747a73f40a3a836c3078fe93afe208f6db39a (diff) |
hs-test: added tls tcp iperf test
Type: test
Change-Id: I7ed1a6dea644eb19b8022db07344503121e61517
Signed-off-by: Adrian Villin <avillin@cisco.com>
Diffstat (limited to 'extras/hs-test')
-rw-r--r-- | extras/hs-test/infra/utils.go | 1 | ||||
-rw-r--r-- | extras/hs-test/ldp_test.go | 27 |
2 files changed, 23 insertions, 5 deletions
diff --git a/extras/hs-test/infra/utils.go b/extras/hs-test/infra/utils.go index 30abb6ac715..761fc178914 100644 --- a/extras/hs-test/infra/utils.go +++ b/extras/hs-test/infra/utils.go @@ -303,6 +303,7 @@ func (s *HstSuite) StartClientApp(c *Container, cmd string, o, err := cmd2.CombinedOutput() if err != nil { s.Log(err) + s.Log(string(o)) if nTries > 5 { clnRes <- "" clnCh <- fmt.Errorf("failed to start client app '%s'", err) diff --git a/extras/hs-test/ldp_test.go b/extras/hs-test/ldp_test.go index e72fac4fbba..deba2141d08 100644 --- a/extras/hs-test/ldp_test.go +++ b/extras/hs-test/ldp_test.go @@ -9,17 +9,35 @@ import ( ) func init() { - RegisterLdpTests(LDPreloadIperfVppTest, LDPreloadIperfVppInterruptModeTest, RedisBenchmarkTest) + RegisterLdpTests(LDPreloadIperfVppTest, LDPreloadIperfVppInterruptModeTest, RedisBenchmarkTest, LDPreloadIperfTlsTcpTest) } func LDPreloadIperfVppInterruptModeTest(s *LdpSuite) { - LDPreloadIperfVppTest(s) + ldPreloadIperfVpp(s, true) +} + +func LDPreloadIperfTlsTcpTest(s *LdpSuite) { + for _, c := range s.Containers { + c.Exec(false, "openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.key -out crt.crt -subj \"/CN=test\"") + c.AddEnvVar("LDP_TRANSPARENT_TLS", "1") + c.AddEnvVar("LDP_TLS_CERT_FILE", "/crt.crt") + c.AddEnvVar("LDP_TLS_KEY_FILE", "/key.key") + } + ldPreloadIperfVpp(s, false) } func LDPreloadIperfVppTest(s *LdpSuite) { + ldPreloadIperfVpp(s, true) +} + +func ldPreloadIperfVpp(s *LdpSuite, useUdp bool) { + protocol := "" + if useUdp { + protocol = " -u " + } clientContainer := s.GetContainerByName("client-vpp") serverContainer := s.GetContainerByName("server-vpp") - + serverVethAddress := s.GetInterfaceByName(ServerInterfaceName).Ip4AddressString() stopServerCh := make(chan struct{}, 1) srvCh := make(chan error, 1) clnCh := make(chan error) @@ -38,10 +56,9 @@ func LDPreloadIperfVppTest(s *LdpSuite) { err := <-srvCh s.AssertNil(err, fmt.Sprint(err)) - serverVethAddress := s.GetInterfaceByName(ServerInterfaceName).Ip4AddressString() go func() { defer GinkgoRecover() - cmd := "iperf3 -c " + serverVethAddress + " -u -l 1460 -b 10g -p " + s.GetPortFromPpid() + cmd := "iperf3 -c " + serverVethAddress + " -l 1460 -b 10g -p " + s.GetPortFromPpid() + protocol s.StartClientApp(clientContainer, cmd, clnCh, clnRes) }() |