public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] memcg_function:fix the wrong of test_proc_kill
@ 2011-12-16  8:50 Peng Haitao
  2011-12-22 15:18 ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Peng Haitao @ 2011-12-16  8:50 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: LTP List


test_proc_kill() tests process will be killed due to exceed memory limit, but
when memcg_process exit due to mmap/munmap fails, the case still pass.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
 .../memcg/functional/memcg_function_test.sh        |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh b/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh
index 1f07cb5..6cfe9a5 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh
@@ -175,13 +175,23 @@ test_failcnt()
 test_proc_kill()
 {
 	echo $1 > memory.limit_in_bytes
-	$TEST_PATH/memcg_process $2 -s $3 &
+	($TEST_PATH/memcg_process $2 -s $3 2>/tmp/errlog) &
 	pid=$!
 	sleep 1
 	echo $pid > tasks
 
 	/bin/kill -s SIGUSR1 $pid 2> /dev/null
 	sleep 1
+
+	if [ -s /tmp/errlog ]; then
+		err_msg=`cat /tmp/errlog`
+		rm -f /tmp/errlog
+		result $FAIL "$err_msg"
+		return
+	fi
+
+	rm -f /tmp/errlog
+
 	ps -p $pid > /dev/null 2> /dev/null
 	if [ $? -ne 0 ]; then
 		result $PASS "process $pid is killed"
-- 
1.7.1

-- 
Best Regards,
Peng Haitao


------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2012-01-05 16:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-16  8:50 [LTP] [PATCH] memcg_function:fix the wrong of test_proc_kill Peng Haitao
2011-12-22 15:18 ` Cyril Hrubis
     [not found]   ` <4EF98B7B.3040005@cn.fujitsu.com>
2011-12-28 11:54     ` Cyril Hrubis
     [not found]       ` <4EFBCE29.9070000@cn.fujitsu.com>
2011-12-30 13:25         ` Cyril Hrubis
     [not found]           ` <4F02696B.9040202@cn.fujitsu.com>
2012-01-05 16:21             ` Cyril Hrubis

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