diff options
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/p2041rdb')
8 files changed, 543 insertions, 0 deletions
diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/ethernet b/recipes-test/ddt-runner/files/scripts/p2041rdb/ethernet new file mode 100755 index 0000000..0f2b4cf --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/ethernet | |||
@@ -0,0 +1,111 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | |||
4 | exit1() { | ||
5 | echo $@ >&2 | ||
6 | exit 1 | ||
7 | } | ||
8 | |||
9 | |||
10 | err() { | ||
11 | echo $@ >&2 | ||
12 | exit_status=1 | ||
13 | } | ||
14 | |||
15 | |||
16 | get_default_gw() { | ||
17 | echo $(route | grep default | awk '{ print $2 }') | ||
18 | } | ||
19 | |||
20 | |||
21 | test_eth_device() { | ||
22 | local readonly dev=$1 | ||
23 | local readonly ethernet_ping_ipaddr=$2 | ||
24 | local readonly MINDATASIZE=56 | ||
25 | local readonly MAXDATASIZE=650 | ||
26 | local readonly STEPSIZE=100 | ||
27 | local readonly ITERATION=2 | ||
28 | local datasize | ||
29 | local i | ||
30 | local ping_err | ||
31 | for i in `seq 1 $ITERATION`; do | ||
32 | datasize=$MINDATASIZE | ||
33 | while [ $datasize -le $MAXDATASIZE ]; do | ||
34 | ping -I $dev -c 1 -s $datasize $ethernet_ping_ipaddr > $STATISTICS | ||
35 | ping_err=$? | ||
36 | packets_received=`cat $STATISTICS | grep "received" | | ||
37 | awk '{print$4}'` | ||
38 | |||
39 | # Evaluate possible errors on the ping operation | ||
40 | if [ $ping_err -ne 0 ] || [ -z "$packets_received" ] || | ||
41 | [ $packets_received -eq 0 ]; then | ||
42 | err "FAIL: ping $ethernet_ping_ipaddr through $dev" | ||
43 | cat $STATISTICS >> $LOGFILE | ||
44 | echo "Size: $datasize Iteration: $i" >> $LOGFILE | ||
45 | fi | ||
46 | datasize=$((datasize+STEPSIZE)) | ||
47 | done | ||
48 | done | ||
49 | } | ||
50 | |||
51 | |||
52 | clean_tasks() { | ||
53 | echo "Executing clean up tasks" | ||
54 | rm -f $LOGFILE $STATISTICS | ||
55 | } | ||
56 | |||
57 | |||
58 | cleanup() { | ||
59 | echo "Aborting script execution" | ||
60 | clean_tasks | ||
61 | exit 1 | ||
62 | } | ||
63 | |||
64 | |||
65 | |||
66 | readonly LOGFILE=`/bin/mktemp` | ||
67 | readonly STATISTICS=`/bin/mktemp` | ||
68 | exit_status=0 | ||
69 | |||
70 | trap cleanup SIGHUP SIGINT SIGTERM | ||
71 | |||
72 | |||
73 | |||
74 | readonly DEF_GW=$(get_default_gw) | ||
75 | |||
76 | [ -n "$DEF_GW" ] && echo "Found default gw $DEF_GW" || | ||
77 | exit1 "FAIL: no default gw" | ||
78 | |||
79 | readonly S=: | ||
80 | readonly DEVS="$(route -n | tail -n +3 | sort -k8 -u | awk '{print $8"'$S'"$2}')" | ||
81 | |||
82 | if [ -n "$DEVS" ]; then | ||
83 | echo "Will test: $DEVS" | ||
84 | else | ||
85 | exit1 "FAIL: no ethernet devices to test" | ||
86 | fi | ||
87 | |||
88 | for iface_gw in $DEVS; do | ||
89 | iface=$(echo "$iface_gw" | sed -n 's/\(.*\)'$S'.*/\1/p') | ||
90 | gw=$(echo "$iface_gw" | sed -n 's/.*'$S'\(.*\)/\1/p') | ||
91 | if [ -z "$gw" ]; then | ||
92 | err "FAIL: no ethernet gateway for $iface" | ||
93 | else | ||
94 | [ "$gw" = 0.0.0.0 ] && gw="$DEF_GW" | ||
95 | echo "Testing $iface:$gw" | ||
96 | test_eth_device $iface $gw | ||
97 | fi | ||
98 | done | ||
99 | |||
100 | # Report failures | ||
101 | if [ $exit_status -ne 0 ]; then | ||
102 | echo "=================== error report ===================" | ||
103 | cat $LOGFILE | ||
104 | echo "====================================================" | ||
105 | echo "FAIL: ping test" | ||
106 | else | ||
107 | echo "PASS: ping test success" | ||
108 | fi | ||
109 | |||
110 | clean_tasks | ||
111 | exit $exit_status | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/flash b/recipes-test/ddt-runner/files/scripts/p2041rdb/flash new file mode 100755 index 0000000..2d10600 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/flash | |||
@@ -0,0 +1,49 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test flash driver functionality. I removed the write | ||
4 | # operations since all partition are in use in p2041rdb and there might be | ||
5 | # possibility of corrupting data even if we backup in test script. | ||
6 | |||
7 | if part_num=`cat /proc/mtd | grep -c 'mtd'`; then | ||
8 | echo "PASS: show $part_num partitions" | ||
9 | else | ||
10 | echo "FAIL: show $part_num partitions" | ||
11 | exit 1 | ||
12 | fi | ||
13 | |||
14 | for((part=0; part<$part_num; part++)); | ||
15 | do | ||
16 | if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then | ||
17 | echo "PASS: show partition $part debug info" | ||
18 | else | ||
19 | echo "FAIL: show partition $part debug info" | ||
20 | exit 1 | ||
21 | fi | ||
22 | done | ||
23 | |||
24 | READ_TEST=`find / -name mtd_readtest.ko -print` | ||
25 | |||
26 | if [ ! -e $READ_TEST ]; then | ||
27 | echo "FAIL: $READ_TEST does not exist" | ||
28 | exit 1 | ||
29 | else | ||
30 | echo "PASS: $READ_TEST exists" | ||
31 | fi | ||
32 | |||
33 | for((part=0; part<$part_num; part++)); | ||
34 | do | ||
35 | dmesg -c | ||
36 | |||
37 | insmod $READ_TEST dev=$part | ||
38 | |||
39 | finish=`dmesg | grep -c 'mtd_readtest: finished'` | ||
40 | if [ $finish -eq 1 ]; then | ||
41 | echo "PASS: read test $part" | ||
42 | else | ||
43 | echo "FAIL: read test $part" | ||
44 | rmmod $READ_TEST | ||
45 | exit 1 | ||
46 | fi | ||
47 | |||
48 | rmmod $READ_TEST | ||
49 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/i2c b/recipes-test/ddt-runner/files/scripts/p2041rdb/i2c new file mode 100755 index 0000000..58800ce --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/i2c | |||
@@ -0,0 +1,44 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test i2c bus functionality for p2041rdb board. | ||
3 | |||
4 | if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then | ||
5 | echo "PASS: found $I2C_ADAPTERS i2c adapters" | ||
6 | else | ||
7 | echo "FAIL: no i2c adapters found" | ||
8 | exit 1 | ||
9 | fi | ||
10 | |||
11 | if [ -z "$adapters" ]; then | ||
12 | adapters=0 | ||
13 | fi | ||
14 | |||
15 | while [ $adapters -lt $I2C_ADAPTERS ] | ||
16 | do | ||
17 | i2cdetect -y $adapters | ||
18 | if [ $? -ne 0 ]; then | ||
19 | echo "FAIL: detect i2c adapter $adapters failed" | ||
20 | else | ||
21 | echo "PASS: detect i2c adapter $adapters success" | ||
22 | fi | ||
23 | adapters=`expr $adapters + 1` | ||
24 | sleep 1 | ||
25 | done | ||
26 | |||
27 | i2cdetect -y 0 | ||
28 | if [ $? -ne 0 ]; then | ||
29 | echo "FAIL: detect i2c bus 0 fail" | ||
30 | exit 1 | ||
31 | else | ||
32 | echo "PASS: detect i2c bus 0 success" | ||
33 | fi | ||
34 | |||
35 | #i2c bus 0, device address 0x52, DDR3 DIMM Socket 1, SPD EEPROM | ||
36 | i2cdump -f -y 0 0x52 |grep UG51U6400N8SU | ||
37 | if [ $? -ne 0 ]; then | ||
38 | echo "FAIL: read SPD EEPROM on i2c bus 0 fail" | ||
39 | exit 1 | ||
40 | else | ||
41 | echo "PASS: read SPD EEPROM on i2c bus 0 success" | ||
42 | fi | ||
43 | |||
44 | |||
diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/pci-express b/recipes-test/ddt-runner/files/scripts/p2041rdb/pci-express new file mode 100755 index 0000000..91db286 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/pci-express | |||
@@ -0,0 +1,109 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth0" | ||
4 | #sestord02 ip address | ||
5 | ethernet_ping_ipaddr="172.21.3.22" | ||
6 | ethernet_ipaddr=$1 | ||
7 | |||
8 | #Intel Corporation 82574L Gigabit Network Card (intel e1000e) | ||
9 | vendor_id="8086" | ||
10 | product_id="10d3" | ||
11 | |||
12 | #find vendor id & product id | ||
13 | lspci -nn |grep $vendor_id:$product_id | ||
14 | if [ $? -ne 0 ]; then | ||
15 | echo "FAIL: pci-e ethernet card device does not exist" | ||
16 | exit 1 | ||
17 | else | ||
18 | echo "PASS: got pci-e ethernet card device" | ||
19 | fi | ||
20 | |||
21 | setpci -v -d $vendor_id:$product_id latency_timer=b0 | ||
22 | if [ $? -ne 0 ]; then | ||
23 | echo "FAIL: parameter changes to pci config space failed" | ||
24 | exit 1 | ||
25 | else | ||
26 | echo "PASS: parameter changes to pci config space success" | ||
27 | fi | ||
28 | |||
29 | IFCONFIG=`which ifconfig` | ||
30 | |||
31 | $IFCONFIG $ethernet_interface up | ||
32 | $IFCONFIG | grep $ethernet_interface | ||
33 | if [ $? -ne 0 ]; then | ||
34 | echo "FAIL: pci-e ethernet card device $ethernet_interface is not up" | ||
35 | exit 1 | ||
36 | else | ||
37 | echo "PASS: pci-e ethernet card device $ethernet_interface is up" | ||
38 | fi | ||
39 | |||
40 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
41 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
42 | fi | ||
43 | |||
44 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
45 | if [ $? -ne 0 ]; then | ||
46 | echo "FAIL: ipaddr of pci-e ethernet card device $ethernet_interface setup failed" | ||
47 | exit 1 | ||
48 | else | ||
49 | echo "PASS: ipaddr of pci-e ethernet card device $ethernet_interface setup success" | ||
50 | fi | ||
51 | |||
52 | mindatasize=56 | ||
53 | maxdatasize=650 | ||
54 | stepsize=100 | ||
55 | iteration=1 | ||
56 | datasize=$mindatasize | ||
57 | logfile=`/bin/mktemp` | ||
58 | statistics=`/bin/mktemp` | ||
59 | error=0 | ||
60 | |||
61 | trap cleanup SIGHUP SIGINT SIGTERM | ||
62 | |||
63 | clean_tasks() { | ||
64 | echo "Executing clean up tasks" | ||
65 | rm -f $logfile $statistics | ||
66 | } | ||
67 | |||
68 | cleanup() { | ||
69 | echo "Aborting script execution" | ||
70 | clean_tasks | ||
71 | exit 0 | ||
72 | } | ||
73 | |||
74 | echo "start ping test for pci-e ethernet card device $ethernet_interface..." | ||
75 | |||
76 | while [ $datasize -le $maxdatasize ]; do | ||
77 | for i in `seq 1 $iteration`; do | ||
78 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
79 | ping_err=`echo $?` | ||
80 | echo "" && cat $statistics | grep -r "PING" | ||
81 | cat $statistics | grep -r "received" | ||
82 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
83 | packets_received=`cat $statistics | \ | ||
84 | grep -r "received" | awk '{print$4}'` | ||
85 | |||
86 | # Evaluate possible errors on the ping operation | ||
87 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
88 | error=1 | ||
89 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
90 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
91 | fi | ||
92 | done | ||
93 | let datasize=$datasize+$stepsize | ||
94 | done | ||
95 | |||
96 | # Report failures | ||
97 | if [ $error -eq 1 ]; then | ||
98 | echo -e "=================== error report ===================\n" | ||
99 | cat $logfile | ||
100 | echo -e "====================================================\n" | ||
101 | clean_tasks | ||
102 | echo -e "FAIL: ping test for pci-e ethernet card device $ethernet_interface failed\n" | ||
103 | exit 1 | ||
104 | else | ||
105 | clean_tasks | ||
106 | echo -e "PASS: ping test for pci-e ethernet card device $ethernet_interface success\n" | ||
107 | fi | ||
108 | |||
109 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/sata b/recipes-test/ddt-runner/files/scripts/p2041rdb/sata new file mode 100755 index 0000000..b7f1fab --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/sata | |||
@@ -0,0 +1,81 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | #This script is to test sata devices on target | ||
4 | # | ||
5 | result=0 | ||
6 | devpath="" | ||
7 | satainfo="" | ||
8 | SD=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'` | ||
9 | if [ -z "$SD" ]; then | ||
10 | echo "FAIL: find sata device" | ||
11 | exit 1 | ||
12 | else | ||
13 | echo "PASS: find sata device" | ||
14 | fi | ||
15 | HDPARM=`which hdparm` | ||
16 | if [ -z $HDPARM ]; then | ||
17 | result=$? | ||
18 | echo "FAIL: find hdparm" | ||
19 | fi | ||
20 | echo "PASS: find hdparm" | ||
21 | |||
22 | |||
23 | for s in $SD | ||
24 | do | ||
25 | devpath=`echo "$s" | awk -F "," '{print "/sys/dev/block/" $1 ":" $2}'` | ||
26 | satainfo=`ls -l $devpath | grep sata` | ||
27 | |||
28 | if [ -z "$satainfo" ] ; then | ||
29 | continue | ||
30 | fi | ||
31 | s=`echo "$s" | awk -F "," '{print $3}'` | ||
32 | |||
33 | echo "testing $s" | ||
34 | $HDPARM -I $s | ||
35 | if [ $? -ne 0 ]; then | ||
36 | result=$? | ||
37 | echo "FAIL: $HDPARM -I $s Detailed/current information directly from $s" | ||
38 | else | ||
39 | echo "PASS: $HDPARM -I $s Detailed/current information directly from $s" | ||
40 | fi | ||
41 | $HDPARM -tT $s | ||
42 | if [ $? -ne 0 ]; then | ||
43 | result=$? | ||
44 | echo "FAIL: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
45 | else | ||
46 | echo "PASS: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
47 | fi | ||
48 | |||
49 | |||
50 | mkdir -p /mnt/sata_tmp | ||
51 | for partition in `ls "$s"[1-9]` | ||
52 | do | ||
53 | mount "$partition" /mnt/sata_tmp | ||
54 | if [ $? -ne 0 ]; then | ||
55 | result=$? | ||
56 | echo "FAIL: Mount $s" | ||
57 | else | ||
58 | echo "PASS: Mount $s" | ||
59 | dd if=/dev/urandom of=/mnt/sata_tmp/writefile bs=1M count=50 | ||
60 | if [ $? -ne 0 ]; then | ||
61 | result=$? | ||
62 | echo "FAIL: write test on $s" | ||
63 | else | ||
64 | echo "PASS: write test on $s" | ||
65 | rm -f /mnt/sata_tmp/writefile | ||
66 | fi | ||
67 | dd if=$s of=/mnt/sata_tmp/readfile bs=1M count=10 | ||
68 | if [ $? -ne 0 ]; then | ||
69 | result=$? | ||
70 | echo "FAIL: read test on $s" | ||
71 | else | ||
72 | echo "PASS: read test on $s" | ||
73 | rm -f /mnt/sata_tmp/readfile | ||
74 | fi | ||
75 | umount /mnt/sata_tmp | ||
76 | fi | ||
77 | done | ||
78 | |||
79 | rm -fr /mnt/sata_tmp | ||
80 | done | ||
81 | exit $result | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/sdhc b/recipes-test/ddt-runner/files/scripts/p2041rdb/sdhc new file mode 100755 index 0000000..bc3026b --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/sdhc | |||
@@ -0,0 +1,41 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | #the content of SD will be lost by running this test case. | ||
4 | |||
5 | SDHC_DEVICE="/dev/mmcblk0p1" | ||
6 | |||
7 | if [ ! -e $SDHC_DEVICE ]; then | ||
8 | echo "FAIL: $SDHC_DEVICE does not exist" | ||
9 | exit 1 | ||
10 | else | ||
11 | echo "PASS: $SDHC_DEVICE device exists" | ||
12 | fi | ||
13 | |||
14 | mount |grep mmcblk0p1 | ||
15 | if [ $? -eq 0 ]; then | ||
16 | umount $SDHC_DEVICE | ||
17 | fi | ||
18 | |||
19 | /sbin/mkfs.ext2 $SDHC_DEVICE | ||
20 | if [ $? -ne 0 ]; then | ||
21 | echo "FAIL: format $SDHC_DEVICE fail" | ||
22 | exit 1 | ||
23 | else | ||
24 | mkdir -p /mnt/sdhc | ||
25 | mount $SDHC_DEVICE /mnt/sdhc | ||
26 | if [ $? -ne 0 ]; then | ||
27 | echo "FAIL: mount $SDHC_DEVICE fail" | ||
28 | exit 1 | ||
29 | else | ||
30 | cp /bin/busybox /mnt/sdhc | ||
31 | ls /mnt/sdhc |grep busybox | ||
32 | if [ $? -ne 0 ]; then | ||
33 | echo "FAIL: read or write $SDHC_DEVICE fail" | ||
34 | exit 1 | ||
35 | else | ||
36 | umount $SDHC_DEVICE | ||
37 | echo "PASS: read or write $SDHC_DEVICE success" | ||
38 | fi | ||
39 | fi | ||
40 | fi | ||
41 | |||
diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/tempsensors b/recipes-test/ddt-runner/files/scripts/p2041rdb/tempsensors new file mode 100755 index 0000000..036ccfa --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/tempsensors | |||
@@ -0,0 +1,60 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script checks that expected temperature sensors are available on pd2901, | ||
4 | # and that their reported values fall within a reasonable range. | ||
5 | |||
6 | # Expected available sensors | ||
7 | SENSORS="adt7461-i2c-0-4c" | ||
8 | |||
9 | # Default accepted temperature range | ||
10 | tempmin=20 | ||
11 | tempmax=80 | ||
12 | |||
13 | usage="Usage: $0 min max" | ||
14 | |||
15 | SENSORS_CMD=`which sensors` | ||
16 | if [ -z $SENSORS_CMD ]; then | ||
17 | echo "FAIL: Cannot find sensors command" | ||
18 | exit 1 | ||
19 | fi | ||
20 | |||
21 | if [ -n "$1" ]; then | ||
22 | if [ -z "$2" ]; then | ||
23 | echo $usage | ||
24 | echo "FAIL: No max value provided." | ||
25 | exit 1 | ||
26 | fi | ||
27 | tempmin=$1 | ||
28 | tempmax=$2 | ||
29 | if [ "$tempmin" -gt "$tempmax" ]; then | ||
30 | echo $usage | ||
31 | echo "FAIL: Invalid range provided (min > max)." | ||
32 | exit 1 | ||
33 | fi | ||
34 | fi | ||
35 | |||
36 | echo "Checking temperature sensor readings (valid range: $tempmin C - $tempmax C)" | ||
37 | |||
38 | for sensor in $SENSORS | ||
39 | do | ||
40 | sensorinfo=$($SENSORS_CMD $sensor) | ||
41 | if [ $? -ne 0 ]; then | ||
42 | echo "FAIL: Sensor $sensor not found" | ||
43 | exit 1 | ||
44 | fi | ||
45 | |||
46 | # Get temperature readings for each sensor (ignore decimals) | ||
47 | for temp in $($SENSORS_CMD $sensor | grep temp | awk -F'[+|.]' {'print $2'}) | ||
48 | do | ||
49 | if [ "$temp" -ge $tempmin ] && [ "$temp" -le $tempmax ]; then | ||
50 | echo $sensor ": " $temp " OK" | ||
51 | else | ||
52 | echo $sensor ": " $temp " NOK" | ||
53 | echo "FAIL: Temperature outside valid range." | ||
54 | exit 1 | ||
55 | fi | ||
56 | done | ||
57 | done | ||
58 | |||
59 | echo "PASS: temperature sensors" | ||
60 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/usb b/recipes-test/ddt-runner/files/scripts/p2041rdb/usb new file mode 100755 index 0000000..017287f --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/usb | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | #This script is to test usb devices on p2041rdb target | ||
4 | # | ||
5 | |||
6 | USB_DISK=`ls /dev/sd*[1-9] | sort | tail -n 1` | ||
7 | |||
8 | usbutils_is_installed=`which lsusb` | ||
9 | if [ -z $usbutils_is_installed ]; then | ||
10 | echo "FAIL: Cannot find lsusb" | ||
11 | exit 1 | ||
12 | else | ||
13 | echo "PASS: usbutils found" | ||
14 | fi | ||
15 | |||
16 | usbdev_num=`lsusb | grep -v root\ hub | wc -l` | ||
17 | if [ $usbdev_num -eq 0 ]; then | ||
18 | echo "FAIL: USB device is not connected" | ||
19 | exit 1 | ||
20 | else | ||
21 | echo "PASS: $usbdev_num USB device(s) connected" | ||
22 | fi | ||
23 | |||
24 | lsusb | grep -v root\ hub | ||
25 | mkdir -p /mnt/usb_ehci | ||
26 | mount $USB_DISK /mnt/usb_ehci | ||
27 | if [ $? -ne 0 ]; then | ||
28 | echo "FAIL: Mount USB device failed" | ||
29 | exit 1 | ||
30 | else | ||
31 | echo "PASS: Mount USB device succeed" | ||
32 | fi | ||
33 | |||
34 | echo "Begin test usb device..." | ||
35 | dd if=/dev/urandom of=/mnt/usb_ehci/testfile bs=1M count=50 | ||
36 | if [ $? -ne 0 ]; then | ||
37 | echo "FAIL: test failed" | ||
38 | rm -f /mnt/usb_ehci_testfile | ||
39 | umount /mnt/usb_ehci | ||
40 | rm -fr /mnt/usb_ehci | ||
41 | exit 1 | ||
42 | fi | ||
43 | |||
44 | echo "PASS: test succeed" | ||
45 | rm -f /mnt/usb_ehci_testfile | ||
46 | umount /mnt/usb_ehci | ||
47 | rm -fr /mnt/usb_ehci | ||
48 | exit 0 | ||