Previous patch fixed exit code of cgclear -e, but I forgot to update the
tests. Here is a fix.

Signed-off-by: Jan Safranek <jsafr...@redhat.com>
---

 tests/tools/cgconfigparser/cgclear_config_multi |    7 ++++++-
 tests/tools/cgconfigparser/cgclear_config_one   |   14 ++++++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/tests/tools/cgconfigparser/cgclear_config_multi 
b/tests/tools/cgconfigparser/cgclear_config_multi
index 765830d..964c61d 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 de43bd3..e673917 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


------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to