generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / generic / 225
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2009 Eric Sandeen.  All Rights Reserved.
4 #
5 # FS QA Test No. 225
6 #
7 # Run the fiemap (file extent mapping) tester
8 #
9 . ./common/preamble
10 _begin_fstest auto quick fiemap
11
12 # Import common functions.
13 . ./common/filter
14
15 # real QA test starts here
16 _supported_fs generic
17 _require_scratch
18 _require_odirect
19 _require_xfs_io_command "fiemap"
20
21 _scratch_mkfs > /dev/null 2>&1
22 _scratch_mount > /dev/null 2>&1
23
24 fiemapfile=$SCRATCH_MNT/$seq.fiemap
25 fiemaplog=$SCRATCH_MNT/$seq.log
26
27 _require_test_program "fiemap-tester"
28
29 seed=`date +%s`
30
31 echo "using seed $seed" >> $fiemaplog
32
33 echo "fiemap run without preallocation, with sync"
34 $here/src/fiemap-tester -q -S -s $seed -p 0 -r 200 $fiemapfile 2>&1 | tee -a $fiemaplog
35
36 if [ $? -ne 0 ]; then
37         if grep -q "Operation not supported" $fiemaplog; then
38               _notrun "FIEMAP not supported by this filesystem type: $FSTYP"
39         fi
40         status=$?
41         exit
42 fi
43
44 echo "fiemap run without preallocation or sync"
45 $here/src/fiemap-tester -q -s $seed -p 0 -r 200 $fiemapfile 2>&1 | tee -a $fiemaplog
46
47 status=0
48 exit