summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/script/build.sh
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2023-01-31 10:34:18 +0100
committerFilip Tehlar <ftehlar@cisco.com>2023-02-24 14:38:15 +0100
commit671cf51d6d0b08c216a99696aa30f17faff5e653 (patch)
tree569ca122ed05396a4174c91c775d289b75769cf4 /extras/hs-test/script/build.sh
parent182d2b466d158de4b2320fd280c1e7beb5bb37e4 (diff)
hs-test: improve test infra
- add support for building/running debug/release images - have one point of control (Makefile) - list all test cases Type: test Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I97949abc2fff85d7a2b3784122be159aeec72b52
Diffstat (limited to 'extras/hs-test/script/build.sh')
-rwxr-xr-xextras/hs-test/script/build.sh38
1 files changed, 31 insertions, 7 deletions
diff --git a/extras/hs-test/script/build.sh b/extras/hs-test/script/build.sh
index 0fc49bbf7d0..78facd1605d 100755
--- a/extras/hs-test/script/build.sh
+++ b/extras/hs-test/script/build.sh
@@ -17,23 +17,47 @@ if [ -z $(which wrk) ]; then
exit 1
fi
-source vars
+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_WS}/build-root/build-vpp_debug-native/vpp/bin/* ${bin}
+cp ${VPP_BUILD_ROOT}/bin/* ${bin}
res+=$?
-cp -r ${VPP_WS}/build-root/build-vpp_debug-native/vpp/lib/x86_64-linux-gnu/* ${lib}
+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 --build-arg UBUNTU_VERSION --build-arg http_proxy=$HTTP_PROXY \
- -t hs-test/vpp -f docker/Dockerfile.vpp .
-docker build --build-arg UBUNTU_VERSION --build-arg http_proxy=$HTTP_PROXY \
- -t hs-test/nginx-ldp -f docker/Dockerfile.nginx .
+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