hs-test: run LDP iperf in app containers 77/43077/3
authorAdrian Villin <[email protected]>
Fri, 30 May 2025 09:07:29 +0000 (11:07 +0200)
committerFlorin Coras <[email protected]>
Sat, 31 May 2025 21:49:55 +0000 (17:49 -0400)
Type: test

Change-Id: I24b0556a8d530dbd487370b7113660a6ed455846
Signed-off-by: Adrian Villin <[email protected]>
extras/hs-test/infra/suite_ldp.go
extras/hs-test/ldp_test.go
extras/hs-test/topo-containers/2peerVethLdp.yaml [deleted file]

index d1df322..f97a79c 100644 (file)
@@ -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 {
index b42edab..8f9982a 100644 (file)
@@ -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 (file)
index bd6e63a..0000000
+++ /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