fsx/fsstress: round blocksize properly
[xfstests-dev.git] / tests / generic / 133
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FSQA Test No. 133
6 #
7 # Concurrent I/O to same file to ensure no deadlocks
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 "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 generic
24 _require_test
25 _require_odirect
26
27 echo "Buffered writer, buffered reader"
28 $XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
29 $XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
30 $XFS_IO_PROG -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
31 wait
32 rm $TEST_DIR/io_test
33
34 echo "Direct writer, buffered reader"
35 $XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
36 $XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
37 $XFS_IO_PROG -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
38 wait
39 rm $TEST_DIR/io_test
40
41 echo "Buffered writer, direct reader"
42 $XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
43 $XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
44 $XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
45 wait
46 rm $TEST_DIR/io_test
47
48 echo "Direct writer, direct reader"
49 $XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
50 $XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
51 $XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
52 wait
53 rm $TEST_DIR/io_test
54
55 status=0
56 exit