hs-test: added interrupt mode tests

Type: test

Change-Id: I327fa1a4ea23a3af3aa33e5260367426a11e7b4f
Signed-off-by: Adrian Villin <avillin@cisco.com>
diff --git a/extras/hs-test/http_test.go b/extras/hs-test/http_test.go
index d83f2d1..68e2e65 100644
--- a/extras/hs-test/http_test.go
+++ b/extras/hs-test/http_test.go
@@ -17,7 +17,8 @@
 func init() {
 	RegisterVethTests(HttpCliTest, HttpCliConnectErrorTest)
 	RegisterNoTopoTests(NginxHttp3Test, NginxAsServerTest,
-		NginxPerfCpsTest, NginxPerfRpsTest, NginxPerfWrkTest, HeaderServerTest,
+		NginxPerfCpsTest, NginxPerfRpsTest, NginxPerfWrkTest, NginxPerfCpsInterruptModeTest,
+		NginxPerfRpsInterruptModeTest, NginxPerfWrkInterruptModeTest, HeaderServerTest,
 		HttpStaticMovedTest, HttpStaticNotFoundTest, HttpCliMethodNotAllowedTest,
 		HttpCliBadRequestTest, HttpStaticBuildInUrlGetIfStatsTest, HttpStaticBuildInUrlPostIfStatsTest,
 		HttpInvalidRequestLineTest, HttpMethodNotImplementedTest, HttpInvalidHeadersTest,
@@ -25,7 +26,7 @@
 		HttpStaticMacTimeTest, HttpStaticBuildInUrlGetVersionVerboseTest, HttpVersionNotSupportedTest,
 		HttpInvalidContentLengthTest, HttpInvalidTargetSyntaxTest, HttpStaticPathTraversalTest, HttpUriDecodeTest,
 		HttpHeadersTest)
-	RegisterNoTopoSoloTests(HttpStaticPromTest, HttpTpsTest)
+	RegisterNoTopoSoloTests(HttpStaticPromTest, HttpTpsTest, HttpTpsInterruptModeTest)
 }
 
 const wwwRootPath = "/tmp/www_root"
@@ -46,6 +47,10 @@
 	experiment.RecordValue("Download Speed", (float64(resp.ContentLength)/1024/1024)/duration.Seconds(), gmeasure.Units("MB/s"), gmeasure.Precision(2))
 }
 
+func HttpTpsInterruptModeTest(s *NoTopoSuite) {
+	HttpTpsTest(s)
+}
+
 func HttpTpsTest(s *NoTopoSuite) {
 	vpp := s.GetContainerByName("vpp").VppInstance
 	serverAddress := s.GetInterfaceByName(TapInterfaceName).Peer.Ip4AddressString()
@@ -635,16 +640,28 @@
 	return nil
 }
 
+func NginxPerfCpsInterruptModeTest(s *NoTopoSuite) {
+	NginxPerfCpsTest(s)
+}
+
 // unstable with multiple workers
 func NginxPerfCpsTest(s *NoTopoSuite) {
 	s.SkipIfMultiWorker()
 	s.AssertNil(runNginxPerf(s, "cps", "ab"))
 }
 
+func NginxPerfRpsInterruptModeTest(s *NoTopoSuite) {
+	NginxPerfRpsTest(s)
+}
+
 func NginxPerfRpsTest(s *NoTopoSuite) {
 	s.AssertNil(runNginxPerf(s, "rps", "ab"))
 }
 
+func NginxPerfWrkInterruptModeTest(s *NoTopoSuite) {
+	NginxPerfWrkTest(s)
+}
+
 func NginxPerfWrkTest(s *NoTopoSuite) {
 	s.AssertNil(runNginxPerf(s, "", "wrk"))
 }
diff --git a/extras/hs-test/infra/suite_nginx.go b/extras/hs-test/infra/suite_nginx.go
index f835262..bb1bdb0 100644
--- a/extras/hs-test/infra/suite_nginx.go
+++ b/extras/hs-test/infra/suite_nginx.go
@@ -45,7 +45,14 @@
 	sessionConfig.
 		NewStanza("session").
 		Append("enable").
