public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] controllers/cpuacct: add kernel version check
@ 2015-11-19  9:49 Xiao Yang
  2015-11-19 12:05 ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Xiao Yang @ 2015-11-19  9:49 UTC (permalink / raw)
  To: ltp

Cpuacct should be supported with kernel 2.6.30 or newer

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 testcases/kernel/controllers/cpuacct/cpuacct.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testcases/kernel/controllers/cpuacct/cpuacct.sh b/testcases/kernel/controllers/cpuacct/cpuacct.sh
index 8552b5e..9916367 100755
--- a/testcases/kernel/controllers/cpuacct/cpuacct.sh
+++ b/testcases/kernel/controllers/cpuacct/cpuacct.sh
@@ -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
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] controllers/cpuacct: add kernel version check
  2015-11-19  9:49 [LTP] [PATCH] controllers/cpuacct: add kernel version check Xiao Yang
@ 2015-11-19 12:05 ` Cyril Hrubis
  2015-11-20  3:10   ` yangxiao
  2015-11-20  5:36   ` [LTP] [PATCH v2] controllers/cpuacct: add cpuacct availability check Xiao Yang
  0 siblings, 2 replies; 5+ messages in thread
From: Cyril Hrubis @ 2015-11-19 12:05 UTC (permalink / raw)
  To: ltp

Hi!
>  	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

Can we do 'grep -q cpuacct /proc/cgroups' to figure out if it's
supported instead?

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] controllers/cpuacct: add kernel version check
  2015-11-19 12:05 ` Cyril Hrubis
@ 2015-11-20  3:10   ` yangxiao
  2015-11-20  5:36   ` [LTP] [PATCH v2] controllers/cpuacct: add cpuacct availability check Xiao Yang
  1 sibling, 0 replies; 5+ messages in thread
From: yangxiao @ 2015-11-20  3:10 UTC (permalink / raw)
  To: ltp

Hi !
> Hi!
>>   	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
> Can we do 'grep -q cpuacct /proc/cgroups' to figure out if it's
> supported instead?
>
Thanks, I will rewirte it as what you suggested.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH v2] controllers/cpuacct: add cpuacct availability check
  2015-11-19 12:05 ` Cyril Hrubis
  2015-11-20  3:10   ` yangxiao
@ 2015-11-20  5:36   ` Xiao Yang
  2015-11-24 13:02     ` Cyril Hrubis
  1 sibling, 1 reply; 5+ messages in thread
From: Xiao Yang @ 2015-11-20  5:36 UTC (permalink / raw)
  To: ltp

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 testcases/kernel/controllers/cpuacct/cpuacct.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testcases/kernel/controllers/cpuacct/cpuacct.sh b/testcases/kernel/controllers/cpuacct/cpuacct.sh
index 8552b5e..8639e42 100755
--- a/testcases/kernel/controllers/cpuacct/cpuacct.sh
+++ b/testcases/kernel/controllers/cpuacct/cpuacct.sh
@@ -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
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [LTP] [PATCH v2] controllers/cpuacct: add cpuacct availability check
  2015-11-20  5:36   ` [LTP] [PATCH v2] controllers/cpuacct: add cpuacct availability check Xiao Yang
@ 2015-11-24 13:02     ` Cyril Hrubis
  0 siblings, 0 replies; 5+ messages in thread
From: Cyril Hrubis @ 2015-11-24 13:02 UTC (permalink / raw)
  To: ltp

Hi!
Pushed with minor change (to unify the check with rest of the
controllers testcases), thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-24 13:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-19  9:49 [LTP] [PATCH] controllers/cpuacct: add kernel version check Xiao Yang
2015-11-19 12:05 ` Cyril Hrubis
2015-11-20  3:10   ` yangxiao
2015-11-20  5:36   ` [LTP] [PATCH v2] controllers/cpuacct: add cpuacct availability check Xiao Yang
2015-11-24 13:02     ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox