summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/script/build_hst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'extras/hs-test/script/build_hst.sh')
-rwxr-xr-xextras/hs-test/script/build_hst.sh23
1 files changed, 12 insertions, 11 deletions
diff --git a/extras/hs-test/script/build_hst.sh b/extras/hs-test/script/build_hst.sh
index 3b4bc28e275..f3a8e272207 100755
--- a/extras/hs-test/script/build_hst.sh
+++ b/extras/hs-test/script/build_hst.sh
@@ -1,17 +1,17 @@
#!/usr/bin/env bash
-if [ $(lsb_release -is) != Ubuntu ]; then
+if [ "$(lsb_release -is)" != Ubuntu ]; then
echo "Host stack test framework is supported only on Ubuntu"
exit 1
fi
-if [ -z $(which ab) ]; then
+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
+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
@@ -28,9 +28,7 @@ else
fi
echo "Taking build objects from ${VPP_BUILD_ROOT}"
-if [ -z "$UBUNTU_VERSION" ] ; then
- export UBUNTU_VERSION=$(lsb_release -rs)
-fi
+export UBUNTU_VERSION=${UBUNTU_VERSION:-"$(lsb_release -rs)"}
echo "Ubuntu version is set to ${UBUNTU_VERSION}"
export HST_LDPRELOAD=${VPP_BUILD_ROOT}/lib/x86_64-linux-gnu/libvcl_ldpreload.so
@@ -57,12 +55,14 @@ fi
docker_build () {
tag=$1
dockername=$2
+ set -x
docker build --build-arg UBUNTU_VERSION \
- --build-arg http_proxy=$HTTP_PROXY \
- --build-arg https_proxy=$HTTP_PROXY \
- --build-arg HTTP_PROXY=$HTTP_PROXY \
- --build-arg HTTPS_PROXY=$HTTP_PROXY \
- -t $tag -f docker/Dockerfile.$dockername .
+ --build-arg http_proxy="$HTTP_PROXY" \
+ --build-arg https_proxy="$HTTP_PROXY" \
+ --build-arg HTTP_PROXY="$HTTP_PROXY" \
+ --build-arg HTTPS_PROXY="$HTTP_PROXY" \
+ -t "$tag" -f docker/Dockerfile."$dockername" .
+ set +x
}
docker_build hs-test/vpp vpp
@@ -77,5 +77,6 @@ fi
# cleanup detached images
images=$(docker images --filter "dangling=true" -q --no-trunc)
if [ "$images" != "" ]; then
+ # shellcheck disable=SC2086
docker rmi $images
fi