From: Matus Fabian Date: Tue, 29 Jul 2025 15:26:24 +0000 (-0400) Subject: hs-test: nsim loss rate test X-Git-Tag: v26.02-rc0~137 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F43497%2F3;p=vpp.git hs-test: nsim loss rate test Type: test Change-Id: I592c755c7bdc5daf422655892b171c42f19e9a7c Signed-off-by: Matus Fabian --- diff --git a/extras/hs-test/nsim_test.go b/extras/hs-test/nsim_test.go new file mode 100644 index 00000000000..c47e83455e7 --- /dev/null +++ b/extras/hs-test/nsim_test.go @@ -0,0 +1,24 @@ +package main + +import ( + "strings" + + . "fd.io/hs-test/infra" +) + +func init() { + RegisterVethTests(NsimLossTest) +} +func NsimLossTest(s *VethsSuite) { + clientVpp := s.Containers.ClientVpp.VppInstance + + s.Log(clientVpp.Vppctl("set nsim poll-main-thread delay 0.01 ms bandwidth 40 gbit packet-size 1400 drop-fraction 0.1")) + s.Log(clientVpp.Vppctl("nsim output-feature enable-disable host-" + s.Interfaces.Client.Name())) + o := clientVpp.Vppctl("show nsim") + s.AssertNotContains(o, "nsim not enabled") + o = clientVpp.Vppctl("ping " + s.Interfaces.Server.Ip4AddressString() + " repeat 10000 interval 0.0001") + lines := strings.Split(o, "\n") + stats := lines[len(lines)-2] + s.Log(stats) + s.AssertContains(stats, "10% packet loss") +}