2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Oracle, Inc.
7 # Make sure pretty printed XFS geometry is the same across all programs.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
16 trap "_cleanup; exit \$status" 0 1 2 3 15
26 # get standard environment, filters and checks
30 # real QA test starts here
34 _require_scratch_nocheck
36 # Geometry printing wasn't unified until xfs_spaceman grew an 'info'
37 # command, so skip this test if there is no spaceman or it doesn't
38 # know what 'info' is.
39 _require_xfs_spaceman_command "info"
40 _require_command "$XFS_GROWFS_PROG" xfs_growfs
42 _scratch_mkfs | sed -e '/Discarding/d' > $tmp.mkfs
43 echo MKFS >> $seqres.full
44 cat $tmp.mkfs >> $seqres.full
46 _scratch_xfs_db -c "info" > $tmp.dbinfo
47 echo DB >> $seqres.full
48 cat $tmp.dbinfo >> $seqres.full
49 # xfs_db doesn't take a rtdev argument, so it reports "realtime=external".
50 # mkfs does, so make a quick substitution
51 diff -u <(cat $tmp.mkfs | sed -e 's/realtime =\/.*extsz=/realtime =external extsz=/g') $tmp.dbinfo
55 $XFS_SPACEMAN_PROG -c "info" $SCRATCH_MNT > $tmp.spaceman
56 echo SPACEMAN >> $seqres.full
57 cat $tmp.spaceman >> $seqres.full
58 diff -u $tmp.mkfs $tmp.spaceman
60 $XFS_GROWFS_PROG -n $SCRATCH_MNT > $tmp.growfs
61 echo GROWFS >> $seqres.full
62 cat $tmp.growfs >> $seqres.full
63 diff -u $tmp.mkfs $tmp.growfs
65 $XFS_INFO_PROG $SCRATCH_MNT > $tmp.info.mnt
66 echo INFO_MNT >> $seqres.full
67 cat $tmp.info.mnt >> $seqres.full
68 diff -u $tmp.mkfs $tmp.info.mnt
70 $XFS_INFO_PROG $SCRATCH_DEV > $tmp.info.dev
71 echo INFO_DEV >> $seqres.full
72 cat $tmp.info.dev >> $seqres.full
73 diff -u $tmp.mkfs $tmp.info.dev
75 echo "Silence is golden."