]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fstests: add _require_command check to killall
authorMasayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Mon, 13 Jun 2016 02:58:01 +0000 (11:58 +0900)
committerEryu Guan <eguan@redhat.com>
Wed, 15 Jun 2016 07:44:49 +0000 (15:44 +0800)
Some tests use killall command, but killall may not exist.
We should check whether killall exists or not.

Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
12 files changed:
tests/generic/051
tests/generic/270
tests/generic/310
tests/xfs/011
tests/xfs/013
tests/xfs/051
tests/xfs/070
tests/xfs/079
tests/xfs/141
tests/xfs/167
tests/xfs/297
tests/xfs/305

index d62080796cf7b472ce7eabf471f2bf7db6364233..b0c37824ac7feb7927c8fc08305b50f8bcdeceff 100755 (executable)
@@ -50,6 +50,7 @@ _supported_os Linux
 
 _require_scratch
 _require_scratch_shutdown
+_require_command "$KILLALL_PROG" killall
 
 rm -f $seqres.full
 
@@ -64,7 +65,7 @@ load_dir=$SCRATCH_MNT/test
 # let this run for a while
 $FSSTRESS_PROG -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
 sleep $SLEEP_TIME
-killall -q $FSSTRESS_PROG
+$KILLALL_PROG -q $FSSTRESS_PROG
 wait
 sync
 _scratch_unmount
@@ -79,7 +80,7 @@ sync
 # now shutdown and unmount
 sleep 5
 $here/src/godown $load_dir
-killall -q $FSSTRESS_PROG
+$KILLALL_PROG -q $FSSTRESS_PROG
 wait
 
 # for some reason fsstress processes manage to live on beyond the wait?
index e6874c98c899780631465effd6f8eee4ee0e7b04..f5026ba0cd300b2f8b2e722bea3ac363eccc918e 100755 (executable)
@@ -69,7 +69,7 @@ _workout()
                sleep $enospc_time
        done
 
-       killall $tmp.fsstress.bin
+       $KILLALL_PROG $tmp.fsstress.bin
        wait $pid
 }
 
@@ -79,6 +79,7 @@ _supported_os Linux
 _require_quota
 _require_user
 _require_scratch
+_require_command "$KILLALL_PROG" killall
 
 rm -f $seqres.full
 _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1
index c0a8645146caf466eed3041a0664affefcf51494..895481cb7fc1800482c5708448b0d2954a2b1061 100755 (executable)
@@ -58,6 +58,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _require_test
+_require_command "$KILLALL_PROG" killall
 
 dmesg -c > /dev/null
 
