From c2f76f4590f57729d1bcf03bd816c10991431b18 Mon Sep 17 00:00:00 2001 From: Maros Ondrejicka Date: Mon, 27 Feb 2023 13:22:45 +0100 Subject: hs-test: test vpp+nginx mirroring with tap ifaces Type: test Signed-off-by: Maros Ondrejicka Change-Id: I05bbed8fd9d40929f040574044aed5292a475e91 --- extras/hs-test/suite_nginx_test.go | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 extras/hs-test/suite_nginx_test.go (limited to 'extras/hs-test/suite_nginx_test.go') 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) +} -- cgit 1.2.3-korg