xfs/530: skip test if user MKFS_OPTIONS screw up formatting
[xfstests-dev.git] / tests / xfs / 275
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. 275
6 #
7 # Check that getfsmap reports external log devices
8 #
9 . ./common/preamble
10 _begin_fstest auto quick rmap fsmap
11
12 # Override the default cleanup function.
13 _cleanup()
14 {
15         cd /
16         rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout
17 }
18
19 # Import common functions.
20 . ./common/filter
21
22 # real QA test starts here
23 _supported_fs xfs
24 _require_logdev
25 _require_scratch
26 _require_xfs_io_command "fsmap"
27
28 rm -f "$seqres.full"
29
30 echo "Format and mount"
31 _scratch_mkfs > "$seqres.full" 2>&1
32 _scratch_mount
33
34 echo "Get fsmap" | tee -a $seqres.full
35 $XFS_IO_PROG -c 'fsmap -v' $SCRATCH_MNT >> $seqres.full
36 $XFS_IO_PROG -c 'fsmap -v' $SCRATCH_MNT | tr '[]()' '    ' > $TEST_DIR/fsmap
37
38 echo "Check device field of FS metadata and journalling log"
39 data_dev=$(grep 'static fs metadata' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
40 journal_dev=$(grep 'journalling log' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
41 test "${data_dev}" != "${journal_dev}" || echo "data ${data_dev} journal ${journal_dev}?"
42
43 # success, all done
44 status=0
45 exit