summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAmérico Wang2008-11-06 16:46:22 +0100
committerKarel Zak2008-11-19 13:17:08 +0100
commitf0b561b63207f679881e73a23a2374c08d340086 (patch)
tree26c4d11e732cb4ecb686de18822fb696042cb2b2 /tests
parentbuild-sys: add --disable-mount (diff)
downloadkernel-qcow2-util-linux-f0b561b63207f679881e73a23a2374c08d340086.tar.gz
kernel-qcow2-util-linux-f0b561b63207f679881e73a23a2374c08d340086.tar.xz
kernel-qcow2-util-linux-f0b561b63207f679881e73a23a2374c08d340086.zip
tests: clean up the testing scripts
Do some cleanups to the testing scripts. Signed-off-by: WANG Cong <wangcong@zeuux.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/functions.sh4
-rwxr-xr-xtests/ts-ipcs-limits6
-rwxr-xr-xtests/ts-mount-special4
3 files changed, 5 insertions, 9 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index a39c98b61..d57d19d86 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -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
}
diff --git a/tests/ts-ipcs-limits b/tests/ts-ipcs-limits
index ce760c382..6224ac440 100755
--- a/tests/ts-ipcs-limits
+++ b/tests/ts-ipcs-limits
@@ -21,14 +21,10 @@
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
diff --git a/tests/ts-mount-special b/tests/ts-mount-special
index 88b9d91de..9ec78836c 100755
--- a/tests/ts-mount-special
+++ b/tests/ts-mount-special
@@ -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