* Use 'test.sh' script and use 'tst_*'.

* Add 'TCID' and 'TST_TOTAL' global variables.

* Use '.' instead of 'source'.

* Use '$()' instead of '``'.

* Some cleanup.

Signed-off-by: Zeng Linggang <zenglg...@cn.fujitsu.com>
---
 .../kernel/security/smack/smack_set_direct.sh      | 40 ++++++++++++----------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/testcases/kernel/security/smack/smack_set_direct.sh 
b/testcases/kernel/security/smack/smack_set_direct.sh
index 84135f5..9d27653 100755
--- a/testcases/kernel/security/smack/smack_set_direct.sh
+++ b/testcases/kernel/security/smack/smack_set_direct.sh
@@ -10,29 +10,31 @@
 #      CAP_MAC_ADMIN
 #
 
-source smack_common.sh
+export TCID=smack_set_direct
+export TST_TOTAL=1
 
-NotTheStartValue="17"
-StartValue=`cat "$smackfsdir/direct" 2>/dev/null`
+. test.sh
 
-echo "$NotTheStartValue" 2>/dev/null > "$smackfsdir/direct"
+. smack_common.sh
 
-DirectValue=`cat "$smackfsdir/direct" 2>/dev/null`
-if [ "$DirectValue" != "$NotTheStartValue" ]; then
-       cat <<EOM
-The CIPSO direct level reported is "$DirectValue",
-not the expected "$NotTheStartValue".
-EOM
-       exit 1
+not_start_value="17"
+start_value=$(cat "$smackfsdir/direct" 2>/dev/null)
+
+echo "$not_start_value" 2>/dev/null > "$smackfsdir/direct"
+
+direct_value=$(cat "$smackfsdir/direct" 2>/dev/null)
+if [ "$direct_value" != "$not_start_value" ]; then
+       tst_brkm TFAIL "The CIPSO direct level reported is \"$direct_value\"," \
+                      "not the expected \"$not_start_value\"."
 fi
 
-echo "$StartValue" 2>/dev/null> "$smackfsdir/direct"
+echo "$start_value" 2>/dev/null> "$smackfsdir/direct"
 
-DirectValue=`cat "$smackfsdir/direct" 2>/dev/null`
-if [ "$DirectValue" != "$StartValue" ]; then
-       cat <<EOM
-The CIPSO direct level reported is "$DirectValue",
-not the expected "$StartValue".
-EOM
-       exit 1
+direct_value=$(cat "$smackfsdir/direct" 2>/dev/null)
+if [ "$direct_value" != "$start_value" ]; then
+       tst_brkm TFAIL "The CIPSO direct level reported is \"$direct_value\"," \
+                      "not the expected \"$start_value\"."
 fi
+
+tst_resm TPASS "Test \"$TCID\" success."
+tst_exit
-- 
1.9.3


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to