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.HstSuite.SetupSuite()
18 s.loadNetworkTopology("2taps")
19 s.loadContainerTopology("nginxProxyAndServer")
22 func (s *NginxSuite) SetupTest() {
23 s.HstSuite.SetupTest()
25 // Setup test conditions
26 var sessionConfig Stanza
30 append("use-app-socket-api").close()
32 cpus := s.AllocateCpus()
34 vppProxyContainer := s.getContainerByName(vppProxyContainerName)
35 proxyVpp, _ := vppProxyContainer.newVppInstance(cpus, sessionConfig)
36 s.assertNil(proxyVpp.start())
38 clientInterface := s.netInterfaces[mirroringClientInterfaceName]
39 s.assertNil(proxyVpp.createTap(clientInterface, 1))
41 serverInterface := s.netInterfaces[mirroringServerInterfaceName]
42 s.assertNil(proxyVpp.createTap(serverInterface, 2))
44 nginxContainer := s.getTransientContainerByName(nginxProxyContainerName)
45 nginxContainer.create()
51 Proxy: clientInterface.peer.ip4AddressString(),
52 Server: serverInterface.ip4AddressString(),
54 nginxContainer.createConfig(
56 "./resources/nginx/nginx_proxy_mirroring.conf",
59 s.assertNil(nginxContainer.start())
61 proxyVpp.waitForApp("nginx-", 5)