generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / xfs / 135
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat, Inc. All Rights Reserved.
4 #
5 # FS QA Test No. 135
6 #
7 # This test verifies that the xfsprogs log formatting infrastructure works
8 # correctly for various log stripe unit values. The log is formatted with xfs_db
9 # and verified with xfs_logprint.
10 #
11 . ./common/preamble
12 _begin_fstest auto logprint quick v2log
13
14 # Import common functions.
15 . ./common/log
16
17 # real QA test starts here
18
19 # Modify as appropriate.
20 _supported_fs xfs
21 _require_scratch
22 _require_v2log
23 _require_xfs_db_command "logformat"
24
25 _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
26
27 # Reformat the log with various log stripe unit sizes and see if logprint dumps
28 # any errors. Use a cycle value larger than 1 so the log is actually written
29 # (the log is zeroed when cycle == 1).
30 for i in 16 32 64 128 256; do
31         lsunit=$((i * 1024))
32         _scratch_xfs_db -x -c "logformat -c 3 -s $lsunit" | \
33                 tee -a $seqres.full
34         # don't redirect error output so it causes test failure
35         _scratch_xfs_logprint >> $seqres.full
36 done
37
38 # success, all done
39 status=0
40 exit