* On some systems 'smackfs' mounts aren't listed in the output from 'df', so we switch to the '/proc/mounts' instead.
* Use 'tst_brkm'. * Use '$()' instead of '``'. Signed-off-by: Zeng Linggang <zenglg...@cn.fujitsu.com> --- testcases/kernel/security/smack/smack_common.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/testcases/kernel/security/smack/smack_common.sh b/testcases/kernel/security/smack/smack_common.sh index 5d7f112..d4165d1 100755 --- a/testcases/kernel/security/smack/smack_common.sh +++ b/testcases/kernel/security/smack/smack_common.sh @@ -27,20 +27,20 @@ smackfsdir=${smackfsdir:=/smack} -check_mounted() { - if ! expr "$smackfsdir" : "$(df -P | awk "\$NF == \"$smackfsdir\""'{ print $NF }')"; then - echo "smackfs not mounted at $smackfsdir" - exit 1 +check_mounted() +{ + grep -q $smackfsdir /proc/mounts + if [ $? -ne 0 ]; then + tst_brkm TCONF "smackfs not mounted at \"$smackfsdir\"" fi } -check_onlycap() { - onlycap=`cat "$smackfsdir/onlycap" 2>/dev/null` - if [ "$onlycap" != "" ]; then - cat <<EOM -The smack label reported for $smackfsdir/onlycap is "$onlycap", not the expected "". -EOM - exit 1 +check_onlycap() +{ + onlycap=$(cat "$smackfsdir/onlycap" 2>/dev/null) + if [ -n "$onlycap" ]; then + tst_brkm TCONF "\"$smackfsdir/onlycap\" is \"$onlycap\", not" \ + "the expected \"\"." fi } -- 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