summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/ldp_test.go
diff options
context:
space:
mode:
authorMaros Ondrejicka <maros.ondrejicka@pantheon.tech>2023-02-02 08:58:04 +0100
committerFlorin Coras <florin.coras@gmail.com>2023-02-10 05:23:19 +0000
commit2908f8cf07c21f385f80d83fdad826a0eea98977 (patch)
tree6391c5b989f2a7800958489feb1d7f460a87e850 /extras/hs-test/ldp_test.go
parent0a192ea93df9d1cd4d7777bcc5418a2f9e861a6c (diff)
hs-test: refactor test cases from ns suite
This converts more tests to configure VPP from test context. Type: test Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech> Change-Id: Idf26b0c16f87e87c97b198412af39b99d947ced6
Diffstat (limited to 'extras/hs-test/ldp_test.go')
-rw-r--r--extras/hs-test/ldp_test.go27
1 files changed, 9 insertions, 18 deletions
diff --git a/extras/hs-test/ldp_test.go b/extras/hs-test/ldp_test.go
index cbba227c328..17f78ca4db3 100644
--- a/extras/hs-test/ldp_test.go
+++ b/extras/hs-test/ldp_test.go
@@ -3,17 +3,16 @@ package main
import (
"fmt"
"os"
- "time"
)
func (s *VethsSuite) TestLDPreloadIperfVpp() {
var clnVclConf, srvVclConf Stanza
serverContainer := s.getContainerByName("server-vpp")
- srvVcl := serverContainer.GetHostWorkDir() + "/vcl_srv.conf"
+ serverVclFileName := serverContainer.GetHostWorkDir() + "/vcl_srv.conf"
clientContainer := s.getContainerByName("client-vpp")
- clnVcl := clientContainer.GetHostWorkDir() + "/vcl_cln.conf"
+ clientVclFileName := clientContainer.GetHostWorkDir() + "/vcl_cln.conf"
ldpreload := os.Getenv("HST_LDPRELOAD")
s.assertNotEqual("", ldpreload)
@@ -26,15 +25,9 @@ func (s *VethsSuite) TestLDPreloadIperfVpp() {
s.log("starting VPPs")
- _, err := serverContainer.execAction("Configure2Veths srv")
- s.assertNil(err)
-
- _, err = clientContainer.execAction("Configure2Veths cln")
- s.assertNil(err)
-
clientAppSocketApi := fmt.Sprintf("app-socket-api %s/var/run/app_ns_sockets/2",
clientContainer.GetContainerWorkDir())
- err = clnVclConf.
+ err := clnVclConf.
NewStanza("vcl").
Append("rx-fifo-size 4000000").
Append("tx-fifo-size 4000000").
@@ -42,7 +35,7 @@ func (s *VethsSuite) TestLDPreloadIperfVpp() {
Append("app-scope-global").
Append("use-mq-eventfd").
Append(clientAppSocketApi).Close().
- SaveToFile(clnVcl)
+ SaveToFile(clientVclFileName)
s.assertNil(err)
serverAppSocketApi := fmt.Sprintf("app-socket-api %s/var/run/app_ns_sockets/1",
@@ -55,15 +48,12 @@ func (s *VethsSuite) TestLDPreloadIperfVpp() {
Append("app-scope-global").
Append("use-mq-eventfd").
Append(serverAppSocketApi).Close().
- SaveToFile(srvVcl)
+ SaveToFile(serverVclFileName)
s.assertNil(err)
s.log("attaching server to vpp")
- // FIXME
- time.Sleep(5 * time.Second)
-
- srvEnv := append(os.Environ(), ldpreload, "VCL_CONFIG="+srvVcl)
+ srvEnv := append(os.Environ(), ldpreload, "VCL_CONFIG="+serverVclFileName)
go StartServerApp(srvCh, stopServerCh, srvEnv)
err = <-srvCh
@@ -71,8 +61,9 @@ func (s *VethsSuite) TestLDPreloadIperfVpp() {
s.log("attaching client to vpp")
var clnRes = make(chan string, 1)
- clnEnv := append(os.Environ(), ldpreload, "VCL_CONFIG="+clnVcl)
- go StartClientApp(clnEnv, clnCh, clnRes)
+ clnEnv := append(os.Environ(), ldpreload, "VCL_CONFIG="+clientVclFileName)
+ serverVethAddress := s.netInterfaces[serverInterfaceName].Ip4AddressString()
+ go StartClientApp(serverVethAddress, clnEnv, clnCh, clnRes)
s.log(<-clnRes)
// wait for client's result