summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Safranek <jsafrane@redhat.com>2009-03-26 15:04:36 +0100
committerJan Safranek <jsafrane@redhat.com>2009-03-26 15:04:36 +0100
commitb491ec4a847043c59798066e02701cfd435811f9 (patch)
tree26a127e01acf2d69ba8d165e87855022d42086da
parent45290e6ea3889c0a970e11f16a22a3d8a546d15a (diff)
downloadlibcg-b491ec4a847043c59798066e02701cfd435811f9.tar.gz
libcg-b491ec4a847043c59798066e02701cfd435811f9.tar.xz
libcg-b491ec4a847043c59798066e02701cfd435811f9.zip
Add warrning when test script is started by normal user
The runlibcgrouptest.sh will now whine when script is started by non-root user. Root permissions are needed to create directories and mount the cgroups there. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
-rwxr-xr-xtests/runlibcgrouptest.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/runlibcgrouptest.sh b/tests/runlibcgrouptest.sh
index 4ddb52d..847f932 100755
--- a/tests/runlibcgrouptest.sh
+++ b/tests/runlibcgrouptest.sh
@@ -325,6 +325,13 @@ runtest()
exit $SKIP_TEST;
fi;
+ MY_ID=`id -u`
+ if [ $MY_ID -ne 0 ]; then
+ echo "Only root can start this script."
+ echo " Exiting the testcase..."
+ exit $SKIP_TEST
+ fi
+
# TestSet01: Run tests without mounting cgroup filesystem
echo;
echo Running first set of testcases;