Skip to content

Commit

Permalink
tests: nydus: Decorate some calls with sudo
Browse files Browse the repository at this point in the history
Otherwise we canoot properly start the nydus snapshotter, nor properly
kill it after it's been started.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 376574a)
  • Loading branch information
fidencio committed Sep 21, 2023
1 parent 4b58777 commit fd5935d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/integration/nydus/nydus_tests.sh
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit fd5935d

Please sign in to comment.