0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 TYPES='control out in'
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 declare -i COUNT BUFLEN
0033
0034 COUNT=50000
0035 BUFLEN=2048
0036
0037
0038
0039
0040
0041 if [ "$DEVICE" = "" ]; then
0042 echo "testing ALL recognized usbtest devices"
0043 echo ""
0044 TEST_ARGS="-a"
0045 else
0046 TEST_ARGS=""
0047 fi
0048
0049 do_test ()
0050 {
0051 if ! ./testusb $TEST_ARGS -s $BUFLEN -c $COUNT $* 2>/dev/null
0052 then
0053 echo "FAIL"
0054 exit 1
0055 fi
0056 }
0057
0058 ARGS="$*"
0059
0060 if [ "$ARGS" = "" ];
0061 then
0062 ARGS="$TYPES"
0063 fi
0064
0065
0066
0067
0068 CONFIG=''
0069
0070 check_config ()
0071 {
0072 if [ "$CONFIG" = "" ]; then
0073 CONFIG=$1
0074 echo "assuming $CONFIG configuration"
0075 return
0076 fi
0077 if [ "$CONFIG" = $1 ]; then
0078 return
0079 fi
0080
0081 echo "** device must be in $1 config, but it's $CONFIG instead"
0082 exit 1
0083 }
0084
0085
0086 echo "TESTING: $ARGS"
0087
0088 while : true
0089 do
0090 echo $(date)
0091
0092 for TYPE in $ARGS
0093 do
0094
0095 COUNT=5000
0096 BUFLEN=2048
0097
0098
0099
0100
0101
0102
0103 case $TYPE in
0104 control)
0105
0106 echo '** Control test cases:'
0107
0108 echo "test 9: ch9 postconfig"
0109 do_test -t 9 -c 5000
0110 echo "test 10: control queueing"
0111 do_test -t 10 -c 5000
0112
0113
0114 echo "test 14: control writes"
0115 do_test -t 14 -c 15000 -s 256 -v 1
0116
0117 echo "test 21: control writes, unaligned"
0118 do_test -t 21 -c 100 -s 256 -v 1
0119
0120 ;;
0121
0122 out)
0123 check_config sink-src
0124 echo '** Host Write (OUT) test cases:'
0125
0126 echo "test 1: $COUNT transfers, same size"
0127 do_test -t 1
0128 echo "test 3: $COUNT transfers, variable/short size"
0129 do_test -t 3 -v 421
0130
0131 COUNT=100
0132 echo "test 17: $COUNT transfers, unaligned DMA map by core"
0133 do_test -t 17
0134
0135 echo "test 19: $COUNT transfers, unaligned DMA map by usb_alloc_coherent"
0136 do_test -t 19
0137
0138 COUNT=2000
0139 echo "test 5: $COUNT scatterlists, same size entries"
0140 do_test -t 5
0141
0142
0143 echo "test 7a: $COUNT scatterlists, variable size/short entries"
0144 do_test -t 7 -v 579
0145 BUFLEN=4096
0146 echo "test 7b: $COUNT scatterlists, variable size/bigger entries"
0147 do_test -t 7 -v 41
0148 BUFLEN=64
0149 echo "test 7c: $COUNT scatterlists, variable size/micro entries"
0150 do_test -t 7 -v 63
0151 ;;
0152
0153 iso-out)
0154 check_config sink-src
0155 echo '** Host ISOCHRONOUS Write (OUT) test cases:'
0156
0157
0158
0159
0160 BUFLEN=24500
0161
0162 COUNT=1000
0163
0164
0165
0166 echo "test 15: $COUNT transfers, same size"
0167
0168 BUFLEN=32768
0169 do_test -t 15 -g 8 -v 0
0170
0171
0172
0173
0174 COUNT=100
0175 echo "test 22: $COUNT transfers, non aligned"
0176 do_test -t 22 -g 8 -v 0
0177
0178 ;;
0179
0180 in)
0181 check_config sink-src
0182 echo '** Host Read (IN) test cases:'
0183
0184
0185
0186
0187 echo "test 2: $COUNT transfers, same size"
0188 do_test -t 2
0189 echo "test 4: $COUNT transfers, variable size"
0190 do_test -t 4
0191
0192 COUNT=100
0193 echo "test 18: $COUNT transfers, unaligned DMA map by core"
0194 do_test -t 18
0195
0196 echo "test 20: $COUNT transfers, unaligned DMA map by usb_alloc_coherent"
0197 do_test -t 20
0198
0199 COUNT=2000
0200 echo "test 6: $COUNT scatterlists, same size entries"
0201 do_test -t 6
0202 echo "test 8: $COUNT scatterlists, variable size entries"
0203 do_test -t 8
0204 ;;
0205
0206 iso-in)
0207 check_config sink-src
0208 echo '** Host ISOCHRONOUS Read (IN) test cases:'
0209
0210
0211
0212
0213 BUFLEN=24500
0214
0215 COUNT=1000
0216
0217
0218
0219 echo "test 16: $COUNT transfers, same size"
0220
0221 BUFLEN=32768
0222 do_test -t 16 -g 8 -v 0
0223
0224
0225
0226
0227 COUNT=100
0228 echo "test 23: $COUNT transfers, unaligned"
0229 do_test -t 23 -g 8 -v 0
0230
0231 ;;
0232
0233 halt)
0234
0235
0236
0237
0238 COUNT=2000
0239 echo "test 13: $COUNT halt set/clear"
0240 do_test -t 13
0241 ;;
0242
0243 unlink)
0244 COUNT=2000
0245 echo "test 11: $COUNT read unlinks"
0246 do_test -t 11
0247
0248 echo "test 12: $COUNT write unlinks"
0249 do_test -t 12
0250 ;;
0251
0252 loop)
0253
0254 BUFLEN=2048
0255 COUNT=32
0256
0257
0258 check_config loopback
0259
0260
0261
0262 echo "write $COUNT buffers of $BUFLEN bytes, read them back"
0263
0264 echo "write $COUNT variable size buffers, read them back"
0265
0266 ;;
0267
0268 *)
0269 echo "Don't understand test type $TYPE"
0270 exit 1;
0271 esac
0272 echo ''
0273 done
0274 done