summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/raw_session_test.go
diff options
context:
space:
mode:
authorAdrian Villin <avillin@cisco.com>2024-06-14 09:32:39 +0200
committerDave Wallace <dwallacelf@gmail.com>2024-06-14 18:10:26 +0000
commit4677d920c0b0ff1f1aae81fb2f0052d939a2e89c (patch)
tree9c1adf90f6c1a977b622c1d0211e0e86d1bef985 /extras/hs-test/raw_session_test.go
parent2aa0f0da5dedcf6301c74a39b5e3749359e07e6d (diff)
hs-test: separate infra from tests
- most functions and vars now start with a capital letter: needed to access them outside the package that declares them - updated README.md - very minor changes in MAKEFILE Type: test Change-Id: I4b5a194f08f09d59e372e57da6451fbb5a1de4da Signed-off-by: Adrian Villin <avillin@cisco.com>
Diffstat (limited to 'extras/hs-test/raw_session_test.go')
-rw-r--r--extras/hs-test/raw_session_test.go32
1 files changed, 17 insertions, 15 deletions
diff --git a/extras/hs-test/raw_session_test.go b/extras/hs-test/raw_session_test.go
index 5c66df0b1ce..438b7ba03a5 100644
--- a/extras/hs-test/raw_session_test.go
+++ b/extras/hs-test/raw_session_test.go
@@ -1,40 +1,42 @@
package main
+import . "fd.io/hs-test/infra"
+
func init() {
- registerVethTests(VppEchoQuicTest, VppEchoTcpTest)
+ RegisterVethTests(VppEchoQuicTest, VppEchoTcpTest)
}
func VppEchoQuicTest(s *VethsSuite) {
- s.testVppEcho("quic")
+ testVppEcho(s, "quic")
}
// TODO: udp echo currently broken in vpp
func VppEchoUdpTest(s *VethsSuite) {
- s.testVppEcho("udp")
+ testVppEcho(s, "udp")
}
func VppEchoTcpTest(s *VethsSuite) {
- s.testVppEcho("tcp")
+ testVppEcho(s, "tcp")
}
-func (s *VethsSuite) testVppEcho(proto string) {
- serverVethAddress := s.getInterfaceByName(serverInterfaceName).ip4AddressString()
+func testVppEcho(s *VethsSuite, proto string) {
+ serverVethAddress := s.GetInterfaceByName(ServerInterfaceName).Ip4AddressString()
uri := proto + "://" + serverVethAddress + "/12344"
- echoSrvContainer := s.getContainerByName("server-app")
+ echoSrvContainer := s.GetContainerByName("server-app")
serverCommand := "vpp_echo server TX=RX" +
- " socket-name " + echoSrvContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
+ " socket-name " + echoSrvContainer.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" +
" use-app-socket-api" +
" uri " + uri
- s.log(serverCommand)
- echoSrvContainer.execServer(serverCommand)
+ s.Log(serverCommand)
+ echoSrvContainer.ExecServer(serverCommand)
- echoClnContainer := s.getContainerByName("client-app")
+ echoClnContainer := s.GetContainerByName("client-app")
clientCommand := "vpp_echo client" +
- " socket-name " + echoClnContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
+ " socket-name " + echoClnContainer.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" +
" use-app-socket-api uri " + uri
- s.log(clientCommand)
- o := echoClnContainer.exec(clientCommand)
- s.log(o)
+ s.Log(clientCommand)
+ o := echoClnContainer.Exec(clientCommand)
+ s.Log(o)
}