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 <[email protected]>
---
 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to