From 31eaea9eef0594117e83733aa01f8bbda940e4da Mon Sep 17 00:00:00 2001 From: Filip Tehlar Date: Thu, 15 Jun 2023 10:06:57 +0200 Subject: hs-test: add nginx+quic test Type: test Change-Id: I15e4f2fb84cb4f34b6fea95978db000854a63e78 Signed-off-by: Filip Tehlar --- extras/hs-test/script/build.sh | 70 ----------------------------- extras/hs-test/script/build_boringssl.sh | 4 ++ extras/hs-test/script/build_curl.sh | 36 +++++++++++++++ extras/hs-test/script/build_hst.sh | 75 ++++++++++++++++++++++++++++++++ extras/hs-test/script/build_nginx.sh | 5 +++ extras/hs-test/script/nginx_ldp.sh | 2 +- 6 files changed, 121 insertions(+), 71 deletions(-) delete mode 100755 extras/hs-test/script/build.sh create mode 100755 extras/hs-test/script/build_boringssl.sh create mode 100755 extras/hs-test/script/build_curl.sh create mode 100755 extras/hs-test/script/build_hst.sh create mode 100755 extras/hs-test/script/build_nginx.sh (limited to 'extras/hs-test/script') diff --git a/extras/hs-test/script/build.sh b/extras/hs-test/script/build.sh deleted file mode 100755 index 398cdd71fc3..00000000000 --- a/extras/hs-test/script/build.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env bash - -if [ $(lsb_release -is) != Ubuntu ]; then - echo "Host stack test framework is supported only on Ubuntu" - exit 1 -fi - -if [ -z $(which ab) ]; then - echo "Host stack test framework requires apache2-utils to be installed" - echo "It is recommended to run 'sudo make install-dep'" - exit 1 -fi - -if [ -z $(which wrk) ]; then - echo "Host stack test framework requires wrk to be installed" - echo "It is recommended to run 'sudo make install-dep'" - exit 1 -fi - -export VPP_WS=../.. - -if [ "$1" == "debug" ]; then - VPP_BUILD_ROOT=${VPP_WS}/build-root/build-vpp_debug-native/vpp -else - VPP_BUILD_ROOT=${VPP_WS}/build-root/build-vpp-native/vpp -fi -echo "Taking build objects from ${VPP_BUILD_ROOT}" - -if [ -z "$UBUNTU_VERSION" ] ; then - export UBUNTU_VERSION=$(lsb_release -rs) -fi -echo "Ubuntu version is set to ${UBUNTU_VERSION}" - -export HST_LDPRELOAD=${VPP_BUILD_ROOT}/lib/x86_64-linux-gnu/libvcl_ldpreload.so -echo "HST_LDPRELOAD is set to ${HST_LDPRELOAD}" - -export PATH=${VPP_BUILD_ROOT}/bin:$PATH - -bin=vpp-data/bin -lib=vpp-data/lib - -mkdir -p ${bin} ${lib} || true -rm -rf vpp-data/bin/* || true -rm -rf vpp-data/lib/* || true - -cp ${VPP_BUILD_ROOT}/bin/* ${bin} -res+=$? -cp -r ${VPP_BUILD_ROOT}/lib/x86_64-linux-gnu/* ${lib} -res+=$? -if [ $res -ne 0 ]; then - echo "Failed to copy VPP files. Is VPP built? Try running 'make build' in VPP directory." - exit 1 -fi - -docker_build () { - tag=$1 - dockername=$2 - docker build --build-arg UBUNTU_VERSION --build-arg http_proxy=$HTTP_PROXY \ - -t $tag -f docker/Dockerfile.$dockername . -} - -docker_build hs-test/vpp vpp -docker_build hs-test/nginx-ldp nginx -docker_build hs-test/nginx-server nginx-server - -# cleanup detached images -images=$(docker images --filter "dangling=true" -q --no-trunc) -if [ "$images" != "" ]; then - docker rmi $images -fi diff --git a/extras/hs-test/script/build_boringssl.sh b/extras/hs-test/script/build_boringssl.sh new file mode 100755 index 00000000000..441878a77ca --- /dev/null +++ b/extras/hs-test/script/build_boringssl.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd boringssl +cmake -GNinja -B build +ninja -C build diff --git a/extras/hs-test/script/build_curl.sh b/extras/hs-test/script/build_curl.sh new file mode 100755 index 00000000000..ae675c270fe --- /dev/null +++ b/extras/hs-test/script/build_curl.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +dir1=/tmp/dir1 +dir2=/tmp/dir2 +dir3=/tmp/dir3 + +git clone --depth 1 -b openssl-3.0.9+quic https://github.com/quictls/openssl +cd openssl +echo "install path ${dir1}" +./config enable-tls1_3 --prefix=${dir1} +make +make install + +cd .. +git clone -b v0.12.0 https://github.com/ngtcp2/nghttp3 +cd nghttp3 +autoreconf -fi +./configure --prefix=${dir2} --enable-lib-only +make +make install + +cd .. +git clone -b v0.16.0 https://github.com/ngtcp2/ngtcp2 +cd ngtcp2 +autoreconf -fi +./configure PKG_CONFIG_PATH=${dir1}/lib64/pkgconfig:${dir2}/lib/pkgconfig LDFLAGS="-Wl,-rpath,${dir1}/lib64" --prefix=${dir3} --enable-lib-only +make +make install + +cd .. +git clone https://github.com/curl/curl +cd curl +autoreconf -fi +LDFLAGS="-Wl,-rpath,${dir1}/lib64" ./configure --with-openssl=${dir1} --with-nghttp3=${dir2} --with-ngtcp2=${dir3} +make +make install diff --git a/extras/hs-test/script/build_hst.sh b/extras/hs-test/script/build_hst.sh new file mode 100755 index 00000000000..0212e776aec --- /dev/null +++ b/extras/hs-test/script/build_hst.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash + +if [ $(lsb_release -is) != Ubuntu ]; then + echo "Host stack test framework is supported only on Ubuntu" + exit 1 +fi + +if [ -z $(which ab) ]; then + echo "Host stack test framework requires apache2-utils to be installed" + echo "It is recommended to run 'sudo make install-dep'" + exit 1 +fi + +if [ -z $(which wrk) ]; then + echo "Host stack test framework requires wrk to be installed" + echo "It is recommended to run 'sudo make install-dep'" + exit 1 +fi + +export VPP_WS=../.. + +if [ "$1" == "debug" ]; then + VPP_BUILD_ROOT=${VPP_WS}/build-root/build-vpp_debug-native/vpp +else + VPP_BUILD_ROOT=${VPP_WS}/build-root/build-vpp-native/vpp +fi +echo "Taking build objects from ${VPP_BUILD_ROOT}" + +if [ -z "$UBUNTU_VERSION" ] ; then + export UBUNTU_VERSION=$(lsb_release -rs) +fi +echo "Ubuntu version is set to ${UBUNTU_VERSION}" + +export HST_LDPRELOAD=${VPP_BUILD_ROOT}/lib/x86_64-linux-gnu/libvcl_ldpreload.so +echo "HST_LDPRELOAD is set to ${HST_LDPRELOAD}" + +export PATH=${VPP_BUILD_ROOT}/bin:$PATH + +bin=vpp-data/bin +lib=vpp-data/lib + +mkdir -p ${bin} ${lib} || true +rm -rf vpp-data/bin/* || true +rm -rf vpp-data/lib/* || true + +cp ${VPP_BUILD_ROOT}/bin/* ${bin} +res+=$? +cp -r ${VPP_BUILD_ROOT}/lib/x86_64-linux-gnu/* ${lib} +res+=$? +if [ $res -ne 0 ]; then + echo "Failed to copy VPP files. Is VPP built? Try running 'make build' in VPP directory." + exit 1 +fi + +docker_build () { + tag=$1 + dockername=$2 + docker build --build-arg UBUNTU_VERSION --build-arg http_proxy=$HTTP_PROXY \ + -t $tag -f docker/Dockerfile.$dockername . +} + +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/build build +if [ "$HST_EXTENDED_TESTS" = true ] ; then + docker_build hs-test/nginx-http3 nginx-http3 + docker_build hs-test/curl curl +fi + +# cleanup detached images +images=$(docker images --filter "dangling=true" -q --no-trunc) +if [ "$images" != "" ]; then + docker rmi $images +fi diff --git a/extras/hs-test/script/build_nginx.sh b/extras/hs-test/script/build_nginx.sh new file mode 100755 index 00000000000..69d366aab0e --- /dev/null +++ b/extras/hs-test/script/build_nginx.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cd nginx +./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 diff --git a/extras/hs-test/script/nginx_ldp.sh b/extras/hs-test/script/nginx_ldp.sh index 90146f61443..4a22e14aaf7 100755 --- a/extras/hs-test/script/nginx_ldp.sh +++ b/extras/hs-test/script/nginx_ldp.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -LD_PRELOAD=$LDP nginx $@ 2>&1 > /proc/1/fd/1 +LD_PRELOAD=$LDP $@ 2>&1 > /proc/1/fd/1 -- cgit 1.2.3-korg