From fd5935da9d645d32898042235618bd1735813f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 16 Aug 2023 11:33:33 +0200 Subject: [PATCH] tests: nydus: Decorate some calls with `sudo` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we canoot properly start the nydus snapshotter, nor properly kill it after it's been started. Signed-off-by: Fabiano FidĂȘncio (cherry picked from commit 376574a16c650482106597416463ecab96f515e2) --- tests/integration/nydus/nydus_tests.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/nydus/nydus_tests.sh b/tests/integration/nydus/nydus_tests.sh index 87cf22917..15512b32d 100755 --- a/tests/integration/nydus/nydus_tests.sh +++ b/tests/integration/nydus/nydus_tests.sh @@ -68,7 +68,7 @@ function setup_nydus() { sudo -E cp "$dir_path/nydusd-config.json" /etc/ # start nydus-snapshotter - nohup /usr/local/bin/containerd-nydus-grpc \ + sudo nohup /usr/local/bin/containerd-nydus-grpc \ --config-path /etc/nydusd-config.json \ --shared-daemon \ --log-level debug \ @@ -163,7 +163,7 @@ function run_test() { state=$(sudo -E crictl inspect $cnt | jq .status.state | tr -d '"') [ $state == "CONTAINER_RUNNING" ] || die "Container is not running($state)" # run a command in container - crictl exec $cnt ls + sudo -E crictl exec $cnt ls # cleanup containers sudo -E crictl stop $cnt @@ -176,11 +176,11 @@ function teardown() { # kill nydus-snapshotter bin=containerd-nydus-grpc - kill -9 $(pidof $bin) || true + sudo -E kill -9 $(pidof $bin) || true [ "$(pidof $bin)" == "" ] || die "$bin is running" bin=nydusd - kill -9 $(pidof $bin) || true + sudo -E kill -9 $(pidof $bin) || true [ "$(pidof $bin)" == "" ] || die "$bin is running" # restore kata configuratiom.toml if needed