summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/script
diff options
context:
space:
mode:
authorMaros Ondrejicka <maros.ondrejicka@pantheon.tech>2023-01-17 10:52:20 +0100
committerFlorin Coras <florin.coras@gmail.com>2023-01-17 17:38:47 +0000
commitf643b6f67111061e90ea41471b4b42c75b7a5988 (patch)
treef20df5dc8770677d97bf808253f10613e799c11d /extras/hs-test/script
parent4da8be4dbabbbf53f1a3a9576f5178d982de6a06 (diff)
hs-test: autodetect ubuntu version during build
Since VPP binaries are being compiled on host system, it makes sense to autodetect Ubuntu version when building test images so that containers would be running version equal to host system. Type: test Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech> Change-Id: I0e13d9ba1ddcd3ad5835bce1b8cccfc048e5e528
Diffstat (limited to 'extras/hs-test/script')
-rwxr-xr-xextras/hs-test/script/build.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/extras/hs-test/script/build.sh b/extras/hs-test/script/build.sh
index dd6f9c02575..9860ba231b7 100755
--- a/extras/hs-test/script/build.sh
+++ b/extras/hs-test/script/build.sh
@@ -1,5 +1,10 @@
#!/usr/bin/env bash
+if [ $(lsb_release -is) != Ubuntu ]; then
+ echo "Host stack test framework is supported only on Ubuntu"
+ exit 1
+fi
+
source vars
bin=vpp-data/bin
@@ -8,7 +13,13 @@ lib=vpp-data/lib
mkdir -p ${bin} ${lib} || true
cp ${VPP_WS}/build-root/build-vpp_debug-native/vpp/bin/* ${bin}
+res+=$?
cp -r ${VPP_WS}/build-root/build-vpp_debug-native/vpp/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 -t hs-test/vpp -f docker/Dockerfile.vpp .
docker build --build-arg UBUNTU_VERSION -t hs-test/nginx-ldp -f docker/Dockerfile.nginx .