summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/suite_nginx_test.go
diff options
context:
space:
mode:
authorMaros Ondrejicka <mondreji@cisco.com>2023-02-28 12:49:43 +0100
committerFlorin Coras <florin.coras@gmail.com>2023-02-28 22:13:21 +0000
commit85396a5488264690c7da2684742e4a5f38d192a7 (patch)
treed9afdf5bb8a7fd965adb2c3d4aa4111b7abb02d7 /extras/hs-test/suite_nginx_test.go
parent729b9c94f8222346a61c21d21a674bcb9b5974f8 (diff)
hs-test: fill configuration files at runtime
Treat certain configuration files, which contain runtime-dependent information, as templates. The information is filled at runtime and the files are copied into containers. This allows to avoid hard-coding IP addresses into configuration files. Type: test Signed-off-by: Maros Ondrejicka <mondreji@cisco.com> Change-Id: I1dae8f15f4f76c0bf1779d7c68b7f3859bf5a861
Diffstat (limited to 'extras/hs-test/suite_nginx_test.go')
-rw-r--r--extras/hs-test/suite_nginx_test.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/extras/hs-test/suite_nginx_test.go b/extras/hs-test/suite_nginx_test.go
index d950cf834b5..e66eca70d73 100644
--- a/extras/hs-test/suite_nginx_test.go
+++ b/extras/hs-test/suite_nginx_test.go
@@ -45,7 +45,19 @@ func (s *NginxSuite) SetupTest() {
nginxContainer := s.getTransientContainerByName(nginxProxyContainerName)
nginxContainer.create()
- nginxContainer.copy("./resources/nginx/nginx_proxy_mirroring.conf", "/nginx.conf")
+
+ values := struct {
+ Proxy string
+ Server string
+ }{
+ Proxy: clientInterface.Peer().IP4AddressString(),
+ Server: serverInterface.IP4AddressString(),
+ }
+ nginxContainer.createConfig(
+ "/nginx.conf",
+ "./resources/nginx/nginx_proxy_mirroring.conf",
+ values,
+ )
nginxContainer.start()
proxyVpp.waitForApp("-app", 5)