4 registerVethTests(EchoBuiltinTest)
5 registerSoloVethTests(TcpWithLossTest)
8 func EchoBuiltinTest(s *VethsSuite) {
9 serverVpp := s.getContainerByName("server-vpp").vppInstance
10 serverVeth := s.getInterfaceByName(serverInterfaceName)
12 serverVpp.vppctl("test echo server " +
13 " uri tcp://" + serverVeth.ip4AddressString() + "/1234")
15 clientVpp := s.getContainerByName("client-vpp").vppInstance
17 o := clientVpp.vppctl("test echo client nclients 100 bytes 1 verbose" +
18 " syn-timeout 100 test-timeout 100" +
19 " uri tcp://" + serverVeth.ip4AddressString() + "/1234")
21 s.assertNotContains(o, "failed:")
24 func TcpWithLossTest(s *VethsSuite) {
25 serverVpp := s.getContainerByName("server-vpp").vppInstance
27 serverVeth := s.getInterfaceByName(serverInterfaceName)
28 serverVpp.vppctl("test echo server uri tcp://%s/20022",
29 serverVeth.ip4AddressString())
31 clientVpp := s.getContainerByName("client-vpp").vppInstance
33 // TODO: investigate why this ping was here:
35 // Ensure that VPP doesn't abort itself with NSIM enabled
36 // Warning: Removing this ping will make the test fail!
37 // clientVpp.vppctl("ping %s", serverVeth.ip4AddressString())
40 // Add loss of packets with Network Delay Simulator
41 clientVpp.vppctl("set nsim poll-main-thread delay 0.01 ms bandwidth 40 gbit" +
42 " packet-size 1400 packets-per-drop 1000")
44 clientVpp.vppctl("nsim output-feature enable-disable " + s.getInterfaceByName(clientInterfaceName).name)
46 // Do echo test from client-vpp container
47 output := clientVpp.vppctl("test echo client uri tcp://%s/20022 verbose echo-bytes mbytes 50",
48 serverVeth.ip4AddressString())
50 s.assertNotEqual(len(output), 0)
51 s.assertNotContains(output, "failed: timeout", output)