xfs: convert tests to SPDX license tags
[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 "rm -f $tmp.*; exit \$status" 0 1 2 3 15
17
18 # get standard environment, filters and checks
19 . ./common/rc
20 . ./common/dump
21
22 # real QA test starts here
23 _supported_fs xfs
24 _supported_os Linux
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 #
50 # Now do the xfsinvutil and
51 # look and the inventory before and after
52 # to see if it did the job
53 #
54 _dump_inventory
55 _do_invutil -F
56 _dump_inventory
57
58 # success, all done
59 exit