* 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_current.sh | 40 ++++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/testcases/kernel/security/smack/smack_set_current.sh b/testcases/kernel/security/smack/smack_set_current.sh index 28a1b1b..4e52c89 100755 --- a/testcases/kernel/security/smack/smack_set_current.sh +++ b/testcases/kernel/security/smack/smack_set_current.sh @@ -11,29 +11,31 @@ # /smack/onlycap unset # -source smack_common.sh +export TCID=smack_set_current +export TST_TOTAL=1 -NotTheFloorLabel="XYZZY" -StartLabel=`cat /proc/self/attr/current 2>/dev/null` +. test.sh -echo "$NotTheFloorLabel" 2>/dev/null > /proc/self/attr/current +. smack_common.sh -label=`cat /proc/self/attr/current 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 /proc/self/attr/current 2>/dev/null) + +echo "$not_floor_label" 2>/dev/null > /proc/self/attr/current + +label=$(cat /proc/self/attr/current 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 > /proc/self/attr/current +echo "$start_label" 2>/dev/null > /proc/self/attr/current -label=`cat /proc/self/attr/current > /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 /proc/self/attr/current 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