]> err.no Git - util-linux/commitdiff
tests: clean up the testing scripts
authorAmérico Wang <xiyou.wangcong@gmail.com>
Thu, 6 Nov 2008 15:46:22 +0000 (15:46 +0000)
committerKarel Zak <kzak@redhat.com>
Wed, 19 Nov 2008 12:17:08 +0000 (13:17 +0100)
Do some cleanups to the testing scripts.

Signed-off-by: WANG Cong <wangcong@zeuux.org>
tests/functions.sh
tests/ts-ipcs-limits
tests/ts-mount-special

index a39c98b610db3133d0251e9146409a477dc2e450..d57d19d865cd5285429f31fa22e75dcfcf640066 100644 (file)
@@ -22,14 +22,14 @@ TS_VERBOSE="no"
 
 function ts_skip {
        echo " IGNORE ($1)"
-       if [ -n "$2" ] && [ -b "$2" ]; then
+       if [ -n "$2" -a -b "$2" ]; then
                ts_device_deinit "$2"
        fi
        exit 0
 }
 
 function ts_skip_nonroot {
-       if [ $UID != 0 ]; then
+       if [ $UID -ne 0 ]; then
                ts_skip "not root permissions"
        fi
 }
index ce760c382c500f26d52c5889935210ffa298f2cc..6224ac4406396681959f69e5da1a2efb17bc2b80 100755 (executable)
 TS_COMPONENT="ipcs"
 TS_DESC="limits overflow"
 
-if [ $UID != 0 ]; then
-       ts_init "$*"
-       ts_skip_nonroot
-fi
-
 . ./ts-ipcs.sh
 
 ts_init "$*"
+ts_skip_nonroot
 
 ts_log "load original values"
 for i in $IPCS_IDX; do
index 88b9d91deb77721cb07dd0c5291de04aebd65df7..9ec78836c88149c2741aac80dabd66518f97920e 100755 (executable)
@@ -26,12 +26,12 @@ MOUNTER="/sbin/mount.mytest"
 ts_init "$*"
 ts_skip_nonroot
 
-cat > $MOUNTER << EOF
+cat > $MOUNTER <<\EOF
 #!/bin/bash
 # This util-linux-ng regression test component
 # It's safe to remove me...
 #
-echo "\$0 called with \"\$*\""
+echo "$0 called with \"$*\""
 EOF
 chmod +x $MOUNTER