controllers/cpuacct: add kernel version check
PATCH 1/1 controllers/cpuacct: add kernel version check
Cpuacct should be supported with kernel 2.6.30 or newer
--- testcases/kernel/controllers/cpuacct/cpuacct.sh | 5 +++++ 1 file changed, 5 insertions(+)
testcases/kernel/controllers/cpuacct/cpuacct.sh +5 -0
@@ -48,6 +48,11 @@ setup() { tst_require_root + tst_kvercmp 2 6 30 + if [ $? -eq 0 ]; then + tst_brkm TCONF "Test should be run with kernel 2.6.30 or newer" + fi + mount_point=`grep -w cpuacct /proc/mounts | cut -f 2 | cut -d " " -f2` tst_resm TINFO "cpuacct: $mount_point" if [ "$mount_point" = "" ]; then
Signature · 1 line
1.8.3.1
PATCH 1/1 controllers/cpuacct: add kernel version check
Hi!
testcases/kernel/controllers/cpuacct/cpuacct.sh setup() · line 54
Quoted 6 lines
testcases/kernel/controllers/cpuacct/cpuacct.sh +4
-0tst_require_root + tst_kvercmp 2 6 30 + if [ $? -eq 0 ]; then + tst_brkm TCONF "Test should be run with kernel 2.6.30 or newer" + fi
Can we do 'grep -q cpuacct /proc/cgroups' to figure out if it's supported instead?
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 controllers/cpuacct: add kernel version check
Hi !
Quoted 10 lines
Hi!
testcases/kernel/controllers/cpuacct/cpuacct.sh setup() · line 54
Quoted 6 lines
tst_require_roottestcases/kernel/controllers/cpuacct/cpuacct.sh +4
-0+ tst_kvercmp 2 6 30 + if [ $? -eq 0 ]; then + tst_brkm TCONF "Test should be run with kernel 2.6.30 or newer" + fiCan we do 'grep -q cpuacct
/proc/cgroups' to figure out if it's supported instead?
Thanks, I will rewirte it as what you suggested.
PATCH v2 1/1 controllers/cpuacct: add cpuacct availability check
In reply to Cyril Hrubis--- testcases/kernel/controllers/cpuacct/cpuacct.sh | 5 +++++ 1 file changed, 5 insertions(+)
testcases/kernel/controllers/cpuacct/cpuacct.sh +5 -0
@@ -48,6 +48,11 @@ setup() { tst_require_root + grep -q cpuacct /proc/cgroups 2>/dev/null + if [ $? -ne 0 ]; then + tst_brkm TCONF "cpuacct not supported on this system" + fi + mount_point=`grep -w cpuacct /proc/mounts | cut -f 2 | cut -d " " -f2` tst_resm TINFO "cpuacct: $mount_point" if [ "$mount_point" = "" ]; then
Signature · 1 line
1.8.3.1
PATCH v2 1/1 controllers/cpuacct: add cpuacct availability check
Hi!
Pushed with minor change (to unify the check with rest of the controllers testcases), thanks.
Signature · 2 lines
Cyril Hrubis [email protected]