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 <[email protected]>
---

 tests/runlibcgrouptest.sh |   15 ++++++++++-----
 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;


------------------------------------------------------------------------------
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to