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 <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
Jose Carlos Venegas Munoz 2018-02-16 17:11:13 -06:00
parent e186ef835d
commit ec05357463

View File

@ -40,13 +40,16 @@ test_setup() {
fi fi
# Start containerd # 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" echo "containerd is not installed, please run hack/install-deps.sh"
exit 1 exit 1
fi fi
sudo pkill -x cri-containerd sudo pkill -x cri-containerd
sudo pkill -x 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=$! containerd_pid=$!
# Wait for containerd to be running by using the containerd client ctr to check the version # 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 # of the containerd server. Wait an increasing amount of time after each of five attempts