diff --git a/hack/test-utils.sh b/hack/test-utils.sh index 42bbe319e..8a4832fde 100755 --- a/hack/test-utils.sh +++ b/hack/test-utils.sh @@ -18,6 +18,13 @@ source $(dirname "${BASH_SOURCE[0]}")/utils.sh # RESTART_WAIT_PERIOD is the period to wait before restarting containerd. RESTART_WAIT_PERIOD=${RESTART_WAIT_PERIOD:-10} +CONTAINERD_CONFIG="--log-level=debug " + +# Use a configuration file for containerd. +CONTAINERD_CONFIG_FILE=${CONTAINERD_CONFIG_FILE:-""} +if [ -f "${CONTAINERD_CONFIG_FILE}" ]; then + CONTAINERD_CONFIG+="--config $CONTAINERD_CONFIG_FILE" +fi CONTAINERD_SOCK=/run/containerd/containerd.sock @@ -32,7 +39,7 @@ test_setup() { exit 1 fi sudo pkill -x containerd - keepalive "sudo ${ROOT}/_output/containerd --log-level=debug" \ + keepalive "sudo ${ROOT}/_output/containerd ${CONTAINERD_CONFIG}" \ ${RESTART_WAIT_PERIOD} &> ${report_dir}/containerd.log & containerd_pid=$! # Wait for containerd to be running by using the containerd client ctr to check the version