overlay: run unionmount testsuite test cases
[xfstests-dev.git] / tests / xfs / 090
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 090
6 #
7 # Exercise IO on the realtime device (direct, buffered, mmapd)
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 "rm -f $tmp.*; exit \$status" 0 1 2 3 15
17
18 # get standard environment, filters and checks
19 . ./common/rc
20 . ./common/filter
21
22 # real QA test starts here
23 _supported_fs xfs
24 _supported_os Linux
25 _require_realtime
26 _require_scratch
27
28 _filter_io()
29 {
30         sed -e '/.* ops; /d'
31 }
32
33 _create_scratch()
34 {
35         echo "*** mkfs"
36         if ! _scratch_mkfs_xfs >$tmp.out 2>&1
37         then
38                 cat $tmp.out
39                 echo "failed to mkfs $SCRATCH_DEV"
40                 exit 1
41         fi
42
43         echo "*** mount"
44         if ! _try_scratch_mount
45         then
46                 echo "failed to mount $SCRATCH_DEV"
47                 exit 1
48         fi
49 }
50
51 realtime_direct_aligned()
52 {
53         echo direct realtime writes, 4 files, 2m each, increasing offsets.
54         for i in 0 1 2 3
55         do
56                 $XFS_IO_PROG -fdxR $SCRATCH_MNT/rt-direct-$1-$i \
57                         -c "extsize $1" -c "pwrite ${i}m 1m" \
58                         | _filter_io
59         done
60         _check_scratch_fs
61 }
62
63 realtime_buffer_aligned()
64 {
65         echo buffered realtime writes, 4 files, 2m each, increasing offsets.
66         for i in 0 1 2 3
67         do
68                 $XFS_IO_PROG -fxR $SCRATCH_MNT/rt-buffera-$1-$i \
69                         -c "extsize $1" -c "pwrite ${i}m 1m" \
70                         | _filter_io
71         done
72         _check_scratch_fs
73 }
74
75 realtime_buffer_unaligned()
76 {
77         echo buffered realtime writes, 4 files, unaligned byte offsets/sizes.
78         for i in 0 1 2 3
79         do
80                 $XFS_IO_PROG -fxR $SCRATCH_MNT/rt-bufferu-$1-$i \
81                         -c "extsize $1" -c "pwrite $i 1" \
82                         | _filter_io
83         done
84         _check_scratch_fs
85 }
86
87 realtime_mmap_unaligned()
88 {
89         # mmap realtime writes, 4 files, unaligned byte offsets/sizes.
90         for i in 0 1 2 3
91         do
92                 $XFS_IO_PROG -fxR $SCRATCH_MNT/rt-mmap-$1-$i \
93                         -c "extsize $1" -c "pwrite $i 1" \
94                         | _filter_io
95         done
96         _check_scratch_fs
97 }
98
99 _create_scratch
100
101 realtime_direct_aligned 0
102 #realtime_direct_aligned 1m
103 realtime_buffer_aligned 0
104 #realtime_buffer_aligned 1m
105 realtime_buffer_unaligned 0
106 #realtime_buffer_unaligned 1m
107 #realtime_mmap_unaligned 0
108 #realtime_mmap_unaligned 1m
109
110 status=0
111 exit