fixed order of quota reports to always follow:
[xfstests-dev.git] / 127
1 #! /bin/sh
2 # FSQA Test No. 127
3 #
4 # fsx tests modified from CXFSQA tests
5 #   - fsx_00_lite
6 #   - fsx_05_lite_mmap
7 #   - fsx_10_std, 
8 #   - fsx_15_std_mmap 
9 #-----------------------------------------------------------------------
10 #  Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
11 #-----------------------------------------------------------------------
12 #
13 # creator
14 owner=allanr@sgi.com
15
16 seq=`basename $0`
17 echo "QA output created by $seq"
18
19 here=`pwd`
20 tmp=/tmp/$$
21 status=1        # failure is the default!
22 trap "_cleanup; exit \$status" 0 1 2 3 15
23
24 _cleanup()
25 {
26     _cleanup_testdir
27 }
28
29 # get standard environment, filters and checks
30 . ./common.rc
31 . ./common.filter
32
33 FSX_FILE_SIZE=262144
34 FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
35
36 _fsx_lite_nommap()
37 {
38     echo "=== FSX Light Mode, No Memory Mapping ==="
39     dd if=/dev/zero of=$testdir/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
40     if ! ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap > $tmp.output 2>&1
41     then
42         echo "ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap"
43         cat $tmp.output
44         return 1
45     fi
46     cat $tmp.output
47     return 0
48 }
49
50 _fsx_lite_mmap()
51 {
52     echo "=== FSX Light Mode, Memory Mapping ==="
53     dd if=/dev/zero of=$testdir/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
54     if ! ltp/fsx $FSX_ARGS -L $testdir/fsx_lite_mmap > $tmp.output 2>&1
55     then
56         echo "ltp/fsx $FSX_ARGS -L fsx_lite_mmap"
57         cat $tmp.output
58         return 1
59     fi
60     cat $tmp.output
61     return 0
62 }
63
64 _fsx_std_nommap()
65 {
66     echo "=== FSX Standard Mode, No Memory Mapping ==="
67     if ! ltp/fsx $FSX_ARGS -R -W $testdir/fsx_std_nommap > $tmp.output 2>&1
68     then
69         echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap"
70         cat $tmp.output
71         return 1
72     fi
73     cat $tmp.output
74     return 0
75 }
76
77 _fsx_std_mmap()
78 {
79     echo "=== FSX Standard Mode, Memory Mapping ==="
80     if ! ltp/fsx $FSX_ARGS $testdir/fsx_std_mmap > $tmp.output 2>&1
81     then
82         echo "ltp/fsx $FSX_ARGS fsx_std_mmap"
83         cat $tmp.output
84         return 1
85     fi
86     cat $tmp.output
87     return 0
88 }
89
90 # real QA test starts here
91 _supported_fs xfs
92 _supported_os Linux
93
94 _require_user
95 _setup_testdir
96
97 _fsx_lite_nommap 
98 _fsx_lite_mmap
99
100 _fsx_std_nommap
101 _fsx_std_mmap
102
103 #flush cache after write
104 FSX_ARGS="-f $FSX_ARGS"
105 _fsx_std_nommap
106 _fsx_std_mmap
107
108
109 status=0
110 _cleanup
111 exit