public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] kernel/connectors: TCONF vs TBROK, and fix check for root
@ 2013-10-25 12:32 Stanislav Kholmanskikh
  2013-10-28  3:14 ` Wanlong Gao
  2013-10-29  6:06 ` Wanlong Gao
  0 siblings, 2 replies; 3+ messages in thread
From: Stanislav Kholmanskikh @ 2013-10-25 12:32 UTC (permalink / raw)
  To: ltp-list; +Cc: vasily.isaenko

Fixed check for root the same way as in
08dcfbb5a4ebad9319c54935a600ab936708c6da.

If the test is run on unsupported kernels it
should return TCONF, not TBROK. Fixed this.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
 testcases/kernel/connectors/pec/run_pec_test |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/connectors/pec/run_pec_test b/testcases/kernel/connectors/pec/run_pec_test
index 7577ffa..2729485 100755
--- a/testcases/kernel/connectors/pec/run_pec_test
+++ b/testcases/kernel/connectors/pec/run_pec_test
@@ -33,14 +33,14 @@ export TST_COUNT=1
 
 exit_status=0
 
-if [ "$USER" != root ]; then
-	tst_brkm TBROK ignored "Test must be run as root"
+if [ $(id -u) != 0 ]; then
+	tst_brkm TCONF ignored "Test must be run as root"
 	exit 0;
 fi
 
 grep cn_proc /proc/net/connector > /dev/null
 if [ $? -ne 0 ]; then
-	tst_brkm TBROK ignored "Process Event Connector is not supported or kernel is below 2.6.26"
+	tst_brkm TCONF ignored "Process Event Connector is not supported or kernel is below 2.6.26"
 	exit 0;
 fi
 
@@ -77,7 +77,7 @@ run_case()
 	fi
 
 	if [ $ret2 -eq 2 ]; then
-		tst_brkm TBROK NULL "connector may not be supported"
+		tst_brkm TCONF NULL "connector may not be supported"
 		exit 0
 	fi
 
-- 
1.7.1


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
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

* Re: [LTP] [PATCH] kernel/connectors: TCONF vs TBROK, and fix check for root
  2013-10-25 12:32 [LTP] [PATCH] kernel/connectors: TCONF vs TBROK, and fix check for root Stanislav Kholmanskikh
@ 2013-10-28  3:14 ` Wanlong Gao
  2013-10-29  6:06 ` Wanlong Gao
  1 sibling, 0 replies; 3+ messages in thread
From: Wanlong Gao @ 2013-10-28  3:14 UTC (permalink / raw)
  To: Stanislav Kholmanskikh, ltp-list; +Cc: vasily.isaenko

On 10/25/2013 08:32 PM, Stanislav Kholmanskikh wrote:
> Fixed check for root the same way as in
> 08dcfbb5a4ebad9319c54935a600ab936708c6da.
> 
> If the test is run on unsupported kernels it
> should return TCONF, not TBROK. Fixed this.
> 
> Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>

Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>

> ---
>  testcases/kernel/connectors/pec/run_pec_test |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/testcases/kernel/connectors/pec/run_pec_test b/testcases/kernel/connectors/pec/run_pec_test
> index 7577ffa..2729485 100755
> --- a/testcases/kernel/connectors/pec/run_pec_test
> +++ b/testcases/kernel/connectors/pec/run_pec_test
> @@ -33,14 +33,14 @@ export TST_COUNT=1
>  
>  exit_status=0
>  
> -if [ "$USER" != root ]; then
> -	tst_brkm TBROK ignored "Test must be run as root"
> +if [ $(id -u) != 0 ]; then
> +	tst_brkm TCONF ignored "Test must be run as root"
>  	exit 0;
>  fi
>  
>  grep cn_proc /proc/net/connector > /dev/null
>  if [ $? -ne 0 ]; then
> -	tst_brkm TBROK ignored "Process Event Connector is not supported or kernel is below 2.6.26"
> +	tst_brkm TCONF ignored "Process Event Connector is not supported or kernel is below 2.6.26"
>  	exit 0;
>  fi
>  
> @@ -77,7 +77,7 @@ run_case()
>  	fi
>  
>  	if [ $ret2 -eq 2 ]; then
> -		tst_brkm TBROK NULL "connector may not be supported"
> +		tst_brkm TCONF NULL "connector may not be supported"
>  		exit 0
>  	fi
>  
> 


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] kernel/connectors: TCONF vs TBROK, and fix check for root
  2013-10-25 12:32 [LTP] [PATCH] kernel/connectors: TCONF vs TBROK, and fix check for root Stanislav Kholmanskikh
  2013-10-28  3:14 ` Wanlong Gao
@ 2013-10-29  6:06 ` Wanlong Gao
  1 sibling, 0 replies; 3+ messages in thread
From: Wanlong Gao @ 2013-10-29  6:06 UTC (permalink / raw)
  To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, ltp-list

On 10/25/2013 08:32 PM, Stanislav Kholmanskikh wrote:
> Fixed check for root the same way as in
> 08dcfbb5a4ebad9319c54935a600ab936708c6da.
> 
> If the test is run on unsupported kernels it
> should return TCONF, not TBROK. Fixed this.
> 
> Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>

Applied, thank you.

Wanlong Gao


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2013-10-29  6:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-25 12:32 [LTP] [PATCH] kernel/connectors: TCONF vs TBROK, and fix check for root Stanislav Kholmanskikh
2013-10-28  3:14 ` Wanlong Gao
2013-10-29  6:06 ` Wanlong Gao

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