* 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> --- testcases/kernel/security/smack/smack_set_doi.sh | 40 ++++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/testcases/kernel/security/smack/smack_set_doi.sh b/testcases/kernel/security/smack/smack_set_doi.sh index 8aca7d0..c6636e1 100755 --- a/testcases/kernel/security/smack/smack_set_doi.sh +++ b/testcases/kernel/security/smack/smack_set_doi.sh @@ -10,31 +10,31 @@ # CAP_MAC_ADMIN # -source smack_common.sh +export TCID=smack_set_doi +export TST_TOTAL=1 -NotTheStartValue="17" -StartValue=`cat "$smackfsdir/doi" 2>/dev/null` +. test.sh -echo "$NotTheStartValue" 2>/dev/null > "$smackfsdir/doi" +. smack_common.sh -DirectValue=`cat "$smackfsdir/doi" 2>/dev/null` -if [ "$DirectValue" != "$NotTheStartValue" ]; then - cat <<EOM -The CIPSO doi reported is "$DirectValue", -not the expected "$NotTheStartValue". -EOM - exit 1 +not_start_value="17" +start_value=$(cat "$smackfsdir/doi" 2>/dev/null) + +echo "$not_start_value" 2>/dev/null > "$smackfsdir/doi" + +direct_value=$(cat "$smackfsdir/doi" 2>/dev/null) +if [ "$direct_value" != "$not_start_value" ]; then + tst_brkm TFAIL "The CIPSO doi reported is \"$direct_value\", not the" \ + "expected \"$not_start_value\"." fi -echo "$StartValue" 2>/dev/null > "$smackfsdir/doi" +echo "$start_value" 2>/dev/null > "$smackfsdir/doi" -DirectValue=`cat "$smackfsdir/doi" 2>/dev/null` -if [ "$DirectValue" != "$StartValue" ]; then - cat <<EOM -The CIPSO doi reported is "$DirectValue", -not the expected "$StartValue". -EOM - exit 1 +direct_value=$(cat "$smackfsdir/doi" 2>/dev/null) +if [ "$direct_value" != "$start_value" ]; then + tst_brkm TFAIL "The CIPSO doi reported is \"$direct_value\", not the" \ + "expected \"$start_value\"." fi -exit 0 +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