2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017, Oracle and/or its affiliates. All Rights Reserved.
7 # Check that getfsmap reports external log devices
10 _begin_fstest auto quick fsmap
12 # Override the default cleanup function.
16 rm -f "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout
19 # Import common functions.
22 # real QA test starts here
26 _require_xfs_io_command "fsmap"
30 echo "Format and mount"
31 _scratch_mkfs > "$seqres.full" 2>&1
34 echo "Get fsmap" | tee -a $seqres.full
35 $XFS_IO_PROG -c 'fsmap' $SCRATCH_MNT >> $seqres.full
36 $XFS_IO_PROG -c 'fsmap' $SCRATCH_MNT | tr '[]()' ' ' > $TEST_DIR/fsmap
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}?"