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
33 _require_scratch_nocheck
35 # Geometry printing wasn't unified until xfs_spaceman grew an 'info'
36 # command, so skip this test if there is no spaceman or it doesn't
37 # know what 'info' is.
38 _require_xfs_spaceman_command "info"
39 _require_command "$XFS_GROWFS_PROG" xfs_growfs
41 _scratch_mkfs | sed -e '/Discarding/d' > $tmp.mkfs
42 echo MKFS >> $seqres.full
43 cat $tmp.mkfs >> $seqres.full
45 _scratch_xfs_db -c "info" > $tmp.dbinfo
46 echo DB >> $seqres.full
47 cat $tmp.dbinfo >> $seqres.full
48 # xfs_db doesn't take a rtdev argument, so it reports "realtime=external".
49 # mkfs does, so make a quick substitution
50 diff -u <(cat $tmp.mkfs | sed -e 's/realtime =\/.*extsz=/realtime =external extsz=/g') $tmp.dbinfo
54 $XFS_SPACEMAN_PROG -c "info" $SCRATCH_MNT > $tmp.spaceman
55 echo SPACEMAN >> $seqres.full
56 cat $tmp.spaceman >> $seqres.full
57 diff -u $tmp.mkfs $tmp.spaceman
59 $XFS_GROWFS_PROG -n $SCRATCH_MNT > $tmp.growfs
60 echo GROWFS >> $seqres.full
61 cat $tmp.growfs >> $seqres.full
62 diff -u $tmp.mkfs $tmp.growfs
64 $XFS_INFO_PROG $SCRATCH_MNT > $tmp.info.mnt
65 echo INFO_MNT >> $seqres.full
66 cat $tmp.info.mnt >> $seqres.full
67 diff -u $tmp.mkfs $tmp.info.mnt
69 $XFS_INFO_PROG $SCRATCH_DEV > $tmp.info.dev
70 echo INFO_DEV >> $seqres.full
71 cat $tmp.info.dev >> $seqres.full
72 diff -u $tmp.mkfs $tmp.info.dev
74 echo "Silence is golden."