From ec0535746373a36d186e5b8af359a0c2cacf21d3 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Fri, 16 Feb 2018 17:11:13 -0600 Subject: [PATCH] tests: Use path found to containerd. After check if containerd is intalled the command executed using sudo, /usr/local/bin may not been in sudo secure_path, save the path where containerd was installed and use it. Signed-off-by: Jose Carlos Venegas Munoz --- hack/test-utils.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hack/test-utils.sh b/hack/test-utils.sh index 0968a6581..db6a8f644 100755 --- a/hack/test-utils.sh +++ b/hack/test-utils.sh @@ -40,13 +40,16 @@ test_setup() { fi # Start containerd - if [ ! -x "$(command -v containerd)" ]; then + local containerd=$(command -v containerd) + if [ ! -x "${containerd}" ]; then echo "containerd is not installed, please run hack/install-deps.sh" exit 1 fi sudo pkill -x cri-containerd sudo pkill -x containerd - keepalive "sudo containerd" ${RESTART_WAIT_PERIOD} &> ${report_dir}/containerd.log & + echo "using ${containerd}" + echo "containerd version: $(${containerd} --version)" + keepalive "sudo ${containerd}" ${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 # of the containerd server. Wait an increasing amount of time after each of five attempts