-		Append("use-app-socket-api").Close()
+		Append("use-app-socket-api")
+
+	if strings.Contains(CurrentSpecReport().LeafNodeText, "InterruptMode") {
+		sessionConfig.Append("use-private-rx-mqs").Close()
+		s.Log("**********************INTERRUPT MODE**********************")
+	} else {
+		sessionConfig.Close()
+	}
 
 	// ... for proxy
 	vppProxyContainer := s.GetContainerByName(VppProxyContainerName)
diff --git a/extras/hs-test/infra/suite_no_topo.go b/extras/hs-test/infra/suite_no_topo.go
index c48e6fb..5f53f55 100644
--- a/extras/hs-test/infra/suite_no_topo.go
+++ b/extras/hs-test/infra/suite_no_topo.go
@@ -42,7 +42,14 @@
 	sessionConfig.
 		NewStanza("session").
 		Append("enable").
-		Append("use-app-socket-api").Close()
+		Append("use-app-socket-api")
+
+	if strings.Contains(CurrentSpecReport().LeafNodeText, "InterruptMode") {
+		sessionConfig.Append("use-private-rx-mqs").Close()
+		s.Log("**********************INTERRUPT MODE**********************")
+	} else {
+		sessionConfig.Close()
+	}
 
 	container := s.GetContainerByName(SingleTopoContainerVpp)
 	vpp, _ := container.newVppInstance(container.AllocatedCpus, sessionConfig)
diff --git a/extras/hs-test/infra/suite_ns.go b/extras/hs-test/infra/suite_ns.go
index d88730b..601ec22 100644
--- a/extras/hs-test/infra/suite_ns.go
+++ b/extras/hs-test/infra/suite_ns.go
@@ -45,7 +45,13 @@
 		Append("enable").
 		Append("use-app-socket-api").
 		Append("evt_qs_memfd_seg").
-		Append("event-queue-length 100000").Close()
+		Append("event-queue-length 100000")
+
+	if strings.Contains(CurrentSpecReport().LeafNodeText, "InterruptMode") {
+		sessionConfig.Append("use-private-rx-mqs").Close()
+	} else {
+		sessionConfig.Close()
+	}
 
 	container := s.GetContainerByName("vpp")
 	vpp, _ := container.newVppInstance(container.AllocatedCpus, sessionConfig)
diff --git a/extras/hs-test/infra/suite_veth.go b/extras/hs-test/infra/suite_veth.go
index d7bfa55..f7b1c3d 100644
--- a/extras/hs-test/infra/suite_veth.go
+++ b/extras/hs-test/infra/suite_veth.go
@@ -45,7 +45,14 @@
 	sessionConfig.
 		NewStanza("session").
 		Append("enable").
-		Append("use-app-socket-api").Close()
+		Append("use-app-socket-api")
+
+	if strings.Contains(CurrentSpecReport().LeafNodeText, "InterruptMode") {
+		sessionConfig.Append("use-private-rx-mqs").Close()
+		s.Log("**********************INTERRUPT MODE**********************")
+	} else {
+		sessionConfig.Close()
+	}
 
 	// ... For server
 	serverContainer := s.GetContainerByName("server-vpp")
diff --git a/extras/hs-test/ldp_test.go b/extras/hs-test/ldp_test.go
index 53043aa..e9e8bba 100644
--- a/extras/hs-test/ldp_test.go
+++ b/extras/hs-test/ldp_test.go
@@ -9,7 +9,11 @@
 )
 
 func init() {
-	RegisterVethTests(LDPreloadIperfVppTest)
+	RegisterVethTests(LDPreloadIperfVppTest, LDPreloadIperfVppInterruptModeTest)
+}
+
+func LDPreloadIperfVppInterruptModeTest(s *VethsSuite) {
+	LDPreloadIperfVppTest(s)
 }
 
 func LDPreloadIperfVppTest(s *VethsSuite) {