* 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_ambient.sh | 39 ++++++++++++---------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/testcases/kernel/security/smack/smack_set_ambient.sh b/testcases/kernel/security/smack/smack_set_ambient.sh index fcfdbc5..c100b44 100755 --- a/testcases/kernel/security/smack/smack_set_ambient.sh +++ b/testcases/kernel/security/smack/smack_set_ambient.sh @@ -10,28 +10,31 @@ # CAP_MAC_ADMIN # -source smack_common.sh +export TCID=smack_set_ambient +export TST_TOTAL=1 -NotTheFloorLabel="XYZZY" -StartLabel=`cat "$smackfsdir/ambient" 2>/dev/null` +. test.sh -echo "$NotTheFloorLabel" 2>/dev/null > "$smackfsdir/ambient" +. smack_common.sh -label=`cat "$smackfsdir/ambient" 2>/dev/null` -if [ "$label" != "$NotTheFloorLabel" ]; then - cat <<EOM -The smack label reported for the current process is "$label", not the expected -"$NotTheFloorLabel". -EOM - exit 1 +not_floor_label="XYZZY" +start_label=$(cat "$smackfsdir/ambient" 2>/dev/null) + +echo "$not_floor_label" 2>/dev/null > "$smackfsdir/ambient" + +label=$(cat "$smackfsdir/ambient" 2>/dev/null) +if [ "$label" != "$not_floor_label" ]; then + tst_brkm TFAIL "The smack label reported for the current process is" \ + "\"$label\", not the expected \"$not_floor_label\"." fi -echo "$StartLabel" 2>/dev/null > "$smackfsdir/ambient" +echo "$start_label" 2>/dev/null > "$smackfsdir/ambient" -label=`cat "$smackfsdir/ambient" 2>/dev/null` -if [ "$label" != "$StartLabel" ]; then - cat <<EOM -The smack label reported for the current process is "$label", not the expected "$StartLabel". -EOM - exit 1 +label=$(cat "$smackfsdir/ambient" 2>/dev/null) +if [ "$label" != "$start_label" ]; then + tst_brkm TFAIL "The smack label reported for the current process is" \ + "\"$label\", not the expected \"$start_label\"." 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