scripts: add missing quotes, and minor linting issues

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2021-07-20 12:06:02 +02:00
parent 0cb656860f
commit dba0ef4eb5
14 changed files with 58 additions and 53 deletions

View File

@@ -17,8 +17,8 @@
set -o nounset
set -o pipefail
source $(dirname "${BASH_SOURCE[0]}")/utils.sh
cd ${ROOT}
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
cd "${ROOT}"
# FOCUS focuses the test to run.
FOCUS=${FOCUS:-""}
@@ -29,15 +29,15 @@ RUNTIME=${RUNTIME:-""}
CRI_ROOT="${CONTAINERD_ROOT}/io.containerd.grpc.v1.cri"
mkdir -p ${REPORT_DIR}
test_setup ${REPORT_DIR}
mkdir -p "${REPORT_DIR}"
test_setup "${REPORT_DIR}"
# Run integration test.
${sudo} bin/cri-integration.test --test.run="${FOCUS}" --test.v \
--cri-endpoint=${CONTAINERD_SOCK} \
--cri-root=${CRI_ROOT} \
--runtime-handler=${RUNTIME} \
--containerd-bin=${CONTAINERD_BIN} \
--cri-endpoint="${CONTAINERD_SOCK}" \
--cri-root="${CRI_ROOT}" \
--runtime-handler="${RUNTIME}" \
--containerd-bin="${CONTAINERD_BIN}" \
--image-list="${TEST_IMAGE_LIST:-}"
test_exit_code=$?

View File

@@ -83,7 +83,7 @@ pid=
# NOTE: We don't have the sudo command on Windows.
sudo=""
if [ $(id -u) -ne 0 ] && command -v sudo &> /dev/null; then
if [ "$(id -u)" -ne 0 ] && command -v sudo &> /dev/null; then
sudo="sudo PATH=${PATH}"
fi
@@ -99,7 +99,7 @@ test_setup() {
# Create containerd in a different process group
# so that we can easily clean them up.
keepalive "${sudo} bin/containerd ${CONTAINERD_FLAGS}" \
${RESTART_WAIT_PERIOD} &> ${report_dir}/containerd.log &
"${RESTART_WAIT_PERIOD}" &> "${report_dir}/containerd.log" &
pid=$!
set +m
@@ -122,7 +122,7 @@ test_teardown() {
# so we can kill both of them by matching the PGID.
${sudo} ps | awk "{if (\$3 == ${pid}) print \$1}" | xargs kill
else
${sudo} pkill -g $(ps -o pgid= -p ${pid})
${sudo} pkill -g $(ps -o pgid= -p "${pid}")
fi
fi
}
@@ -131,11 +131,11 @@ test_teardown() {
# keepalive process is eventually killed in test_teardown.
keepalive() {
local command=$1
echo ${command}
echo "${command}"
local wait_period=$2
while true; do
${command}
sleep ${wait_period}
sleep "${wait_period}"
done
}