2023-05-22 15:48:51 +02:00
|
|
|
package main
|
|
|
|
|
2024-06-14 09:32:39 +02:00
|
|
|
import . "fd.io/hs-test/infra"
|
|
|
|
|
2024-03-14 11:42:55 -04:00
|
|
|
func init() {
|
2024-06-14 09:32:39 +02:00
|
|
|
RegisterVethTests(VppEchoQuicTest, VppEchoTcpTest)
|
2024-03-14 11:42:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func VppEchoQuicTest(s *VethsSuite) {
|
2024-06-14 09:32:39 +02:00
|
|
|
testVppEcho(s, "quic")
|
2023-05-22 15:48:51 +02:00
|
|
|
}
|
|
|
|
|
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) {
|
2024-06-14 09:32:39 +02:00
|
|
|
testVppEcho(s, "udp")
|
2023-05-22 15:48:51 +02:00
|
|
|
}
|
|
|
|
|
2024-03-14 11:42:55 -04:00
|
|
|
func VppEchoTcpTest(s *VethsSuite) {
|
2024-06-14 09:32:39 +02:00
|
|
|
testVppEcho(s, "tcp")
|
2023-05-22 15:48:51 +02:00
|
|
|
}
|
|
|
|
|
2024-06-14 09:32:39 +02:00
|
|
|
func testVppEcho(s *VethsSuite, proto string) {
|
2024-12-09 14:18:31 +01:00
|
|
|
serverVethAddress := s.Interfaces.Server.Ip4AddressString()
|
2023-05-22 15:48:51 +02:00
|
|
|
uri := proto + "://" + serverVethAddress + "/12344"
|
|
|
|
|
|
|
|
serverCommand := "vpp_echo server TX=RX" +
|
2024-12-09 14:18:31 +01:00
|
|
|
" socket-name " + s.Containers.ServerApp.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" +
|
2023-05-22 15:48:51 +02:00
|
|
|
" use-app-socket-api" +
|
|
|
|
" uri " + uri
|
2024-06-14 09:32:39 +02:00
|
|
|
s.Log(serverCommand)
|
2024-12-09 14:18:31 +01:00
|
|
|
s.Containers.ServerApp.ExecServer(true, serverCommand)
|
2023-05-22 15:48:51 +02:00
|
|
|
|
|
|
|
clientCommand := "vpp_echo client" +
|
2024-12-09 14:18:31 +01:00
|
|
|
" socket-name " + s.Containers.ClientApp.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" +
|
2023-05-22 15:48:51 +02:00
|
|
|
" use-app-socket-api uri " + uri
|
2024-06-14 09:32:39 +02:00
|
|
|
s.Log(clientCommand)
|
2024-12-09 14:18:31 +01:00
|
|
|
o := s.Containers.ClientApp.Exec(true, clientCommand)
|
2024-06-14 09:32:39 +02:00
|
|
|
s.Log(o)
|
2023-05-22 15:48:51 +02:00
|
|
|
}
|