From: Jan Safranek Date: Fri, 9 Dec 2011 14:04:17 +0000 (+0100) Subject: tests: Fixed tests for cgclear -e X-Git-Tag: v0.38~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba9551ead78ba9acc566435a3aee3a31c8cd9798;p=thirdparty%2Flibcgroup.git tests: Fixed tests for cgclear -e Previous patch fixed exit code of cgclear -e, but I forgot to update the tests. Here is a fix. Signed-off-by: Jan Safranek --- diff --git a/tests/tools/cgconfigparser/cgclear_config_multi b/tests/tools/cgconfigparser/cgclear_config_multi index 765830d0..964c61d3 100755 --- a/tests/tools/cgconfigparser/cgclear_config_multi +++ b/tests/tools/cgconfigparser/cgclear_config_multi @@ -44,7 +44,12 @@ grep 1/2/3 <$TMP/groups.log >/dev/null \ $TOOLSDIR/cgclear -e -l `prepare_config cgclear/cgclear_config_multi_3.conf` \ -l `prepare_config cgclear/cgclear_config_multi_2.conf` \ -l `prepare_config cgclear/cgclear_config_multi_1.conf` \ - && die "STEP2: cgclear should fail!" + || die "STEP2: cgclear failed" + +# check that cpu,cpuacct:/1/2 still exists +$TOOLSDIR/lscgroup > $TMP/groups.log +grep 1/2 <$TMP/groups.log >/dev/null \ + || die "STEP2: cannot find group '1/2 after cgclear" $TOOLSDIR/cgclear diff --git a/tests/tools/cgconfigparser/cgclear_config_one b/tests/tools/cgconfigparser/cgclear_config_one index de43bd3d..e673917a 100755 --- a/tests/tools/cgconfigparser/cgclear_config_one +++ b/tests/tools/cgconfigparser/cgclear_config_one @@ -80,9 +80,12 @@ grep first <$TMP/groups.log >/dev/null \ $TOOLSDIR/cgclassify -g cpu:first $PID \ || die "STEP4: cgclassify failed" -# try to clear it - cgclear should fail +# try to clear it - cgclear should not fail and the group should survive $TOOLSDIR/cgclear -e -l `prepare_config cgclear/cgclear_config_one.conf` \ - && die "STEP4: cgclear did not fail!" + || die "STEP4: cgclear failed" +$TOOLSDIR/lscgroup > $TMP/groups2.log +grep first <$TMP/groups2.log >/dev/null \ + || die "STEP4: cannot find group 'first' after cgclear" # cpu:first should survive $TOOLSDIR/lscgroup > $TMP/groups.log @@ -113,9 +116,12 @@ grep first <$TMP/groups.log >/dev/null \ $TOOLSDIR/cgcreate -g cpu:first/evil \ || die "STEP5: cgcreate failed" -# try to clear it - cgclear should fail +# try to clear it - cgclear should not fail, the group should survive $TOOLSDIR/cgclear -e -l `prepare_config cgclear/cgclear_config_one.conf` \ - && die "STEP5: cgclear did not fail!" + || die "STEP5: cgclear failed" +$TOOLSDIR/lscgroup > $TMP/groups2.log +grep first <$TMP/groups2.log >/dev/null \ + || die "STEP5: cannot find group 'first' after clear" # cpu:first/evil should survive $TOOLSDIR/lscgroup > $TMP/groups.log