public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 01/12] smack_common.sh: Cleanup
@ 2014-12-23  9:33 Zeng Linggang
  2014-12-23  9:33 ` [LTP] [PATCH v2 02/12] smack_file_access.sh: Cleanup Zeng Linggang
                   ` (10 more replies)
  0 siblings, 11 replies; 17+ messages in thread
From: Zeng Linggang @ 2014-12-23  9:33 UTC (permalink / raw)
  To: ltp-list

* 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.jy@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


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-01-27 15:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-23  9:33 [LTP] [PATCH v2 01/12] smack_common.sh: Cleanup Zeng Linggang
2014-12-23  9:33 ` [LTP] [PATCH v2 02/12] smack_file_access.sh: Cleanup Zeng Linggang
2015-01-19 15:51   ` Cyril Hrubis
     [not found]     ` <1421742761-10192-1-git-send-email-zenglg.jy@cn.fujitsu.com>
     [not found]       ` <1421742761-10192-9-git-send-email-zenglg.jy@cn.fujitsu.com>
2015-01-20 13:34         ` [LTP] [PATCH v3 09/12] smack_set_load.sh: Cleanup Cyril Hrubis
     [not found]       ` <1421742761-10192-12-git-send-email-zenglg.jy@cn.fujitsu.com>
2015-01-20 13:41         ` [LTP] [PATCH v3 12/12] smack_set_socket_labels.c: Cleanup Cyril Hrubis
     [not found]           ` <1421809918-21785-1-git-send-email-zenglg.jy@cn.fujitsu.com>
2015-01-27 15:28             ` [LTP] [PATCH] smack_set_socket_labels.c: Add `parse_opts' and so on Cyril Hrubis
     [not found]       ` <1421742761-10192-8-git-send-email-zenglg.jy@cn.fujitsu.com>
     [not found]         ` <1421810019.19850.1.camel@G08JYZSD130126.localdomain>
2015-01-21 11:56           ` [LTP] [PATCH v3 08/12] smack_set_doi.sh: Cleanup Cyril Hrubis
2014-12-23  9:33 ` [LTP] [PATCH v2 03/12] smack_set_ambient.sh: Cleanup Zeng Linggang
2014-12-23  9:33 ` [LTP] [PATCH v2 04/12] smack_set_cipso.sh: Cleanup Zeng Linggang
2014-12-23  9:33 ` [LTP] [PATCH v2 05/12] smack_set_current.sh: Cleanup Zeng Linggang
2014-12-23  9:33 ` [LTP] [PATCH v2 06/12] smack_set_direct.sh: Cleanup Zeng Linggang
2014-12-23  9:33 ` [LTP] [PATCH v2 07/12] smack_set_doi.sh: Cleanup Zeng Linggang
2014-12-23  9:33 ` [LTP] [PATCH v2 08/12] smack_set_load.sh: Cleanup Zeng Linggang
2014-12-23  9:33 ` [LTP] [PATCH v2 09/12] smack_set_netlabel.sh: Cleanup Zeng Linggang
2014-12-23  9:33 ` [LTP] [PATCH v2 10/12] smack_set_onlycap.sh: Cleanup Zeng Linggang
2014-12-23  9:33 ` [LTP] [PATCH v2 11/12] smack: Rename 'notroot.c' to 'smack_notroot.c' Zeng Linggang
2014-12-23  9:33 ` [LTP] [PATCH v2 12/12] smack_set_socket_labels.c: Cleanup Zeng Linggang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox