blob: cbf85a545307887faa2ccfce657435a06b696d61 [file] [log] [blame]
Filip Tehlar71fc1942023-05-22 15:48:51 +02001package main
2
Adrian Villin4677d922024-06-14 09:32:39 +02003import . "fd.io/hs-test/infra"
4
Adrian Villincee15aa2024-03-14 11:42:55 -04005func init() {
Adrian Villin4677d922024-06-14 09:32:39 +02006 RegisterVethTests(VppEchoQuicTest, VppEchoTcpTest)
Adrian Villincee15aa2024-03-14 11:42:55 -04007}
8
9func VppEchoQuicTest(s *VethsSuite) {
Adrian Villin4677d922024-06-14 09:32:39 +020010 testVppEcho(s, "quic")
Filip Tehlar71fc1942023-05-22 15:48:51 +020011}
12
Adrian Villin637edda2024-05-06 06:55:34 -040013// TODO: udp echo currently broken in vpp
Adrian Villincee15aa2024-03-14 11:42:55 -040014func VppEchoUdpTest(s *VethsSuite) {
Adrian Villin4677d922024-06-14 09:32:39 +020015 testVppEcho(s, "udp")
Filip Tehlar71fc1942023-05-22 15:48:51 +020016}
17
Adrian Villincee15aa2024-03-14 11:42:55 -040018func VppEchoTcpTest(s *VethsSuite) {
Adrian Villin4677d922024-06-14 09:32:39 +020019 testVppEcho(s, "tcp")
Filip Tehlar71fc1942023-05-22 15:48:51 +020020}
21
Adrian Villin4677d922024-06-14 09:32:39 +020022func testVppEcho(s *VethsSuite, proto string) {
Adrian Villinaf5fcbf2024-12-09 14:18:31 +010023 serverVethAddress := s.Interfaces.Server.Ip4AddressString()
Filip Tehlar71fc1942023-05-22 15:48:51 +020024 uri := proto + "://" + serverVethAddress + "/12344"
25
Filip Tehlar71fc1942023-05-22 15:48:51 +020026 serverCommand := "vpp_echo server TX=RX" +
Adrian Villinaf5fcbf2024-12-09 14:18:31 +010027 " socket-name " + s.Containers.ServerApp.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" +
Filip Tehlar71fc1942023-05-22 15:48:51 +020028 " use-app-socket-api" +
29 " uri " + uri
Adrian Villin4677d922024-06-14 09:32:39 +020030 s.Log(serverCommand)
Adrian Villinaf5fcbf2024-12-09 14:18:31 +010031 s.Containers.ServerApp.ExecServer(true, serverCommand)
Filip Tehlar71fc1942023-05-22 15:48:51 +020032
33 clientCommand := "vpp_echo client" +
Adrian Villinaf5fcbf2024-12-09 14:18:31 +010034 " socket-name " + s.Containers.ClientApp.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" +
Filip Tehlar71fc1942023-05-22 15:48:51 +020035 " use-app-socket-api uri " + uri
Adrian Villin4677d922024-06-14 09:32:39 +020036 s.Log(clientCommand)
Adrian Villinaf5fcbf2024-12-09 14:18:31 +010037 o := s.Containers.ClientApp.Exec(true, clientCommand)
Adrian Villin4677d922024-06-14 09:32:39 +020038 s.Log(o)
Filip Tehlar71fc1942023-05-22 15:48:51 +020039}