vpp/extras/hs-test/raw_session_test.go
Adrian Villin 4677d920c0 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>
2024-06-14 18:10:26 +00:00

43 lines
1.1 KiB
Go

package main
import . "fd.io/hs-test/infra"
func init() {
RegisterVethTests(VppEchoQuicTest, VppEchoTcpTest)
}
func VppEchoQuicTest(s *VethsSuite) {
testVppEcho(s, "quic")
}
// TODO: udp echo currently broken in vpp
func VppEchoUdpTest(s *VethsSuite) {
testVppEcho(s, "udp")
}
func VppEchoTcpTest(s *VethsSuite) {
testVppEcho(s, "tcp")
}
func testVppEcho(s *VethsSuite, proto string) {
serverVethAddress := s.GetInterfaceByName(ServerInterfaceName).Ip4AddressString()
uri := proto + "://" + serverVethAddress + "/12344"
echoSrvContainer := s.GetContainerByName("server-app")
serverCommand := "vpp_echo server TX=RX" +
" socket-name " + echoSrvContainer.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" +
" use-app-socket-api" +
" uri " + uri
s.Log(serverCommand)
echoSrvContainer.ExecServer(serverCommand)
echoClnContainer := s.GetContainerByName("client-app")
clientCommand := "vpp_echo client" +
" 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)
}