blob: cf74c62cd3ea0b9a08170530572c451f15449a1f [file] [log] [blame]
Filip Tehlar71fc1942023-05-22 15:48:51 +02001package main
2
Adrian Villincee15aa2024-03-14 11:42:55 -04003func init() {
4 registerVethTests(VppEchoQuicTest, VppEchoTcpTest, VppEchoUdpTest)
5}
6
7func VppEchoQuicTest(s *VethsSuite) {
Filip Tehlar71fc1942023-05-22 15:48:51 +02008 s.testVppEcho("quic")
9}
10
Filip Tehlar94181432024-01-15 13:11:28 +010011// udp echo currently broken in vpp, skipping
Adrian Villincee15aa2024-03-14 11:42:55 -040012func VppEchoUdpTest(s *VethsSuite) {
13 s.skip("Broken")
Filip Tehlar71fc1942023-05-22 15:48:51 +020014 s.testVppEcho("udp")
15}
16
Adrian Villincee15aa2024-03-14 11:42:55 -040017func VppEchoTcpTest(s *VethsSuite) {
Filip Tehlar71fc1942023-05-22 15:48:51 +020018 s.testVppEcho("tcp")
19}
20
21func (s *VethsSuite) testVppEcho(proto string) {
adrianvillin28bd8f02024-02-13 06:00:02 -050022 serverVethAddress := s.getInterfaceByName(serverInterfaceName).ip4AddressString()
Filip Tehlar71fc1942023-05-22 15:48:51 +020023 uri := proto + "://" + serverVethAddress + "/12344"
24
25 echoSrvContainer := s.getContainerByName("server-app")
26 serverCommand := "vpp_echo server TX=RX" +
Filip Tehlar5ebdd512023-12-14 13:06:54 +010027 " socket-name " + echoSrvContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
Filip Tehlar71fc1942023-05-22 15:48:51 +020028 " use-app-socket-api" +
29 " uri " + uri
30 s.log(serverCommand)
31 echoSrvContainer.execServer(serverCommand)
32
33 echoClnContainer := s.getContainerByName("client-app")
34
35 clientCommand := "vpp_echo client" +
Filip Tehlar5ebdd512023-12-14 13:06:54 +010036 " socket-name " + echoClnContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
Filip Tehlar71fc1942023-05-22 15:48:51 +020037 " use-app-socket-api uri " + uri
38 s.log(clientCommand)
39 o := echoClnContainer.exec(clientCommand)
40 s.log(o)
41}