summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Kerola2014-02-17 00:54:14 +0100
committerKarel Zak2014-02-17 13:55:41 +0100
commite130ce53ce87f39f4bee3288d106c681e82dbb86 (patch)
treecc8c576a2aef0d463bdf1c8d5dd4f65971519cc1
parenttests: fix trailing spaces in cal(1) stuff (diff)
downloadkernel-qcow2-util-linux-e130ce53ce87f39f4bee3288d106c681e82dbb86.tar.gz
kernel-qcow2-util-linux-e130ce53ce87f39f4bee3288d106c681e82dbb86.tar.xz
kernel-qcow2-util-linux-e130ce53ce87f39f4bee3288d106c681e82dbb86.zip
tests: avoid executing dirname(1) command
Bash parameter expansion does the same thing. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r--tests/functions.sh2
-rwxr-xr-xtests/run.sh2
-rwxr-xr-xtests/ts/bitops/swapbytes2
-rwxr-xr-xtests/ts/blkid/low-probe2
-rwxr-xr-xtests/ts/blkid/lowprobe-pt2
-rwxr-xr-xtests/ts/blkid/md-raid0-whole2
-rwxr-xr-xtests/ts/blkid/md-raid1-part2
-rwxr-xr-xtests/ts/blkid/md-raid1-whole2
-rwxr-xr-xtests/ts/build-sys/config2
-rwxr-xr-xtests/ts/cal/1m2
-rwxr-xr-xtests/ts/cal/1mw2
-rwxr-xr-xtests/ts/cal/3m2
-rwxr-xr-xtests/ts/cal/3mw2
-rwxr-xr-xtests/ts/cal/bigyear2
-rwxr-xr-xtests/ts/cal/bigyearw2
-rwxr-xr-xtests/ts/cal/color2
-rwxr-xr-xtests/ts/cal/colorw2
-rwxr-xr-xtests/ts/cal/sep17522
-rwxr-xr-xtests/ts/cal/sep1752w2
-rwxr-xr-xtests/ts/cal/weekarg2
-rwxr-xr-xtests/ts/cal/weeknum2
-rwxr-xr-xtests/ts/cal/year2
-rwxr-xr-xtests/ts/cal/yearw2
-rwxr-xr-xtests/ts/col/multibyte2
-rwxr-xr-xtests/ts/colrm/rm2-22
-rwxr-xr-xtests/ts/column/fillrow2
-rwxr-xr-xtests/ts/column/multi-file2
-rwxr-xr-xtests/ts/column/separator_table2
-rwxr-xr-xtests/ts/cramfs/doubles2
-rwxr-xr-xtests/ts/cramfs/fsck-endianness2
-rwxr-xr-xtests/ts/cramfs/mkfs2
-rwxr-xr-xtests/ts/cramfs/mkfs-endianness2
-rwxr-xr-xtests/ts/dmesg/console-levels2
-rwxr-xr-xtests/ts/dmesg/decode2
-rwxr-xr-xtests/ts/dmesg/delta2
-rwxr-xr-xtests/ts/dmesg/facilities2
-rwxr-xr-xtests/ts/eject/umount2
-rwxr-xr-xtests/ts/fdisk/align-512-4K2
-rwxr-xr-xtests/ts/fdisk/align-512-4K-632
-rwxr-xr-xtests/ts/fdisk/align-512-4K-md2
-rwxr-xr-xtests/ts/fdisk/align-512-5122
-rwxr-xr-xtests/ts/fdisk/align-512-512-topology2
-rwxr-xr-xtests/ts/fdisk/bsd2
-rwxr-xr-xtests/ts/fdisk/gpt2
-rwxr-xr-xtests/ts/fdisk/id2
-rwxr-xr-xtests/ts/fdisk/mbr-dos-mode2
-rwxr-xr-xtests/ts/fdisk/mbr-nondos-mode2
-rwxr-xr-xtests/ts/fdisk/oddinput2
-rwxr-xr-xtests/ts/fdisk/sunlabel2
-rwxr-xr-xtests/ts/fsck/ismounted2
-rwxr-xr-xtests/ts/hexdump/format-strings2
-rwxr-xr-xtests/ts/hexdump/highlighting2
-rwxr-xr-xtests/ts/hwclock/systohc2
-rwxr-xr-xtests/ts/ipcs/headers2
-rwxr-xr-xtests/ts/ipcs/limits2
-rwxr-xr-xtests/ts/ipcs/limits22
-rwxr-xr-xtests/ts/ipcs/mk-rm-msg2
-rwxr-xr-xtests/ts/ipcs/mk-rm-sem2
-rwxr-xr-xtests/ts/ipcs/mk-rm-shm2
-rwxr-xr-xtests/ts/isosize/print-size2
-rwxr-xr-xtests/ts/last/ipv62
-rwxr-xr-xtests/ts/last/last2
-rwxr-xr-xtests/ts/libmount/context2
-rwxr-xr-xtests/ts/libmount/context-py2
-rwxr-xr-xtests/ts/libmount/context-utab2
-rwxr-xr-xtests/ts/libmount/context-utab-py2
-rwxr-xr-xtests/ts/libmount/lock2
-rwxr-xr-xtests/ts/libmount/optstr2
-rwxr-xr-xtests/ts/libmount/tabdiff2
-rwxr-xr-xtests/ts/libmount/tabfiles2
-rwxr-xr-xtests/ts/libmount/tabfiles-py2
-rwxr-xr-xtests/ts/libmount/tabfiles-tags2
-rwxr-xr-xtests/ts/libmount/tabfiles-tags-py2
-rwxr-xr-xtests/ts/libmount/update2
-rwxr-xr-xtests/ts/libmount/update-py2
-rwxr-xr-xtests/ts/libmount/utils2
-rwxr-xr-xtests/ts/login/islocal2
-rwxr-xr-xtests/ts/login/logindefs2
-rwxr-xr-xtests/ts/look/separator2
-rwxr-xr-xtests/ts/losetup/losetup2
-rwxr-xr-xtests/ts/lscpu/lscpu2
-rwxr-xr-xtests/ts/md5/md52
-rwxr-xr-xtests/ts/minix/fsck2
-rwxr-xr-xtests/ts/minix/mkfs2
-rwxr-xr-xtests/ts/misc/fallocate2
-rwxr-xr-xtests/ts/misc/getopt2
-rwxr-xr-xtests/ts/misc/ionice2
-rwxr-xr-xtests/ts/misc/line2
-rwxr-xr-xtests/ts/misc/mcookie2
-rwxr-xr-xtests/ts/misc/rev2
-rwxr-xr-xtests/ts/misc/setarch2
-rwxr-xr-xtests/ts/misc/setsid2
-rwxr-xr-xtests/ts/misc/strtosize2
-rwxr-xr-xtests/ts/misc/ul2
-rwxr-xr-xtests/ts/misc/whereis2
-rwxr-xr-xtests/ts/more/regexp2
-rwxr-xr-xtests/ts/more/squeeze2
-rwxr-xr-xtests/ts/mount/devname2
-rwxr-xr-xtests/ts/mount/fstab-broken2
-rwxr-xr-xtests/ts/mount/fstab-devname2
-rwxr-xr-xtests/ts/mount/fstab-devname2label2
-rwxr-xr-xtests/ts/mount/fstab-devname2uuid2
-rwxr-xr-xtests/ts/mount/fstab-label2
-rwxr-xr-xtests/ts/mount/fstab-label2devname2
-rwxr-xr-xtests/ts/mount/fstab-label2uuid2
-rwxr-xr-xtests/ts/mount/fstab-none2
-rwxr-xr-xtests/ts/mount/fstab-symlink2
-rwxr-xr-xtests/ts/mount/fstab-uuid2
-rwxr-xr-xtests/ts/mount/fstab-uuid2devname2
-rwxr-xr-xtests/ts/mount/fstab-uuid2label2
-rwxr-xr-xtests/ts/mount/label2
-rwxr-xr-xtests/ts/mount/move2
-rwxr-xr-xtests/ts/mount/noncanonical2
-rwxr-xr-xtests/ts/mount/paths2
-rwxr-xr-xtests/ts/mount/regfile2
-rwxr-xr-xtests/ts/mount/remount2
-rwxr-xr-xtests/ts/mount/rlimit2
-rwxr-xr-xtests/ts/mount/shared-subtree2
-rwxr-xr-xtests/ts/mount/special2
-rwxr-xr-xtests/ts/mount/umount-alltargets2
-rwxr-xr-xtests/ts/mount/umount-recursive2
-rwxr-xr-xtests/ts/mount/uuid2
-rwxr-xr-xtests/ts/namei/logic2
-rwxr-xr-xtests/ts/partx/partx2
-rwxr-xr-xtests/ts/paths/built-in2
-rwxr-xr-xtests/ts/schedutils/cpuset2
-rwxr-xr-xtests/ts/script/race2
-rwxr-xr-xtests/ts/swapon/devname2
-rwxr-xr-xtests/ts/swapon/fixpgsz2
-rwxr-xr-xtests/ts/swapon/fixsig2
-rwxr-xr-xtests/ts/swapon/label2
-rwxr-xr-xtests/ts/swapon/uuid2
-rwxr-xr-xtests/ts/tailf/simple2
-rwxr-xr-xtests/ts/utmpdump/ipv6tobin2
-rwxr-xr-xtests/ts/utmpdump/ipv6totxt2
-rwxr-xr-xtests/ts/utmpdump/to-binary2
-rwxr-xr-xtests/ts/utmpdump/to-text2
-rwxr-xr-xtests/ts/wipefs/wipefs2
138 files changed, 138 insertions, 138 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index f210204e2..c802136e2 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -117,7 +117,7 @@ function ts_init_core_subtest_env {
}
function ts_init_env {
- local mydir=$(ts_abspath $(dirname $0))
+ local mydir=$(ts_abspath ${0%/*})
LANG="POSIX"
LANGUAGE="POSIX"
diff --git a/tests/run.sh b/tests/run.sh
index 474c21cb3..8a7924ae1 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR=$(cd $(dirname $0) && pwd)
+TS_TOPDIR=$(cd ${0%/*} && pwd)
SUBTESTS=
OPTS=
diff --git a/tests/ts/bitops/swapbytes b/tests/ts/bitops/swapbytes
index 62e380c40..6b843f85e 100755
--- a/tests/ts/bitops/swapbytes
+++ b/tests/ts/bitops/swapbytes
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="swap bytes"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/blkid/low-probe b/tests/ts/blkid/low-probe
index 0ecc664c3..e22d6c849 100755
--- a/tests/ts/blkid/low-probe
+++ b/tests/ts/blkid/low-probe
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="low-level superblocks probing"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/blkid/lowprobe-pt b/tests/ts/blkid/lowprobe-pt
index b88dd6003..8def673f9 100755
--- a/tests/ts/blkid/lowprobe-pt
+++ b/tests/ts/blkid/lowprobe-pt
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="partitions probing"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/blkid/md-raid0-whole b/tests/ts/blkid/md-raid0-whole
index bf95f77f5..07ffc584a 100755
--- a/tests/ts/blkid/md-raid0-whole
+++ b/tests/ts/blkid/md-raid0-whole
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="MD raid0 (whole-disks)"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/blkid/md-raid1-part b/tests/ts/blkid/md-raid1-part
index 30900eae6..43140728c 100755
--- a/tests/ts/blkid/md-raid1-part
+++ b/tests/ts/blkid/md-raid1-part
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="MD raid1 (last partition)"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/blkid/md-raid1-whole b/tests/ts/blkid/md-raid1-whole
index fe419017e..8743d3d66 100755
--- a/tests/ts/blkid/md-raid1-whole
+++ b/tests/ts/blkid/md-raid1-whole
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="MD raid1 (whole-disks)"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/build-sys/config b/tests/ts/build-sys/config
index 508bdee85..308c34b2d 100755
--- a/tests/ts/build-sys/config
+++ b/tests/ts/build-sys/config
@@ -2,7 +2,7 @@
# Copyright (C) 2011 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="config"
# Don't execute this test by default, --force required
diff --git a/tests/ts/cal/1m b/tests/ts/cal/1m
index cf7709536..ddb0129aa 100755
--- a/tests/ts/cal/1m
+++ b/tests/ts/cal/1m
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="1 month"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/1mw b/tests/ts/cal/1mw
index 2997f14ce..c258564a4 100755
--- a/tests/ts/cal/1mw
+++ b/tests/ts/cal/1mw
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="1 month with week numbers"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/3m b/tests/ts/cal/3m
index dc6de1e9f..64e7c4e38 100755
--- a/tests/ts/cal/3m
+++ b/tests/ts/cal/3m
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="3 months"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/3mw b/tests/ts/cal/3mw
index d3b122811..934cfdc0a 100755
--- a/tests/ts/cal/3mw
+++ b/tests/ts/cal/3mw
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="3 months with week numbers"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/bigyear b/tests/ts/cal/bigyear
index e1f4a85f4..a01a9defc 100755
--- a/tests/ts/cal/bigyear
+++ b/tests/ts/cal/bigyear
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="Year 2147483646"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/bigyearw b/tests/ts/cal/bigyearw
index 6fddb0bb8..a0220bfe3 100755
--- a/tests/ts/cal/bigyearw
+++ b/tests/ts/cal/bigyearw
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="Year 2147483646 with week numbers"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/color b/tests/ts/cal/color
index 12a48b3bf..67883a2eb 100755
--- a/tests/ts/cal/color
+++ b/tests/ts/cal/color
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="color"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/colorw b/tests/ts/cal/colorw
index b08656e45..8b43461d5 100755
--- a/tests/ts/cal/colorw
+++ b/tests/ts/cal/colorw
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="color with week numbers"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/sep1752 b/tests/ts/cal/sep1752
index df86b7317..4e7fafc49 100755
--- a/tests/ts/cal/sep1752
+++ b/tests/ts/cal/sep1752
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="September 1752"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/sep1752w b/tests/ts/cal/sep1752w
index 293df39ed..bc792143c 100755
--- a/tests/ts/cal/sep1752w
+++ b/tests/ts/cal/sep1752w
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="September 1752 with week numbers"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/weekarg b/tests/ts/cal/weekarg
index 507b564c9..dc500ac19 100755
--- a/tests/ts/cal/weekarg
+++ b/tests/ts/cal/weekarg
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="week number given as argument"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/weeknum b/tests/ts/cal/weeknum
index e25b71b95..a3de709c9 100755
--- a/tests/ts/cal/weeknum
+++ b/tests/ts/cal/weeknum
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="week number corner cases"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/year b/tests/ts/cal/year
index 78b3546ef..f6b7cc7d2 100755
--- a/tests/ts/cal/year
+++ b/tests/ts/cal/year
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="year"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cal/yearw b/tests/ts/cal/yearw
index 9c7259013..9dd673cb7 100755
--- a/tests/ts/cal/yearw
+++ b/tests/ts/cal/yearw
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="year with week numbers"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/col/multibyte b/tests/ts/col/multibyte
index 70010290e..5769dd840 100755
--- a/tests/ts/col/multibyte
+++ b/tests/ts/col/multibyte
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="multibyte input"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/colrm/rm2-2 b/tests/ts/colrm/rm2-2
index a8419cbad..d44e60e2d 100755
--- a/tests/ts/colrm/rm2-2
+++ b/tests/ts/colrm/rm2-2
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="basic check"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/column/fillrow b/tests/ts/column/fillrow
index 172e8587f..71c40da37 100755
--- a/tests/ts/column/fillrow
+++ b/tests/ts/column/fillrow
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="fill row"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/column/multi-file b/tests/ts/column/multi-file
index 654a1da7d..6264bb23d 100755
--- a/tests/ts/column/multi-file
+++ b/tests/ts/column/multi-file
@@ -16,7 +16,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="multiple files"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/column/separator_table b/tests/ts/column/separator_table
index fe6f83c0a..9d39090bd 100755
--- a/tests/ts/column/separator_table
+++ b/tests/ts/column/separator_table
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="separator & table"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cramfs/doubles b/tests/ts/cramfs/doubles
index ed4e4aa72..3053ab5af 100755
--- a/tests/ts/cramfs/doubles
+++ b/tests/ts/cramfs/doubles
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="mkfs doubles"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cramfs/fsck-endianness b/tests/ts/cramfs/fsck-endianness
index 6a98c9e00..200445eb0 100755
--- a/tests/ts/cramfs/fsck-endianness
+++ b/tests/ts/cramfs/fsck-endianness
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="fsck endianness"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cramfs/mkfs b/tests/ts/cramfs/mkfs
index 5facfe9a5..bc9375dc0 100755
--- a/tests/ts/cramfs/mkfs
+++ b/tests/ts/cramfs/mkfs
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="mkfs checksums"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/cramfs/mkfs-endianness b/tests/ts/cramfs/mkfs-endianness
index 68237c0ed..147cb9c8e 100755
--- a/tests/ts/cramfs/mkfs-endianness
+++ b/tests/ts/cramfs/mkfs-endianness
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="mkfs endianness"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/dmesg/console-levels b/tests/ts/dmesg/console-levels
index b87d3fd83..7f21d9ab4 100755
--- a/tests/ts/dmesg/console-levels
+++ b/tests/ts/dmesg/console-levels
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="levels"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/dmesg/decode b/tests/ts/dmesg/decode
index a1afa6fdf..0519a0200 100755
--- a/tests/ts/dmesg/decode
+++ b/tests/ts/dmesg/decode
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="decode"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/dmesg/delta b/tests/ts/dmesg/delta
index 774ffb12f..2ad247746 100755
--- a/tests/ts/dmesg/delta
+++ b/tests/ts/dmesg/delta
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="delta"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/dmesg/facilities b/tests/ts/dmesg/facilities
index 1b7b0d4c9..e503c1a13 100755
--- a/tests/ts/dmesg/facilities
+++ b/tests/ts/dmesg/facilities
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="facilities"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/eject/umount b/tests/ts/eject/umount
index 3c1f84edf..b7ea688a8 100755
--- a/tests/ts/eject/umount
+++ b/tests/ts/eject/umount
@@ -1,6 +1,6 @@
#!/bin/bash
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="umount"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/align-512-4K b/tests/ts/fdisk/align-512-4K
index c5ea72e7a..2b247f802 100755
--- a/tests/ts/fdisk/align-512-4K
+++ b/tests/ts/fdisk/align-512-4K
@@ -20,7 +20,7 @@
# I/O size (32KiB)
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="align 512/4K"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/align-512-4K-63 b/tests/ts/fdisk/align-512-4K-63
index 4ec81982f..6190ae152 100755
--- a/tests/ts/fdisk/align-512-4K-63
+++ b/tests/ts/fdisk/align-512-4K-63
@@ -20,7 +20,7 @@
# I/O size (32KiB)
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="align 512/4K +alignment_offset"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/align-512-4K-md b/tests/ts/fdisk/align-512-4K-md
index ad5568a04..be078357f 100755
--- a/tests/ts/fdisk/align-512-4K-md
+++ b/tests/ts/fdisk/align-512-4K-md
@@ -20,7 +20,7 @@
# I/O size (32KiB)
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="align 512/4K +MD"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/align-512-512 b/tests/ts/fdisk/align-512-512
index 03133a6d1..afcb612ef 100755
--- a/tests/ts/fdisk/align-512-512
+++ b/tests/ts/fdisk/align-512-512
@@ -19,7 +19,7 @@
# topology.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="align 512/512"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/align-512-512-topology b/tests/ts/fdisk/align-512-512-topology
index 9354e45c7..8cc300929 100755
--- a/tests/ts/fdisk/align-512-512-topology
+++ b/tests/ts/fdisk/align-512-512-topology
@@ -20,7 +20,7 @@
# I/O size (32KiB)
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="align 512/512 +topology"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/bsd b/tests/ts/fdisk/bsd
index 288388d8e..23ac0537e 100755
--- a/tests/ts/fdisk/bsd
+++ b/tests/ts/fdisk/bsd
@@ -16,7 +16,7 @@
#
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="nested BSD"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/gpt b/tests/ts/fdisk/gpt
index 25079070e..75bd006e7 100755
--- a/tests/ts/fdisk/gpt
+++ b/tests/ts/fdisk/gpt
@@ -16,7 +16,7 @@
#
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="GPT"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/id b/tests/ts/fdisk/id
index 2c76f428f..866cf6ecf 100755
--- a/tests/ts/fdisk/id
+++ b/tests/ts/fdisk/id
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="MBR - id"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/mbr-dos-mode b/tests/ts/fdisk/mbr-dos-mode
index b16e95c13..45b315b64 100755
--- a/tests/ts/fdisk/mbr-dos-mode
+++ b/tests/ts/fdisk/mbr-dos-mode
@@ -16,7 +16,7 @@
#
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="MBR - dos mode"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/mbr-nondos-mode b/tests/ts/fdisk/mbr-nondos-mode
index 88a80e636..878c1190b 100755
--- a/tests/ts/fdisk/mbr-nondos-mode
+++ b/tests/ts/fdisk/mbr-nondos-mode
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="MBR - non-dos mode"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/oddinput b/tests/ts/fdisk/oddinput
index 5b9bb3108..2120ce7c8 100755
--- a/tests/ts/fdisk/oddinput
+++ b/tests/ts/fdisk/oddinput
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="invalid input tests"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fdisk/sunlabel b/tests/ts/fdisk/sunlabel
index f610ad8f5..b31ec4f5a 100755
--- a/tests/ts/fdisk/sunlabel
+++ b/tests/ts/fdisk/sunlabel
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="sunlabel tests"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/fsck/ismounted b/tests/ts/fsck/ismounted
index 6b7f0f7bc..6c64390ff 100755
--- a/tests/ts/fsck/ismounted
+++ b/tests/ts/fsck/ismounted
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="is mounted"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/hexdump/format-strings b/tests/ts/hexdump/format-strings
index 9b6745c7f..8716197cd 100755
--- a/tests/ts/hexdump/format-strings
+++ b/tests/ts/hexdump/format-strings
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="format-strings"
FILES="$TS_TOPDIR/ts/hexdump/files"
#sample input consists of hexdump-ed results of the following py3script:
diff --git a/tests/ts/hexdump/highlighting b/tests/ts/hexdump/highlighting
index 8a0aa1d9c..f3b8c8172 100755
--- a/tests/ts/hexdump/highlighting
+++ b/tests/ts/hexdump/highlighting
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="highlighting"
FILES="$TS_TOPDIR/ts/hexdump/files"
OPTS="--color=always"
diff --git a/tests/ts/hwclock/systohc b/tests/ts/hwclock/systohc
index 401ee937e..8dc56b779 100755
--- a/tests/ts/hwclock/systohc
+++ b/tests/ts/hwclock/systohc
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="system to hw"
NTP_SERVER="0.fedora.pool.ntp.org"
diff --git a/tests/ts/ipcs/headers b/tests/ts/ipcs/headers
index 99b82a383..52e108c23 100755
--- a/tests/ts/ipcs/headers
+++ b/tests/ts/ipcs/headers
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="headers"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/ipcs/limits b/tests/ts/ipcs/limits
index b44adb1c1..9e164e526 100755
--- a/tests/ts/ipcs/limits
+++ b/tests/ts/ipcs/limits
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="limits overflow"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/ipcs/limits2 b/tests/ts/ipcs/limits2
index f99a35448..39f26d708 100755
--- a/tests/ts/ipcs/limits2
+++ b/tests/ts/ipcs/limits2
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="basic limits"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/ipcs/mk-rm-msg b/tests/ts/ipcs/mk-rm-msg
index 529d86142..5bea09bed 100755
--- a/tests/ts/ipcs/mk-rm-msg
+++ b/tests/ts/ipcs/mk-rm-msg
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="mk-rm-msg"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/ipcs/mk-rm-sem b/tests/ts/ipcs/mk-rm-sem
index 2eb149d5f..816d306d4 100755
--- a/tests/ts/ipcs/mk-rm-sem
+++ b/tests/ts/ipcs/mk-rm-sem
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="mk-rm-sem"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/ipcs/mk-rm-shm b/tests/ts/ipcs/mk-rm-shm
index f2bc33ec5..8aa604df9 100755
--- a/tests/ts/ipcs/mk-rm-shm
+++ b/tests/ts/ipcs/mk-rm-shm
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="mk-rm-shm"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/isosize/print-size b/tests/ts/isosize/print-size
index cd260a0c8..3c7325b71 100755
--- a/tests/ts/isosize/print-size
+++ b/tests/ts/isosize/print-size
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="print-size"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/last/ipv6 b/tests/ts/last/ipv6
index 60b72bd4b..138cf4570 100755
--- a/tests/ts/last/ipv6
+++ b/tests/ts/last/ipv6
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="last ipv6"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/last/last b/tests/ts/last/last
index 83b7f8d08..fa263506c 100755
--- a/tests/ts/last/last
+++ b/tests/ts/last/last
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="last"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/context b/tests/ts/libmount/context
index 0c3bce986..7d06a28f0 100755
--- a/tests/ts/libmount/context
+++ b/tests/ts/libmount/context
@@ -2,7 +2,7 @@
# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="context"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/context-py b/tests/ts/libmount/context-py
index 4be19dde6..9535171ba 100755
--- a/tests/ts/libmount/context-py
+++ b/tests/ts/libmount/context-py
@@ -2,7 +2,7 @@
# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="context-py"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/context-utab b/tests/ts/libmount/context-utab
index b3aaff99f..9c1487e87 100755
--- a/tests/ts/libmount/context-utab
+++ b/tests/ts/libmount/context-utab
@@ -2,7 +2,7 @@
# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="context (utab)"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/context-utab-py b/tests/ts/libmount/context-utab-py
index ed379d4a6..c36d8acae 100755
--- a/tests/ts/libmount/context-utab-py
+++ b/tests/ts/libmount/context-utab-py
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="context-py (utab)"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/lock b/tests/ts/libmount/lock
index 5c8bcb645..26f001544 100755
--- a/tests/ts/libmount/lock
+++ b/tests/ts/libmount/lock
@@ -2,7 +2,7 @@
# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="lock"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/optstr b/tests/ts/libmount/optstr
index f6a5c0530..7de299dbe 100755
--- a/tests/ts/libmount/optstr
+++ b/tests/ts/libmount/optstr
@@ -2,7 +2,7 @@
# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="options string"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/tabdiff b/tests/ts/libmount/tabdiff
index c988258c2..80753ea2a 100755
--- a/tests/ts/libmount/tabdiff
+++ b/tests/ts/libmount/tabdiff
@@ -2,7 +2,7 @@
# Copyright (C) 2011 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="table diffs"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/tabfiles b/tests/ts/libmount/tabfiles
index c6fa360b3..a60c03894 100755
--- a/tests/ts/libmount/tabfiles
+++ b/tests/ts/libmount/tabfiles
@@ -2,7 +2,7 @@
# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="tab files"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/tabfiles-py b/tests/ts/libmount/tabfiles-py
index b89fb5bc9..89e4da249 100755
--- a/tests/ts/libmount/tabfiles-py
+++ b/tests/ts/libmount/tabfiles-py
@@ -2,7 +2,7 @@
# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="tab files-py"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/tabfiles-tags b/tests/ts/libmount/tabfiles-tags
index f52c4047c..318ccf05c 100755
--- a/tests/ts/libmount/tabfiles-tags
+++ b/tests/ts/libmount/tabfiles-tags
@@ -1,6 +1,6 @@
#!/bin/bash
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="tags"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/tabfiles-tags-py b/tests/ts/libmount/tabfiles-tags-py
index 05c2c2076..237a6d827 100755
--- a/tests/ts/libmount/tabfiles-tags-py
+++ b/tests/ts/libmount/tabfiles-tags-py
@@ -1,6 +1,6 @@
#!/bin/bash
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="tags-py"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/update b/tests/ts/libmount/update
index 6d4bce81c..89279ba26 100755
--- a/tests/ts/libmount/update
+++ b/tests/ts/libmount/update
@@ -2,7 +2,7 @@
# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="tab update"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/update-py b/tests/ts/libmount/update-py
index e49d33ef0..da14b9bae 100755
--- a/tests/ts/libmount/update-py
+++ b/tests/ts/libmount/update-py
@@ -2,7 +2,7 @@
# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="tab update-py"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/libmount/utils b/tests/ts/libmount/utils
index 6facaad10..211f015a9 100755
--- a/tests/ts/libmount/utils
+++ b/tests/ts/libmount/utils
@@ -2,7 +2,7 @@
# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="utils"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/login/islocal b/tests/ts/login/islocal
index c25da6a07..a1a7a3b60 100755
--- a/tests/ts/login/islocal
+++ b/tests/ts/login/islocal
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="islocal"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/login/logindefs b/tests/ts/login/logindefs
index 10caed752..0b3b9a44c 100755
--- a/tests/ts/login/logindefs
+++ b/tests/ts/login/logindefs
@@ -4,7 +4,7 @@
#
# This file is part of util-linux.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="defs"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/look/separator b/tests/ts/look/separator
index 51e96c9e7..967dec401 100755
--- a/tests/ts/look/separator
+++ b/tests/ts/look/separator
@@ -28,7 +28,7 @@
# uniq > words
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="separator"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/losetup/losetup b/tests/ts/losetup/losetup
index 29d4b4201..64eb03888 100755
--- a/tests/ts/losetup/losetup
+++ b/tests/ts/losetup/losetup
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="losetup"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/lscpu/lscpu b/tests/ts/lscpu/lscpu
index a7d7a952b..2b8747165 100755
--- a/tests/ts/lscpu/lscpu
+++ b/tests/ts/lscpu/lscpu
@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
. $TS_TOPDIR/functions.sh
ts_init "$*"
diff --git a/tests/ts/md5/md5 b/tests/ts/md5/md5
index e94fb6360..6fe3f147e 100755
--- a/tests/ts/md5/md5
+++ b/tests/ts/md5/md5
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
. $TS_TOPDIR/functions.sh
ts_init "$*"
diff --git a/tests/ts/minix/fsck b/tests/ts/minix/fsck
index f635fc1b4..2b290b0f8 100755
--- a/tests/ts/minix/fsck
+++ b/tests/ts/minix/fsck
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="mkfs checksums"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/minix/mkfs b/tests/ts/minix/mkfs
index 39185ad81..00d5a863d 100755
--- a/tests/ts/minix/mkfs
+++ b/tests/ts/minix/mkfs
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="mkfs"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/misc/fallocate b/tests/ts/misc/fallocate
index 735baab0f..b39794a1f 100755
--- a/tests/ts/misc/fallocate
+++ b/tests/ts/misc/fallocate
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="fallocate"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/misc/getopt b/tests/ts/misc/getopt
index a6b91cb53..082e41170 100755
--- a/tests/ts/misc/getopt
+++ b/tests/ts/misc/getopt
@@ -15,7 +15,7 @@
# This test script is modified version of 'getopt-parse.bash' example
# file in misc/ directory.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="getopt"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/misc/ionice b/tests/ts/misc/ionice
index d0cca8e8f..29f4d6164 100755
--- a/tests/ts/misc/ionice
+++ b/tests/ts/misc/ionice
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="ionice"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/misc/line b/tests/ts/misc/line
index 3863a3f89..2acf2d217 100755
--- a/tests/ts/misc/line
+++ b/tests/ts/misc/line
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="line"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/misc/mcookie b/tests/ts/misc/mcookie
index 9e650b26b..c5051bcea 100755
--- a/tests/ts/misc/mcookie
+++ b/tests/ts/misc/mcookie
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="mcookie"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/misc/rev b/tests/ts/misc/rev
index 035ce8230..5b95f289a 100755
--- a/tests/ts/misc/rev
+++ b/tests/ts/misc/rev
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="rev"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/misc/setarch b/tests/ts/misc/setarch
index 805055688..62e00707c 100755
--- a/tests/ts/misc/setarch
+++ b/tests/ts/misc/setarch
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="setarch"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/misc/setsid b/tests/ts/misc/setsid
index 43a76f9b5..a758c1273 100755
--- a/tests/ts/misc/setsid
+++ b/tests/ts/misc/setsid
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="setsid"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/misc/strtosize b/tests/ts/misc/strtosize
index 7fb2ff996..4b08b5e56 100755
--- a/tests/ts/misc/strtosize
+++ b/tests/ts/misc/strtosize
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="strtosize"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/misc/ul b/tests/ts/misc/ul
index bc0ecf74f..974a7f25e 100755
--- a/tests/ts/misc/ul
+++ b/tests/ts/misc/ul
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="ul"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/misc/whereis b/tests/ts/misc/whereis
index 853b27a65..98441193b 100755
--- a/tests/ts/misc/whereis
+++ b/tests/ts/misc/whereis
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="whereis"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/more/regexp b/tests/ts/more/regexp
index 06a00a290..947f55624 100755
--- a/tests/ts/more/regexp
+++ b/tests/ts/more/regexp
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="regexp"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/more/squeeze b/tests/ts/more/squeeze
index d448fc15f..16b537e3a 100755
--- a/tests/ts/more/squeeze
+++ b/tests/ts/more/squeeze
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="squeeze"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/devname b/tests/ts/mount/devname
index 8f32ef1ae..016a16e0e 100755
--- a/tests/ts/mount/devname
+++ b/tests/ts/mount/devname
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by devname"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/fstab-broken b/tests/ts/mount/fstab-broken
index 48fe1a18d..522453503 100755
--- a/tests/ts/mount/fstab-broken
+++ b/tests/ts/mount/fstab-broken
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="broken fstab"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/fstab-devname b/tests/ts/mount/fstab-devname
index 9af8db648..9cf73e008 100755
--- a/tests/ts/mount/fstab-devname
+++ b/tests/ts/mount/fstab-devname
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by devname (fstab)"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/fstab-devname2label b/tests/ts/mount/fstab-devname2label
index 34214dbcb..63e8126f9 100755
--- a/tests/ts/mount/fstab-devname2label
+++ b/tests/ts/mount/fstab-devname2label
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by devname (fstab label)"
LABEL="testMountD2L"
diff --git a/tests/ts/mount/fstab-devname2uuid b/tests/ts/mount/fstab-devname2uuid
index 859bcda47..8cdf946e5 100755
--- a/tests/ts/mount/fstab-devname2uuid
+++ b/tests/ts/mount/fstab-devname2uuid
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by devname (fstab uuid)"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/fstab-label b/tests/ts/mount/fstab-label
index 2c1e7eb5d..5e8a97a0f 100755
--- a/tests/ts/mount/fstab-label
+++ b/tests/ts/mount/fstab-label
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by label (fstab)"
LABEL="testFstabLabel"
diff --git a/tests/ts/mount/fstab-label2devname b/tests/ts/mount/fstab-label2devname
index 0d10f1b89..1bb8d042c 100755
--- a/tests/ts/mount/fstab-label2devname
+++ b/tests/ts/mount/fstab-label2devname
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by label (fstab devname)"
LABEL="testMountL2D"
diff --git a/tests/ts/mount/fstab-label2uuid b/tests/ts/mount/fstab-label2uuid
index 0ad4f050b..ba63a38ea 100755
--- a/tests/ts/mount/fstab-label2uuid
+++ b/tests/ts/mount/fstab-label2uuid
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by label (fstab uuid)"
LABEL="testMountL2U"
diff --git a/tests/ts/mount/fstab-none b/tests/ts/mount/fstab-none
index 62a89ca44..1a8fa78e4 100755
--- a/tests/ts/mount/fstab-none
+++ b/tests/ts/mount/fstab-none
@@ -1,6 +1,6 @@
#!/bin/bash
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="none"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/fstab-symlink b/tests/ts/mount/fstab-symlink
index 7f9d91f7b..c8d5eec72 100755
--- a/tests/ts/mount/fstab-symlink
+++ b/tests/ts/mount/fstab-symlink
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by devname (fstab symlink)"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/fstab-uuid b/tests/ts/mount/fstab-uuid
index 8c65b4d9e..a0394a4ff 100755
--- a/tests/ts/mount/fstab-uuid
+++ b/tests/ts/mount/fstab-uuid
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by uuid (fstab)"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/fstab-uuid2devname b/tests/ts/mount/fstab-uuid2devname
index 51bac141a..572291146 100755
--- a/tests/ts/mount/fstab-uuid2devname
+++ b/tests/ts/mount/fstab-uuid2devname
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by uuid (fstab devname)"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/fstab-uuid2label b/tests/ts/mount/fstab-uuid2label
index 442cdb7e3..098f43bad 100755
--- a/tests/ts/mount/fstab-uuid2label
+++ b/tests/ts/mount/fstab-uuid2label
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by uuid (fstab label)"
LABEL="testMountU2L"
diff --git a/tests/ts/mount/label b/tests/ts/mount/label
index 873ea95a5..2dda82530 100755
--- a/tests/ts/mount/label
+++ b/tests/ts/mount/label
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by label"
LABEL="testMountLabel"
diff --git a/tests/ts/mount/move b/tests/ts/mount/move
index ea376856a..dc130d484 100755
--- a/tests/ts/mount/move
+++ b/tests/ts/mount/move
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="move"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/noncanonical b/tests/ts/mount/noncanonical
index 1d28304e0..a5402d3d9 100755
--- a/tests/ts/mount/noncanonical
+++ b/tests/ts/mount/noncanonical
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="non canonical path"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/paths b/tests/ts/mount/paths
index 0b3432bd9..8a6ed352b 100755
--- a/tests/ts/mount/paths
+++ b/tests/ts/mount/paths
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="basic paths"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/regfile b/tests/ts/mount/regfile
index 8d786adbf..b342ececd 100755
--- a/tests/ts/mount/regfile
+++ b/tests/ts/mount/regfile
@@ -3,7 +3,7 @@
# Copyright (C) 2011 Karel Zak <kzak@redhat.com>
# This file is part of util-linux.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="regular file"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/remount b/tests/ts/mount/remount
index 051c595a8..c6c772f91 100755
--- a/tests/ts/mount/remount
+++ b/tests/ts/mount/remount
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="remount"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/rlimit b/tests/ts/mount/rlimit
index 7d7e42bbc..dc7a2c821 100755
--- a/tests/ts/mount/rlimit
+++ b/tests/ts/mount/rlimit
@@ -23,7 +23,7 @@
# calls are successful.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="rlimit-fsize"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/shared-subtree b/tests/ts/mount/shared-subtree
index 995aed204..c0716de2b 100755
--- a/tests/ts/mount/shared-subtree
+++ b/tests/ts/mount/shared-subtree
@@ -1,6 +1,6 @@
#!/bin/bash
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="shared-subtree"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/special b/tests/ts/mount/special
index 6e198b3b3..633f23df8 100755
--- a/tests/ts/mount/special
+++ b/tests/ts/mount/special
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="call mount.<type>"
MOUNTER="/sbin/mount.mytest"
diff --git a/tests/ts/mount/umount-alltargets b/tests/ts/mount/umount-alltargets
index 434ecab2d..e6a284727 100755
--- a/tests/ts/mount/umount-alltargets
+++ b/tests/ts/mount/umount-alltargets
@@ -2,7 +2,7 @@
# Copyright (C) 2013 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="umount-all-targets"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/umount-recursive b/tests/ts/mount/umount-recursive
index 85e54df7a..83d6dee3c 100755
--- a/tests/ts/mount/umount-recursive
+++ b/tests/ts/mount/umount-recursive
@@ -2,7 +2,7 @@
# Copyright (C) 2012 Karel Zak <kzak@redhat.com>
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="umount-recursive"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/mount/uuid b/tests/ts/mount/uuid
index e29ad3929..14df0b140 100755
--- a/tests/ts/mount/uuid
+++ b/tests/ts/mount/uuid
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by uuid"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/namei/logic b/tests/ts/namei/logic
index eda5d1b05..b216ee7cc 100755
--- a/tests/ts/namei/logic
+++ b/tests/ts/namei/logic
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="basic functionality"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/partx/partx b/tests/ts/partx/partx
index 76d1db49a..74600cbc2 100755
--- a/tests/ts/partx/partx
+++ b/tests/ts/partx/partx
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="partitions probing"
TS_IMGDIR="$TS_TOPDIR/ts/blkid/images-pt"
PARTS=3
diff --git a/tests/ts/paths/built-in b/tests/ts/paths/built-in
index 84ee55539..f866514c7 100755
--- a/tests/ts/paths/built-in
+++ b/tests/ts/paths/built-in
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="built-in"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/schedutils/cpuset b/tests/ts/schedutils/cpuset
index f3f11ddb4..9872e270c 100755
--- a/tests/ts/schedutils/cpuset
+++ b/tests/ts/schedutils/cpuset
@@ -14,7 +14,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="cpuset"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/script/race b/tests/ts/script/race
index e4822644f..98ac56a47 100755
--- a/tests/ts/script/race
+++ b/tests/ts/script/race
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="race conditions"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/swapon/devname b/tests/ts/swapon/devname
index cbab1285d..10fcc4282 100755
--- a/tests/ts/swapon/devname
+++ b/tests/ts/swapon/devname
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by devname"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/swapon/fixpgsz b/tests/ts/swapon/fixpgsz
index 0a694add3..53f8833f5 100755
--- a/tests/ts/swapon/fixpgsz
+++ b/tests/ts/swapon/fixpgsz
@@ -1,6 +1,6 @@
#!/bin/bash
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="fix page size"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/swapon/fixsig b/tests/ts/swapon/fixsig
index 2005dec4b..d7ba65625 100755
--- a/tests/ts/swapon/fixsig
+++ b/tests/ts/swapon/fixsig
@@ -1,6 +1,6 @@
#!/bin/bash
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="fix signature"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/swapon/label b/tests/ts/swapon/label
index 5df0541c1..5f9599cd2 100755
--- a/tests/ts/swapon/label
+++ b/tests/ts/swapon/label
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by label"
LABEL="testSwapLabel"
diff --git a/tests/ts/swapon/uuid b/tests/ts/swapon/uuid
index f40720ce2..858350630 100755
--- a/tests/ts/swapon/uuid
+++ b/tests/ts/swapon/uuid
@@ -15,7 +15,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="by uuid"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/tailf/simple b/tests/ts/tailf/simple
index e8bdb5012..60257aee6 100755
--- a/tests/ts/tailf/simple
+++ b/tests/ts/tailf/simple
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="simple"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/utmpdump/ipv6tobin b/tests/ts/utmpdump/ipv6tobin
index 6de99ad1b..cb52e513b 100755
--- a/tests/ts/utmpdump/ipv6tobin
+++ b/tests/ts/utmpdump/ipv6tobin
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="IPv6 to binary"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/utmpdump/ipv6totxt b/tests/ts/utmpdump/ipv6totxt
index fb81f3922..560806c5b 100755
--- a/tests/ts/utmpdump/ipv6totxt
+++ b/tests/ts/utmpdump/ipv6totxt
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="IPv6 to text"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/utmpdump/to-binary b/tests/ts/utmpdump/to-binary
index f2ec324ce..dcfe6ea1e 100755
--- a/tests/ts/utmpdump/to-binary
+++ b/tests/ts/utmpdump/to-binary
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="to-binary"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/utmpdump/to-text b/tests/ts/utmpdump/to-text
index 220f4d0a5..56f411a5d 100755
--- a/tests/ts/utmpdump/to-text
+++ b/tests/ts/utmpdump/to-text
@@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="to-text"
. $TS_TOPDIR/functions.sh
diff --git a/tests/ts/wipefs/wipefs b/tests/ts/wipefs/wipefs
index 38dbedbb1..e6ace2166 100755
--- a/tests/ts/wipefs/wipefs
+++ b/tests/ts/wipefs/wipefs
@@ -1,6 +1,6 @@
#!/bin/bash
-TS_TOPDIR="$(dirname $0)/../.."
+TS_TOPDIR="${0%/*}/../.."
TS_DESC="wipefs"
. $TS_TOPDIR/functions.sh