aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/suite_nginx_test.go
diff options
context:
space:
mode:
authorMaros Ondrejicka <mondreji@cisco.com>2023-02-27 13:22:45 +0100
committerFlorin Coras <florin.coras@gmail.com>2023-02-28 18:27:17 +0000
commitc2f76f4590f57729d1bcf03bd816c10991431b18 (patch)
tree9ab0273c87c3f5ba21cf0ee8277f60f73e95f762 /extras/hs-test/suite_nginx_test.go
parentb0116a13dcc631d5128209dec867c3fb5209629d (diff)
hs-test: test vpp+nginx mirroring with tap ifaces
Type: test Signed-off-by: Maros Ondrejicka <mondreji@cisco.com> Change-Id: I05bbed8fd9d40929f040574044aed5292a475e91
Diffstat (limited to 'extras/hs-test/suite_nginx_test.go')
-rw-r--r--extras/hs-test/suite_nginx_test.go50
1 files changed, 50 insertions, 0 deletions
diff --git a/extras/hs-test/suite_nginx_test.go b/extras/hs-test/suite_nginx_test.go
new file mode 100644
index 00000000000..cd67efb6cc5
--- /dev/null
+++ b/extras/hs-test/suite_nginx_test.go
@@ -0,0 +1,50 @@
+package main
+
+const (
+ // These correspond to names used in yaml config
+ mirroringClientInterfaceName = "hst_client"
+ mirroringServerInterfaceName = "hst_server"
+ vppProxyContainerName = "vpp-proxy"
+ nginxProxyContainerName = "nginx-proxy"
+ nginxServerContainerName = "nginx-server"
+)
+
+type NginxSuite struct {
+ HstSuite
+}
+
+func (s *NginxSuite) SetupSuite() {
+ s.loadNetworkTopology("2taps")
+
+ s.loadContainerTopology("nginxProxyAndServer")
+}
+
+func (s *NginxSuite) SetupTest() {
+ s.SetupVolumes()
+ s.SetupContainers()
+
+ // Setup test conditions
+ var startupConfig Stanza
+ startupConfig.
+ NewStanza("session").
+ Append("enable").
+ Append("use-app-socket-api").Close()
+
+ // ... for proxy
+ vppProxyContainer := s.getContainerByName(vppProxyContainerName)
+ proxyVpp, _ := vppProxyContainer.newVppInstance(startupConfig)
+ proxyVpp.start()
+
+ clientInterface := s.netInterfaces[mirroringClientInterfaceName]
+ proxyVpp.createTap(clientInterface, 1)
+
+ serverInterface := s.netInterfaces[mirroringServerInterfaceName]
+ proxyVpp.createTap(serverInterface, 2)
+
+ nginxContainer := s.getTransientContainerByName(nginxProxyContainerName)
+ nginxContainer.create()
+ nginxContainer.copy("./resources/nginx/nginx_proxy_mirroring.conf", "/nginx.conf")
+ nginxContainer.start()
+
+ proxyVpp.waitForApp("-app", 5)
+}