7 func (s *VethsSuite) TestVclEchoQuic() {
8 s.skip("quic test skipping..")
12 func (s *VethsSuite) TestVclEchoUdp() {
13 s.skip("udp echo currently broken in vpp, skipping..")
17 func (s *VethsSuite) TestVclEchoTcp() {
21 func (s *VethsSuite) testVclEcho(proto string) {
22 srvVppContainer := s.getContainerByName("server-vpp")
24 _, err := srvVppContainer.execAction("Configure2Veths srv")
27 clnVppContainer := s.getContainerByName("client-vpp")
29 _, err = clnVppContainer.execAction("Configure2Veths cln")
32 echoSrvContainer := s.getContainerByName("server-application")
35 _, err = echoSrvContainer.execAction("RunEchoServer " + proto)
38 echoClnContainer := s.getContainerByName("client-application")
40 o, err := echoClnContainer.execAction("RunEchoClient " + proto)
46 func (s *VethsSuite) TestVclRetryAttach() {
48 s.testRetryAttach("tcp")
51 func (s *VethsSuite) testRetryAttach(proto string) {
52 srvVppContainer := s.getContainerByName("server-vpp")
54 _, err := srvVppContainer.execAction("Configure2Veths srv-with-preset-hw-addr")
57 clnVppContainer := s.getContainerByName("client-vpp")
59 _, err = clnVppContainer.execAction("Configure2Veths cln")
62 echoSrvContainer := s.getContainerByName("server-application")
63 _, err = echoSrvContainer.execAction("RunVclEchoServer " + proto)
66 s.log("This whole test case can take around 3 minutes to run. Please be patient.")
67 s.log("... Running first echo client test, before disconnect.")
68 echoClnContainer := s.getContainerByName("client-application")
69 _, err = echoClnContainer.execAction("RunVclEchoClient " + proto)
71 s.log("... First test ended. Stopping VPP server now.")
73 // Stop server-vpp-instance, start it again and then run vcl-test-client once more
74 stopVppCommand := "/bin/bash -c 'ps -C vpp_main -o pid= | xargs kill -9'"
75 _, err = srvVppContainer.exec(stopVppCommand)
77 time.Sleep(5 * time.Second) // Give parent process time to reap the killed child process
78 stopVppCommand = "/bin/bash -c 'ps -C hs-test -o pid= | xargs kill -9'"
79 _, err = srvVppContainer.exec(stopVppCommand)
81 _, err = srvVppContainer.execAction("Configure2Veths srv-with-preset-hw-addr")
84 s.log("... VPP server is starting again, so waiting for a bit.")
85 time.Sleep(30 * time.Second) // Wait a moment for the re-attachment to happen
87 s.log("... Running second echo client test, after disconnect and re-attachment.")
88 _, err = echoClnContainer.execAction("RunVclEchoClient " + proto)
93 func (s *VethsSuite) TestTcpWithLoss() {
94 serverContainer := s.getContainerByName("server-vpp")
96 serverVpp := NewVppInstance(serverContainer)
97 s.assertNotNil(serverVpp)
98 serverVpp.set2VethsServer()
99 err := serverVpp.start()
100 s.assertNil(err, "starting VPP failed")
102 _, err = serverVpp.vppctl("test echo server uri tcp://10.10.10.1/20022")
103 s.assertNil(err, "starting echo server failed")
105 clientContainer := s.getContainerByName("client-vpp")
107 clientVpp := NewVppInstance(clientContainer)
108 s.assertNotNil(clientVpp)
109 clientVpp.set2VethsClient()
110 err = clientVpp.start()
111 s.assertNil(err, "starting VPP failed")
113 // Ensure that VPP doesn't abort itself with NSIM enabled
114 // Warning: Removing this ping will make the test fail!
115 _, err = serverVpp.vppctl("ping 10.10.10.2")
116 s.assertNil(err, "ping failed")
118 // Add loss of packets with Network Delay Simulator
119 _, err = clientVpp.vppctl("set nsim poll-main-thread delay 0.01 ms bandwidth 40 gbit packet-size 1400 packets-per-drop 1000")
120 s.assertNil(err, "configuring NSIM failed")
121 _, err = clientVpp.vppctl("nsim output-feature enable-disable host-vppcln")
122 s.assertNil(err, "enabling NSIM failed")
124 // Do echo test from client-vpp container
125 output, err := clientVpp.vppctl("test echo client uri tcp://10.10.10.1/20022 mbytes 50")
127 s.assertEqual(true, len(output) != 0)
128 s.assertNotContains(output, "failed: timeout")