Output wasn't deterministic. Remove bmap output from stdout,
[xfstests-dev.git] / 135
1 #! /bin/sh
2 # FSQA Test No. 133
3 #
4 # Concurrent I/O to same file to ensure no deadlocks
5 #
6 #-----------------------------------------------------------------------
7 #  Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=lachlan@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 "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23     _cleanup_testdir
24 }
25
26 # get standard environment, filters and checks
27 . ./common.rc
28 . ./common.filter
29
30 # real QA test starts here
31 _supported_fs xfs
32 _supported_os Linux IRIX
33
34 _setup_testdir
35 _require_scratch
36 _scratch_mkfs_xfs >/dev/null 2>&1
37
38 _umount_mount()
39 {
40     CWD=`pwd`
41     cd /
42     # pipe error into /dev/null, in case not mounted (after _require_scratch)
43     umount $SCRATCH_MNT 2>/dev/null
44     _scratch_mount
45     cd "$CWD"
46 }
47
48
49
50 _umount_mount
51
52 cd $SCRATCH_MNT
53
54 # create file with async I/O
55 xfs_io -f -c 'pwrite -b 4k -S 0x12 0 4k' async_file > /dev/null
56
57 # create file with sync I/O
58 xfs_io -f -s -c 'pwrite -b 4k -S 0x34 0 4k' sync_file > /dev/null
59
60 # create file with sync I/O
61 xfs_io -f -d -c 'pwrite -b 4k -S 0x56 0 4k' direct_file > /dev/null
62
63 # create file, truncate and then dirty again
64 xfs_io -f -c 'pwrite -b 4k -S 0x78 0 4k' trunc_file > /dev/null
65 xfs_io -c 'truncate 2k' trunc_file > /dev/null
66 xfs_io -c 'pwrite 1k 0 1k' trunc_file > /dev/null
67
68 _umount_mount
69
70 # check file size and contents
71 od -Ad -x async_file
72 od -Ad -x sync_file
73 od -Ad -x direct_file
74 od -Ad -x trunc_file
75
76 rm -f async_file sync_file direct_file trunc_file
77
78 status=0
79 exit