mridge | 79506cb | 2004-02-27 22:55:50 +0000 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | # This script should be run after installing the libaio RPM or libraries |
| 3 | # A valid large file should be passed to the test. |
| 4 | # These tests will only run correctly if the kernel and libaio has been compiled |
| 5 | # with at least a 3.3.X GCC. Older versions of the compiler will seg fault. |
| 6 | # |
| 7 | # 02/08/04 mridge@us.ibm.com |
| 8 | # |
| 9 | # |
| 10 | |
| 11 | cd `dirname $0` |
| 12 | export LTPROOT=${PWD} |
| 13 | echo $LTPROOT | grep testscripts > /dev/null 2>&1 |
| 14 | if [ $? -eq 0 ]; then |
| 15 | cd .. |
| 16 | export LTPROOT=${PWD} |
| 17 | fi |
| 18 | |
| 19 | run0=0 |
| 20 | runTest=0 |
| 21 | nextTest=0 |
| 22 | |
| 23 | export TMPBASE="/tmp" |
| 24 | usage() |
| 25 | { |
| 26 | cat <<-END >&2 |
| 27 | usage: ${0##*/} [ -f large_filename -b partition] [-e 1] [-t 1] [-j 1] [-x 1] or [-a 1] |
| 28 | |
| 29 | defaults: |
| 30 | file1=$file1 |
| 31 | part1=$part1 |
| 32 | ext2=0 |
| 33 | ext3=0 |
| 34 | jfs=0 |
| 35 | xfs=0 |
| 36 | |
| 37 | example: ${0##*/} -f MyLargeFile -b /dev/hdc1 [-a 1] or [-e 1] [-x 1] [-j 1] [-s 1] |
| 38 | -e = test ex2 filesystem. |
| 39 | -t = test ext3 filesystem |
| 40 | -j = test JFS filesystem |
| 41 | -x = test XFS filesystem |
| 42 | or |
| 43 | -a = test all supported filesystems, this will override any other filesystem flags passed. |
| 44 | |
| 45 | - a 1 turns on the test for the above supported filesystem, just omit passing the flag to skip that filesystem. |
| 46 | |
| 47 | - A Large file should be passed to fully stress the test. You must pass at least one filesystem to test, you can pass any combination |
| 48 | but there is not a default filesystem. ReiserFS does not support AIO so these tests will not support ReiserFS. |
| 49 | |
| 50 | - WARNING !! The partition you pass will be overwritten. This is a destructive test so only pass a partition where data can be destroyed. |
| 51 | |
| 52 | |
| 53 | |
| 54 | END |
| 55 | exit |
| 56 | } |
| 57 | |
| 58 | while getopts :a:b:e:f:t:x:j: arg |
| 59 | do case $arg in |
| 60 | f) file1=$OPTARG;; |
| 61 | b) part1=$OPTARG;; |
| 62 | e) ext2=$OPTARG;; |
| 63 | t) ext3=$OPTARG;; |
| 64 | x) xfs=$OPTARG;; |
| 65 | j) jfs=$OPTARG;; |
| 66 | a) allfs=$OPTARG;; |
| 67 | |
| 68 | \?) echo "************** Help Info: ********************" |
| 69 | usage;; |
| 70 | esac |
| 71 | done |
| 72 | |
| 73 | if [ ! -n "$file1" ]; then |
| 74 | echo "Missing the large file. You must pass a large filename for testing" |
| 75 | usage; |
| 76 | exit |
| 77 | fi |
| 78 | |
| 79 | if [ ! -n "$part1" ]; then |
| 80 | echo "Missing the partition. You must pass a partition for testing" |
| 81 | usage; |
| 82 | exit |
| 83 | fi |
| 84 | |
| 85 | if [ -n "$allfs" ]; then |
| 86 | echo "testing ALL supported filesystems" |
| 87 | ext2="1" |
| 88 | ext3="1" |
| 89 | jfs="1" |
| 90 | xfs="1" |
| 91 | echo "test run = $run0" |
| 92 | fi |
| 93 | |
| 94 | if [ -n "$ext2" ]; then |
| 95 | echo "** testing ext2 **" |
| 96 | run0=$(($run0+1)) |
| 97 | fi |
| 98 | |
| 99 | if [ -n "$ext3" ]; then |
| 100 | echo "** testing ext3 **" |
| 101 | run0=$(($run0+1)) |
| 102 | fi |
| 103 | |
| 104 | if [ -n "$xfs" ]; then |
| 105 | echo "** testing xfs **" |
| 106 | run0=$(($run0+1)) |
| 107 | fi |
| 108 | |
| 109 | if [ -n "$jfs" ]; then |
| 110 | echo "** testing jfs **" |
| 111 | run0=$(($run0+1)) |
| 112 | fi |
| 113 | |
| 114 | if [ "$run0" -eq 0 ]; then |
| 115 | echo "No filesystems passed to test" |
| 116 | echo "Please pass at least one supported filesystem or the -a 1 flag to run all " |
| 117 | fi |
| 118 | |
| 119 | |
| 120 | mkdir /test 2&>1 > /dev/nul |
| 121 | mkdir /test/aiodio 2&>1 > /dev/nul |
| 122 | |
| 123 | while [ "$runTest" -lt "$run0" ] |
| 124 | do |
| 125 | |
| 126 | echo "runTest=$runTest run0=$run0 nextTest=$nextTest" |
| 127 | |
| 128 | if [ -n "$ext2" -a $nextTest -eq 0 ]; then |
| 129 | echo "***************************" |
| 130 | echo "* Testing ext2 filesystem *" |
| 131 | echo "***************************" |
| 132 | mkfs -t ext2 $part1 |
| 133 | mount -t ext2 $part1 /test/aiodio |
| 134 | elif [ $nextTest -eq 0 ]; then |
| 135 | nextTest=$(($nextTest+1)) |
| 136 | fi |
| 137 | |
| 138 | if [ -n "$ext3" -a $nextTest -eq 1 ]; then |
| 139 | echo "***************************" |
| 140 | echo "* Testing ext3 filesystem *" |
| 141 | echo "***************************" |
| 142 | mkfs -t ext3 $part1 |
| 143 | mount -t ext3 $part1 /test/aiodio |
| 144 | elif [ $nextTest -eq 1 ]; then |
| 145 | nextTest=$(($nextTest+1)) |
| 146 | fi |
| 147 | |
| 148 | if [ -n "$jfs" -a $nextTest -eq 2 ]; then |
| 149 | echo "**************************" |
| 150 | echo "* Testing jfs filesystem *" |
| 151 | echo "**************************" |
| 152 | mkfs.jfs $part1 <yesenter.txt |
| 153 | mount -t jfs $part1 /test/aiodio |
| 154 | elif [ $nextTest -eq 2 ]; then |
| 155 | nextTest=$(($nextTest+1)) |
| 156 | fi |
| 157 | |
| 158 | if [ -n "$xfs" -a $nextTest -eq 3 ]; then |
| 159 | echo "**************************" |
| 160 | echo "* Testing xfs filesystem *" |
| 161 | echo "**************************" |
| 162 | mkfs.xfs -f $part1 |
| 163 | mount -t xfs $part1 /test/aiodio |
| 164 | elif [ $nextTest -eq 3 ]; then |
| 165 | nextTest=$(($nextTest+1)) |
| 166 | fi |
| 167 | |
| 168 | nextTest=$(($nextTest+1)) |
| 169 | runTest=$(($runTest+1)) |
| 170 | |
| 171 | mkdir /test/aiodio/junkdir |
| 172 | cp $file1 /test/aiodio/junkfile |
| 173 | cp $file1 /test/aiodio/fff |
| 174 | cp $file1 /test/aiodio/ff1 |
| 175 | cp $file1 /test/aiodio/ff2 |
| 176 | cp $file1 /test/aiodio/ff3 |
| 177 | |
| 178 | |
| 179 | |
| 180 | echo "************ Running aiocp tests " |
| 181 | echo "current working dir = ${PWD}" |
| 182 | ${LTPROOT}/tools/rand_lines -g ${LTPROOT}/runtest/ltp-aiodio.part1 > ${TMPBASE}/ltp-aiodio.part1 |
| 183 | |
| 184 | ${LTPROOT}/pan/pan -e -S -a ltpaiodiopart1 -n ltp-aiodiopart1 -l ltpaiodio.logfile -f ${TMPBASE}/ltp-aiodio.part1 & |
| 185 | |
| 186 | wait $! |
| 187 | sync |
| 188 | |
| 189 | echo "************ Running aiodio_sparse tests " |
| 190 | ${LTPROOT}/tools/rand_lines -g ${LTPROOT}/runtest/ltp-aiodio.part2 > ${TMPBASE}/ltp-aiodio.part2 |
| 191 | |
| 192 | ${LTPROOT}/pan/pan -e -S -a ltpaiodiopart2 -n ltp-aiodiopart2 -l ltpaiodio2.logfile -f ${TMPBASE}/ltp-aiodio.part2 & |
| 193 | |
| 194 | wait $! |
| 195 | |
| 196 | echo "************ Running aio-stress tests " |
| 197 | ${LTPROOT}/tools/rand_lines -g ${LTPROOT}/runtest/ltp-aio-stress.part1 > ${TMPBASE}/ltp-aio-stress.part1 |
| 198 | |
| 199 | ${LTPROOT}/pan/pan -e -S -a ltpaiostresspart1 -n ltp-aiostresspart1 -l ltpaiostress.logfile -f ${TMPBASE}/ltp-aio-stress.part1 & |
| 200 | |
| 201 | wait $! |
| 202 | |
| 203 | |
| 204 | echo "************ Running aiodio_sparse tests " |
| 205 | ${LTPROOT}/tools/rand_lines -g ${LTPROOT}/runtest/ltp-aiodio.part3 > ${TMPBASE}/ltp-aiodio.part3 |
| 206 | |
| 207 | ${LTPROOT}/pan/pan -x 5 -e -S -a ltpaiodiopart3 -n ltp-aiodiopart3 -l ltpaiodio3.logfile -f ${TMPBASE}/ltp-aiodio.part3 & |
| 208 | |
| 209 | wait $! |
| 210 | |
| 211 | |
| 212 | #!/bin/bash |
| 213 | |
| 214 | LIMIT=10 |
| 215 | |
| 216 | |
| 217 | echo "Running dio_sparse" |
| 218 | |
| 219 | var0=1 |
| 220 | while [ "$var0" -lt "$LIMIT" ] |
| 221 | do |
| 222 | echo -n "$var0 iteration on dio_sparse" |
| 223 | dirty |
| 224 | dio_sparse |
| 225 | date |
| 226 | var0=$(($var0+1)) |
| 227 | done |
| 228 | |
| 229 | var0=1 |
| 230 | while [ "$var0" -lt "$LIMIT" ] |
| 231 | do |
| 232 | echo -n "$var0 iteration on dio_sparse" |
| 233 | ./dio_sparse |
| 234 | date |
| 235 | var0=$(($var0+1)) |
| 236 | done |
| 237 | |
| 238 | echo "Running aiodio_append" |
| 239 | var0=1 |
| 240 | while [ "$var0" -lt "$LIMIT" ] |
| 241 | do |
| 242 | ./aiodio_append |
| 243 | date |
| 244 | var0=$(($var0+1)) |
| 245 | done |
| 246 | |
| 247 | echo "Running dio_append" |
| 248 | var0=1 |
| 249 | while [ "$var0" -lt "$LIMIT" ] |
| 250 | do |
| 251 | ./dio_append |
| 252 | date |
| 253 | var0=$(($var0+1)) |
| 254 | done |
| 255 | |
| 256 | #echo "Running dio_truncate" |
| 257 | #var0=1 |
| 258 | #while [ "$var0" -lt "$LIMIT" ] |
| 259 | #do |
| 260 | #./dio_truncate |
| 261 | #date |
| 262 | # var0=$(($var0+1)) |
| 263 | #done |
| 264 | |
| 265 | echo "Running read_checkzero" |
| 266 | var0=1 |
| 267 | while [ "$var0" -lt "$LIMIT" ] |
| 268 | do |
| 269 | ./read_checkzero |
| 270 | date |
| 271 | var0=$(($var0+1)) |
| 272 | done |
| 273 | |
| 274 | echo "Running ltp-diorh" |
| 275 | var0=1 |
| 276 | while [ "$var0" -lt "$LIMIT" ] |
| 277 | do |
| 278 | ./ltp-diorh /test/aiodio/file |
| 279 | date |
| 280 | var0=$(($var0+1)) |
| 281 | done |
| 282 | |
| 283 | |
| 284 | rm -f /test/aiodio/fff |
| 285 | rm -f /test/aiodio/ff1 |
| 286 | rm -f /test/aiodio/ff2 |
| 287 | rm -f /test/aiodio/ff3 |
| 288 | rm -f /test/aiodio/junkfile* |
| 289 | rm -f /test/aiodio/file* |
| 290 | rm -rf /test/aiodio/junkdir |
| 291 | |
| 292 | umount $part1 |
| 293 | |
| 294 | done |
| 295 | |
| 296 | echo "AIO/DIO test complete " date |