Add Makepkgs support to xfstests (tar & rpm only so far)
[xfstests-dev.git] / 124
1 #! /bin/sh
2 # FSQA Test No. 124
3 #
4 # Test preallocated_rw_pattern_test modified from CXFSQA test preallocated_rw_pattern_test
5 #
6 # pat stands for pattern.  First 8 bytes contains the 64-bit number 0,
7 # second is 1, ..., until last 8 bytes (1048568-1048575) contain 131071.
8 # patw preallocates the file and then writes the pattern, patr checks it
9 #
10 #-----------------------------------------------------------------------
11 #  Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
12 #-----------------------------------------------------------------------
13 #
14 # creator
15 owner=ajones@sgi.com
16
17 seq=`basename $0`
18 echo "QA output created by $seq"
19
20 here=`pwd`
21 tmp=/tmp/$$
22 status=1        # failure is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
24
25 _cleanup()
26 {
27     cd /
28     _cleanup_testdir
29 }
30
31 # get standard environment, filters and checks
32 . ./common.rc
33 . ./common.filter
34
35 # real QA test starts here
36 _supported_fs xfs udf nfs
37 _supported_os Linux
38
39 _setup_testdir
40 _require_scratch
41 _scratch_mkfs >/dev/null 2>&1
42 _scratch_mount
43
44 # Run preallo_rw_pattern on both test and scratch partitions
45 for TESTFILE in $testdir/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
46   do
47   count=1
48   while (( count < 101 ))
49     do
50     src/preallo_rw_pattern_writer $TESTFILE
51     src/preallo_rw_pattern_reader $TESTFILE
52     if (test $? -ne 0) then
53         echo Read/Write Pattern Test FAILED.
54         _cleanup
55         exit 1
56     fi
57     rm $TESTFILE
58     ((count=count+1))
59   done #done for count of  100
60 done
61
62 if (test $? -eq 0 ) then
63     status=0
64 fi
65
66 umount $SCRATCH_DEV
67
68 _check_test_fs
69 _check_scratch_fs
70
71 exit