6a03168503b91942c835ecef3be6db20fd7c4d61
[xfstests-dev.git] / tests / xfs / 449
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Oracle, Inc.
4 #
5 # FS QA Test No. 449
6 #
7 # Make sure pretty printed XFS geometry is the same across all programs.
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20         cd /
21         rm -f $tmp.*
22 }
23
24 rm -f $seqres.full
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29
30 # real QA test starts here
31 _supported_fs xfs
32 _supported_os Linux
33
34 _require_scratch_nocheck
35
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
41
42 _scratch_mkfs > $tmp.mkfs
43 echo MKFS >> $seqres.full
44 cat $tmp.mkfs >> $seqres.full
45
46 _scratch_xfs_db -c "info" > $tmp.dbinfo
47 echo DB >> $seqres.full
48 cat $tmp.dbinfo >> $seqres.full
49 diff -u $tmp.mkfs $tmp.dbinfo
50
51 _scratch_mount
52
53 $XFS_SPACEMAN_PROG -c "info" $SCRATCH_MNT > $tmp.spaceman
54 echo SPACEMAN >> $seqres.full
55 cat $tmp.spaceman >> $seqres.full
56 diff -u $tmp.mkfs $tmp.spaceman
57
58 $XFS_GROWFS_PROG -n $SCRATCH_MNT > $tmp.growfs
59 echo GROWFS >> $seqres.full
60 cat $tmp.growfs >> $seqres.full
61 diff -u $tmp.mkfs $tmp.growfs
62
63 $XFS_INFO_PROG $SCRATCH_MNT > $tmp.info
64 echo INFO >> $seqres.full
65 cat $tmp.info >> $seqres.full
66 diff -u $tmp.mkfs $tmp.info
67
68 echo "Silence is golden."
69 status=0
70 exit 0