2023-05-22 15:48:51 +02:00
|
|
|
package main
|
|
|
|
|
2024-03-14 11:42:55 -04:00
|
|
|
func init() {
|
2024-05-06 06:55:34 -04:00
|
|
|
registerVethTests(VppEchoQuicTest, VppEchoTcpTest)
|
2024-03-14 11:42:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func VppEchoQuicTest(s *VethsSuite) {
|
2023-05-22 15:48:51 +02:00
|
|
|
s.testVppEcho("quic")
|
|
|
|
}
|
|
|
|
|
2024-05-06 06:55:34 -04:00
|
|
|
// TODO: udp echo currently broken in vpp
|
2024-03-14 11:42:55 -04:00
|
|
|
func VppEchoUdpTest(s *VethsSuite) {
|
2023-05-22 15:48:51 +02:00
|
|
|
s.testVppEcho("udp")
|
|
|
|
}
|
|
|
|
|
2024-03-14 11:42:55 -04:00
|
|
|
func VppEchoTcpTest(s *VethsSuite) {
|
2023-05-22 15:48:51 +02:00
|
|
|
s.testVppEcho("tcp")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *VethsSuite) testVppEcho(proto string) {
|
2024-02-13 06:00:02 -05:00
|
|
|
serverVethAddress := s.getInterfaceByName(serverInterfaceName).ip4AddressString()
|
2023-05-22 15:48:51 +02:00
|
|
|
uri := proto + "://" + serverVethAddress + "/12344"
|
|
|
|
|
|
|
|
echoSrvContainer := s.getContainerByName("server-app")
|
|
|
|
serverCommand := "vpp_echo server TX=RX" +
|
2023-12-14 13:06:54 +01:00
|
|
|
" socket-name " + echoSrvContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
|
2023-05-22 15:48:51 +02:00
|
|
|
" use-app-socket-api" +
|
|
|
|
" uri " + uri
|
|
|
|
s.log(serverCommand)
|
|
|
|
echoSrvContainer.execServer(serverCommand)
|
|
|
|
|
|
|
|
echoClnContainer := s.getContainerByName("client-app")
|
|
|
|
|
|
|
|
clientCommand := "vpp_echo client" +
|
2023-12-14 13:06:54 +01:00
|
|
|
" socket-name " + echoClnContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
|
2023-05-22 15:48:51 +02:00
|
|
|
" use-app-socket-api uri " + uri
|
|
|
|
s.log(clientCommand)
|
|
|
|
o := echoClnContainer.exec(clientCommand)
|
|
|
|
s.log(o)
|
|
|
|
}
|