fsx/fsstress: round blocksize properly
[xfstests-dev.git] / tests / xfs / 028
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 028
6 #
7 # To test out xfsinvutil
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=0        # success is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20         _cleanup_dump
21         cd /
22         rm -f $tmp.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/dump
28
29 # real QA test starts here
30 _supported_fs xfs
31
32 # wipe test dir clean first
33 # so dump can be real quick
34 _wipe_fs
35
36 #
37 # Create 5 dumps
38 # and on the 3rd dump note the date
39 # which we'll use to prune against using xfsinvutil
40 #
41 i=0
42 while [ $i -lt 5 ]; do
43     _do_dump_file -L "session.$i"
44     if [ $i -eq 2 ]; then
45        sleep 1
46        middate=`date '+%m/%d/%Y %T'`
47     fi
48     rm $dump_file
49     sleep 2
50     let i=$i+1
51 done
52
53 echo "middate = $middate" >>$seqres.full
54
55 #
56 # Now do the xfsinvutil and
57 # look and the inventory before and after
58 # to see if it did the job
59 #
60 _dump_inventory
61 _do_invutil -F
62 _dump_inventory
63
64 # success, all done
65 exit