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