summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Safranek <jsafrane@redhat.com>2009-03-25 10:28:39 +0100
committerJan Safranek <jsafrane@redhat.com>2009-03-26 09:37:38 +0100
commit45290e6ea3889c0a970e11f16a22a3d8a546d15a (patch)
tree13170c6c1b5fe961952d229510a65ea5c2c592da
parentfe97107b28c97e312206ea8dc961b3d0aee48f4c (diff)
downloadlibcg-45290e6ea3889c0a970e11f16a22a3d8a546d15a.tar.gz
libcg-45290e6ea3889c0a970e11f16a22a3d8a546d15a.tar.xz
libcg-45290e6ea3889c0a970e11f16a22a3d8a546d15a.zip
Fix runlibcgrouptest.sh exit codes
Automake's 'make check' executes runlibcgrouptest.sh automatically. It interprets exit code '77' as 'skip the test' and it is not counted as failure. Also the script should return nozero exit code != 77 when some test fails. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
-rwxr-xr-xtests/runlibcgrouptest.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/runlibcgrouptest.sh b/tests/runlibcgrouptest.sh
index c34ca0a..4ddb52d 100755
--- a/tests/runlibcgrouptest.sh
+++ b/tests/runlibcgrouptest.sh
@@ -27,6 +27,8 @@ CTLR1="";
CTLR2="";
CPU="";
MEMORY="";
+SKIP_TEST=77
+RET=0
declare -a allcontrollers;
declare -a targets;
@@ -167,7 +169,7 @@ no_controllers()
echo "Kernel needs to have 2 controllers enabled";
echo "Recompile your kernel with at least 2 controllers"
echo "Exiting the tests.....";
- exit 1;
+ exit $SKIP_TEST;
fi;
return 0; # true
@@ -186,7 +188,7 @@ mount_fs ()
echo "Kernel has none of cpu/memory controllers enabled";
echo "Recompile your kernel with at least one of these enabled"
echo "Exiting the tests.....";
- exit 1;
+ exit $SKIP_TEST;
fi;
# At least one Controller is enabled. So proceed further.
@@ -227,7 +229,7 @@ mount_fs ()
else
echo "Only 1 controler enabled in kernel";
echo "So not running multiple mount testcases";
- exit 1;
+ exit $SKIP_TEST;
fi;
fi;
@@ -320,7 +322,7 @@ runtest()
echo "Your Kernel seems to be too old. Plz recompile your"
echo "Kernel with cgroups and appropriate controllers enabled"
echo " Exiting the testcases...."
- exit 1;
+ exit $SKIP_TEST;
fi;
# TestSet01: Run tests without mounting cgroup filesystem
@@ -345,6 +347,7 @@ runtest()
echo Test binary $FILE exited abnormaly with return value $RC;
# Do not exit here. Failure in this case does not imply
# failure in other cases also
+ RET=$RC
fi;
# TestSet02: Run tests with mounting cgroup filesystem
@@ -372,6 +375,7 @@ runtest()
if [ $RC -ne 0 ]
then
echo Test binary $FILE exited abnormaly with return value $RC;
+ RET=$RC
fi;
umount_fs;
@@ -402,7 +406,8 @@ runtest()
if [ $RC -ne 0 ]
then
echo Test binary $FILE exited abnormaly with return value $RC;
+ RET=$RC
fi;
umount_fs;
- exit 0;
+ exit $RET;