hs-test: use nginx 1.26.2 for NginxHttp3Test

- test is no longer marked as extended
- no building required -> removed nginx build scripts

Type: test

Change-Id: I1814b1e4b7e514f81797efa3b5c1e818d2fe4cda
Signed-off-by: Adrian Villin <avillin@cisco.com>
This commit is contained in:
Adrian Villin
2024-10-02 15:07:40 +02:00
committed by Florin Coras
parent 2c52f5e888
commit 7bae9b0e82
9 changed files with 46 additions and 47 deletions

View File

@@ -74,7 +74,6 @@ help:
@echo
@echo "'make build' arguments:"
@echo " UBUNTU_VERSION - ubuntu version for docker image"
@echo " HST_EXTENDED_TESTS - build extended tests"
@echo
@echo "'make test' arguments:"
@echo " PERSIST=[true|false] - whether clean up topology and dockers after test"

View File

@@ -3,16 +3,16 @@ ARG UBUNTU_VERSION
FROM ubuntu:${UBUNTU_VERSION}
RUN apt-get update \
&& apt-get install -y gcc git make autoconf libtool pkg-config cmake ninja-build golang \
&& rm -rf /var/lib/apt/lists/*
&& apt-get install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring libunwind-dev
RUN curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
| tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
RUN echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
| tee /etc/apt/sources.list.d/nginx.list
RUN bash -c 'echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
| tee /etc/apt/preferences.d/99nginx'
COPY script/build_boringssl.sh /build_boringssl.sh
RUN git clone https://boringssl.googlesource.com/boringssl
RUN ./build_boringssl.sh
COPY script/build_nginx.sh /build_nginx.sh
RUN git clone https://github.com/nginx/nginx
RUN ./build_nginx.sh
RUN apt update && apt install -y nginx=1.26.2-1~jammy
COPY vpp-data/lib/* /usr/lib/
COPY resources/nginx/vcl.conf /vcl.conf
@@ -27,4 +27,4 @@ ENV LDP_DEBUG=0
ENV VCL_DEBUG=0
ENV LDP_SID_BIT=8
ENTRYPOINT ["nginx_ldp.sh", "/usr/local/nginx/sbin/nginx", "-c", "/nginx.conf"]
ENTRYPOINT ["nginx_ldp.sh", "nginx", "-c", "/nginx.conf"]

View File

@@ -338,20 +338,6 @@ func (s *HstSuite) SkipIfNotEnoughAvailableCpus() bool {
return true
}
func (s *HstSuite) SkipUnlessExtendedTestsBuilt() {
imageName := "hs-test/nginx-http3"
cmd := exec.Command("docker", "images", imageName)
byteOutput, err := cmd.CombinedOutput()
if err != nil {
s.Log("error while searching for docker image")
return
}
if !strings.Contains(string(byteOutput), imageName) {
s.Skip("extended tests not built")
}
}
func (s *HstSuite) SkipUnlessLeakCheck() {
if !*IsLeakCheck {
s.Skip("leak-check tests excluded")

View File

@@ -12,6 +12,7 @@ const (
SingleTopoContainerVpp = "vpp"
SingleTopoContainerNginx = "nginx"
TapInterfaceName = "htaphost"
NginxHttp3ContainerName = "nginx-http3"
)
var noTopoTests = map[string][]func(s *NoTopoSuite){}
@@ -60,6 +61,13 @@ func (s *NoTopoSuite) SetupTest() {
s.AssertNil(vpp.createTap(tapInterface), "failed to create tap interface")
}
func (s *NoTopoSuite) TearDownTest() {
if CurrentSpecReport().Failed() {
s.CollectNginxLogs(NginxHttp3ContainerName)
}
s.HstSuite.TearDownTest()
}
func (s *NoTopoSuite) VppAddr() string {
return s.GetInterfaceByName(TapInterfaceName).Peer.Ip4AddressString()
}
@@ -72,6 +80,19 @@ func (s *NoTopoSuite) HostAddr() string {
return s.GetInterfaceByName(TapInterfaceName).Ip4AddressString()
}
func (s *NoTopoSuite) CreateNginxConfig(container *Container) {
nginxSettings := struct {
LogPrefix string
}{
LogPrefix: container.Name,
}
container.CreateConfig(
"/nginx.conf",
"./resources/nginx/nginx_http3.conf",
nginxSettings,
)
}
var _ = Describe("NoTopoSuite", Ordered, ContinueOnFailure, func() {
var s NoTopoSuite
BeforeAll(func() {

View File

@@ -15,11 +15,11 @@ func init() {
}
func NginxHttp3Test(s *NoTopoSuite) {
s.SkipUnlessExtendedTestsBuilt()
query := "index.html"
nginxCont := s.GetContainerByName("nginx-http3")
nginxCont.Run()
nginxCont := s.GetContainerByName(NginxHttp3ContainerName)
nginxCont.Create()
s.CreateNginxConfig(nginxCont)
nginxCont.Start()
vpp := s.GetContainerByName("vpp").VppInstance
vpp.WaitForApp("nginx-", 5)
@@ -30,11 +30,14 @@ func NginxHttp3Test(s *NoTopoSuite) {
args := fmt.Sprintf("curl --noproxy '*' --local-port 55444 --http3-only -k https://%s:8443/%s", serverAddress, query)
curlCont.ExtraRunningArgs = args
curlCont.Run()
o, err := curlCont.GetOutput()
s.Log(o)
s.AssertEmpty(err)
s.AssertContains(o, "<http>", "<http> not found in the result!")
body, stats := curlCont.GetOutput()
s.Log(body)
s.Log(stats)
s.AssertNotContains(stats, "refused")
s.AssertContains(stats, "100")
s.AssertContains(body, "<http>", "<http> not found in the result!")
}
func NginxAsServerTest(s *NoTopoSuite) {
query := "return_ok"
finished := make(chan error, 1)

View File

@@ -2,6 +2,8 @@ master_process on;
worker_processes 2;
daemon off;
error_log /tmp/nginx/{{.LogPrefix}}-error.log info;
events {
use epoll;
accept_mutex off;
@@ -12,12 +14,11 @@ http {
quic_gso on;
quic_retry on;
access_log logs/access.log;
access_log /tmp/nginx/{{.LogPrefix}}-access.log;
keepalive_timeout 300s;
sendfile on;
server {
listen 0.0.0.0:8443 quic;
#listen 0.0.0.0:8443 ssl;
root /usr/share/nginx;
ssl_certificate /etc/nginx/ssl/localhost.crt;
ssl_certificate_key /etc/nginx/ssl/localhost.key;

View File

@@ -1,4 +0,0 @@
#!/bin/bash
cd boringssl || exit 1
cmake -GNinja -B build
ninja -C build

View File

@@ -85,9 +85,7 @@ docker_build hs-test/vpp vpp
docker_build hs-test/nginx-ldp nginx
docker_build hs-test/nginx-server nginx-server
docker_build hs-test/curl curl
if [ "$HST_EXTENDED_TESTS" = true ] ; then
docker_build hs-test/nginx-http3 nginx-http3
fi
docker_build hs-test/nginx-http3 nginx-http3
# cleanup detached images
images=$(docker images --filter "dangling=true" -q --no-trunc)

View File

@@ -1,5 +0,0 @@
#!/bin/bash
cd nginx || exit 1
./auto/configure --with-debug --with-http_v3_module --with-cc-opt="-I../boringssl/include" --with-ld-opt="-L../boringssl/build/ssl -L../boringssl/build/crypto" --without-http_rewrite_module --without-http_gzip_module
make
make install