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