All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Haitao <penght@cn.fujitsu.com>
To: Garrett Cooper <yanegomi@gmail.com>
Cc: LTP List <ltp-list@lists.sourceforge.net>
Subject: [LTP] [PATCH] memcg_function:fix the wrong of test_proc_kill
Date: Fri, 16 Dec 2011 16:50:36 +0800	[thread overview]
Message-ID: <4EEB065C.4060805@cn.fujitsu.com> (raw)


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

             reply	other threads:[~2011-12-16  8:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-16  8:50 Peng Haitao [this message]
2011-12-22 15:18 ` [LTP] [PATCH] memcg_function:fix the wrong of test_proc_kill 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EEB065C.4060805@cn.fujitsu.com \
    --to=penght@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=yanegomi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.