aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/ldp_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'extras/hs-test/ldp_test.go')
-rw-r--r--extras/hs-test/ldp_test.go31
1 files changed, 20 insertions, 11 deletions
diff --git a/extras/hs-test/ldp_test.go b/extras/hs-test/ldp_test.go
index 8d9168d3d5d..24d2de39485 100644
--- a/extras/hs-test/ldp_test.go
+++ b/extras/hs-test/ldp_test.go
@@ -3,9 +3,15 @@ package main
import (
"fmt"
"os"
+
+ . "github.com/onsi/ginkgo/v2"
)
-func (s *VethsSuite) TestLDPreloadIperfVpp() {
+func init() {
+ registerVethTests(LDPreloadIperfVppTest)
+}
+
+func LDPreloadIperfVppTest(s *VethsSuite) {
var clnVclConf, srvVclConf Stanza
serverContainer := s.getContainerByName("server-vpp")
@@ -14,10 +20,7 @@ func (s *VethsSuite) TestLDPreloadIperfVpp() {
clientContainer := s.getContainerByName("client-vpp")
clientVclFileName := clientContainer.getHostWorkDir() + "/vcl_cln.conf"
- ldpreload := os.Getenv("HST_LDPRELOAD")
- s.assertNotEqual("", ldpreload)
-
- ldpreload = "LD_PRELOAD=" + ldpreload
+ ldpreload := "LD_PRELOAD=../../build-root/build-vpp-native/vpp/lib/x86_64-linux-gnu/libvcl_ldpreload.so"
stopServerCh := make(chan struct{}, 1)
srvCh := make(chan error, 1)
@@ -36,7 +39,7 @@ func (s *VethsSuite) TestLDPreloadIperfVpp() {
append("use-mq-eventfd").
append(clientAppSocketApi).close().
saveToFile(clientVclFileName)
- s.assertNil(err, err)
+ s.assertNil(err, fmt.Sprint(err))
serverAppSocketApi := fmt.Sprintf("app-socket-api %s/var/run/app_ns_sockets/default",
serverContainer.getHostWorkDir())
@@ -49,26 +52,32 @@ func (s *VethsSuite) TestLDPreloadIperfVpp() {
append("use-mq-eventfd").
append(serverAppSocketApi).close().
saveToFile(serverVclFileName)
- s.assertNil(err, err)
+ s.assertNil(err, fmt.Sprint(err))
s.log("attaching server to vpp")
srvEnv := append(os.Environ(), ldpreload, "VCL_CONFIG="+serverVclFileName)
- go s.startServerApp(srvCh, stopServerCh, srvEnv)
+ go func() {
+ defer GinkgoRecover()
+ s.startServerApp(srvCh, stopServerCh, srvEnv)
+ }()
err = <-srvCh
- s.assertNil(err, err)
+ s.assertNil(err, fmt.Sprint(err))
s.log("attaching client to vpp")
var clnRes = make(chan string, 1)
clnEnv := append(os.Environ(), ldpreload, "VCL_CONFIG="+clientVclFileName)
serverVethAddress := s.getInterfaceByName(serverInterfaceName).ip4AddressString()
- go s.startClientApp(serverVethAddress, clnEnv, clnCh, clnRes)
+ go func() {
+ defer GinkgoRecover()
+ s.startClientApp(serverVethAddress, clnEnv, clnCh, clnRes)
+ }()
s.log(<-clnRes)
// wait for client's result
err = <-clnCh
- s.assertNil(err, err)
+ s.assertNil(err, fmt.Sprint(err))
// stop server
stopServerCh <- struct{}{}