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
This commit is contained in:
Florin Coras
2023-03-06 09:46:11 -08:00
parent 2d3da8054b
commit 87767d82d7
4 changed files with 14 additions and 5 deletions

View File

@ -3,14 +3,18 @@ ARG UBUNTU_VERSION
FROM ubuntu:${UBUNTU_VERSION} FROM ubuntu:${UBUNTU_VERSION}
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y nginx \ && apt-get install -y nginx gdb less \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY vpp-data/lib/* /usr/lib/ COPY vpp-data/lib/* /usr/lib/
COPY resources/nginx/vcl.conf /vcl.conf COPY resources/nginx/vcl.conf /vcl.conf
COPY resources/nginx/nginx.conf /nginx.conf COPY resources/nginx/nginx.conf /nginx.conf
COPY script/nginx_ldp.sh /usr/bin/nginx_ldp.sh
ENV VCL_CONFIG=/vcl.conf 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"]

View File

@ -9,7 +9,7 @@ func (s *NginxSuite) TestMirroring() {
path := "/64B.json" 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) s.log(testCommand)
o, _ := exechelper.Output(testCommand) o, _ := exechelper.Output(testCommand)
s.log(string(o)) s.log(string(o))

View File

@ -1,8 +1,10 @@
user root; master_process on;
worker_processes 4; worker_processes 4;
worker_rlimit_nofile 102400; worker_rlimit_nofile 102400;
daemon off; daemon off;
error_log /tmp/nginx/error.log;
events { events {
use epoll; use epoll;
worker_connections 102400; worker_connections 102400;

View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
LD_PRELOAD=$LDP nginx $@ 2>&1 > /proc/1/fd/1