summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/echo_test.go
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2023-09-04 14:17:52 +0200
committerFlorin Coras <florin.coras@gmail.com>2023-10-26 16:32:17 +0000
commitefe875e7cd4bbdf0d55374c7a49577f02a92a3fd (patch)
tree966ef834d31d1a6f4900de11bbb5b15aaaab899c /extras/hs-test/echo_test.go
parent4d05f069a3be308f7fbd8cf043d6ac4266861fa2 (diff)
hsa: unify echo test setup
Type: test Change-Id: I8665492c2f7755901a428aacdb27e98329ff557a Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'extras/hs-test/echo_test.go')
-rw-r--r--extras/hs-test/echo_test.go35
1 files changed, 31 insertions, 4 deletions
diff --git a/extras/hs-test/echo_test.go b/extras/hs-test/echo_test.go
index a9391af8193..fc221aa9ab5 100644
--- a/extras/hs-test/echo_test.go
+++ b/extras/hs-test/echo_test.go
@@ -5,13 +5,40 @@ func (s *VethsSuite) TestEchoBuiltin() {
serverVeth := s.netInterfaces["vppsrv"]
serverVpp.vppctl("test echo server " +
- " private-segment-size 1g fifo-size 4 no-echo" +
" uri tcp://" + serverVeth.ip4AddressString() + "/1234")
clientVpp := s.getContainerByName("client-vpp").vppInstance
- o := clientVpp.vppctl("test echo client nclients 10000 bytes 1" +
- " syn-timeout 100 test-timeout 100 no-return private-segment-size 1g" +
- " fifo-size 4 uri tcp://" + serverVeth.ip4AddressString() + "/1234")
+ o := clientVpp.vppctl("test echo client nclients 100 bytes 1 verbose" +
+ " syn-timeout 100 test-timeout 100" +
+ " uri tcp://" + serverVeth.ip4AddressString() + "/1234")
s.log(o)
+ s.assertNotContains(o, "failed:")
+}
+
+func (s *VethsSuite) TestTcpWithLoss() {
+ serverVpp := s.getContainerByName("server-vpp").vppInstance
+
+ serverVeth := s.netInterfaces[serverInterfaceName]
+ serverVpp.vppctl("test echo server uri tcp://%s/20022",
+ serverVeth.ip4AddressString())
+
+ clientVpp := s.getContainerByName("client-vpp").vppInstance
+
+ // Ensure that VPP doesn't abort itself with NSIM enabled
+ // Warning: Removing this ping will make the test fail!
+ clientVpp.vppctl("ping %s", serverVeth.ip4AddressString())
+
+ // Add loss of packets with Network Delay Simulator
+ clientVpp.vppctl("set nsim poll-main-thread delay 0.01 ms bandwidth 40 gbit" +
+ " packet-size 1400 packets-per-drop 1000")
+
+ clientVpp.vppctl("nsim output-feature enable-disable host-vppcln")
+
+ // Do echo test from client-vpp container
+ output := clientVpp.vppctl("test echo client uri tcp://%s/20022 verbose echo-bytes mbytes 50",
+ serverVeth.ip4AddressString())
+ s.log(output)
+ s.assertNotEqual(len(output), 0)
+ s.assertNotContains(output, "failed: timeout")
}