All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/6 v3] cgroups/cgroup_regression_test: clear dmesg before test
@ 2011-07-22  8:10 Jan Stancek
  2011-07-28 17:01 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Stancek @ 2011-07-22  8:10 UTC (permalink / raw)
  To: ltp-list

[-- Attachment #1: Type: text/plain, Size: 282 bytes --]


dmesg can rotate and number of found bugs can actually go down,
clear the buffer before test to avoid this

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
   .../controllers/cgroup/cgroup_regression_test.sh   |    3 +++
   1 files changed, 3 insertions(+), 0 deletions(-)




[-- Attachment #2: 0001-cgroups-cgroup_regression_test-clear-dmesg-before-te.patch --]
[-- Type: text/x-patch, Size: 704 bytes --]

diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
index 878f91a..5615053 100755
--- a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
@@ -40,6 +40,7 @@ elif [ "x$(id -ru)" != x0 ]; then
 	exit 0
 fi
 
+dmesg -c > /dev/null
 nr_bug=`dmesg | grep -c "kernel BUG"`
 nr_null=`dmesg | grep -c "kernel NULL pointer dereference"`
 nr_warning=`dmesg | grep -c "^WARNING"`
@@ -78,6 +79,8 @@ check_kernel_bug()
 	nr_warning=$new_warning
 	nr_lockdep=$new_lockdep
 
+	echo "check_kernel_bug found something!"
+	dmesg
 	failed=1
 	return 0
 }



[-- Attachment #3: Type: text/plain, Size: 380 bytes --]

------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH 1/6 v3] cgroups/cgroup_regression_test: clear dmesg before test
  2011-07-22  8:10 [LTP] [PATCH 1/6 v3] cgroups/cgroup_regression_test: clear dmesg before test Jan Stancek
@ 2011-07-28 17:01 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2011-07-28 17:01 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list

Hi!
> dmesg can rotate and number of found bugs can actually go down,
> clear the buffer before test to avoid this
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
>   .../controllers/cgroup/cgroup_regression_test.sh   |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
> 
> 
> 

> diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
> index 878f91a..5615053 100755
> --- a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
> +++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
> @@ -40,6 +40,7 @@ elif [ "x$(id -ru)" != x0 ]; then
>  	exit 0
>  fi
>  
> +dmesg -c > /dev/null
>  nr_bug=`dmesg | grep -c "kernel BUG"`
>  nr_null=`dmesg | grep -c "kernel NULL pointer dereference"`
>  nr_warning=`dmesg | grep -c "^WARNING"`
> @@ -78,6 +79,8 @@ check_kernel_bug()
>  	nr_warning=$new_warning
>  	nr_lockdep=$new_lockdep
>  
> +	echo "check_kernel_bug found something!"
> +	dmesg
>  	failed=1
>  	return 0
>  }

Applied, but with the 'dmesg -c' the test could be simplified as storing
number of bugs in log at the start is meaningless now as it's most
likely 0.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2011-07-28 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-22  8:10 [LTP] [PATCH 1/6 v3] cgroups/cgroup_regression_test: clear dmesg before test Jan Stancek
2011-07-28 17:01 ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.