public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] memcg : fix various test failures
@ 2009-09-28  6:50 liubo
  0 siblings, 0 replies; 3+ messages in thread
From: liubo @ 2009-09-28  6:50 UTC (permalink / raw)
  To: ltp-list

In memcg testcases,

1. use /dev/memcg consistently

2. for testcase_25, since 2.6.31, writing -1 to 
   memory.limit_in_bytes will reset to unlimit.

3. for testcase 35, writing to memory.force_empty for 
   non-empty cgroup should return failure.

Signed-off-by: Liu Bo <liubo-fnst@cn.fujitsu.com>

---
diff --git a/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh b/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh
index e48c8dd..e22954f 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh
@@ -398,8 +398,12 @@ testcase_24()
 testcase_25()
 {
 	echo -1 > memory.limit_in_bytes 2> /dev/null
-#	result $(( !($? != 0) ))  "return value is $?"  //lizf
-	result $(( !($? == 0) ))  "return value is $?"
+	tst_kvercmp 2 6 31
+	if [ $? -eq 0 ]; then
+		result $(( !($? != 0) ))  "return value is $?"
+       else
+		result $(( !($? == 0) ))  "return value is $?"
+	fi
 }
 
 testcase_26()
@@ -488,8 +492,8 @@ testcase_35()
 {
 	# writing to non-empty top mem cgroup's force_empty
 	# should return failure
-	echo 1 > /memcg/memory.force_empty 2> /dev/null
-	result $(( $? )) "return value is $?"
+	echo 1 > /dev/memcg/memory.force_empty 2> /dev/null
+	result $(( !$? )) "return value is $?"
 }
 
 # Case 36 - 38: Test that group and subgroup have no relationship
diff --git a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
index 1e17525..86b8cb9 100755
--- a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
+++ b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
@@ -68,11 +68,11 @@ run_stress()
 
 	for ((i = 0; i < $1; i++))
 	{
-		mkdir /memcg/$i 2> /dev/null
+		mkdir /dev/memcg/$i 2> /dev/null
 		./memcg_process_stress $2 $3 &
 		pid[$i]=$!
 
-		echo ${pid[$i]} > /memcg/$i/tasks
+		echo ${pid[$i]} > /dev/memcg/$i/tasks
 	}
 
 	for ((i = 0; i < $1; i++))
@@ -87,7 +87,7 @@ run_stress()
 		/bin/kill -s SIGINT ${pid[$i]} 2> /dev/null
 		wait ${pid[$i]}
 
-		rmdir /memcg/$i 2> /dev/null
+		rmdir /dev/memcg/$i 2> /dev/null
 	}
 
 	cleanup;

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [LTP] [PATCH] memcg : fix various test failures
@ 2009-09-28  6:54 liubo
  2009-09-28 13:05 ` Subrata Modak
  0 siblings, 1 reply; 3+ messages in thread
From: liubo @ 2009-09-28  6:54 UTC (permalink / raw)
  To: ltp-list

In memcg testcases,

1. use /dev/memcg consistently

2. for testcase_25, since 2.6.31, writing -1 to 
   memory.limit_in_bytes will reset to unlimit.

3. for testcase_35, writing to memory.force_empty for 
   non-empty cgroup should return failure.

Signed-off-by: Liu Bo <liubo-fnst@cn.fujitsu.com>

---
diff --git a/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh b/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh
index e48c8dd..e22954f 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_function_test.sh
@@ -398,8 +398,12 @@ testcase_24()
 testcase_25()
 {
 	echo -1 > memory.limit_in_bytes 2> /dev/null
-#	result $(( !($? != 0) ))  "return value is $?"  //lizf
-	result $(( !($? == 0) ))  "return value is $?"
+	tst_kvercmp 2 6 31
+	if [ $? -eq 0 ]; then
+		result $(( !($? != 0) ))  "return value is $?"
+       else
+		result $(( !($? == 0) ))  "return value is $?"
+	fi
 }
 
 testcase_26()
@@ -488,8 +492,8 @@ testcase_35()
 {
 	# writing to non-empty top mem cgroup's force_empty
 	# should return failure
-	echo 1 > /memcg/memory.force_empty 2> /dev/null
-	result $(( $? )) "return value is $?"
+	echo 1 > /dev/memcg/memory.force_empty 2> /dev/null
+	result $(( !$? )) "return value is $?"
 }
 
 # Case 36 - 38: Test that group and subgroup have no relationship
diff --git a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
index 1e17525..86b8cb9 100755
--- a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
+++ b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
@@ -68,11 +68,11 @@ run_stress()
 
 	for ((i = 0; i < $1; i++))
 	{
-		mkdir /memcg/$i 2> /dev/null
+		mkdir /dev/memcg/$i 2> /dev/null
 		./memcg_process_stress $2 $3 &
 		pid[$i]=$!
 
-		echo ${pid[$i]} > /memcg/$i/tasks
+		echo ${pid[$i]} > /dev/memcg/$i/tasks
 	}
 
 	for ((i = 0; i < $1; i++))
@@ -87,7 +87,7 @@ run_stress()
 		/bin/kill -s SIGINT ${pid[$i]} 2> /dev/null
 		wait ${pid[$i]}
 
-		rmdir /memcg/$i 2> /dev/null
+		rmdir /dev/memcg/$i 2> /dev/null
 	}
 
 	cleanup;

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2009-09-28 13:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-28  6:50 [LTP] [PATCH] memcg : fix various test failures liubo
  -- strict thread matches above, loose matches on Subject: below --
2009-09-28  6:54 liubo
2009-09-28 13:05 ` Subrata Modak

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