From 2f791546395cb43f3f93de6c095c812c7cd5237f Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 16 Feb 2014 15:22:56 +0000 Subject: tests: check commands needed for running a test exist Signed-off-by: Sami Kerola Signed-off-by: Karel Zak --- tests/functions.sh | 9 +++++++-- tests/ts/bitops/swapbytes | 2 ++ tests/ts/blkid/low-probe | 4 +--- tests/ts/blkid/lowprobe-pt | 4 +--- tests/ts/blkid/md-raid0-whole | 4 ++++ tests/ts/blkid/md-raid1-part | 4 ++++ tests/ts/blkid/md-raid1-whole | 4 ++++ 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 | 4 +++- 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 | 4 +++- tests/ts/column/separator_table | 2 ++ tests/ts/cramfs/doubles | 5 +++++ tests/ts/cramfs/fsck-endianness | 4 ++++ tests/ts/cramfs/mkfs | 6 ++++++ tests/ts/cramfs/mkfs-endianness | 3 +++ 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 | 8 ++++++-- tests/ts/fdisk/align-512-4K | 3 +++ tests/ts/fdisk/align-512-4K-63 | 3 +++ tests/ts/fdisk/align-512-4K-md | 3 +++ tests/ts/fdisk/align-512-512 | 3 +++ tests/ts/fdisk/align-512-512-topology | 3 +++ tests/ts/fdisk/bsd | 4 +++- tests/ts/fdisk/gpt | 4 +++- tests/ts/fdisk/id | 2 ++ tests/ts/fdisk/mbr-dos-mode | 2 ++ tests/ts/fdisk/mbr-nondos-mode | 6 ++++-- tests/ts/fdisk/oddinput | 2 ++ tests/ts/fdisk/sunlabel | 2 ++ tests/ts/fsck/ismounted | 4 ++++ tests/ts/hexdump/format-strings | 2 +- tests/ts/hwclock/systohc | 3 +++ tests/ts/ipcs/headers | 2 ++ tests/ts/ipcs/limits | 3 +++ tests/ts/ipcs/limits2 | 3 +++ tests/ts/ipcs/mk-rm-msg | 4 ++++ tests/ts/ipcs/mk-rm-sem | 4 ++++ tests/ts/ipcs/mk-rm-shm | 4 ++++ tests/ts/isosize/print-size | 2 ++ tests/ts/last/ipv6 | 2 +- tests/ts/last/last | 2 +- tests/ts/libmount/context | 7 ++++++- tests/ts/libmount/context-py | 6 ++++++ tests/ts/libmount/context-utab | 4 ++++ tests/ts/libmount/context-utab-py | 5 +++++ tests/ts/login/islocal | 2 ++ tests/ts/login/logindefs | 2 ++ tests/ts/look/separator | 2 ++ tests/ts/losetup/losetup | 3 +++ tests/ts/lscpu/lscpu | 4 +++- tests/ts/minix/fsck | 5 +++-- tests/ts/minix/mkfs | 5 +++-- tests/ts/misc/fallocate | 2 ++ tests/ts/misc/getopt | 2 ++ tests/ts/misc/ionice | 2 ++ tests/ts/misc/line | 4 +--- tests/ts/misc/mcookie | 2 ++ tests/ts/misc/rev | 2 ++ tests/ts/misc/setarch | 2 ++ tests/ts/misc/setsid | 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 | 4 ++++ tests/ts/mount/fstab-broken | 5 +++++ tests/ts/mount/fstab-devname | 4 ++++ tests/ts/mount/fstab-devname2label | 4 ++++ tests/ts/mount/fstab-devname2uuid | 4 ++++ tests/ts/mount/fstab-label | 4 ++++ tests/ts/mount/fstab-label2devname | 4 ++++ tests/ts/mount/fstab-label2uuid | 4 ++++ tests/ts/mount/fstab-none | 5 +++++ tests/ts/mount/fstab-symlink | 4 ++++ tests/ts/mount/fstab-uuid | 4 ++++ tests/ts/mount/fstab-uuid2devname | 4 ++++ tests/ts/mount/fstab-uuid2label | 4 ++++ tests/ts/mount/label | 4 ++++ tests/ts/mount/move | 5 +++++ tests/ts/mount/noncanonical | 3 +++ tests/ts/mount/paths | 3 +++ tests/ts/mount/regfile | 4 ++++ tests/ts/mount/remount | 4 ++++ tests/ts/mount/rlimit | 4 ++++ tests/ts/mount/shared-subtree | 5 +++++ tests/ts/mount/special | 3 +++ tests/ts/mount/umount-alltargets | 5 +++++ tests/ts/mount/umount-recursive | 5 +++++ tests/ts/mount/uuid | 4 ++++ tests/ts/namei/logic | 2 ++ tests/ts/partx/partx | 7 +++++-- tests/ts/schedutils/cpuset | 2 ++ tests/ts/script/race | 2 ++ tests/ts/swapon/devname | 5 +++++ tests/ts/swapon/fixpgsz | 5 +++++ tests/ts/swapon/fixsig | 5 +++++ tests/ts/swapon/label | 5 +++++ tests/ts/swapon/uuid | 5 +++++ 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 ++ 122 files changed, 373 insertions(+), 30 deletions(-) diff --git a/tests/functions.sh b/tests/functions.sh index 5e2292d9b..191a310ac 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -37,7 +37,12 @@ function ts_report { else echo "$1" fi +} +function ts_check_test_command { + if [ ! -x "$1" ]; then + ts_skip "${1##*/} not found" + fi } function ts_skip_subtest { @@ -371,7 +376,7 @@ function ts_die { ts_log "$1" if [ -n "$2" ] && [ -b "$2" ]; then ts_device_deinit "$2" - ts_fstab_clean # for sure... + ts_fstab_clean # for sure... fi ts_finalize } @@ -384,7 +389,7 @@ function ts_image_md5sum { function ts_image_init { local mib=${1:-"5"} # size in MiBs local img=${2:-"$TS_OUTDIR/${TS_TESTNAME}.img"} - + dd if=/dev/zero of="$img" bs=1M count=$mib &> /dev/null echo "$img" return 0 diff --git a/tests/ts/bitops/swapbytes b/tests/ts/bitops/swapbytes index 6b843f85e..798ad53c6 100755 --- a/tests/ts/bitops/swapbytes +++ b/tests/ts/bitops/swapbytes @@ -21,6 +21,8 @@ TS_DESC="swap bytes" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_HELPER_BYTESWAP" + $TS_HELPER_BYTESWAP >> $TS_OUTPUT ts_finalize diff --git a/tests/ts/blkid/low-probe b/tests/ts/blkid/low-probe index e22d6c849..eaee08982 100755 --- a/tests/ts/blkid/low-probe +++ b/tests/ts/blkid/low-probe @@ -23,9 +23,7 @@ TS_DESC="low-level superblocks probing" ts_init "$*" -if [ ! -x "$TS_CMD_BLKID" ]; then - ts_skip "blkid disabled" -fi +ts_check_test_command "$TS_CMD_BLKID" mkdir -p $TS_OUTDIR/images-fs diff --git a/tests/ts/blkid/lowprobe-pt b/tests/ts/blkid/lowprobe-pt index 8def673f9..4e9927b51 100755 --- a/tests/ts/blkid/lowprobe-pt +++ b/tests/ts/blkid/lowprobe-pt @@ -23,9 +23,7 @@ TS_DESC="partitions probing" ts_init "$*" -if [ ! -x "$TS_HELPER_PARTITIONS" ]; then - ts_skip "blkid disabled" -fi +ts_check_test_command "$TS_HELPER_PARTITIONS" mkdir -p $TS_OUTDIR/images-pt diff --git a/tests/ts/blkid/md-raid0-whole b/tests/ts/blkid/md-raid0-whole index 07ffc584a..46442bb2a 100755 --- a/tests/ts/blkid/md-raid0-whole +++ b/tests/ts/blkid/md-raid0-whole @@ -21,6 +21,10 @@ TS_DESC="MD raid0 (whole-disks)" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_BLKID" + ts_skip_nonroot [ -x /sbin/mdadm ] || ts_skip "missing mdadm" diff --git a/tests/ts/blkid/md-raid1-part b/tests/ts/blkid/md-raid1-part index 43140728c..0257e15a8 100755 --- a/tests/ts/blkid/md-raid1-part +++ b/tests/ts/blkid/md-raid1-part @@ -21,6 +21,10 @@ TS_DESC="MD raid1 (last partition)" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_BLKID" + ts_skip_nonroot DEVICE=$(ts_scsi_debug_init dev_size_mb=51 sector_size=512) diff --git a/tests/ts/blkid/md-raid1-whole b/tests/ts/blkid/md-raid1-whole index 8743d3d66..fcb55c2a4 100755 --- a/tests/ts/blkid/md-raid1-whole +++ b/tests/ts/blkid/md-raid1-whole @@ -21,6 +21,10 @@ TS_DESC="MD raid1 (whole-disks)" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_BLKID" + ts_skip_nonroot [ -x /sbin/mdadm ] || ts_skip "missing mdadm" diff --git a/tests/ts/cal/1m b/tests/ts/cal/1m index ddb0129aa..295758aad 100755 --- a/tests/ts/cal/1m +++ b/tests/ts/cal/1m @@ -22,6 +22,8 @@ TS_DESC="1 month" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail export TERM=linux diff --git a/tests/ts/cal/1mw b/tests/ts/cal/1mw index c258564a4..66649487a 100755 --- a/tests/ts/cal/1mw +++ b/tests/ts/cal/1mw @@ -22,6 +22,8 @@ TS_DESC="1 month with week numbers" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail export TERM=linux diff --git a/tests/ts/cal/3m b/tests/ts/cal/3m index 64e7c4e38..50f284ec2 100755 --- a/tests/ts/cal/3m +++ b/tests/ts/cal/3m @@ -21,6 +21,8 @@ TS_DESC="3 months" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail export TERM=linux diff --git a/tests/ts/cal/3mw b/tests/ts/cal/3mw index 934cfdc0a..5ea951e49 100755 --- a/tests/ts/cal/3mw +++ b/tests/ts/cal/3mw @@ -21,6 +21,8 @@ TS_DESC="3 months with week numbers" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cal/bigyear b/tests/ts/cal/bigyear index a01a9defc..b5e415ca1 100755 --- a/tests/ts/cal/bigyear +++ b/tests/ts/cal/bigyear @@ -18,6 +18,8 @@ TS_DESC="Year 2147483646" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail export TERM=linux diff --git a/tests/ts/cal/bigyearw b/tests/ts/cal/bigyearw index a0220bfe3..75a18ddee 100755 --- a/tests/ts/cal/bigyearw +++ b/tests/ts/cal/bigyearw @@ -18,6 +18,8 @@ TS_DESC="Year 2147483646 with week numbers" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail export TERM=linux diff --git a/tests/ts/cal/color b/tests/ts/cal/color index 67883a2eb..44e9381e2 100755 --- a/tests/ts/cal/color +++ b/tests/ts/cal/color @@ -20,6 +20,8 @@ TS_DESC="color" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + # --color output depends on terminal type export TERM=linux diff --git a/tests/ts/cal/colorw b/tests/ts/cal/colorw index 8b43461d5..0092e133e 100755 --- a/tests/ts/cal/colorw +++ b/tests/ts/cal/colorw @@ -20,6 +20,8 @@ TS_DESC="color with week numbers" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + # --color output depends on terminal type export TERM=linux diff --git a/tests/ts/cal/sep1752 b/tests/ts/cal/sep1752 index 4e7fafc49..fa57b9b8b 100755 --- a/tests/ts/cal/sep1752 +++ b/tests/ts/cal/sep1752 @@ -18,6 +18,8 @@ TS_DESC="September 1752" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail export TERM=linux diff --git a/tests/ts/cal/sep1752w b/tests/ts/cal/sep1752w index bc792143c..b229e8369 100755 --- a/tests/ts/cal/sep1752w +++ b/tests/ts/cal/sep1752w @@ -18,6 +18,8 @@ TS_DESC="September 1752 with week numbers" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail export TERM=linux diff --git a/tests/ts/cal/weekarg b/tests/ts/cal/weekarg index dc500ac19..a7987051c 100755 --- a/tests/ts/cal/weekarg +++ b/tests/ts/cal/weekarg @@ -21,6 +21,8 @@ TS_DESC="week number given as argument" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail export TERM=linux diff --git a/tests/ts/cal/weeknum b/tests/ts/cal/weeknum index a3de709c9..0bea00de1 100755 --- a/tests/ts/cal/weeknum +++ b/tests/ts/cal/weeknum @@ -21,6 +21,8 @@ TS_DESC="week number corner cases" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail export TERM=linux @@ -29,7 +31,7 @@ USETERM=$( ts_has_option "useterm" "$*" ) [ "$USETERM" == "yes" ] && TS_VERBOSE="yes" ts_log "" -for x in 2001 2002 2003 2009 2010 2011 2012 ; do +for x in 2001 2002 2003 2009 2010 2011 2012 ; do MYTIME="1 $x" ts_log "Gregorian - Monday-based week with week numbers - year $x" diff --git a/tests/ts/cal/year b/tests/ts/cal/year index f6b7cc7d2..1204b5ffb 100755 --- a/tests/ts/cal/year +++ b/tests/ts/cal/year @@ -21,6 +21,8 @@ TS_DESC="year" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail export TERM=linux diff --git a/tests/ts/cal/yearw b/tests/ts/cal/yearw index 9dd673cb7..c05b1c2b7 100755 --- a/tests/ts/cal/yearw +++ b/tests/ts/cal/yearw @@ -21,6 +21,8 @@ TS_DESC="year with week numbers" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CAL" + set -o pipefail export TERM=linux diff --git a/tests/ts/col/multibyte b/tests/ts/col/multibyte index 5769dd840..e9c02922e 100755 --- a/tests/ts/col/multibyte +++ b/tests/ts/col/multibyte @@ -21,6 +21,8 @@ TS_DESC="multibyte input" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_COL" + cat $TS_SELF/multibyte.data | $TS_CMD_COL > /dev/null 2> $TS_OUTPUT ts_finalize diff --git a/tests/ts/colrm/rm2-2 b/tests/ts/colrm/rm2-2 index d44e60e2d..c13e4ecc6 100755 --- a/tests/ts/colrm/rm2-2 +++ b/tests/ts/colrm/rm2-2 @@ -21,6 +21,8 @@ TS_DESC="basic check" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_COLRM" + printf "a b\nc\td\nef\b\tg\n" | $TS_CMD_COLRM 2 2 > $TS_OUTPUT 2>&1 ts_finalize diff --git a/tests/ts/column/fillrow b/tests/ts/column/fillrow index 71c40da37..263a2673f 100755 --- a/tests/ts/column/fillrow +++ b/tests/ts/column/fillrow @@ -21,6 +21,8 @@ TS_DESC="fill row" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_COLUMN" + cd $TS_OUTDIR $TS_CMD_COLUMN -x -c 50 $TS_SELF/input >> $TS_OUTPUT 2>&1 diff --git a/tests/ts/column/multi-file b/tests/ts/column/multi-file index 6264bb23d..76b868635 100755 --- a/tests/ts/column/multi-file +++ b/tests/ts/column/multi-file @@ -2,7 +2,7 @@ # # Copyright (C) 2011 Sami Kerola -# 2011 Karel Zak +# 2011 Karel Zak # # This file is part of util-linux. # @@ -22,6 +22,8 @@ TS_DESC="multiple files" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_COLUMN" + cd $TS_OUTDIR $TS_CMD_COLUMN -x -c 50 $TS_SELF/input \ diff --git a/tests/ts/column/separator_table b/tests/ts/column/separator_table index 9d39090bd..8be1e2000 100755 --- a/tests/ts/column/separator_table +++ b/tests/ts/column/separator_table @@ -21,6 +21,8 @@ TS_DESC="separator & table" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_COLUMN" + cd $TS_OUTDIR $TS_CMD_COLUMN -s 2 -t $TS_SELF/input >> $TS_OUTPUT 2>&1 diff --git a/tests/ts/cramfs/doubles b/tests/ts/cramfs/doubles index 3053ab5af..9b1ce2eb3 100755 --- a/tests/ts/cramfs/doubles +++ b/tests/ts/cramfs/doubles @@ -20,6 +20,11 @@ TS_DESC="mkfs doubles" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MKCRAMFS" +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/cramfs/fsck-endianness b/tests/ts/cramfs/fsck-endianness index 200445eb0..33bd18b2a 100755 --- a/tests/ts/cramfs/fsck-endianness +++ b/tests/ts/cramfs/fsck-endianness @@ -20,6 +20,10 @@ TS_DESC="fsck endianness" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MKCRAMFS" +ts_check_test_command "$TS_CMD_FSCKCRAMFS" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/cramfs/mkfs b/tests/ts/cramfs/mkfs index bc9375dc0..96d6855d7 100755 --- a/tests/ts/cramfs/mkfs +++ b/tests/ts/cramfs/mkfs @@ -20,6 +20,12 @@ TS_DESC="mkfs checksums" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MKCRAMFS" +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" +ts_check_test_command "$TS_CMD_LOSETUP" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/cramfs/mkfs-endianness b/tests/ts/cramfs/mkfs-endianness index 147cb9c8e..c7df720b6 100755 --- a/tests/ts/cramfs/mkfs-endianness +++ b/tests/ts/cramfs/mkfs-endianness @@ -20,6 +20,9 @@ TS_DESC="mkfs endianness" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MKCRAMFS" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/dmesg/console-levels b/tests/ts/dmesg/console-levels index 7f21d9ab4..14c69c980 100755 --- a/tests/ts/dmesg/console-levels +++ b/tests/ts/dmesg/console-levels @@ -18,6 +18,8 @@ TS_DESC="levels" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_DMESG" + for I in {-1..8}; do $TS_CMD_DMESG -F $TS_SELF/input -l $I >> $TS_OUTPUT 2>/dev/null done diff --git a/tests/ts/dmesg/decode b/tests/ts/dmesg/decode index 0519a0200..63f3c5c47 100755 --- a/tests/ts/dmesg/decode +++ b/tests/ts/dmesg/decode @@ -18,6 +18,8 @@ TS_DESC="decode" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_DMESG" + $TS_CMD_DMESG -x -F $TS_SELF/input >> $TS_OUTPUT 2>/dev/null ts_finalize diff --git a/tests/ts/dmesg/delta b/tests/ts/dmesg/delta index 2ad247746..da480421d 100755 --- a/tests/ts/dmesg/delta +++ b/tests/ts/dmesg/delta @@ -18,6 +18,8 @@ TS_DESC="delta" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_DMESG" + $TS_CMD_DMESG -d -F $TS_SELF/input >> $TS_OUTPUT 2>/dev/null ts_finalize diff --git a/tests/ts/dmesg/facilities b/tests/ts/dmesg/facilities index e503c1a13..7066ae58e 100755 --- a/tests/ts/dmesg/facilities +++ b/tests/ts/dmesg/facilities @@ -18,6 +18,8 @@ TS_DESC="facilities" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_DMESG" + for I in {-1..12}; do $TS_CMD_DMESG -F $TS_SELF/input -f $I >> $TS_OUTPUT 2>/dev/null done diff --git a/tests/ts/eject/umount b/tests/ts/eject/umount index b7ea688a8..e781a7ba6 100755 --- a/tests/ts/eject/umount +++ b/tests/ts/eject/umount @@ -5,10 +5,14 @@ TS_DESC="umount" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_EJECT" + ts_skip_nonroot # -# Note that eject --force is required because scsi_debug is +# Note that eject --force is required because scsi_debug is # not removable device. # @@ -35,7 +39,7 @@ p w EOF udevadm settle - mkfs.ext2 -q ${dev}1 + mkfs.ext2 -q ${dev}1 mkfs.ext2 -q ${dev}2 udevadm settle } diff --git a/tests/ts/fdisk/align-512-4K b/tests/ts/fdisk/align-512-4K index 2b247f802..5d70fe1fa 100755 --- a/tests/ts/fdisk/align-512-4K +++ b/tests/ts/fdisk/align-512-4K @@ -25,6 +25,9 @@ TS_DESC="align 512/4K" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot DEVICE=$(ts_scsi_debug_init dev_size_mb=50 sector_size=512 physblk_exp=3) diff --git a/tests/ts/fdisk/align-512-4K-63 b/tests/ts/fdisk/align-512-4K-63 index 6190ae152..65f2a7556 100755 --- a/tests/ts/fdisk/align-512-4K-63 +++ b/tests/ts/fdisk/align-512-4K-63 @@ -25,6 +25,9 @@ TS_DESC="align 512/4K +alignment_offset" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot DEVICE=$(ts_scsi_debug_init dev_size_mb=50 sector_size=512 physblk_exp=3 lowest_aligned=7) diff --git a/tests/ts/fdisk/align-512-4K-md b/tests/ts/fdisk/align-512-4K-md index be078357f..9a2cb88f7 100755 --- a/tests/ts/fdisk/align-512-4K-md +++ b/tests/ts/fdisk/align-512-4K-md @@ -25,6 +25,9 @@ TS_DESC="align 512/4K +MD" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot DEVICE=$(ts_scsi_debug_init dev_size_mb=50 sector_size=512 physblk_exp=3) diff --git a/tests/ts/fdisk/align-512-512 b/tests/ts/fdisk/align-512-512 index afcb612ef..8057f9339 100755 --- a/tests/ts/fdisk/align-512-512 +++ b/tests/ts/fdisk/align-512-512 @@ -24,6 +24,9 @@ TS_DESC="align 512/512" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot DEVICE=$(ts_device_init 50) diff --git a/tests/ts/fdisk/align-512-512-topology b/tests/ts/fdisk/align-512-512-topology index 8cc300929..f988b4e42 100755 --- a/tests/ts/fdisk/align-512-512-topology +++ b/tests/ts/fdisk/align-512-512-topology @@ -25,6 +25,9 @@ TS_DESC="align 512/512 +topology" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot diff --git a/tests/ts/fdisk/bsd b/tests/ts/fdisk/bsd index 23ac0537e..7e3c78726 100755 --- a/tests/ts/fdisk/bsd +++ b/tests/ts/fdisk/bsd @@ -22,6 +22,8 @@ TS_DESC="nested BSD" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + FDISK_CMD_CREATE_DOSLABEL="o\n" # create dos label FDISK_CMD_SETID="x\ni\n0x1\nr\n" # set non-random ID FDISK_CMD_WRITE_CLOSE="w\nq\n" # write to image @@ -35,7 +37,7 @@ FDISK_CMD_BSD_CREATE_PART="b\nn\na\n\n+1M\n" # add BSD partition 'a', size 1MiB FDISK_CMD_BSD_PARTTYPE="b\nt\na\n7\n" # set partition 'a' to type 4.2BSD FDISK_CMD_BSD_LIST_TYPES="b\nl\nq\n" # list supported PT types and quit -#set -x +#set -x function print_layout { echo -ne "\n---layout----------" >> $TS_OUTPUT diff --git a/tests/ts/fdisk/gpt b/tests/ts/fdisk/gpt index 75bd006e7..3c174e968 100755 --- a/tests/ts/fdisk/gpt +++ b/tests/ts/fdisk/gpt @@ -22,6 +22,8 @@ TS_DESC="GPT" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + FDISK_CMD_CREATE_GPTLABEL="g\n" # create GPT label FDISK_CMD_WRITE_CLOSE="w\nq\n" # write to image @@ -29,7 +31,7 @@ FDISK_CMD_CHANGE_TYPE_BY_NUM="t\n1\n1\n" # set 1st partition to EFI System # set 5th partition to Linux swap FDISK_CMD_CHANGE_TYPE_BY_UUID="t\n5\n0657FD6D-A4AB-43C4-84E5-0933C84B4F4F\n" -FDISK_CMD_DELETE_PART="d\n2\n" # delete 2nd partition +FDISK_CMD_DELETE_PART="d\n2\n" # delete 2nd partition FDISK_CMD_CREATE_PART="n\n2\n\n\n" # create 2nd partition function print_layout { diff --git a/tests/ts/fdisk/id b/tests/ts/fdisk/id index 866cf6ecf..a24d793e8 100755 --- a/tests/ts/fdisk/id +++ b/tests/ts/fdisk/id @@ -20,6 +20,8 @@ TS_DESC="MBR - id" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + FDISK_CMD_ID1="x\ni\n0x1\nr\nw\n" FDISK_CMD_ID2="x\ni\n0x2\nr\nw\n" diff --git a/tests/ts/fdisk/mbr-dos-mode b/tests/ts/fdisk/mbr-dos-mode index 45b315b64..6d517ea3e 100755 --- a/tests/ts/fdisk/mbr-dos-mode +++ b/tests/ts/fdisk/mbr-dos-mode @@ -22,6 +22,8 @@ TS_DESC="MBR - dos mode" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + FDISK_CMD_INIT="x\ni\n0x1\nr\n" FDISK_CMD_WRITE_CLOSE="w\nq\n" FDISK_CMD_CREATE_DOSLABEL="o\n" #create dos label diff --git a/tests/ts/fdisk/mbr-nondos-mode b/tests/ts/fdisk/mbr-nondos-mode index 878c1190b..9c38f3aff 100755 --- a/tests/ts/fdisk/mbr-nondos-mode +++ b/tests/ts/fdisk/mbr-nondos-mode @@ -20,6 +20,8 @@ TS_DESC="MBR - non-dos mode" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + # cmd to changes system id to 0x1 FDISK_CMD_INIT="x\ni\n0x1\nr\n" FDISK_CMD_WRITE_CLOSE="w\nq\n" @@ -27,7 +29,7 @@ FDISK_CMD_CREATE_DOSLABEL="o\n" #create dos label FDISK_CMD_CREATE_1PRIMARY="n\np\n\n\n+3M\n" # create primary partition of size 3MiB FDISK_CMD_CREATE_2PRIMARY="n\np\n\n\n+2M\n" # create primary partition of size 2MiB FDISK_CMD_SET_ACTIVE="a\n1\n" # set first partition active -FDISK_CMD_CREATE_EXTENDED="n\ne\n\n\n\n" # create extended partition +FDISK_CMD_CREATE_EXTENDED="n\ne\n\n\n\n" # create extended partition FDISK_CMD_CREATE_LOGICAL="n\nl\n\n+2M\n" # create next logical partition of size 10 sectors FDISK_CMD_DELETE_LOGICALS="d\n6\nd\n5\nd\n6\n" # delete middle, head, tail, last partitions FDISK_CMD_DELETE_1PRIMARY="d\n1\n" # delete first primary @@ -40,7 +42,7 @@ function print_layout { echo -ne "-------------------\n\n" >> $TS_OUTPUT } -#set -x +#set -x ts_log "Initialize empty image" TEST_IMAGE_NAME=$(ts_image_init 20) # 20 MiB diff --git a/tests/ts/fdisk/oddinput b/tests/ts/fdisk/oddinput index 2120ce7c8..8d512200d 100755 --- a/tests/ts/fdisk/oddinput +++ b/tests/ts/fdisk/oddinput @@ -20,6 +20,8 @@ TS_DESC="invalid input tests" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + #set -x ts_log "Initialize empty image" diff --git a/tests/ts/fdisk/sunlabel b/tests/ts/fdisk/sunlabel index b31ec4f5a..5bfbb4f4c 100755 --- a/tests/ts/fdisk/sunlabel +++ b/tests/ts/fdisk/sunlabel @@ -20,6 +20,8 @@ TS_DESC="sunlabel tests" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FDISK" + FDISK_CMD_INIT="s\n" # create new sunlabel FDISK_CMD_WRITE_CLOSE="w\nq\n" FDISK_CMD_DELETEALL="d\n1\nd\n2\nd\n3\nd\n4\nd\n5\nd\n6\nd\n7\nd\n8\n" # delete all partitions diff --git a/tests/ts/fsck/ismounted b/tests/ts/fsck/ismounted index 6c64390ff..685601613 100755 --- a/tests/ts/fsck/ismounted +++ b/tests/ts/fsck/ismounted @@ -19,6 +19,10 @@ TS_DESC="is mounted" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_MOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/hexdump/format-strings b/tests/ts/hexdump/format-strings index 8716197cd..229e6513f 100755 --- a/tests/ts/hexdump/format-strings +++ b/tests/ts/hexdump/format-strings @@ -22,7 +22,7 @@ FILES="$TS_TOPDIR/ts/hexdump/files" . $TS_TOPDIR/functions.sh ts_init "$*" -[ -x $TS_CMD_HEXDUMP ] || ts_skip "hexdump not compiled" +ts_check_test_command "$TS_CMD_HEXDUMP" #885314 ts_init_subtest "empty-format" diff --git a/tests/ts/hwclock/systohc b/tests/ts/hwclock/systohc index 8dc56b779..8a3eccaf4 100755 --- a/tests/ts/hwclock/systohc +++ b/tests/ts/hwclock/systohc @@ -22,6 +22,9 @@ NTP_SERVER="0.fedora.pool.ntp.org" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_HWCLOCK" + ts_skip_nonroot PATH='/usr/sbin:/usr/bin:/sbin:/bin' diff --git a/tests/ts/ipcs/headers b/tests/ts/ipcs/headers index 52e108c23..5089ea512 100755 --- a/tests/ts/ipcs/headers +++ b/tests/ts/ipcs/headers @@ -21,6 +21,8 @@ TS_DESC="headers" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_IPCS" + ts_log "test: shm headers" $TS_CMD_IPCS -m -t | grep --after-context=1 "^---" >> $TS_OUTPUT $TS_CMD_IPCS -m -p | grep --after-context=1 "^---" >> $TS_OUTPUT diff --git a/tests/ts/ipcs/limits b/tests/ts/ipcs/limits index 9e164e526..71980b533 100755 --- a/tests/ts/ipcs/limits +++ b/tests/ts/ipcs/limits @@ -22,6 +22,9 @@ TS_DESC="limits overflow" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_IPCS" + ts_skip_nonroot type bc >/dev/null 2>&1 || ts_skip "cannot find bc command" diff --git a/tests/ts/ipcs/limits2 b/tests/ts/ipcs/limits2 index 39f26d708..7a7549aa3 100755 --- a/tests/ts/ipcs/limits2 +++ b/tests/ts/ipcs/limits2 @@ -21,6 +21,9 @@ TS_DESC="basic limits" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_IPCS" + type bc >/dev/null 2>&1 || ts_skip "cannot find bc command" . $TS_SELF/functions.sh diff --git a/tests/ts/ipcs/mk-rm-msg b/tests/ts/ipcs/mk-rm-msg index 5bea09bed..72f89b8a1 100755 --- a/tests/ts/ipcs/mk-rm-msg +++ b/tests/ts/ipcs/mk-rm-msg @@ -18,6 +18,10 @@ TS_DESC="mk-rm-msg" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_IPCS" +ts_check_test_command "$TS_CMD_IPCMK" +ts_check_test_command "$TS_CMD_IPCRM" + . $TS_SELF/functions.sh rm -f $TS_OUTDIR/id-msg diff --git a/tests/ts/ipcs/mk-rm-sem b/tests/ts/ipcs/mk-rm-sem index 816d306d4..315261874 100755 --- a/tests/ts/ipcs/mk-rm-sem +++ b/tests/ts/ipcs/mk-rm-sem @@ -18,6 +18,10 @@ TS_DESC="mk-rm-sem" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_IPCS" +ts_check_test_command "$TS_CMD_IPCMK" +ts_check_test_command "$TS_CMD_IPCRM" + . $TS_SELF/functions.sh rm -f $TS_OUTDIR/id-sem diff --git a/tests/ts/ipcs/mk-rm-shm b/tests/ts/ipcs/mk-rm-shm index 8aa604df9..9695ed17c 100755 --- a/tests/ts/ipcs/mk-rm-shm +++ b/tests/ts/ipcs/mk-rm-shm @@ -18,6 +18,10 @@ TS_DESC="mk-rm-shm" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_IPCS" +ts_check_test_command "$TS_CMD_IPCMK" +ts_check_test_command "$TS_CMD_IPCRM" + . $TS_SELF/functions.sh rm -f $TS_OUTDIR/id-shm diff --git a/tests/ts/isosize/print-size b/tests/ts/isosize/print-size index d7cf783e4..277c12483 100755 --- a/tests/ts/isosize/print-size +++ b/tests/ts/isosize/print-size @@ -18,6 +18,8 @@ TS_DESC="print-size" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_ISOSIZE" + gzip -cd $TS_SELF/sample.iso.gz >| $TS_OUTDIR/sample.iso ts_init_subtest "default_output" diff --git a/tests/ts/last/ipv6 b/tests/ts/last/ipv6 index 138cf4570..b9b4de4dd 100755 --- a/tests/ts/last/ipv6 +++ b/tests/ts/last/ipv6 @@ -18,7 +18,7 @@ TS_DESC="last ipv6" . $TS_TOPDIR/functions.sh ts_init "$*" -[ -x $TS_CMD_LAST ] || ts_skip "last not enabled" +ts_check_test_command "$TS_CMD_LAST" export LANG=C export TZ=GMT diff --git a/tests/ts/last/last b/tests/ts/last/last index fa263506c..b6308fca1 100755 --- a/tests/ts/last/last +++ b/tests/ts/last/last @@ -18,7 +18,7 @@ TS_DESC="last" . $TS_TOPDIR/functions.sh ts_init "$*" -[ -x $TS_CMD_LAST ] || ts_skip "last not enabled" +ts_check_test_command "$TS_CMD_LAST" export LANG=C export TZ=GMT diff --git a/tests/ts/libmount/context b/tests/ts/libmount/context index 7d06a28f0..35e1a014e 100755 --- a/tests/ts/libmount/context +++ b/tests/ts/libmount/context @@ -7,8 +7,13 @@ TS_DESC="context" . $TS_TOPDIR/functions.sh ts_init "$*" -ts_skip_nonroot +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_FINDMNT" +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + +ts_skip_nonroot TESTPROG="$TS_HELPER_LIBMOUNT_CONTEXT" LABEL=libmount-test UUID=$(uuidgen) diff --git a/tests/ts/libmount/context-py b/tests/ts/libmount/context-py index 9535171ba..840634413 100755 --- a/tests/ts/libmount/context-py +++ b/tests/ts/libmount/context-py @@ -7,6 +7,12 @@ TS_DESC="context-py" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_FINDMNT" +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_init_py libmount ts_skip_nonroot diff --git a/tests/ts/libmount/context-utab b/tests/ts/libmount/context-utab index 9c1487e87..4d3e3d7ca 100755 --- a/tests/ts/libmount/context-utab +++ b/tests/ts/libmount/context-utab @@ -7,6 +7,10 @@ TS_DESC="context (utab)" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_FINDMNT" +ts_check_test_command "$TS_CMD_WIPEFS" ts_skip_nonroot TESTPROG="$TS_HELPER_LIBMOUNT_CONTEXT" diff --git a/tests/ts/libmount/context-utab-py b/tests/ts/libmount/context-utab-py index c36d8acae..b454ceb54 100755 --- a/tests/ts/libmount/context-utab-py +++ b/tests/ts/libmount/context-utab-py @@ -6,6 +6,11 @@ TS_DESC="context-py (utab)" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_FINDMNT" +ts_check_test_command "$TS_CMD_WIPEFS" + ts_init_py libmount ts_skip_nonroot diff --git a/tests/ts/login/islocal b/tests/ts/login/islocal index a1a7a3b60..bb372705b 100755 --- a/tests/ts/login/islocal +++ b/tests/ts/login/islocal @@ -21,6 +21,8 @@ TS_DESC="islocal" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_HELPER_ISLOCAL" + $TS_HELPER_ISLOCAL "$TS_SELF/islocal.data" root nobody "" youngman youngman2 \ abcdefghx nobo long rot al malformed \ nonl znobody >> $TS_OUTPUT diff --git a/tests/ts/login/logindefs b/tests/ts/login/logindefs index 0b3b9a44c..2db3f89fa 100755 --- a/tests/ts/login/logindefs +++ b/tests/ts/login/logindefs @@ -10,6 +10,8 @@ TS_DESC="defs" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_HELPER_LOGINDEFS" + # list all items $TS_HELPER_LOGINDEFS "$TS_SELF/logindefs.data" | sed 's:'$TS_SELF'/::g' >> $TS_OUTPUT diff --git a/tests/ts/look/separator b/tests/ts/look/separator index 967dec401..c6028e314 100755 --- a/tests/ts/look/separator +++ b/tests/ts/look/separator @@ -34,6 +34,8 @@ TS_DESC="separator" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_LOOK" + $TS_CMD_LOOK apple-pie $TS_TOPDIR/ts/look/words >> $TS_OUTPUT ts_finalize diff --git a/tests/ts/losetup/losetup b/tests/ts/losetup/losetup index 64eb03888..234c58f6f 100755 --- a/tests/ts/losetup/losetup +++ b/tests/ts/losetup/losetup @@ -21,6 +21,9 @@ TS_DESC="losetup" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_LOSETUP" + ts_skip_nonroot DEVICE=$(ts_scsi_debug_init dev_size_mb=11) diff --git a/tests/ts/lscpu/lscpu b/tests/ts/lscpu/lscpu index 2b8747165..4a98b8604 100755 --- a/tests/ts/lscpu/lscpu +++ b/tests/ts/lscpu/lscpu @@ -22,6 +22,8 @@ TS_TOPDIR="${0%/*}/../.." ts_init "$*" +ts_check_test_command "$TS_CMD_LSCPU" + for dump in $(ls $TS_SELF/dumps/*.tar.gz | sort); do name=$(basename $dump .tar.gz) dumpdir="$TS_OUTDIR/dumps" @@ -29,7 +31,7 @@ for dump in $(ls $TS_SELF/dumps/*.tar.gz | sort); do ts_init_subtest $name mkdir -p $dumpdir - tar -C $dumpdir -zxf $dump + tar -C $dumpdir -zxf $dump # Architecture information is not applicable with -s. "${TS_CMD_LSCPU}" -s "${dumpdir}/${name}" | \ diff --git a/tests/ts/minix/fsck b/tests/ts/minix/fsck index 2b290b0f8..70ad2faa7 100755 --- a/tests/ts/minix/fsck +++ b/tests/ts/minix/fsck @@ -19,12 +19,13 @@ TS_DESC="mkfs checksums" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MKMINIX" + ts_skip_nonroot set -o pipefail -[ -x $TS_CMD_FSCKMINIX ] || ts_skip "fsck.minix not compiled" - IMAGE="$TS_OUTDIR/${TS_TESTNAME}-loop.img" DEVICE=$(ts_device_init) diff --git a/tests/ts/minix/mkfs b/tests/ts/minix/mkfs index 00d5a863d..0159c7b97 100755 --- a/tests/ts/minix/mkfs +++ b/tests/ts/minix/mkfs @@ -19,12 +19,13 @@ TS_DESC="mkfs" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MKMINIX" + ts_skip_nonroot set -o pipefail -[ -x $TS_CMD_MKMINIX ] || ts_skip "mkfs.minix not compiled" - IMAGE="$TS_OUTDIR/${TS_TESTNAME}-loop.img" DEVICE=$(ts_device_init) diff --git a/tests/ts/misc/fallocate b/tests/ts/misc/fallocate index b39794a1f..cbb25d8e8 100755 --- a/tests/ts/misc/fallocate +++ b/tests/ts/misc/fallocate @@ -18,6 +18,8 @@ TS_DESC="fallocate" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_FALLOCATE" + IMAGE=${TS_OUTDIR}/${TS_TESTNAME}.file rm -f $IMAGE diff --git a/tests/ts/misc/getopt b/tests/ts/misc/getopt index 082e41170..715ec36ec 100755 --- a/tests/ts/misc/getopt +++ b/tests/ts/misc/getopt @@ -21,6 +21,8 @@ TS_DESC="getopt" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_GETOPT" + TEMP=$($TS_CMD_GETOPT -o ab:c:: --long a-long,b-long:,c-long:: -n 'example.bash' -- -a -b 1 -c2 --a-long --b-long 3 --c-long foo bar) if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi diff --git a/tests/ts/misc/ionice b/tests/ts/misc/ionice index 29f4d6164..32b22598a 100755 --- a/tests/ts/misc/ionice +++ b/tests/ts/misc/ionice @@ -18,6 +18,8 @@ TS_DESC="ionice" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_IONICE" + $TS_CMD_IONICE -p $$ -n 0 -c 0 >> $TS_OUTPUT 2>&1 $TS_CMD_IONICE -p $$ -n 3 -c 7 >> $TS_OUTPUT 2>&1 $TS_CMD_IONICE -p $$ -n 4 -c 7 >> $TS_OUTPUT 2>&1 diff --git a/tests/ts/misc/line b/tests/ts/misc/line index 2acf2d217..a17ee28cc 100755 --- a/tests/ts/misc/line +++ b/tests/ts/misc/line @@ -18,9 +18,7 @@ TS_DESC="line" . $TS_TOPDIR/functions.sh ts_init "$*" -if [ ! -x "$TS_CMD_LINE" ]; then - ts_skip "line disabled" -fi +ts_check_test_command "$TS_CMD_LINE" printf "a\nb\n" | $TS_CMD_LINE > $TS_OUTPUT 2>&1 diff --git a/tests/ts/misc/mcookie b/tests/ts/misc/mcookie index c5051bcea..96e3cc70a 100755 --- a/tests/ts/misc/mcookie +++ b/tests/ts/misc/mcookie @@ -18,6 +18,8 @@ TS_DESC="mcookie" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_MCOOKIE" + $TS_CMD_MCOOKIE -f /etc/services | # The sed will convert only 32 characters long hexadecimal string # to expected string, but nothing else. diff --git a/tests/ts/misc/rev b/tests/ts/misc/rev index 5b95f289a..a3d45e6a9 100755 --- a/tests/ts/misc/rev +++ b/tests/ts/misc/rev @@ -18,6 +18,8 @@ TS_DESC="rev" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_REV" + for I in {0..512}; do printf "%s " {a..z}; done | md5sum >> $TS_OUTPUT 2>&1 for I in {0..512}; do printf "%s " {a..z}; done | \ diff --git a/tests/ts/misc/setarch b/tests/ts/misc/setarch index 62e00707c..912050958 100755 --- a/tests/ts/misc/setarch +++ b/tests/ts/misc/setarch @@ -18,6 +18,8 @@ TS_DESC="setarch" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_SETARCH" + $TS_CMD_SETARCH $(uname -m) -vRFZLXBIST3 --uname-2.6 echo "success" >$TS_OUTPUT 2>&1 ts_finalize diff --git a/tests/ts/misc/setsid b/tests/ts/misc/setsid index a758c1273..baef70d43 100755 --- a/tests/ts/misc/setsid +++ b/tests/ts/misc/setsid @@ -18,6 +18,8 @@ TS_DESC="setsid" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_SETSID" + $TS_CMD_SETSID echo "success" > $TS_OUTPUT 2>&1 ts_finalize diff --git a/tests/ts/misc/ul b/tests/ts/misc/ul index 974a7f25e..2c2c1da54 100755 --- a/tests/ts/misc/ul +++ b/tests/ts/misc/ul @@ -18,6 +18,8 @@ TS_DESC="ul" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_UL" + printf "a\x08ab\x5F\x08c\\n\\ttab\\f\\b\\r" | $TS_CMD_UL -t xterm > $TS_OUTPUT 2>&1 diff --git a/tests/ts/misc/whereis b/tests/ts/misc/whereis index 98441193b..ee7ec2701 100755 --- a/tests/ts/misc/whereis +++ b/tests/ts/misc/whereis @@ -18,6 +18,8 @@ TS_DESC="whereis" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_WHEREIS" + LS_COUNT=$($TS_CMD_WHEREIS ls | wc -w) if [ $LS_COUNT -lt 2 ]; then echo "ls binary nor manual not found?" > $TS_OUTPUT diff --git a/tests/ts/more/regexp b/tests/ts/more/regexp index 947f55624..67c6f6281 100755 --- a/tests/ts/more/regexp +++ b/tests/ts/more/regexp @@ -18,6 +18,8 @@ TS_DESC="regexp" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_HELPER_MORE" + printf "abba\nbar\nfoo\nxyzzy\n" | $TS_HELPER_MORE +/foo > $TS_OUTPUT 2>&1 diff --git a/tests/ts/more/squeeze b/tests/ts/more/squeeze index 16b537e3a..d5b4a6ab7 100755 --- a/tests/ts/more/squeeze +++ b/tests/ts/more/squeeze @@ -18,6 +18,8 @@ TS_DESC="squeeze" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_HELPER_MORE" + printf "a\n\n\nb\n" | $TS_HELPER_MORE -s > $TS_OUTPUT 2>&1 diff --git a/tests/ts/mount/devname b/tests/ts/mount/devname index 016a16e0e..1cab468d8 100755 --- a/tests/ts/mount/devname +++ b/tests/ts/mount/devname @@ -21,6 +21,10 @@ TS_DESC="by devname" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-broken b/tests/ts/mount/fstab-broken index 522453503..5934c22d3 100755 --- a/tests/ts/mount/fstab-broken +++ b/tests/ts/mount/fstab-broken @@ -20,6 +20,11 @@ TS_DESC="broken fstab" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" +ts_check_test_command "$TS_CMD_FINDMNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-devname b/tests/ts/mount/fstab-devname index 9cf73e008..4dcc4fc74 100755 --- a/tests/ts/mount/fstab-devname +++ b/tests/ts/mount/fstab-devname @@ -20,6 +20,10 @@ TS_DESC="by devname (fstab)" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-devname2label b/tests/ts/mount/fstab-devname2label index 63e8126f9..f8040959e 100755 --- a/tests/ts/mount/fstab-devname2label +++ b/tests/ts/mount/fstab-devname2label @@ -21,6 +21,10 @@ LABEL="testMountD2L" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-devname2uuid b/tests/ts/mount/fstab-devname2uuid index 8cdf946e5..f5548265e 100755 --- a/tests/ts/mount/fstab-devname2uuid +++ b/tests/ts/mount/fstab-devname2uuid @@ -20,6 +20,10 @@ TS_DESC="by devname (fstab uuid)" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-label b/tests/ts/mount/fstab-label index 5e8a97a0f..24fb80f7a 100755 --- a/tests/ts/mount/fstab-label +++ b/tests/ts/mount/fstab-label @@ -21,6 +21,10 @@ LABEL="testFstabLabel" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-label2devname b/tests/ts/mount/fstab-label2devname index 1bb8d042c..b2359a519 100755 --- a/tests/ts/mount/fstab-label2devname +++ b/tests/ts/mount/fstab-label2devname @@ -21,6 +21,10 @@ LABEL="testMountL2D" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-label2uuid b/tests/ts/mount/fstab-label2uuid index ba63a38ea..165426bd7 100755 --- a/tests/ts/mount/fstab-label2uuid +++ b/tests/ts/mount/fstab-label2uuid @@ -22,6 +22,10 @@ LABEL="testMountL2U" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-none b/tests/ts/mount/fstab-none index 1a8fa78e4..64eb48bbf 100755 --- a/tests/ts/mount/fstab-none +++ b/tests/ts/mount/fstab-none @@ -5,6 +5,11 @@ TS_DESC="none" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" +ts_check_test_command "$TS_CMD_FINDMNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-symlink b/tests/ts/mount/fstab-symlink index c8d5eec72..ddabcd645 100755 --- a/tests/ts/mount/fstab-symlink +++ b/tests/ts/mount/fstab-symlink @@ -21,6 +21,10 @@ TS_DESC="by devname (fstab symlink)" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-uuid b/tests/ts/mount/fstab-uuid index a0394a4ff..5d3afb706 100755 --- a/tests/ts/mount/fstab-uuid +++ b/tests/ts/mount/fstab-uuid @@ -20,6 +20,10 @@ TS_DESC="by uuid (fstab)" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-uuid2devname b/tests/ts/mount/fstab-uuid2devname index 572291146..90f7d9177 100755 --- a/tests/ts/mount/fstab-uuid2devname +++ b/tests/ts/mount/fstab-uuid2devname @@ -20,6 +20,10 @@ TS_DESC="by uuid (fstab devname)" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/fstab-uuid2label b/tests/ts/mount/fstab-uuid2label index 098f43bad..5291688fc 100755 --- a/tests/ts/mount/fstab-uuid2label +++ b/tests/ts/mount/fstab-uuid2label @@ -21,6 +21,10 @@ LABEL="testMountU2L" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/label b/tests/ts/mount/label index 2dda82530..b0e7ca69a 100755 --- a/tests/ts/mount/label +++ b/tests/ts/mount/label @@ -22,6 +22,10 @@ LABEL="testMountLabel" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/move b/tests/ts/mount/move index dc130d484..524488777 100755 --- a/tests/ts/mount/move +++ b/tests/ts/mount/move @@ -20,6 +20,11 @@ TS_DESC="move" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" +ts_check_test_command "$TS_CMD_FINDMNT" + ts_skip_nonroot DIR_PRIVATE2="$TS_OUTDIR/mnt-move-private2" diff --git a/tests/ts/mount/noncanonical b/tests/ts/mount/noncanonical index a5402d3d9..a311577f0 100755 --- a/tests/ts/mount/noncanonical +++ b/tests/ts/mount/noncanonical @@ -20,6 +20,9 @@ TS_DESC="non canonical path" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" + ts_skip_nonroot [ ! -e "/etc" ] && ts_skip "/etc not such file of directory" diff --git a/tests/ts/mount/paths b/tests/ts/mount/paths index 8a6ed352b..edc283757 100755 --- a/tests/ts/mount/paths +++ b/tests/ts/mount/paths @@ -20,6 +20,9 @@ TS_DESC="basic paths" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" + ts_skip_nonroot $TS_CMD_MOUNT -V | grep -q "libmount" diff --git a/tests/ts/mount/regfile b/tests/ts/mount/regfile index b342ececd..9f24c721a 100755 --- a/tests/ts/mount/regfile +++ b/tests/ts/mount/regfile @@ -8,6 +8,10 @@ TS_DESC="regular file" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/mount/remount b/tests/ts/mount/remount index c6c772f91..f983ab37b 100755 --- a/tests/ts/mount/remount +++ b/tests/ts/mount/remount @@ -20,6 +20,10 @@ TS_DESC="remount" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_FINDMNT" + ts_skip_nonroot # mountpoint diff --git a/tests/ts/mount/rlimit b/tests/ts/mount/rlimit index dc7a2c821..13064c842 100755 --- a/tests/ts/mount/rlimit +++ b/tests/ts/mount/rlimit @@ -28,6 +28,10 @@ TS_DESC="rlimit-fsize" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot [ -L /etc/mtab ] && ts_skip "mtab is symlink" diff --git a/tests/ts/mount/shared-subtree b/tests/ts/mount/shared-subtree index f234a289e..d512a0007 100755 --- a/tests/ts/mount/shared-subtree +++ b/tests/ts/mount/shared-subtree @@ -5,6 +5,11 @@ TS_DESC="shared-subtree" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" +ts_check_test_command "$TS_CMD_FINDMNT" + ts_skip_nonroot [ -d $TS_MOUNTPOINT ] || mkdir -p $TS_MOUNTPOINT diff --git a/tests/ts/mount/special b/tests/ts/mount/special index 633f23df8..21edd6507 100755 --- a/tests/ts/mount/special +++ b/tests/ts/mount/special @@ -21,6 +21,9 @@ MOUNTER="/sbin/mount.mytest" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" + ts_skip_nonroot cat > $MOUNTER <<\EOF diff --git a/tests/ts/mount/umount-alltargets b/tests/ts/mount/umount-alltargets index e6a284727..e3b5aec9a 100755 --- a/tests/ts/mount/umount-alltargets +++ b/tests/ts/mount/umount-alltargets @@ -7,6 +7,11 @@ TS_DESC="umount-all-targets" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot $TS_CMD_UMOUNT --help | grep -q all-targets diff --git a/tests/ts/mount/umount-recursive b/tests/ts/mount/umount-recursive index 83d6dee3c..d55f61285 100755 --- a/tests/ts/mount/umount-recursive +++ b/tests/ts/mount/umount-recursive @@ -7,6 +7,11 @@ TS_DESC="umount-recursive" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" +ts_check_test_command "$TS_CMD_FDISK" + ts_skip_nonroot $TS_CMD_UMOUNT --help | grep -q recursive diff --git a/tests/ts/mount/uuid b/tests/ts/mount/uuid index 14df0b140..0233064cf 100755 --- a/tests/ts/mount/uuid +++ b/tests/ts/mount/uuid @@ -20,6 +20,10 @@ TS_DESC="by uuid" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MOUNT" +ts_check_test_command "$TS_CMD_UMOUNT" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/namei/logic b/tests/ts/namei/logic index b216ee7cc..df48b7620 100755 --- a/tests/ts/namei/logic +++ b/tests/ts/namei/logic @@ -21,6 +21,8 @@ TS_DESC="basic functionality" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_NAMEI" + cd $TS_OUTDIR mkdir -p namei1/namei2 diff --git a/tests/ts/partx/partx b/tests/ts/partx/partx index 74600cbc2..bc612b0a4 100755 --- a/tests/ts/partx/partx +++ b/tests/ts/partx/partx @@ -24,9 +24,12 @@ PARTS=3 . $TS_TOPDIR/functions.sh ts_init "$*" -ts_skip_nonroot -[ ! -x "$TS_CMD_PARTX" ] && ts_skip "partx disabled" +ts_check_test_command "$TS_CMD_PARTX" +ts_check_test_command "$TS_CMD_ADDPART" +ts_check_test_command "$TS_CMD_DELPART" + +ts_skip_nonroot mkdir -p $TS_OUTDIR/images-pt for img in $(ls $TS_IMGDIR/*.img.bz2 | sort); do diff --git a/tests/ts/schedutils/cpuset b/tests/ts/schedutils/cpuset index 9872e270c..f1df59794 100755 --- a/tests/ts/schedutils/cpuset +++ b/tests/ts/schedutils/cpuset @@ -20,6 +20,8 @@ TS_DESC="cpuset" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_CPUSET" + MASKS=" 0x00000001 \ 0x00000002 \ 0x00000003 \ diff --git a/tests/ts/script/race b/tests/ts/script/race index 98ac56a47..ef7e83f12 100755 --- a/tests/ts/script/race +++ b/tests/ts/script/race @@ -22,6 +22,8 @@ TS_DESC="race conditions" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_SCRIPT" + bingofile="$TS_OUTDIR/${TS_TESTNAME}-bingo" set -o pipefail diff --git a/tests/ts/swapon/devname b/tests/ts/swapon/devname index 10fcc4282..f8f312105 100755 --- a/tests/ts/swapon/devname +++ b/tests/ts/swapon/devname @@ -20,6 +20,11 @@ TS_DESC="by devname" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MKSWAP" +ts_check_test_command "$TS_CMD_SWAPON" +ts_check_test_command "$TS_CMD_SWAPOFF" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/swapon/fixpgsz b/tests/ts/swapon/fixpgsz index 53f8833f5..f0dafe934 100755 --- a/tests/ts/swapon/fixpgsz +++ b/tests/ts/swapon/fixpgsz @@ -5,6 +5,11 @@ TS_DESC="fix page size" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MKSWAP" +ts_check_test_command "$TS_CMD_SWAPON" +ts_check_test_command "$TS_CMD_SWAPOFF" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/swapon/fixsig b/tests/ts/swapon/fixsig index d7ba65625..a4d04110c 100755 --- a/tests/ts/swapon/fixsig +++ b/tests/ts/swapon/fixsig @@ -5,6 +5,11 @@ TS_DESC="fix signature" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MKSWAP" +ts_check_test_command "$TS_CMD_SWAPON" +ts_check_test_command "$TS_CMD_SWAPOFF" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/swapon/label b/tests/ts/swapon/label index 5f9599cd2..03cf017ed 100755 --- a/tests/ts/swapon/label +++ b/tests/ts/swapon/label @@ -21,6 +21,11 @@ LABEL="testSwapLabel" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MKSWAP" +ts_check_test_command "$TS_CMD_SWAPON" +ts_check_test_command "$TS_CMD_SWAPOFF" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/swapon/uuid b/tests/ts/swapon/uuid index 858350630..c80e52fdb 100755 --- a/tests/ts/swapon/uuid +++ b/tests/ts/swapon/uuid @@ -20,6 +20,11 @@ TS_DESC="by uuid" . $TS_TOPDIR/functions.sh ts_init "$*" + +ts_check_test_command "$TS_CMD_MKSWAP" +ts_check_test_command "$TS_CMD_SWAPON" +ts_check_test_command "$TS_CMD_SWAPOFF" + ts_skip_nonroot set -o pipefail diff --git a/tests/ts/tailf/simple b/tests/ts/tailf/simple index 60257aee6..955844d1c 100755 --- a/tests/ts/tailf/simple +++ b/tests/ts/tailf/simple @@ -18,6 +18,8 @@ TS_DESC="simple" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_TAILF" + INPUT=$TS_OUTDIR/$TS_TESTNAME.input rm -f $INPUT diff --git a/tests/ts/utmpdump/ipv6tobin b/tests/ts/utmpdump/ipv6tobin index cb52e513b..fac6fb9a4 100755 --- a/tests/ts/utmpdump/ipv6tobin +++ b/tests/ts/utmpdump/ipv6tobin @@ -18,6 +18,8 @@ TS_DESC="IPv6 to binary" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_UTMPDUMP" + export LANG=C export TZ=GMT $TS_CMD_UTMPDUMP -r $TS_SELF/ipv6txt >| $TS_OUTPUT 2>/dev/null diff --git a/tests/ts/utmpdump/ipv6totxt b/tests/ts/utmpdump/ipv6totxt index 560806c5b..b9da8abd7 100755 --- a/tests/ts/utmpdump/ipv6totxt +++ b/tests/ts/utmpdump/ipv6totxt @@ -18,6 +18,8 @@ TS_DESC="IPv6 to text" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_UTMPDUMP" + export LANG=C export TZ=GMT $TS_CMD_UTMPDUMP $TS_SELF/ipv6bin >| $TS_OUTPUT 2>/dev/null diff --git a/tests/ts/utmpdump/to-binary b/tests/ts/utmpdump/to-binary index dcfe6ea1e..e774915e7 100755 --- a/tests/ts/utmpdump/to-binary +++ b/tests/ts/utmpdump/to-binary @@ -18,6 +18,8 @@ TS_DESC="to-binary" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_UTMPDUMP" + export LANG=C export TZ=GMT $TS_CMD_UTMPDUMP -r $TS_SELF/text >| $TS_OUTPUT 2>/dev/null diff --git a/tests/ts/utmpdump/to-text b/tests/ts/utmpdump/to-text index 56f411a5d..e98215067 100755 --- a/tests/ts/utmpdump/to-text +++ b/tests/ts/utmpdump/to-text @@ -18,6 +18,8 @@ TS_DESC="to-text" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_check_test_command "$TS_CMD_UTMPDUMP" + export LANG=C export TZ=GMT $TS_CMD_UTMPDUMP $TS_SELF/binary >| $TS_OUTPUT 2>/dev/null diff --git a/tests/ts/wipefs/wipefs b/tests/ts/wipefs/wipefs index e6ace2166..4bd174800 100755 --- a/tests/ts/wipefs/wipefs +++ b/tests/ts/wipefs/wipefs @@ -7,6 +7,8 @@ TS_DESC="wipefs" ts_skip_nonroot ts_init "$*" +ts_check_test_command "$TS_CMD_WIPEFS" + DEVICE=$(ts_scsi_debug_init dev_size_mb=50 num_parts=2) # remove old backups -- cgit v1.2.3-55-g7522