xfs/004: don't fail test due to realtime files
[xfstests-dev.git] / tests / xfs / 017
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 017
6 #
7 # test remount ro - pv 795642
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
16 trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     echo "*** unmount"
21     _scratch_unmount 2>/dev/null
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 # real QA test starts here
29 _supported_fs xfs
30
31 _require_scratch
32
33 # xfs_db will OOM kill the machine if you don't have huge amounts of RAM, so
34 # don't run this on large filesystems.
35 _require_no_large_scratch_dev
36
37 echo "*** init FS"
38
39 rm -f $seqres.full
40 _scratch_unmount >/dev/null 2>&1
41 echo "*** MKFS ***"                         >>$seqres.full
42 echo ""                                     >>$seqres.full
43 _scratch_mkfs_xfs                           >>$seqres.full 2>&1 \
44     || _fail "mkfs failed"
45 _scratch_mount
46
47 echo "*** test"
48
49 for l in 0 1 2 3 4
50 do
51         echo "    *** test $l"
52         FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID`
53         $FSSTRESS_PROG  $FSSTRESS_ARGS >>$seqres.full
54
55         _try_scratch_mount -o remount,ro \
56             || _fail "remount ro failed"
57
58         echo ""                                 >>$seqres.full
59         echo "*** xfs_logprint ***"             >>$seqres.full
60         echo ""                                 >>$seqres.full
61         _scratch_xfs_logprint -tb               | tee -a $seqres.full \
62             | head | grep -q "<CLEAN>" || _fail "DIRTY LOG"
63
64         echo ""                             >>$seqres.full
65         echo "*** XFS_CHECK ***"            >>$seqres.full
66         echo ""                             >>$seqres.full
67         _scratch_xfs_check                  >>$seqres.full 2>&1 \
68             || _fail "xfs_check failed"
69         _try_scratch_mount -o remount,rw \
70             || _fail "remount rw failed"
71 done
72
73 echo "*** done"
74 # happy exit
75 rm -f $seqres.full
76 status=0
77 exit 0