overlay: run unionmount testsuite test cases
[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 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         _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 _supported_os Linux
32
33 # wipe test dir clean first
34 # so dump can be real quick
35 _wipe_fs
36
37 #
38 # Create 5 dumps
39 # and on the 3rd dump note the date
40 # which we'll use to prune against using xfsinvutil
41 #
42 i=0
43 while [ $i -lt 5 ]; do
44     _do_dump_file -L "session.$i"
45     if [ $i -eq 2 ]; then
46        sleep 1
47        middate=`date '+%m/%d/%Y %T'`
48     fi
49     rm $dump_file
50     sleep 2
51     let i=$i+1
52 done
53
54 echo "middate = $middate" >>$seqres.full
55
56 # Only say No to 1st question to prune
57 cat >$tmp.input <<EOF
58 N
59 Y
60 Y
61 Y
62 Y
63 EOF
64
65 #
66 # Now do the xfsinvutil and
67 # look and the inventory before and after
68 # to see if it did the job
69 #
70 _dump_inventory
71 _do_invutil <$tmp.input
72 _dump_inventory
73
74 status=0
75 exit