From 09ef08388269cb344066d78a6b7cc05fc94e8b58 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Tue, 21 Mar 2017 16:35:44 -0400 Subject: [PATCH] tests: Kill containers (don't wait for shutdown) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We waste a lot of time waiting for Ubuntu containers to cleanly stop right before we destroy them anyway. Signed-off-by: Stéphane Graber --- src/tests/lxc-test-apparmor-mount | 8 ++++---- src/tests/lxc-test-checkpoint-restore | 2 +- src/tests/lxc-test-unpriv | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tests/lxc-test-apparmor-mount b/src/tests/lxc-test-apparmor-mount index 74fd8c6f8..bb9b1fce6 100755 --- a/src/tests/lxc-test-apparmor-mount +++ b/src/tests/lxc-test-apparmor-mount @@ -167,7 +167,7 @@ if [ "x$profile" != "x${default_profile}" ]; then echo "FAIL: confined container was in profile $profile" exit 1 fi -run_cmd lxc-stop -n $cname +run_cmd lxc-stop -n $cname -k echo "test regular unconfined container" echo "lxc.aa_profile = unconfined" >> $HDIR/.local/share/lxc/$cname/config @@ -179,7 +179,7 @@ if [ "x$profile" != "xunconfined" ]; then echo "FAIL: unconfined container was in profile $profile" exit 1 fi -run_cmd lxc-stop -n $cname +run_cmd lxc-stop -n $cname -k echo "masking $MOUNTSR" mount --bind $dnam $MOUNTSR @@ -209,7 +209,7 @@ if [ "x$profile" != "xunconfined" ]; then echo "FAIL: confined container was in profile $profile" exit 1 fi -run_cmd lxc-stop -n $cname +run_cmd lxc-stop -n $cname -k echo "testing override" sed -i '/aa_profile/d' $HDIR/.local/share/lxc/$cname/config @@ -226,6 +226,6 @@ if [ "x$profile" != "x${default_profile}" ]; then echo "FAIL: confined container was in profile $profile" exit 1 fi -run_cmd lxc-stop -n $cname +run_cmd lxc-stop -n $cname -k DONE=1 diff --git a/src/tests/lxc-test-checkpoint-restore b/src/tests/lxc-test-checkpoint-restore index 4c9133916..2adb131e9 100755 --- a/src/tests/lxc-test-checkpoint-restore +++ b/src/tests/lxc-test-checkpoint-restore @@ -48,5 +48,5 @@ lxc-checkpoint -n $name -v -s -D /tmp/checkpoint || FAIL "failed checkpointing" lxc-wait -n $name -s STOPPED lxc-checkpoint -n $name -v -r -D /tmp/checkpoint || FAIL "failed restoring" -lxc-stop -n $name -t 1 +lxc-stop -n $name -k lxc-destroy -f -n $name diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv index 8ba216f56..8486fbdeb 100755 --- a/src/tests/lxc-test-unpriv +++ b/src/tests/lxc-test-unpriv @@ -185,7 +185,7 @@ for count in `seq 1 2`; do run_cmd lxc-info -n c1 run_cmd lxc-attach -n c1 -- /bin/true - run_cmd lxc-stop -n c1 + run_cmd lxc-stop -n c1 -k done run_cmd lxc-copy -s -n c1 -N c2 @@ -193,7 +193,7 @@ run_cmd lxc-start -n c2 -d p1=$(run_cmd lxc-info -n c2 -p -H) [ "$p1" != "-1" ] || { echo "Failed to start container c2"; false; } -run_cmd lxc-stop -n c2 +run_cmd lxc-stop -n c2 -k if which cgm >/dev/null 2>&1; then echo "Testing containers under different cgroups per subsystem" -- 2.47.2