public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] cpuset_syscall_test: delete '0x' from hex string
@ 2010-01-11 11:03 Shi Weihua
  2010-01-13 14:19 ` Subrata Modak
  0 siblings, 1 reply; 2+ messages in thread
From: Shi Weihua @ 2010-01-11 11:03 UTC (permalink / raw)
  To: ltp-list

By the latest ltp version, the following fail message outputted on my x86_64 box.
------------
TEST 5: CPUSET CONTROLLER TESTING
TEST STARTED: Please avoid using system while this test executes
...
cpuset05    8  TFAIL  :  Result(/proc/<pid>/status) = "", expect = "0")
cpuset05    9  TFAIL  :  Result(/proc/<pid>/status) = "", expect = "1")
cpuset05   10  TFAIL  :  Result(/proc/<pid>/status) = "", expect = "default")
------------

The reason is:
1, '0x' wasn't deleted from a hex string's head.
   e.g. 7f343c900000 is expected ,but 0x7f343c900000 outputted.
2, a wrong '\b' was used in a grep command.

This patch fix the upper problem. Now the message is:
------------
cpuset05    7  TPASS  :  Cpuset vs systemcall test succeeded.
cpuset05    8  TPASS  :  Cpuset vs systemcall test succeeded.
cpuset05    9  TPASS  :  Cpuset vs systemcall test succeeded.
cpuset05   10  TPASS  :  Cpuset vs systemcall test succeeded.
------------

Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
---
diff -urpN ltp-full-20091231.orig/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh ltp-full-20091231/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
--- ltp-full-20091231.orig/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh	2009-06-23 10:09:11.000000000 -0400
+++ ltp-full-20091231/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh	2010-01-11 18:42:59.000000000 -0500
@@ -178,7 +178,8 @@ test7()
 {
 	do_syscall_test 0 0 --mbind=1 0 || return 1
 	memory_addr="$(cat $TEST_OUTPUT)"
-	allowed_list=$(cat $TEST_PROCNUMA | grep "\b$memory_addr" | \
+	memory_addr=${memory_addr##*0x}
+	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
 			awk '{print $2}')
 	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
 	test "$allowed_list" = "0" || return 1
@@ -193,7 +194,8 @@ test8()
 {
 	do_syscall_test 0 0-1 --mbind=1 0 || return 1
 	memory_addr="$(cat $TEST_OUTPUT)"
-	allowed_list=$(cat $TEST_PROCNUMA | grep "\b$memory_addr" | \
+	memory_addr=${memory_addr##*0x}
+	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
 			awk '{print $2}')
 	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
 	test "$allowed_list" = "0"
@@ -208,7 +210,8 @@ test9()
 {
 	do_syscall_test 0 0-1 --mbind=6 0 || return 1
 	memory_addr="$(cat $TEST_OUTPUT)"
-	allowed_list=$(cat $TEST_PROCNUMA | grep "\b$memory_addr" | \
+	memory_addr=${memory_addr##*0x}
+	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
 			awk '{print $2}')
 	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
 	test "$allowed_list" = "1"
@@ -223,7 +226,8 @@ test10()
 {
 	do_syscall_test 0 0 --mbind=6 1 || return 1
 	memory_addr="$(cat $TEST_OUTPUT)"
-	allowed_list=$(cat $TEST_PROCNUMA | grep "\b$memory_addr" | \
+	memory_addr=${memory_addr##*0x}
+	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
 			awk '{print $2}')
 	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
 	test "$allowed_list" = "default"

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
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

* Re: [LTP] [PATCH] cpuset_syscall_test: delete '0x' from hex string
  2010-01-11 11:03 [LTP] [PATCH] cpuset_syscall_test: delete '0x' from hex string Shi Weihua
@ 2010-01-13 14:19 ` Subrata Modak
  0 siblings, 0 replies; 2+ messages in thread
From: Subrata Modak @ 2010-01-13 14:19 UTC (permalink / raw)
  To: Shi Weihua; +Cc: ltp-list

On Mon, 2010-01-11 at 19:03 +0800, Shi Weihua wrote: 
> By the latest ltp version, the following fail message outputted on my x86_64 box.
> ------------
> TEST 5: CPUSET CONTROLLER TESTING
> TEST STARTED: Please avoid using system while this test executes
> ...
> cpuset05    8  TFAIL  :  Result(/proc/<pid>/status) = "", expect = "0")
> cpuset05    9  TFAIL  :  Result(/proc/<pid>/status) = "", expect = "1")
> cpuset05   10  TFAIL  :  Result(/proc/<pid>/status) = "", expect = "default")
> ------------
> 
> The reason is:
> 1, '0x' wasn't deleted from a hex string's head.
>    e.g. 7f343c900000 is expected ,but 0x7f343c900000 outputted.
> 2, a wrong '\b' was used in a grep command.
> 
> This patch fix the upper problem. Now the message is:
> ------------
> cpuset05    7  TPASS  :  Cpuset vs systemcall test succeeded.
> cpuset05    8  TPASS  :  Cpuset vs systemcall test succeeded.
> cpuset05    9  TPASS  :  Cpuset vs systemcall test succeeded.
> cpuset05   10  TPASS  :  Cpuset vs systemcall test succeeded.
> ------------
> 
> Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>

Thanks.

Regards--
Subrata

> ---
> diff -urpN ltp-full-20091231.orig/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh ltp-full-20091231/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
> --- ltp-full-20091231.orig/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh	2009-06-23 10:09:11.000000000 -0400
> +++ ltp-full-20091231/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh	2010-01-11 18:42:59.000000000 -0500
> @@ -178,7 +178,8 @@ test7()
>  {
>  	do_syscall_test 0 0 --mbind=1 0 || return 1
>  	memory_addr="$(cat $TEST_OUTPUT)"
> -	allowed_list=$(cat $TEST_PROCNUMA | grep "\b$memory_addr" | \
> +	memory_addr=${memory_addr##*0x}
> +	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
>  			awk '{print $2}')
>  	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
>  	test "$allowed_list" = "0" || return 1
> @@ -193,7 +194,8 @@ test8()
>  {
>  	do_syscall_test 0 0-1 --mbind=1 0 || return 1
>  	memory_addr="$(cat $TEST_OUTPUT)"
> -	allowed_list=$(cat $TEST_PROCNUMA | grep "\b$memory_addr" | \
> +	memory_addr=${memory_addr##*0x}
> +	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
>  			awk '{print $2}')
>  	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
>  	test "$allowed_list" = "0"
> @@ -208,7 +210,8 @@ test9()
>  {
>  	do_syscall_test 0 0-1 --mbind=6 0 || return 1
>  	memory_addr="$(cat $TEST_OUTPUT)"
> -	allowed_list=$(cat $TEST_PROCNUMA | grep "\b$memory_addr" | \
> +	memory_addr=${memory_addr##*0x}
> +	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
>  			awk '{print $2}')
>  	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
>  	test "$allowed_list" = "1"
> @@ -223,7 +226,8 @@ test10()
>  {
>  	do_syscall_test 0 0 --mbind=6 1 || return 1
>  	memory_addr="$(cat $TEST_OUTPUT)"
> -	allowed_list=$(cat $TEST_PROCNUMA | grep "\b$memory_addr" | \
> +	memory_addr=${memory_addr##*0x}
> +	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
>  			awk '{print $2}')
>  	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
>  	test "$allowed_list" = "default"
> 
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
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:[~2010-01-13 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-11 11:03 [LTP] [PATCH] cpuset_syscall_test: delete '0x' from hex string Shi Weihua
2010-01-13 14:19 ` Subrata Modak

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