@@ -103,7 +104,7 @@ _test_read()
 {
        src/t_readdir_1 $SEQ_DIR &
        sleep $RUN_TIME
-       killall t_readdir_1
+       $KILLALL_PROG t_readdir_1
        check_kernel_bug
        if [ $? -ne 0 ]; then
                _fatal "kernel bug detected, check dmesg for more infomation."
@@ -114,7 +115,7 @@ _test_lseek()
 {
        src/t_readdir_2 $SEQ_DIR &
        sleep $RUN_TIME
-       killall t_readdir_2
+       $KILLALL_PROG t_readdir_2
        check_kernel_bug
        if [ $? -ne 0 ]; then
                _fatal "kernel bug detected, check dmesg for more infomation."
index e84faa5b19133b3209e111de8a3842a9068f4f9f..dde06d7655e87055fe81bf9be6082dc4a915d436 100755 (executable)
@@ -37,7 +37,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-       killall -9 fsstress 2>/dev/null
+       $KILLALL_PROG -9 fsstress 2>/dev/null
        wait
        cd /
        _scratch_unmount 2>/dev/null
@@ -86,6 +86,7 @@ _supported_os Linux
 _require_scratch
 _require_freeze
 _require_xfs_sysfs $(_short_dev $TEST_DEV)/log
+_require_command "$KILLALL_PROG" killall
 
 rm -f $seqres.full
 
@@ -106,7 +107,7 @@ while [ $iters -gt 0 ]; do
        iters=$((iters - 1))
 done
 
-killall $FSSTRESS_PROG
+$KILLALL_PROG $FSSTRESS_PROG
 wait
 
 _scratch_unmount
index 3a96fea1ae7306bc3e607e8ce72a27d2398e53fd..817558fb8820bf3f6b48b91bfe75432b6adc7ccc 100755 (executable)
@@ -40,7 +40,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-       killall -9 fsstress 2>/dev/null
+       $KILLALL_PROG -9 fsstress 2>/dev/null
        wait
        cd /
        _scratch_unmount 2>/dev/null
@@ -101,6 +101,7 @@ _supported_os Linux
 _require_scratch
 _require_xfs_mkfs_finobt
 _require_xfs_finobt
+_require_command "$KILLALL_PROG" killall
 
 rm -f $seqres.full
 
@@ -142,7 +143,7 @@ do
        _rand_replace $SCRATCH_MNT/dir$((i+1)) $COUNT
 done
 
-killall fsstress
+$KILLALL_PROG fsstress
 wait
 
 # clean out the competing fsstress allocations, then everything else
index 3f3363509fe3be0c7a4341577dd4703441ab8d4b..f38743c3098272f21321b2be618c9d9a1d972d54 100755 (executable)
@@ -36,7 +36,7 @@ _cleanup()
 {
        cd /
        rm -f $tmp.*
-       killall -9 $FSSTRESS_PROG > /dev/null 2>&1
+       $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1
        _scratch_unmount > /dev/null 2>&1
 }
 
@@ -51,6 +51,7 @@ _supported_os Linux
 _require_scratch
 _require_dm_target flakey
 _require_xfs_sysfs debug/log_recovery_delay
+_require_command "$KILLALL_PROG" killall
 
 echo "Silence is golden."
 
@@ -62,7 +63,7 @@ _scratch_mount
 $FSSTRESS_PROG -n 9999 -p 2 -w -d $SCRATCH_MNT > /dev/null 2>&1 &
 sleep 5
 src/godown -f $SCRATCH_MNT
-killall -q $FSSTRESS_PROG
+$KILLALL_PROG -q $FSSTRESS_PROG
 wait
 _scratch_unmount
 
index 772e2c1a788f6df5ecd60c24224b06a5b8c5143b..e3a48b3eaeb4791e4fe71e124677ff0db725c18e 100755 (executable)
@@ -46,7 +46,7 @@ _cleanup()
 {
        cd /
        rm -f $tmp.*
-       killall -9 $XFS_REPAIR_PROG > /dev/null 2>&1
+       $KILLALL_PROG -9 $XFS_REPAIR_PROG > /dev/null 2>&1
        wait > /dev/null 2>&1
 }
 
@@ -93,6 +93,7 @@ rm -f $seqres.full
 _supported_fs xfs
 _supported_os Linux
 _require_scratch_nocheck
+_require_command "$KILLALL_PROG" killall
 
 _scratch_mkfs | _filter_mkfs > /dev/null 2> $tmp.mkfs || _fail "mkfs failed"
 
index 8f06e3a7358202e3481ce50007f0e4ff49b7ed02..8ac9d58db38c744bc06f4d2f1fc561251f6846ee 100755 (executable)
@@ -42,7 +42,7 @@ _cleanup()
 {
        cd /
        rm -f $tmp.*
-       killall -9 fsstress > /dev/null 2>&1
+       $KILLALL_PROG -9 fsstress > /dev/null 2>&1
        wait > /dev/null 2>&1
 }
 
@@ -59,6 +59,7 @@ _supported_fs xfs
 _supported_os Linux
 _require_scratch
 _require_v2log
+_require_command "$KILLALL_PROG" killall
 
 echo "Silence is golden."
 
index a70c98646be076be1e5fc29e96789603f2770a06..56ff14e8b56d13539852df19b072e0b54f919e2f 100755 (executable)
@@ -39,7 +39,7 @@ _cleanup()
 {
        cd /
        rm -f $tmp.*
-       killall -9 fsstress > /dev/null 2>&1
+       $KILLALL_PROG -9 fsstress > /dev/null 2>&1
        wait > /dev/null 2>&1
 }
 
@@ -55,6 +55,7 @@ _supported_fs xfs
 _supported_os Linux
 _require_xfs_sysfs $(_short_dev $TEST_DEV)/log/log_badcrc_factor
 _require_scratch
+_require_command "$KILLALL_PROG" killall
 
 echo "Silence is golden."
 
index e6c65d24ce399e3133b7ab9a6bfa4be117c0569a..a9f0e612599f5eb6408baabe43d0efc73dd5863d 100755 (executable)
@@ -56,7 +56,7 @@ workout()
 _supported_fs xfs
 _supported_os Linux
 
-[ -n "$KILLALL_PROG" ] || _notrun "killall executable not found"
+_require_command "$KILLALL_PROG" killall
 
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
index 25b597e55ebbb62d3a16a1ada74c7fb8ec9ddff5..fe924413a5dcf1bef8473598c56ce237a5afe476 100755 (executable)
@@ -48,6 +48,7 @@ _supported_os IRIX Linux
 
 _require_scratch
 _require_freeze
+_require_command "$KILLALL_PROG" killall
 
 rm -f $seqres.full
 _scratch_mkfs_xfs -d agcount=16,su=256k,sw=12 -l su=256k,size=5120b >/dev/null 2>&1
@@ -79,7 +80,7 @@ while [ $LOOP -gt 0 ];do
        let LOOP=$LOOP-1
 done
 echo "Test done" | tee -a $seqres.full
-killall -q $FSSTRESS_PROG
+$KILLALL_PROG -q $FSSTRESS_PROG
 wait
 
 status=0
index 15fb1ad5ced07cd0ac8e79b1da3cee2fe0c5b868..692e9908f00940e1c64542780c6bc378ff642b04 100755 (executable)
@@ -50,6 +50,7 @@ _require_scratch
 _require_xfs_quota
 _require_xfs_mkfs_crc
 _require_xfs_crc
+_require_command "$KILLALL_PROG" killall
 
 rm -f $seqres.full
 _scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
@@ -69,7 +70,7 @@ _exercise()
        sleep 10
        xfs_quota -x -c "off -$type" $SCRATCH_DEV
        sleep 5
-       killall -q $FSSTRESS_PROG
+       $KILLALL_PROG -q $FSSTRESS_PROG
        wait
 }