generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / xfs / 273
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016, Oracle and/or its affiliates.  All Rights Reserved.
4 #
5 # FS QA Test No. 273
6 #
7 # Populate filesystem, check that fsmap -n10000 matches fsmap -n1.
8 #
9 . ./common/preamble
10 _begin_fstest auto rmap fsmap
11
12 # Override the default cleanup function.
13 _cleanup()
14 {
15         cd /
16         rm -rf "$tmp".* $TEST_DIR/a $TEST_DIR/b
17 }
18
19 # Import common functions.
20 . ./common/filter
21 . ./common/populate
22
23 # real QA test starts here
24 _supported_fs xfs
25 _require_scratch
26 _require_populate_commands
27 _require_xfs_io_command "fsmap"
28
29 rm -f "$seqres.full"
30
31 echo "Format and mount"
32 _scratch_populate_cached nofill > $seqres.full 2>&1
33
34 echo "Compare fsmap" | tee -a $seqres.full
35 _scratch_mount
36 $XFS_IO_PROG -c 'fsmap -v -n 65536' $SCRATCH_MNT | grep -v 'EXT:' > $TEST_DIR/a
37 $XFS_IO_PROG -c 'fsmap -v -n 1' $SCRATCH_MNT | grep -v 'EXT:' > $TEST_DIR/b
38 cat $TEST_DIR/a $TEST_DIR/b >> $seqres.full
39
40 diff -uw $TEST_DIR/a $TEST_DIR/b
41
42 # success, all done
43 status=0
44 exit