fsx/fsstress: round blocksize properly
[xfstests-dev.git] / tests / xfs / 514
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0-or-newer
3 # Copyright (c) 2020, Oracle and/or its affiliates.  All Rights Reserved.
4 #
5 # FS QA Test No. 514
6 #
7 # Ensure all xfs_db commands are documented.
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    # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20         cd /
21         rm -f $tmp.* $file
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26
27 # real QA test starts here
28 _supported_fs xfs
29 _require_command "$XFS_DB_PROG" "xfs_db"
30 _require_command "$MAN_PROG" man
31 _require_test
32
33 echo "Silence is golden"
34
35 MANPAGE=$($MAN_PROG --path xfs_db)
36
37 case "$MANPAGE" in
38 *.gz|*.z\|*.Z)  CAT=zcat;;
39 *.bz2)          CAT=bzcat;;
40 *.xz)           CAT=xzcat;;
41 *)              CAT=cat;;
42 esac
43 _require_command `which $CAT` $CAT
44
45 file=$TEST_DIR/xx.$seq
46 truncate -s 128m $file
47 $MKFS_XFS_PROG $file >> /dev/null
48
49 for COMMAND in `$XFS_DB_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do
50   $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \
51         echo "$COMMAND not documented in the xfs_db manpage"
52 done
53
54 # success, all done
55 status=0
56 exit