aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/raw_session_test.go
blob: 45c4278c470917c7f682a1f6f282f6d065541b33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main

func (s *VethsSuite) TestVppEchoQuic() {
	s.testVppEcho("quic")
}

// udp echo currently broken in vpp, skipping
func (s *VethsSuite) SkipTestVppEchoUdp() {
	s.testVppEcho("udp")
}

func (s *VethsSuite) TestVppEchoTcp() {
	s.testVppEcho("tcp")
}

func (s *VethsSuite) testVppEcho(proto string) {
	serverVethAddress := s.netInterfaces["vppsrv"].ip4AddressString()
	uri := proto + "://" + serverVethAddress + "/12344"

	echoSrvContainer := s.getContainerByName("server-app")
	serverCommand := "vpp_echo server TX=RX" +
		" socket-name " + echoSrvContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
		" use-app-socket-api" +
		" uri " + uri
	s.log(serverCommand)
	echoSrvContainer.execServer(serverCommand)

	echoClnContainer := s.getContainerByName("client-app")

	clientCommand := "vpp_echo client" +
		" socket-name " + echoClnContainer.getContainerWorkDir() + "/var/run/app_ns_sockets/default" +
		" use-app-socket-api uri " + uri
	s.log(clientCommand)
	o := echoClnContainer.exec(clientCommand)
	s.log(o)
}