xfs/007: fix regressions on V4 filesystems
[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 . ./common/preamble
10 _begin_fstest dump ioctl auto quick
11
12 status=0        # success is the default!
13
14 # Override the default cleanup function.
15 _cleanup()
16 {
17         _cleanup_dump
18         cd /
19         rm -f $tmp.*
20 }
21
22 # Import common functions.
23 . ./common/dump
24
25 # real QA test starts here
26 _supported_fs xfs
27
28 # wipe test dir clean first
29 # so dump can be real quick
30 _wipe_fs
31
32 #
33 # Create 5 dumps
34 # and on the 3rd dump note the date
35 # which we'll use to prune against using xfsinvutil
36 #
37 i=0
38 while [ $i -lt 5 ]; do
39     _do_dump_file -L "session.$i"
40     if [ $i -eq 2 ]; then
41        sleep 1
42        middate=`date '+%m/%d/%Y %T'`
43     fi
44     rm $dump_file
45     sleep 2
46     let i=$i+1
47 done
48
49 echo "middate = $middate" >>$seqres.full
50
51 #
52 # Now do the xfsinvutil and
53 # look and the inventory before and after
54 # to see if it did the job
55 #
56 _dump_inventory
57 _do_invutil -F
58 _dump_inventory
59
60 # success, all done
61 exit