* [PATCH 1/9] tests: avoid executing dirname(1) command
@ 2014-02-16 23:54 Sami Kerola
2014-02-16 23:54 ` [PATCH 2/9] tests: make tests to run parallel Sami Kerola
` (7 more replies)
0 siblings, 8 replies; 10+ messages in thread
From: Sami Kerola @ 2014-02-16 23:54 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Bash parameter expansion does the same thing.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
tests/functions.sh | 2 +-
tests/run.sh | 2 +-
tests/ts/bitops/swapbytes | 2 +-
tests/ts/blkid/low-probe | 2 +-
tests/ts/blkid/lowprobe-pt | 2 +-
tests/ts/blkid/md-raid0-whole | 2 +-
tests/ts/blkid/md-raid1-part | 2 +-
tests/ts/blkid/md-raid1-whole | 2 +-
tests/ts/build-sys/config | 2 +-
tests/ts/cal/1m | 2 +-
tests/ts/cal/1mw | 2 +-
tests/ts/cal/3m | 2 +-
tests/ts/cal/3mw | 2 +-
tests/ts/cal/bigyear | 2 +-
tests/ts/cal/bigyearw | 2 +-
tests/ts/cal/color | 2 +-
tests/ts/cal/colorw | 2 +-
tests/ts/cal/sep1752 | 2 +-
tests/ts/cal/sep1752w | 2 +-
tests/ts/cal/weekarg | 2 +-
tests/ts/cal/weeknum | 2 +-
tests/ts/cal/year | 2 +-
tests/ts/cal/yearw | 2 +-
tests/ts/col/multibyte | 2 +-
tests/ts/colrm/rm2-2 | 2 +-
tests/ts/column/fillrow | 2 +-
tests/ts/column/multi-file | 2 +-
tests/ts/column/separator_table | 2 +-
tests/ts/cramfs/doubles | 2 +-
tests/ts/cramfs/fsck-endianness | 2 +-
tests/ts/cramfs/mkfs | 2 +-
tests/ts/cramfs/mkfs-endianness | 2 +-
tests/ts/dmesg/console-levels | 2 +-
tests/ts/dmesg/decode | 2 +-
tests/ts/dmesg/delta | 2 +-
tests/ts/dmesg/facilities | 2 +-
tests/ts/eject/umount | 2 +-
tests/ts/fdisk/align-512-4K | 2 +-
tests/ts/fdisk/align-512-4K-63 | 2 +-
tests/ts/fdisk/align-512-4K-md | 2 +-
tests/ts/fdisk/align-512-512 | 2 +-
tests/ts/fdisk/align-512-512-topology | 2 +-
tests/ts/fdisk/bsd | 2 +-
tests/ts/fdisk/gpt | 2 +-
tests/ts/fdisk/id | 2 +-
tests/ts/fdisk/mbr-dos-mode | 2 +-
tests/ts/fdisk/mbr-nondos-mode | 2 +-
tests/ts/fdisk/oddinput | 2 +-
tests/ts/fdisk/sunlabel | 2 +-
tests/ts/fsck/ismounted | 2 +-
tests/ts/hexdump/format-strings | 2 +-
tests/ts/hexdump/highlighting | 2 +-
tests/ts/hwclock/systohc | 2 +-
| 2 +-
tests/ts/ipcs/limits | 2 +-
tests/ts/ipcs/limits2 | 2 +-
tests/ts/ipcs/mk-rm-msg | 2 +-
tests/ts/ipcs/mk-rm-sem | 2 +-
tests/ts/ipcs/mk-rm-shm | 2 +-
tests/ts/isosize/print-size | 2 +-
tests/ts/last/ipv6 | 2 +-
tests/ts/last/last | 2 +-
tests/ts/libmount/context | 2 +-
tests/ts/libmount/context-py | 2 +-
tests/ts/libmount/context-utab | 2 +-
tests/ts/libmount/context-utab-py | 2 +-
tests/ts/libmount/lock | 2 +-
tests/ts/libmount/optstr | 2 +-
tests/ts/libmount/tabdiff | 2 +-
tests/ts/libmount/tabfiles | 2 +-
tests/ts/libmount/tabfiles-py | 2 +-
tests/ts/libmount/tabfiles-tags | 2 +-
tests/ts/libmount/tabfiles-tags-py | 2 +-
tests/ts/libmount/update | 2 +-
tests/ts/libmount/update-py | 2 +-
tests/ts/libmount/utils | 2 +-
tests/ts/login/islocal | 2 +-
tests/ts/login/logindefs | 2 +-
tests/ts/look/separator | 2 +-
tests/ts/losetup/losetup | 2 +-
tests/ts/lscpu/lscpu | 2 +-
tests/ts/md5/md5 | 2 +-
tests/ts/minix/fsck | 2 +-
tests/ts/minix/mkfs | 2 +-
tests/ts/misc/fallocate | 2 +-
tests/ts/misc/getopt | 2 +-
tests/ts/misc/ionice | 2 +-
tests/ts/misc/line | 2 +-
tests/ts/misc/mcookie | 2 +-
tests/ts/misc/rev | 2 +-
tests/ts/misc/setarch | 2 +-
tests/ts/misc/setsid | 2 +-
tests/ts/misc/strtosize | 2 +-
tests/ts/misc/ul | 2 +-
tests/ts/misc/whereis | 2 +-
tests/ts/more/regexp | 2 +-
tests/ts/more/squeeze | 2 +-
tests/ts/mount/devname | 2 +-
tests/ts/mount/fstab-broken | 2 +-
tests/ts/mount/fstab-devname | 2 +-
tests/ts/mount/fstab-devname2label | 2 +-
tests/ts/mount/fstab-devname2uuid | 2 +-
tests/ts/mount/fstab-label | 2 +-
tests/ts/mount/fstab-label2devname | 2 +-
tests/ts/mount/fstab-label2uuid | 2 +-
tests/ts/mount/fstab-none | 2 +-
tests/ts/mount/fstab-symlink | 2 +-
tests/ts/mount/fstab-uuid | 2 +-
tests/ts/mount/fstab-uuid2devname | 2 +-
tests/ts/mount/fstab-uuid2label | 2 +-
tests/ts/mount/label | 2 +-
tests/ts/mount/move | 2 +-
tests/ts/mount/noncanonical | 2 +-
tests/ts/mount/paths | 2 +-
tests/ts/mount/regfile | 2 +-
tests/ts/mount/remount | 2 +-
tests/ts/mount/rlimit | 2 +-
tests/ts/mount/shared-subtree | 2 +-
tests/ts/mount/special | 2 +-
tests/ts/mount/umount-alltargets | 2 +-
tests/ts/mount/umount-recursive | 2 +-
tests/ts/mount/uuid | 2 +-
tests/ts/namei/logic | 2 +-
tests/ts/partx/partx | 2 +-
tests/ts/paths/built-in | 2 +-
tests/ts/schedutils/cpuset | 2 +-
tests/ts/script/race | 2 +-
tests/ts/swapon/devname | 2 +-
tests/ts/swapon/fixpgsz | 2 +-
tests/ts/swapon/fixsig | 2 +-
tests/ts/swapon/label | 2 +-
tests/ts/swapon/uuid | 2 +-
tests/ts/tailf/simple | 2 +-
tests/ts/utmpdump/ipv6tobin | 2 +-
tests/ts/utmpdump/ipv6totxt | 2 +-
tests/ts/utmpdump/to-binary | 2 +-
tests/ts/utmpdump/to-text | 2 +-
tests/ts/wipefs/wipefs | 2 +-
138 files changed, 138 insertions(+), 138 deletions(-)
diff --git a/tests/functions.sh b/tests/functions.sh
index 32b299a..17fa6d2 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -123,7 +123,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 474c21c..8a7924a 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 74f0834..798ad53 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 adf022c..eaee089 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 a7404af..4e9927b 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 e8eeddb..46442bb 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 453d93d..0257e15 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 9967c0c..fcb55c2 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 508bdee..308c34b 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 916959c..295758a 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 9923dd1..6664948 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 489ffe4..50f284e 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 fcb261c..5ea951e 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 d382e1b..b5e415c 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 f7b4aa6..75a18dd 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 d0a3c28..44e9381 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 4fcdee5..0092e13 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 f8f8ef5..fa57b9b 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 8542801..b229e83 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 3d90f64..a798705 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 d0c300e..0bea00d 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 02ace8c..1204b5f 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 dacf235..c05b1c2 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 dc9db41..e9c0292 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 a732015..c13e4ec 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 a68d5e9..263a267 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 591ccd8..76b8686 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 6591756..8be1e20 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 b849032..9b1ce2e 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 c4ea51d..33bd18b 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 66ae0b6..96d6855 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 424cc92..c7df720 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 2c2c57e..14c69c9 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 5ac17bf..63f3c5c 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 7d1de3e..da48042 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 646f875..7066ae5 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 940c77b..e781a7b 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 c733170..5d70fe1 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 bcc1c76..65f2a75 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 d300b4e..9a2cb88 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 9862b58..8057f93 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 b11bc9b..f988b4e 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 54c0a95..7e3c787 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 5737544..3c174e9 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 2126b66..a24d793 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 829d27d..6d517ea 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 d6a6af3..9c38f3a 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 f71b7e2..8d51220 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 46392fa..5bfbb4f 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 93c2e81..6856016 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 0b30037..229e651 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 8a0aa1d..f3b8c81 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 d60adfb..8a3ecca 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"
--git a/tests/ts/ipcs/headers b/tests/ts/ipcs/headers
index 6790471..5089ea5 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 b4f71b0..71980b5 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 769012b..7a7549a 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 a752173..72f89b8 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 7fd10c9..3152618 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 987127a..9695ed1 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 1476b35..312fdc1 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 a09adea..b9b4de4 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 98ba25b..b6308fc 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 3d29d04..35e1a01 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 917e7d9..8406344 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 61af96e..4d3e3d7 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 5eafce6..b454ceb 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 5c8bcb6..26f0015 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 f6a5c05..7de299d 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 c988258..80753ea 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 c6fa360..a60c038 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 b89fb5b..89e4da2 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 f52c404..318ccf0 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 05c2c20..237a6d8 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 6d4bce8..89279ba 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 e49d33e..da14b9b 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 6facaad..211f015 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 3c95a0d..bb37270 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 c3c6385..2db3f89 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 bac9b60..c6028e3 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 86b9c38..234c58f 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 bd8c81b..4a98b86 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 e94fb63..6fe3f14 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 b8cfbc7..70ad2fa 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 cb124cc..0159c7b 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 b68395f..cbb25d8 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 9051947..715ec36 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 3dc73fb..32b2259 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 97aba72..a17ee28 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 d26250a..96e3cc7 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 0586044..a3d45e6 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 f351976..9120509 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 14578a9..baef70d 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 7fb2ff9..4b08b5e 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 593f94a..2c2c1da 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 1fe29fc..ee7ec27 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 4fea43e..67c6f62 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 629c764..d5b4a6a 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 8de8765..1cab468 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 a6435e0..5934c22 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 b3535b0..4dcc4fc 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 0df5021..f804095 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 ee5564c..f554826 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 757fdac..24fb80f 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 7ccb887..b2359a5 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 4079fc4..165426b 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 4a107b0..64eb48b 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 f609b29..ddabcd6 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 860ee73..5d3afb7 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 62536dd..90f7d91 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 d2e164a..5291688 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 d72700e..b0e7ca6 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 63df049..5244887 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 0577967..a311577 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 2ea1917..edc2837 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 5050929..9f24c72 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 21e8590..f983ab3 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 c28cdc0..13064c8 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 c1905e8..9715e1d 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 b65333c..21edd65 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 fe54145..e3b5aec 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 241cc1c..d55f612 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 331e2c8..0233064 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 21517dd..df48b76 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 a81ef12..bc612b0 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 84ee555..f866514 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 ab516c3..f1df597 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 34c6409..ef7e83f 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 43db36b..f8f3121 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 70596d3..f0dafe9 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 937a2ec..a4d0411 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 84967e8..03cf017 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 78d9d49..c80e52f 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 20dc630..955844d 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 4e9e974..fac6fb9 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 17ce2b8..b9da8ab 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 effbfdb..e774915 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 cb04175..e982150 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 bd0d8f3..4bd1748 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
--
1.9.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/9] tests: make tests to run parallel
2014-02-16 23:54 [PATCH 1/9] tests: avoid executing dirname(1) command Sami Kerola
@ 2014-02-16 23:54 ` Sami Kerola
2014-02-17 14:11 ` Karel Zak
2014-02-16 23:54 ` [PATCH 3/9] tools: add usage information to checkconfig.sh Sami Kerola
` (6 subsequent siblings)
7 siblings, 1 reply; 10+ messages in thread
From: Sami Kerola @ 2014-02-16 23:54 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Unarguably this change makes test output to be more messy, but when I
compare run time tells with clear numbers parallel is quicker. For me
the quickness is important factor. Running test suite always after a
change is preferrably quick, and if something is indicated to be broken
it is ok to spend time in drilling down what happen.
$ time ./tests/run.sh --parallel=5
[...]
real 1m48.037s
Same without parallelization.
$ time ./tests/run.sh
real 3m16.687s
The default is changed to be parallel, where job count is same as number
of CPUs.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
tests/functions.sh | 15 +++++++--------
tests/run.sh | 32 +++++++++++++++++++-------------
2 files changed, 26 insertions(+), 21 deletions(-)
diff --git a/tests/functions.sh b/tests/functions.sh
index 17fa6d2..f6f2a5c 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -38,7 +38,7 @@ function ts_check_test_command {
}
function ts_skip_subtest {
- echo " IGNORE ($1)"
+ echo "$TITLE IGNORE ($1)"
}
function ts_skip {
@@ -57,9 +57,9 @@ function ts_skip_nonroot {
function ts_failed_subtest {
if [ x"$1" == x"" ]; then
- echo " FAILED ($TS_NS)"
+ echo "$TITLE FAILED ($TS_NS)"
else
- echo " FAILED ($1)"
+ echo "$TITLE FAILED ($1)"
fi
}
@@ -70,9 +70,9 @@ function ts_failed {
function ts_ok_subtest {
if [ x"$1" == x"" ]; then
- echo " OK"
+ echo "$TITLE OK"
else
- echo " OK ($1)"
+ echo "$TITLE OK ($1)"
fi
}
@@ -214,8 +214,7 @@ function ts_init_subtest {
[ $TS_NSUBTESTS -eq 0 ] && echo
TS_NSUBTESTS=$(( $TS_NSUBTESTS + 1 ))
-
- printf "%16s: %-27s ..." "" "$TS_SUBNAME"
+ TITLE=$(printf "%13s: %-30s ...\n%16s: %-27s ..." "$TS_COMPONENT" "$TS_DESC" "" "$TS_SUBNAME")
}
function ts_init {
@@ -229,7 +228,7 @@ function ts_init {
ts_init_env "$*"
- printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_DESC"
+ TITLE=$(printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_DESC")
[ "$is_fake" == "yes" ] && ts_skip "fake mode"
[ "$TS_OPTIONAL" == "yes" -a "$is_force" != "yes" ] && ts_skip "optional"
diff --git a/tests/run.sh b/tests/run.sh
index 8a7924a..4f55295 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -23,6 +23,8 @@ OPTS=
top_srcdir=
top_builddir=
+paraller_jobs=$(lscpu -bp | grep -cv '^#')
+
while [ -n "$1" ]; do
case "$1" in
--force)
@@ -49,6 +51,9 @@ while [ -n "$1" ]; do
--builddir=*)
top_builddir="${1##--builddir=}"
;;
+ --parallel=*)
+ paraller_jobs="${1##--parallel=}"
+ ;;
--*)
echo "Unknown option $1"
echo "Usage: "
@@ -61,6 +66,7 @@ while [ -n "$1" ]; do
echo " --nonroot ignore test suite if user is root"
echo " --srcdir=<path> autotools top source directory"
echo " --builddir=<path> autotools top build directory"
+ echo " --parallel=<num> number of parallel test jobs, default: num cpus"
echo
exit 1
;;
@@ -87,12 +93,12 @@ fi
OPTS="$OPTS --srcdir=$top_srcdir --builddir=$top_builddir"
+declare -a comps
if [ -n "$SUBTESTS" ]; then
# selected tests only
for s in $SUBTESTS; do
if [ -d "$top_srcdir/tests/ts/$s" ]; then
- co=$(find $top_srcdir/tests/ts/$s -type f -perm /a+x -regex ".*/[^\.~]*" | sort)
- comps="$comps $co"
+ comps+=( $(find $top_srcdir/tests/ts/$s -type f -perm /a+x -regex ".*/[^\.~]*") )
else
echo "Unknown test component '$s'"
exit 1
@@ -104,7 +110,7 @@ else
exit 1
fi
- comps=$(find $top_srcdir/tests/ts/ -type f -perm /a+x -regex ".*/[^\.~]*" | sort)
+ comps=( $(find $top_srcdir/tests/ts/ -type f -perm /a+x -regex ".*/[^\.~]*") )
fi
@@ -119,21 +125,21 @@ echo " For development purpose only. "
echo " Don't execute on production system! "
echo
-res=0
count=0
-for ts in $comps; do
- $ts "$OPTS"
- res=$(( $res + $? ))
- count=$(( $count + 1 ))
-done
-
+>| $top_srcdir/tests/failures
+printf "%s\n" ${comps[*]} |
+ xargs -I '{}' -P $paraller_jobs -n 1 bash -c "'{}' \"$OPTS\" ||
+ echo 1 >> $top_srcdir/tests/failures"
+declare -a fail_file
+fail_file=( $( < $top_srcdir/tests/failures ) )
+rm -f $top_srcdir/tests/failures
echo
echo "---------------------------------------------------------------------"
-if [ $res -eq 0 ]; then
- echo " All $count tests PASSED"
+if [ ${#fail_file[@]} -eq 0 ]; then
+ echo " All ${#comps[@]} tests PASSED"
res=0
else
- echo " $res tests of $count FAILED"
+ echo " ${#fail_file[@]} tests of ${#comps[@]} FAILED"
res=1
fi
echo "---------------------------------------------------------------------"
--
1.9.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/9] tools: add usage information to checkconfig.sh
2014-02-16 23:54 [PATCH 1/9] tests: avoid executing dirname(1) command Sami Kerola
2014-02-16 23:54 ` [PATCH 2/9] tests: make tests to run parallel Sami Kerola
@ 2014-02-16 23:54 ` Sami Kerola
2014-02-16 23:54 ` [PATCH 4/9] docs: make hexdump.1 color specification easier to understand Sami Kerola
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Sami Kerola @ 2014-02-16 23:54 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
tools/checkconfig.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/checkconfig.sh b/tools/checkconfig.sh
index 91f7b1c..5f2063a 100755
--- a/tools/checkconfig.sh
+++ b/tools/checkconfig.sh
@@ -16,6 +16,17 @@ die() {
exit 1
}
+usage() {
+ echo "Usage:"
+ echo " $0 <top_srcdir> <srcfile> [<srcfile> ...]"
+ echo "Example:"
+ echo " find . -name '*.c' | xargs $0 \$(git rev-parse --show-toplevel)"
+}
+
+if [ $# -eq 0 ]; then
+ usage
+ exit 1
+fi
srcdir=$1
config="$srcdir/config.h.in"
--
1.9.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/9] docs: make hexdump.1 color specification easier to understand
2014-02-16 23:54 [PATCH 1/9] tests: avoid executing dirname(1) command Sami Kerola
2014-02-16 23:54 ` [PATCH 2/9] tests: make tests to run parallel Sami Kerola
2014-02-16 23:54 ` [PATCH 3/9] tools: add usage information to checkconfig.sh Sami Kerola
@ 2014-02-16 23:54 ` Sami Kerola
2014-02-16 23:54 ` [PATCH 5/9] tests: align last.1 with recent phantom detection Sami Kerola
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Sami Kerola @ 2014-02-16 23:54 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Fix also spacing, input line lenghts, and troff table for data that is a
table.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
text-utils/hexdump.1 | 72 ++++++++++++++++++++++++++--------------------------
1 file changed, 36 insertions(+), 36 deletions(-)
diff --git a/text-utils/hexdump.1 b/text-utils/hexdump.1
index 8b4bf27..edf5d6f 100644
--- a/text-utils/hexdump.1
+++ b/text-utils/hexdump.1
@@ -226,46 +226,46 @@ displayed as a single
Output US ASCII characters, with the exception that control characters are
displayed using the following, lower-case, names. Characters greater than
0xff, hexadecimal, are displayed as hexadecimal strings.
-.PP
-.nf
- 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq
- 006 ack 007 bel 008 bs 009 ht 00A lf 00B vt
- 00C ff 00D cr 00E so 00F si 010 dle 011 dc1
- 012 dc2 013 dc3 014 dc4 015 nak 016 syn 017 etb
- 018 can 019 em 01A sub 01B esc 01C fs 01D gs
- 01E rs 01F us 0FF del
-.nf
+.RS 10
+.TS
+tab(|);
+left l l l l l.
+000 nul|001 soh|002 stx|003 etx|004 eot|005 enq
+006 ack|007 bel|008 bs|009 ht|00A lf|00B vt
+00C ff|00D cr|00E so|00F si|010 dle|011 dc1
+012 dc2|013 dc3|014 dc4|015 nak|016 syn|017 etb
+018 can|019 em|01A sub|01B esc|01C fs|01D gs
+01E rs|01F us|0FF del
+.TE
.SS Colors
-When put at the end of a format specifier, hexdump highlights the respective
-string with the color specified. Conditions, if present, are evaluated
-prior to highlighting.
-.TP
-.B \&_L[color_unit_1,color_unit_2,...,color_unit_n]
-.TP
+When put at the end of a format specifier, hexdump highlights the
+respective string with the color specified. Conditions, if present, are
+evaluated prior to highlighting.
+.PP
+.B \&_L[color_unit_1,\:color_unit_2,\:...,\:color_unit_n]
+.PP
The full syntax of a color unit is as follows:
-.TP
-.B [!]COLOR[:HEX_VAL|:OCT_VAL|:STRING][@DEC_OFFT|@DEC_OFFT_START-DEC_OFFT_END]
+.PP
+.B [!]COLOR\:[:VALUE]\:[@OFFSET_START[-END]]
.TP
.B !
-Negate the condition. Please note that it only makes sense to negate
-a unit if both a value/string and an offset are specified. In that case
-the respective output string will be highlighted if and only if the value/string
-does not match the one at the offset.
-.PP
+Negate the condition. Please note that it only makes sense to negate a
+unit if both a value/\:string and an offset are specified. In that case
+the respective output string will be highlighted if and only if the
+value/\:string does not match the one at the offset.
+.TP
.BR COLOR
One of the 8 basic shell colors.
-.PP
-.BR HEX_VAL , OCT_VAL
-A value to be matched specified in hexadecimal or octal base.
-.PP
-.BR STRING
-A string to be matched. Please note that the usual C escape sequences
-are not interpreted by hexdump inside the color_units.
-.PP
-.BR DEC_OFFT , DEC_OFFT_START , DEC_OFFT_END
-An offset or an offset range at which
-to check for a match. Please note that DEC_OFFT is equal to DEC_OFFT-DEC_OFFT.
-Also, the range may not be larger than the respective format byte count.
+.TP
+.B VALUE
+A value to be matched specified in hexadecimal, or octal base, or as a
+string. Please note that the usual C escape sequences are not
+interpreted by hexdump inside the color_units.
+.TP
+.B OFFSET
+An offset or an offset range at which to check for a match. Please note
+that lone OFFSET_START uses the same value as END offset. Also, the
+range may not be larger than the respective format byte count.
.SS Counters
The default and supported byte counts for the conversion characters
are as follows:
@@ -345,8 +345,8 @@ Implement the \-x option:
"%07.7_ax " 8/2 "%04x " "\en"
.nf
.PP
-MBR Boot Signature example:
-Highlight the addresses cyan and the bytes at offsets 510 and 511 green if their value is 0xAA55, red otherwise.
+MBR Boot Signature example: Highlight the addresses cyan and the bytes at
+offsets 510 and 511 green if their value is 0xAA55, red otherwise.
.nf
"%07.7_Ax_L[cyan]\en"
"%07.7_ax_L[cyan] " 8/2 " %04x_L[green:0xAA55@510-511,!red:0xAA55@510-511] " "\en"
--
1.9.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/9] tests: align last.1 with recent phantom detection
2014-02-16 23:54 [PATCH 1/9] tests: avoid executing dirname(1) command Sami Kerola
` (2 preceding siblings ...)
2014-02-16 23:54 ` [PATCH 4/9] docs: make hexdump.1 color specification easier to understand Sami Kerola
@ 2014-02-16 23:54 ` Sami Kerola
2014-02-16 23:54 ` [PATCH 6/9] swaplabel: wrong version number in check Sami Kerola
` (3 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Sami Kerola @ 2014-02-16 23:54 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
None existing account is not still-logged-in but gone mysteriously,
assuming wtmp logout markup is missing.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
tests/expected/last/last | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tests/expected/last/last b/tests/expected/last/last
index 2ff5cc1..dfb140b 100644
--- a/tests/expected/last/last
+++ b/tests/expected/last/last
@@ -1,6 +1,6 @@
~~~ basic output ~~~
rick long never-gonna-logo Thu Jan 1 00:00 - 03:14 (24855+03:14)
-torvalds linux hobby Mon Aug 26 00:57 still logged in
+torvalds linux hobby Mon Aug 26 00:57 gone - no logout
reboot system boot system-name Wed Aug 28 18:00 still running
reboot system boot system-name Wed Aug 28 16:00 - 17:00 (01:00)
IPv4 root dns-server Wed Aug 28 13:00 - 14:00 (01:00)
@@ -17,7 +17,7 @@ accounti foo nine Wed Aug 28 03:00 - 04:00 (01:00)
wtmp begins Wed Aug 28 03:00:00 2013
~~~ include system ~~~
rick long never-gonna-logo Thu Jan 1 00:00 - 03:14 (24855+03:14)
-torvalds linux hobby Mon Aug 26 00:57 still logged in
+torvalds linux hobby Mon Aug 26 00:57 gone - no logout
reboot system boot system-name Wed Aug 28 18:00 still running
shutdown system down system-name Wed Aug 28 17:00 - 18:00 (01:00)
reboot system boot system-name Wed Aug 28 16:00 - 17:00 (01:00)
@@ -47,16 +47,16 @@ IPv4 root Wed Aug 28 13:00 - 14:00 (01:00) a.root-servers.net
wtmp begins Wed Aug 28 03:00:00 2013
~~~ show ip ~~~
-torvalds linux 128.214.205.14 Mon Aug 26 00:57 still logged in
+torvalds linux 128.214.205.14 Mon Aug 26 00:57 gone - no logout
wtmp begins Wed Aug 28 03:00:00 2013
~~~ no host ~~~
-torvalds linux Mon Aug 26 00:57 still logged in
+torvalds linux Mon Aug 26 00:57 gone - no logout
wtmp begins Wed Aug 28 03:00:00 2013
~~~ full times ~~~
rick long never-gonna-logo Thu Jan 1 00:00:00 1970 - Tue Jan 19 03:14:07 2038 (24855+03:14)
-torvalds linux hobby Mon Aug 26 00:57:08 1991 still logged in
+torvalds linux hobby Mon Aug 26 00:57:08 1991 gone - no logout
reboot system boot system-name Wed Aug 28 18:00:00 2013 still running
reboot system boot system-name Wed Aug 28 16:00:00 2013 - Wed Aug 28 17:00:00 2013 (01:00)
IPv4 root dns-server Wed Aug 28 13:00:00 2013 - Wed Aug 28 14:00:00 2013 (01:00)
@@ -73,7 +73,7 @@ accounti foo nine Wed Aug 28 03:00:00 2013 - Wed Aug 28 04:
wtmp begins Wed Aug 28 03:00:00 2013
~~~ no time ~~~
rick long never-gonna-logo (24855+03:14)
-torvalds linux hobby logged in
+torvalds linux hobby - no logout
reboot system boot system-name running
reboot system boot system-name (01:00)
IPv4 root dns-server (01:00)
@@ -90,7 +90,7 @@ accounti foo nine (01:00)
wtmp begins Wed Aug 28 03:00:00 2013
~~~ iso-8601 time ~~~
rick long never-gonna-logout 1970-01-01T00:00:00+0000 - 2038-01-19T03:14:07+0000 (24855+03:14)
-torvalds linux hobby 1991-08-26T00:57:08+0000 still logged in
+torvalds linux hobby 1991-08-26T00:57:08+0000 gone - no logout
reboot system boot system-name 2013-08-28T18:00:00+0000 still running
reboot system boot system-name 2013-08-28T16:00:00+0000 - 2013-08-28T17:00:00+0000 (01:00)
IPv4 root dns-server 2013-08-28T13:00:00+0000 - 2013-08-28T14:00:00+0000 (01:00)
@@ -115,7 +115,7 @@ accounti foo nine Wed Aug 28 03:00 - 04:00 (01:00)
wtmp begins Wed Aug 28 03:00:00 2013
~~~ present ~~~
rick long never-gonna-logo Thu Jan 1 00:00 - 03:14 (24855+03:14)
-torvalds linux hobby Mon Aug 26 00:57 still logged in
+torvalds linux hobby Mon Aug 26 00:57 gone - no logout
runlevel foo one Wed Aug 28 11:00 - 12:00 (01:00)
wtmp begins Wed Aug 28 03:00:00 2013
--
1.9.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 6/9] swaplabel: wrong version number in check
2014-02-16 23:54 [PATCH 1/9] tests: avoid executing dirname(1) command Sami Kerola
` (3 preceding siblings ...)
2014-02-16 23:54 ` [PATCH 5/9] tests: align last.1 with recent phantom detection Sami Kerola
@ 2014-02-16 23:54 ` Sami Kerola
2014-02-16 23:54 ` [PATCH 7/9] isosize: move file name printing after error determination Sami Kerola
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Sami Kerola @ 2014-02-16 23:54 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
$ swaplabel /dev/sda2
swaplabel: /dev/sda2: unsupported swap version '1'
The mkswap does not allow any other version, so swaplabel(8) must be
wrong.
Reference: https://github.com/karelzak/util-linux/blob/master/disk-utils/mkswap.c#L520
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
disk-utils/swaplabel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/disk-utils/swaplabel.c b/disk-utils/swaplabel.c
index a5ccb7e..5d048aa 100644
--- a/disk-utils/swaplabel.c
+++ b/disk-utils/swaplabel.c
@@ -70,7 +70,7 @@ static blkid_probe get_swap_prober(const char *devname)
/* supported is SWAPSPACE2 only */
if (blkid_probe_lookup_value(pr, "VERSION", &version, NULL) == 0
&& version
- && strcmp(version, "2"))
+ && strcmp(version, "1"))
warnx(_("%s: unsupported swap version '%s'"),
devname, version);
else
--
1.9.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 7/9] isosize: move file name printing after error determination
2014-02-16 23:54 [PATCH 1/9] tests: avoid executing dirname(1) command Sami Kerola
` (4 preceding siblings ...)
2014-02-16 23:54 ` [PATCH 6/9] swaplabel: wrong version number in check Sami Kerola
@ 2014-02-16 23:54 ` Sami Kerola
2014-02-16 23:54 ` [PATCH 8/9] tests: add isosize --sectors and --divisor tests Sami Kerola
2014-02-16 23:54 ` [PATCH 9/9] isosize: make --divisor to require argument Sami Kerola
7 siblings, 0 replies; 10+ messages in thread
From: Sami Kerola @ 2014-02-16 23:54 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Earlier the filename printing was buffered, and exit at error made output
to appear in front of prompt. Output below demonstrates the brokenness.
prompt> isosize /etc /
isosize: /etc: might not be an ISO filesystem
isosize: read error on /etc: Is a directory
/etc: prompt>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
disk-utils/isosize.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/disk-utils/isosize.c b/disk-utils/isosize.c
index 4c16ec5..f90029e 100644
--- a/disk-utils/isosize.c
+++ b/disk-utils/isosize.c
@@ -125,7 +125,7 @@ struct iso_primary_descriptor
unsigned char unused5 [ISODCL (1396, 2048)];
};
-static void isosize(char *filenamep, int xflag, long divisor)
+static void isosize(int argc, char *filenamep, int xflag, long divisor)
{
int fd, nsecs, ssize;
struct iso_primary_descriptor ipd;
@@ -145,6 +145,8 @@ static void isosize(char *filenamep, int xflag, long divisor)
/* isonum_723 returns nowadays always 2048 */
ssize = isonum_723(ipd.logical_block_size, xflag);
+ if (1 < argc)
+ printf("%s: ", filenamep);
if (xflag) {
printf(_("sector count: %d, sector size: %d\n"), nsecs, ssize);
} else {
@@ -220,11 +222,8 @@ int main(int argc, char **argv)
if (ct <= 0)
usage(stderr);
- for (j = optind; j < argc; j++) {
- if (ct > 1)
- printf("%s: ", argv[j]);
- isosize(argv[j], xflag, divisor);
- }
+ for (j = optind; j < argc; j++)
+ isosize(ct, argv[j], xflag, divisor);
return EXIT_SUCCESS;
}
--
1.9.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 8/9] tests: add isosize --sectors and --divisor tests
2014-02-16 23:54 [PATCH 1/9] tests: avoid executing dirname(1) command Sami Kerola
` (5 preceding siblings ...)
2014-02-16 23:54 ` [PATCH 7/9] isosize: move file name printing after error determination Sami Kerola
@ 2014-02-16 23:54 ` Sami Kerola
2014-02-16 23:54 ` [PATCH 9/9] isosize: make --divisor to require argument Sami Kerola
7 siblings, 0 replies; 10+ messages in thread
From: Sami Kerola @ 2014-02-16 23:54 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
tests/expected/isosize/print-size | 1 -
tests/expected/isosize/print-size-default_output | 1 +
tests/expected/isosize/print-size-divisor_output | 1 +
tests/expected/isosize/print-size-sector_output | 1 +
tests/ts/isosize/print-size | 13 ++++++++++++-
5 files changed, 15 insertions(+), 2 deletions(-)
delete mode 100644 tests/expected/isosize/print-size
create mode 100644 tests/expected/isosize/print-size-default_output
create mode 100644 tests/expected/isosize/print-size-divisor_output
create mode 100644 tests/expected/isosize/print-size-sector_output
diff --git a/tests/expected/isosize/print-size b/tests/expected/isosize/print-size
deleted file mode 100644
index 3def437..0000000
--- a/tests/expected/isosize/print-size
+++ /dev/null
@@ -1 +0,0 @@
-515899392
diff --git a/tests/expected/isosize/print-size-default_output b/tests/expected/isosize/print-size-default_output
new file mode 100644
index 0000000..3def437
--- /dev/null
+++ b/tests/expected/isosize/print-size-default_output
@@ -0,0 +1 @@
+515899392
diff --git a/tests/expected/isosize/print-size-divisor_output b/tests/expected/isosize/print-size-divisor_output
new file mode 100644
index 0000000..ee214a6
--- /dev/null
+++ b/tests/expected/isosize/print-size-divisor_output
@@ -0,0 +1 @@
+57322154
diff --git a/tests/expected/isosize/print-size-sector_output b/tests/expected/isosize/print-size-sector_output
new file mode 100644
index 0000000..dff3634
--- /dev/null
+++ b/tests/expected/isosize/print-size-sector_output
@@ -0,0 +1 @@
+sector count: 251904, sector size: 2048
diff --git a/tests/ts/isosize/print-size b/tests/ts/isosize/print-size
index 312fdc1..277c124 100755
--- a/tests/ts/isosize/print-size
+++ b/tests/ts/isosize/print-size
@@ -20,7 +20,18 @@ ts_init "$*"
ts_check_test_command "$TS_CMD_ISOSIZE"
-gzip -cd $TS_SELF/sample.iso.gz > $TS_OUTDIR/sample.iso
+gzip -cd $TS_SELF/sample.iso.gz >| $TS_OUTDIR/sample.iso
+
+ts_init_subtest "default_output"
$TS_CMD_ISOSIZE $TS_OUTDIR/sample.iso >| $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "sector_output"
+$TS_CMD_ISOSIZE --sectors $TS_OUTDIR/sample.iso &> $TS_OUTPUT 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "divisor_output"
+$TS_CMD_ISOSIZE --divisor=9 $TS_OUTDIR/sample.iso &> $TS_OUTPUT 2>&1
+ts_finalize_subtest
ts_finalize
--
1.9.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 9/9] isosize: make --divisor to require argument
2014-02-16 23:54 [PATCH 1/9] tests: avoid executing dirname(1) command Sami Kerola
` (6 preceding siblings ...)
2014-02-16 23:54 ` [PATCH 8/9] tests: add isosize --sectors and --divisor tests Sami Kerola
@ 2014-02-16 23:54 ` Sami Kerola
7 siblings, 0 replies; 10+ messages in thread
From: Sami Kerola @ 2014-02-16 23:54 UTC (permalink / raw)
To: util-linux; +Cc: kerolasa
Silly bug, only the short option -d allowed divisor argument.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
disk-utils/isosize.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/disk-utils/isosize.c b/disk-utils/isosize.c
index f90029e..5030a50 100644
--- a/disk-utils/isosize.c
+++ b/disk-utils/isosize.c
@@ -186,7 +186,7 @@ int main(int argc, char **argv)
long divisor = 0;
static const struct option longopts[] = {
- {"divisor", no_argument, 0, 'd'},
+ {"divisor", required_argument, 0, 'd'},
{"sectors", no_argument, 0, 'x'},
{"version", no_argument, 0, 'V'},
{"help", no_argument, 0, 'h'},
--
1.9.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/9] tests: make tests to run parallel
2014-02-16 23:54 ` [PATCH 2/9] tests: make tests to run parallel Sami Kerola
@ 2014-02-17 14:11 ` Karel Zak
0 siblings, 0 replies; 10+ messages in thread
From: Karel Zak @ 2014-02-17 14:11 UTC (permalink / raw)
To: Sami Kerola; +Cc: util-linux
On Sun, Feb 16, 2014 at 11:54:15PM +0000, Sami Kerola wrote:
> tests/functions.sh | 15 +++++++--------
> tests/run.sh | 32 +++++++++++++++++++-------------
> 2 files changed, 26 insertions(+), 21 deletions(-)
Applied, but with changes:
* It is not enabled by default if you manually execute ./run.sh, you have
to specify --parallel[=<num>] to enable this feature (the =<num> is optional).
It's enabled for "make check".
Frankly, I cannot imagine that I will debug anything around mount(8)
with enabled --parallel :-)
* the option is propagated to function.sh (where is $TS_PARALLEL)
* the output format depends on $TS_PARALLEL, it means that without
the --parallel option is the output still the same.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-02-17 14:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-16 23:54 [PATCH 1/9] tests: avoid executing dirname(1) command Sami Kerola
2014-02-16 23:54 ` [PATCH 2/9] tests: make tests to run parallel Sami Kerola
2014-02-17 14:11 ` Karel Zak
2014-02-16 23:54 ` [PATCH 3/9] tools: add usage information to checkconfig.sh Sami Kerola
2014-02-16 23:54 ` [PATCH 4/9] docs: make hexdump.1 color specification easier to understand Sami Kerola
2014-02-16 23:54 ` [PATCH 5/9] tests: align last.1 with recent phantom detection Sami Kerola
2014-02-16 23:54 ` [PATCH 6/9] swaplabel: wrong version number in check Sami Kerola
2014-02-16 23:54 ` [PATCH 7/9] isosize: move file name printing after error determination Sami Kerola
2014-02-16 23:54 ` [PATCH 8/9] tests: add isosize --sectors and --divisor tests Sami Kerola
2014-02-16 23:54 ` [PATCH 9/9] isosize: make --divisor to require argument Sami Kerola
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox