xfs/530: skip test if user MKFS_OPTIONS screw up formatting
[xfstests-dev.git] / tests / xfs / 167
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FSQA Test No. 167
6 #
7 # unwritten extent conversion test
8 #
9 . ./common/preamble
10 _begin_fstest rw metadata auto stress
11
12 # Override the default cleanup function.
13 _cleanup()
14 {
15         $KILLALL_PROG -r -q -TERM fsstress 2> /dev/null
16         wait    # ensures all fsstress processes died
17 }
18
19 workout()
20 {
21         procs=100
22         nops=15000
23         FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p $procs -n $nops \
24             $FSSTRESS_AVOID`
25         $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full &
26         sleep 2
27 }
28
29 # Import common functions.
30 . ./common/filter
31
32 # real QA test starts here
33 _supported_fs xfs
34
35 _require_command "$KILLALL_PROG" killall
36 _require_xfs_io_command "falloc"
37
38 _require_scratch
39 _scratch_mkfs_xfs >/dev/null 2>&1
40 _scratch_mount
41
42 # fast devices can consume disk space at a rate of 1GB every 5s via the
43 # background workload. With 50 test loops, at 1 second per loop, that means we
44 # need at least 10GB of disk space to ensure this test will not fail with ENOSPC
45 # errors.
46 _require_fs_space $SCRATCH_MNT 10485760
47
48 TEST_FILE=$SCRATCH_MNT/test_file
49 TEST_PROG=$here/src/unwritten_sync
50 LOOPS=50
51
52 echo "*** test unwritten extent conversion under heavy I/O"
53
54 workout
55
56 rm -f $TEST_FILE
57 $TEST_PROG $LOOPS $TEST_FILE
58
59 echo "     *** test done"
60
61 status=0
62 exit