Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 1 | package main |
| 2 | |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 3 | import . "fd.io/hs-test/infra" |
| 4 | |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 5 | func init() { |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 6 | RegisterVethTests(VppEchoQuicTest, VppEchoTcpTest) |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 7 | } |
| 8 | |
| 9 | func VppEchoQuicTest(s *VethsSuite) { |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 10 | testVppEcho(s, "quic") |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 11 | } |
| 12 | |
Adrian Villin | 637edda | 2024-05-06 06:55:34 -0400 | [diff] [blame] | 13 | // TODO: udp echo currently broken in vpp |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 14 | func VppEchoUdpTest(s *VethsSuite) { |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 15 | testVppEcho(s, "udp") |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 16 | } |
| 17 | |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 18 | func VppEchoTcpTest(s *VethsSuite) { |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 19 | testVppEcho(s, "tcp") |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 20 | } |
| 21 | |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 22 | func testVppEcho(s *VethsSuite, proto string) { |
| 23 | serverVethAddress := s.GetInterfaceByName(ServerInterfaceName).Ip4AddressString() |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 24 | uri := proto + "://" + serverVethAddress + "/12344" |
| 25 | |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 26 | echoSrvContainer := s.GetContainerByName("server-app") |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 27 | serverCommand := "vpp_echo server TX=RX" + |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 28 | " socket-name " + echoSrvContainer.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" + |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 29 | " use-app-socket-api" + |
| 30 | " uri " + uri |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 31 | s.Log(serverCommand) |
| 32 | echoSrvContainer.ExecServer(serverCommand) |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 33 | |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 34 | echoClnContainer := s.GetContainerByName("client-app") |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 35 | |
| 36 | clientCommand := "vpp_echo client" + |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 37 | " socket-name " + echoClnContainer.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" + |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 38 | " use-app-socket-api uri " + uri |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 39 | s.Log(clientCommand) |
| 40 | o := echoClnContainer.Exec(clientCommand) |
| 41 | s.Log(o) |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 42 | } |