4 // These correspond to names used in yaml config
5 mirroringClientInterfaceName = "hst_client"
6 mirroringServerInterfaceName = "hst_server"
7 vppProxyContainerName = "vpp-proxy"
8 nginxProxyContainerName = "nginx-proxy"
9 nginxServerContainerName = "nginx-server"
12 type NginxSuite struct {
16 func (s *NginxSuite) SetupSuite() {
17 s.loadNetworkTopology("2taps")
19 s.loadContainerTopology("nginxProxyAndServer")
22 func (s *NginxSuite) SetupTest() {
23 s.skipIfUnconfiguring()
28 // Setup test conditions
29 var startupConfig Stanza
33 append("use-app-socket-api").close()
36 vppProxyContainer := s.getContainerByName(vppProxyContainerName)
37 proxyVpp, _ := vppProxyContainer.newVppInstance(startupConfig)
40 clientInterface := s.netInterfaces[mirroringClientInterfaceName]
41 proxyVpp.createTap(clientInterface, 1)
43 serverInterface := s.netInterfaces[mirroringServerInterfaceName]
44 proxyVpp.createTap(serverInterface, 2)
46 nginxContainer := s.getTransientContainerByName(nginxProxyContainerName)
47 nginxContainer.create()
53 Proxy: clientInterface.peer.ip4AddressString(),
54 Server: serverInterface.ip4AddressString(),
56 nginxContainer.createConfig(
58 "./resources/nginx/nginx_proxy_mirroring.conf",
61 nginxContainer.start()
63 proxyVpp.waitForApp("nginx-", 5)