overlay/029: fix test failure with nfs_export feature enabled
[xfstests-dev.git] / tests / overlay / 019
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Google, Inc.  All Rights Reserved.
4 #
5 # FS QA Test 019
6 #
7 # Run fsstress on lower dir and top dir at the same time
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         cd /
21         rm -f $tmp.*
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 # remove previous $seqres.full before test
29 rm -f $seqres.full
30
31 # real QA test starts here
32 _supported_fs overlay
33 _supported_os Linux
34 _require_scratch_nocheck
35
36 # Remove all files from previous tests
37 _scratch_mkfs
38
39 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
40 mkdir -p $lowerdir
41
42 _scratch_mount
43
44 echo "Silence is golden"
45
46 d_low=$lowerdir/fsstress
47 d_top=$SCRATCH_MNT/fsstress
48 mkdir -p $d_low $d_top
49
50 echo $FSSTRESS_PROG -s 42 -d $d_low -p 4 -n 1000 -l100 -v > $seqres.full.1
51 $FSSTRESS_PROG -s 42 -d $d_low -p 4 -n 1000 -l100 -v >> $seqres.full.1 2>&1 &
52
53 echo $FSSTRESS_PROG -s 42 -d $d_top -p 4 -n 1000 -l100 -v > $seqres.full.2
54 $FSSTRESS_PROG -s 42 -d $d_top -p 4 -n 1000 -l100 -v >> $seqres.full.2 2>&1 &
55
56 ret=0
57 if ! wait %1; then
58         echo "--------------------------------------"       >>$seqres.full.1
59         echo "fsstress on lower directory returned $? - see $seqres.full.1"
60         echo "--------------------------------------"       >>$seqres.full.1
61         ret=1
62 fi
63
64 if ! wait %2; then
65         echo "--------------------------------------"       >>$seqres.full.2
66         echo "fsstress on overlay directory returned $? - see $seqres.full.2"
67         echo "--------------------------------------"       >>$seqres.full.2
68         ret=1
69 fi
70
71 cat $seqres.full.1 $seqres.full.2 > $seqres.full
72 rm $seqres.full.1 $seqres.full.2
73
74 if [ "$ret" -eq 1 ]; then
75         status=1
76 else
77         status=0
78 fi
79
80 exit $status