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) { |
Adrian Villin | af5fcbf | 2024-12-09 14:18:31 +0100 | [diff] [blame] | 23 | serverVethAddress := s.Interfaces.Server.Ip4AddressString() |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 24 | uri := proto + "://" + serverVethAddress + "/12344" |
| 25 | |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 26 | serverCommand := "vpp_echo server TX=RX" + |
Adrian Villin | af5fcbf | 2024-12-09 14:18:31 +0100 | [diff] [blame] | 27 | " socket-name " + s.Containers.ServerApp.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" + |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 28 | " use-app-socket-api" + |
| 29 | " uri " + uri |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 30 | s.Log(serverCommand) |
Adrian Villin | af5fcbf | 2024-12-09 14:18:31 +0100 | [diff] [blame] | 31 | s.Containers.ServerApp.ExecServer(true, serverCommand) |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 32 | |
| 33 | clientCommand := "vpp_echo client" + |
Adrian Villin | af5fcbf | 2024-12-09 14:18:31 +0100 | [diff] [blame] | 34 | " socket-name " + s.Containers.ClientApp.GetContainerWorkDir() + "/var/run/app_ns_sockets/default" + |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 35 | " use-app-socket-api uri " + uri |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 36 | s.Log(clientCommand) |
Adrian Villin | af5fcbf | 2024-12-09 14:18:31 +0100 | [diff] [blame] | 37 | o := s.Containers.ClientApp.Exec(true, clientCommand) |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 38 | s.Log(o) |
Filip Tehlar | 71fc194 | 2023-05-22 15:48:51 +0200 | [diff] [blame] | 39 | } |