summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-03-06 09:46:11 -0800
committerFlorin Coras <fcoras@cisco.com>2023-03-06 11:16:19 -0800
commit87767d82d77b75e8b7bc5da11c94f29cb035ed47 (patch)
tree644e2a07356d456885254f4d729cfac736a6bce8
parent2d3da8054bab654f36c26a04557c073b12594530 (diff)
hs-test: nginx mirroring test improvements
- avoid setting LD_PRELOAD for container - save nginx error log to shared volume - reduce test run time to 10s - add vcl and ldp debug env variables to docker file. Default to disabled. Type: test Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I401ac74e7c0ebe87befedb44150b04f773f244ea
-rw-r--r--extras/hs-test/docker/Dockerfile.nginx10
-rw-r--r--extras/hs-test/mirroring_test.go2
-rw-r--r--extras/hs-test/resources/nginx/nginx_proxy_mirroring.conf4
-rwxr-xr-xextras/hs-test/script/nginx_ldp.sh3
4 files changed, 14 insertions, 5 deletions
diff --git a/extras/hs-test/docker/Dockerfile.nginx b/extras/hs-test/docker/Dockerfile.nginx
index 56c6220b5ec..c426659905b 100644
--- a/extras/hs-test/docker/Dockerfile.nginx
+++ b/extras/hs-test/docker/Dockerfile.nginx
@@ -3,14 +3,18 @@ ARG UBUNTU_VERSION
FROM ubuntu:${UBUNTU_VERSION}
RUN apt-get update \
- && apt-get install -y nginx \
+ && apt-get install -y nginx gdb less \
&& rm -rf /var/lib/apt/lists/*
COPY vpp-data/lib/* /usr/lib/
COPY resources/nginx/vcl.conf /vcl.conf
COPY resources/nginx/nginx.conf /nginx.conf
+COPY script/nginx_ldp.sh /usr/bin/nginx_ldp.sh
ENV VCL_CONFIG=/vcl.conf
-ENV LD_PRELOAD=/usr/lib/libvcl_ldpreload.so
+ENV LDP=/usr/lib/libvcl_ldpreload.so
+ENV LDP_DEBUG=0
+ENV VCL_DEBUG=0
+ENV LDP_SID_BIT=8
-ENTRYPOINT ["nginx", "-c", "/nginx.conf"]
+ENTRYPOINT ["nginx_ldp.sh", "-c", "/nginx.conf"]
diff --git a/extras/hs-test/mirroring_test.go b/extras/hs-test/mirroring_test.go
index 97c6c8dbf45..6c42fe8f126 100644
--- a/extras/hs-test/mirroring_test.go
+++ b/extras/hs-test/mirroring_test.go
@@ -9,7 +9,7 @@ func (s *NginxSuite) TestMirroring() {
path := "/64B.json"
- testCommand := "wrk -c 20 -t 10 -d 40 http://" + proxyAddress + ":80" + path
+ testCommand := "wrk -c 20 -t 10 -d 10 http://" + proxyAddress + ":80" + path
s.log(testCommand)
o, _ := exechelper.Output(testCommand)
s.log(string(o))
diff --git a/extras/hs-test/resources/nginx/nginx_proxy_mirroring.conf b/extras/hs-test/resources/nginx/nginx_proxy_mirroring.conf
index bf15d1cdb7f..56debf5c290 100644
--- a/extras/hs-test/resources/nginx/nginx_proxy_mirroring.conf
+++ b/extras/hs-test/resources/nginx/nginx_proxy_mirroring.conf
@@ -1,8 +1,10 @@
-user root;
+master_process on;
worker_processes 4;
worker_rlimit_nofile 102400;
daemon off;
+error_log /tmp/nginx/error.log;
+
events {
use epoll;
worker_connections 102400;
diff --git a/extras/hs-test/script/nginx_ldp.sh b/extras/hs-test/script/nginx_ldp.sh
new file mode 100755
index 00000000000..90146f61443
--- /dev/null
+++ b/extras/hs-test/script/nginx_ldp.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+LD_PRELOAD=$LDP nginx $@ 2>&1 > /proc/1/fd/1