From 894f4f064d4d03b72638d1ba85ae9fab95b519ac Mon Sep 17 00:00:00 2001 From: Adrian Villin Date: Fri, 30 May 2025 11:07:29 +0200 Subject: [PATCH] hs-test: run LDP iperf in app containers Type: test Change-Id: I24b0556a8d530dbd487370b7113660a6ed455846 Signed-off-by: Adrian Villin --- extras/hs-test/infra/suite_ldp.go | 18 ++++++++---------- extras/hs-test/ldp_test.go | 14 +++++++------- extras/hs-test/topo-containers/2peerVethLdp.yaml | 18 ------------------ 3 files changed, 15 insertions(+), 35 deletions(-) delete mode 100644 extras/hs-test/topo-containers/2peerVethLdp.yaml diff --git a/extras/hs-test/infra/suite_ldp.go b/extras/hs-test/infra/suite_ldp.go index d1df3228144..f97a79c1d5e 100644 --- a/extras/hs-test/infra/suite_ldp.go +++ b/extras/hs-test/infra/suite_ldp.go @@ -42,7 +42,7 @@ func (s *LdpSuite) SetupSuite() { time.Sleep(1 * time.Second) s.HstSuite.SetupSuite() s.ConfigureNetworkTopology("2peerVeth") - s.LoadContainerTopology("2peerVethLdp") + s.LoadContainerTopology("2peerVeth") s.Interfaces.Client = s.GetInterfaceByName("cln") s.Interfaces.Server = s.GetInterfaceByName("srv") s.Containers.ServerVpp = s.GetContainerByName("server-vpp") @@ -77,17 +77,15 @@ func (s *LdpSuite) SetupTest() { clientVpp, err := s.Containers.ClientVpp.newVppInstance(s.Containers.ClientVpp.AllocatedCpus, sessionConfig) s.AssertNotNil(clientVpp, fmt.Sprint(err)) - s.Containers.ServerVpp.AddEnvVar("VCL_CONFIG", s.Containers.ServerVpp.GetContainerWorkDir()+"/vcl.conf") - s.Containers.ClientVpp.AddEnvVar("VCL_CONFIG", s.Containers.ClientVpp.GetContainerWorkDir()+"/vcl.conf") - for _, container := range s.StartedContainers { + container.AddEnvVar("VCL_CONFIG", container.GetContainerWorkDir()+"/vcl.conf") container.AddEnvVar("LD_PRELOAD", "/usr/lib/libvcl_ldpreload.so") container.AddEnvVar("LDP_DEBUG", "0") container.AddEnvVar("VCL_DEBUG", "0") } - s.CreateVclConfig(s.Containers.ServerVpp) - s.CreateVclConfig(s.Containers.ClientVpp) + s.CreateVclConfig(s.Containers.ServerApp) + s.CreateVclConfig(s.Containers.ClientApp) s.SetupServerVpp(s.Containers.ServerVpp) s.setupClientVpp(s.Containers.ClientVpp) @@ -103,10 +101,10 @@ func (s *LdpSuite) SetupTest() { func (s *LdpSuite) TeardownTest() { if CurrentSpecReport().Failed() { - s.CollectIperfLogs(s.Containers.ServerVpp) - s.CollectRedisServerLogs(s.Containers.ServerVpp) - s.Log(s.Containers.ServerVpp.VppInstance.Vppctl("show error")) - s.Log(s.Containers.ClientVpp.VppInstance.Vppctl("show error")) + s.CollectIperfLogs(s.Containers.ServerApp) + s.CollectRedisServerLogs(s.Containers.ServerApp) + s.Log(s.Containers.ServerApp.VppInstance.Vppctl("show error")) + s.Log(s.Containers.ServerApp.VppInstance.Vppctl("show error")) } for _, container := range s.StartedContainers { diff --git a/extras/hs-test/ldp_test.go b/extras/hs-test/ldp_test.go index b42edabc647..8f9982a2aaa 100644 --- a/extras/hs-test/ldp_test.go +++ b/extras/hs-test/ldp_test.go @@ -36,10 +36,10 @@ func ldpIperfTcpReorder(s *LdpSuite, netInterface *NetInterface, extraIperfArgs o, err := cmd.CombinedOutput() s.AssertNil(err, string(o)) - delete(s.Containers.ClientVpp.EnvVars, "VCL_CONFIG") - delete(s.Containers.ClientVpp.EnvVars, "LD_PRELOAD") - delete(s.Containers.ClientVpp.EnvVars, "VCL_DEBUG") - delete(s.Containers.ClientVpp.EnvVars, "LDP_DEBUG") + delete(s.Containers.ClientApp.EnvVars, "VCL_CONFIG") + delete(s.Containers.ClientApp.EnvVars, "LD_PRELOAD") + delete(s.Containers.ClientApp.EnvVars, "VCL_DEBUG") + delete(s.Containers.ClientApp.EnvVars, "LDP_DEBUG") s.Containers.ClientVpp.VppInstance.Disconnect() s.Containers.ClientVpp.VppInstance.Stop() s.Containers.ClientVpp.Exec(false, "ip addr add dev %s %s", s.Interfaces.Client.Name(), s.Interfaces.Client.Ip4Address) @@ -97,8 +97,8 @@ func ldPreloadIperf(s *LdpSuite, extraClientArgs string) IPerfResult { go func() { defer GinkgoRecover() - cmd := "iperf3 -4 -s -p " + s.Ports.Port1 + " --logfile " + s.IperfLogFileName(s.Containers.ServerVpp) - s.StartServerApp(s.Containers.ServerVpp, "iperf3", cmd, srvCh, stopServerCh) + cmd := "iperf3 -4 -s -p " + s.Ports.Port1 + " --logfile " + s.IperfLogFileName(s.Containers.ServerApp) + s.StartServerApp(s.Containers.ServerApp, "iperf3", cmd, srvCh, stopServerCh) }() err := <-srvCh @@ -107,7 +107,7 @@ func ldPreloadIperf(s *LdpSuite, extraClientArgs string) IPerfResult { go func() { defer GinkgoRecover() cmd := "iperf3 -c " + serverVethAddress + " -l 1460 -b 10g -J -p " + s.Ports.Port1 + " " + extraClientArgs - s.StartClientApp(s.Containers.ClientVpp, cmd, clnCh, clnRes) + s.StartClientApp(s.Containers.ClientApp, cmd, clnCh, clnRes) }() s.AssertChannelClosed(time.Minute*4, clnCh) diff --git a/extras/hs-test/topo-containers/2peerVethLdp.yaml b/extras/hs-test/topo-containers/2peerVethLdp.yaml deleted file mode 100644 index bd6e63a945d..00000000000 --- a/extras/hs-test/topo-containers/2peerVethLdp.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -volumes: - - volume: &server-vol - host-dir: "$HST_VOLUME_DIR/server-share" - container-dir: "/tmp/server-share" - is-default-work-dir: true - - volume: &client-vol - host-dir: "$HST_VOLUME_DIR/client-share" - container-dir: "/tmp/client-share" - is-default-work-dir: true - -containers: - - name: "server-vpp" - volumes: - - <<: *server-vol - - name: "client-vpp" - volumes: - - <<: *client-vol -- 2.16.6