mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fstests: add _require_command check to killall
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>
This commit is contained in:
committed by
Eryu Guan
parent
c0c6e54ce6
commit
2fb853cd58
+3
-2
@@ -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?
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
+3
-2
@@ -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."
|
||||
|
||||
+3
-2
@@ -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
|
||||
|
||||
+3
-2
@@ -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
|
||||
|
||||
+3
-2
@@ -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
|
||||
|
||||
|
||||
+2
-1
@@ -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"
|
||||
|
||||
|
||||
+2
-1
@@ -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."
|
||||
|
||||
|
||||
+2
-1
@@ -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."
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
+2
-1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user