2018-06-05 09:43:33 -07:00
|
|
|
#! /bin/bash
|
2018-06-09 11:35:45 +10:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
# Copyright (c) 2018 Oracle, Inc.
|
|
|
|
|
#
|
2018-06-05 09:43:33 -07:00
|
|
|
# FS QA Test No. 449
|
|
|
|
|
#
|
|
|
|
|
# Make sure pretty printed XFS geometry is the same across all programs.
|
|
|
|
|
#
|
|
|
|
|
seq=`basename $0`
|
|
|
|
|
seqres=$RESULT_DIR/$seq
|
|
|
|
|
echo "QA output created by $seq"
|
|
|
|
|
|
|
|
|
|
here=`pwd`
|
|
|
|
|
tmp=/tmp/$$
|
|
|
|
|
status=1
|
|
|
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
|
|
|
|
|
|
_cleanup()
|
|
|
|
|
{
|
|
|
|
|
cd /
|
|
|
|
|
rm -f $tmp.*
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rm -f $seqres.full
|
|
|
|
|
|
|
|
|
|
# get standard environment, filters and checks
|
|
|
|
|
. ./common/rc
|
|
|
|
|
. ./common/filter
|
|
|
|
|
|
|
|
|
|
# real QA test starts here
|
|
|
|
|
_supported_fs xfs
|
|
|
|
|
|
|
|
|
|
_require_scratch_nocheck
|
|
|
|
|
|
|
|
|
|
# Geometry printing wasn't unified until xfs_spaceman grew an 'info'
|
|
|
|
|
# command, so skip this test if there is no spaceman or it doesn't
|
|
|
|
|
# know what 'info' is.
|
|
|
|
|
_require_xfs_spaceman_command "info"
|
|
|
|
|
_require_command "$XFS_GROWFS_PROG" xfs_growfs
|
|
|
|
|
|
2020-02-04 16:01:48 -08:00
|
|
|
_scratch_mkfs | sed -e '/Discarding/d' > $tmp.mkfs
|
2018-06-05 09:43:33 -07:00
|
|
|
echo MKFS >> $seqres.full
|
|
|
|
|
cat $tmp.mkfs >> $seqres.full
|
|
|
|
|
|
|
|
|
|
_scratch_xfs_db -c "info" > $tmp.dbinfo
|
|
|
|
|
echo DB >> $seqres.full
|
|
|
|
|
cat $tmp.dbinfo >> $seqres.full
|
2020-09-14 18:45:02 -07:00
|
|
|
# xfs_db doesn't take a rtdev argument, so it reports "realtime=external".
|
|
|
|
|
# mkfs does, so make a quick substitution
|
|
|
|
|
diff -u <(cat $tmp.mkfs | sed -e 's/realtime =\/.*extsz=/realtime =external extsz=/g') $tmp.dbinfo
|
2018-06-05 09:43:33 -07:00
|
|
|
|
|
|
|
|
_scratch_mount
|
|
|
|
|
|
|
|
|
|
$XFS_SPACEMAN_PROG -c "info" $SCRATCH_MNT > $tmp.spaceman
|
|
|
|
|
echo SPACEMAN >> $seqres.full
|
|
|
|
|
cat $tmp.spaceman >> $seqres.full
|
|
|
|
|
diff -u $tmp.mkfs $tmp.spaceman
|
|
|
|
|
|
|
|
|
|
$XFS_GROWFS_PROG -n $SCRATCH_MNT > $tmp.growfs
|
|
|
|
|
echo GROWFS >> $seqres.full
|
|
|
|
|
cat $tmp.growfs >> $seqres.full
|
|
|
|
|
diff -u $tmp.mkfs $tmp.growfs
|
|
|
|
|
|
2019-07-06 22:52:17 +08:00
|
|
|
$XFS_INFO_PROG $SCRATCH_MNT > $tmp.info.mnt
|
|
|
|
|
echo INFO_MNT >> $seqres.full
|
|
|
|
|
cat $tmp.info.mnt >> $seqres.full
|
|
|
|
|
diff -u $tmp.mkfs $tmp.info.mnt
|
|
|
|
|
|
|
|
|
|
$XFS_INFO_PROG $SCRATCH_DEV > $tmp.info.dev
|
|
|
|
|
echo INFO_DEV >> $seqres.full
|
|
|
|
|
cat $tmp.info.dev >> $seqres.full
|
|
|
|
|
diff -u $tmp.mkfs $tmp.info.dev
|
2018-06-05 09:43:33 -07:00
|
|
|
|
|
|
|
|
echo "Silence is golden."
|
|
|
|
|
status=0
|
|
|
|
|
exit 0
|