blob: 5c66df0b1ce25b03ca8478f9a5e2eab6e619286d [file] [log] [blame]
Filip Tehlar71fc1942023-05-22 15:48:51 +02001package main
2
Adrian Villincee15aa2024-03-14 11:42:55 -04003func init() {
Adrian Villin637edda2024-05-06 06:55:34 -04004 registerVethTests(VppEchoQuicTest, VppEchoTcpTest)
Adrian Villincee15aa2024-03-14 11:42:55 -04005}
6
7func VppEchoQuicTest(s *VethsSuite) {
Filip Tehlar71fc1942023-05-22 15:48:51 +02008 s.testVppEcho("quic")
9}
10
Adrian Villin637edda2024-05-06 06:55:34 -040011// TODO: udp echo currently broken in vpp
Adrian Villincee15aa2024-03-14 11:42:55 -040012func VppEchoUdpTest(s *VethsSuite) {
Filip Tehlar71fc1942023-05-22 15:48:51 +020013 s.testVppEcho("udp")
14}
15
Adrian Villincee15aa2024-03-14 11:42:55 -040016func VppEchoTcpTest(s *VethsSuite) {
Filip Tehlar71fc1942023-05-22 15:48:51 +020017 s.testVppEcho("tcp")
18}
19
20func (s *VethsSuite) testVppEcho(proto string) {
adrianvillin28bd8f02024-02-13 06:00:02 -050021 serverVethAddress := s.getInterfaceByName(serverInterfaceName).ip4AddressString()
Filip Tehlar71fc1942023-05-22 15:48:51 +020022 uri := proto + "://" + serverVethAddress + "/12344"
23
24 echoSrvContainer := s.getContainerByName("server-app")
25 serverCommand := "vpp_echo server TX=RX" +
Filip Tehlar5ebdd512023-12-14 13:06:54 +010026 " socket-name " + echoSrvContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
Filip Tehlar71fc1942023-05-22 15:48:51 +020027 " use-app-socket-api" +
28 " uri " + uri
29 s.log(serverCommand)
30 echoSrvContainer.execServer(serverCommand)
31
32 echoClnContainer := s.getContainerByName("client-app")
33
34 clientCommand := "vpp_echo client" +
Filip Tehlar5ebdd512023-12-14 13:06:54 +010035 " socket-name " + echoClnContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
Filip Tehlar71fc1942023-05-22 15:48:51 +020036 " use-app-socket-api uri " + uri
37 s.log(clientCommand)
38 o := echoClnContainer.exec(clientCommand)
39 s.log(o)
40}