From 0adf296297252e7ad4cb7821bbd44ba84b31333f Mon Sep 17 00:00:00 2001 From: Balbir Singh Date: Wed, 17 Dec 2008 15:03:49 +0000 Subject: [PATCH] libcgroup Test: change subsyscheck logic in testscript Hi The shell script as expected does not do a non null check using -n option as i observed. hence changing the logic as below. Signed-off-by: Sudhir Kumar git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@247 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- tests/runlibcgrouptest.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/runlibcgrouptest.sh b/tests/runlibcgrouptest.sh index 69a7a684..30edc311 100644 --- a/tests/runlibcgrouptest.sh +++ b/tests/runlibcgrouptest.sh @@ -21,7 +21,7 @@ MOUNTPOINT=/dev/cgroup_controllers; # Just to initialize TARGET=/dev/cgroup_controllers; CONTROLLERS=cpu,memory; NUM_MOUNT=1; # Number of places to be mounted on - +MULTIMOUNT=false; # mounted at on epoint only debug() { # Function parameter is the string to print out @@ -66,7 +66,7 @@ umount_fs () PROC_ENTRY=`cat /proc/mounts|grep cgroup|tr -s [:space:]|cut -d" " -f2`; # Get first mountpoint in case of multiple mounts PROC_ENTRY=`echo $PROC_ENTRY|cut -d" " -f1`; - if [ -n "$PROC_ENTRY" ] + if [ ! -z "$PROC_ENTRY" ] then TARGET=$PROC_ENTRY; # Need to take care if there are tasks running in any group ?? @@ -93,15 +93,15 @@ no_controllers() MEMORY=`cat /proc/cgroups|grep -w memory|cut -f1`; fi; - if [ -n $CPU ] && [ -n $MEMORY ] + if [ ! -z $CPU ] && [ ! -z $MEMORY ] then CONTROLLERS=$CPU,$MEMORY ; return 1; # false - elif [ -n $CPU ] + elif [ ! -z $CPU ] then CONTROLLERS=$CPU ; return 1; # false - elif [ -n $MEMORY ] + elif [ ! -z $MEMORY ] then CONTROLLERS=$MEMORY ; return 1; # false -- 2.47.2