diff options
Diffstat (limited to 'recipes-test/ddt-runner/files')
74 files changed, 4475 insertions, 0 deletions
diff --git a/recipes-test/ddt-runner/files/ddt-runner b/recipes-test/ddt-runner/files/ddt-runner new file mode 100644 index 0000000..5290530 --- /dev/null +++ b/recipes-test/ddt-runner/files/ddt-runner | |||
@@ -0,0 +1,19 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [[ ! -d "/usr/lib/ddt-runner/scripts" ]]; then | ||
4 | echo "SKIP: No available driver testcase" | ||
5 | exit | ||
6 | fi | ||
7 | |||
8 | cd /usr/lib/ddt-runner/scripts | ||
9 | |||
10 | for x in * | ||
11 | do | ||
12 | if [[ -f $x ]]; then | ||
13 | date +%Y-%m-%dT%H:%M | ||
14 | echo "BEGIN: $x" | ||
15 | ./$x | ||
16 | echo "END: $x" | ||
17 | date +%Y-%m-%dT%H:%M | ||
18 | fi | ||
19 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/acp3448v2/ethernet b/recipes-test/ddt-runner/files/scripts/acp3448v2/ethernet new file mode 100755 index 0000000..10a16b4 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/acp3448v2/ethernet | |||
@@ -0,0 +1,97 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test ethernet functionality for acp3448v2. | ||
4 | # | ||
5 | |||
6 | ethernet_interface="eth0" | ||
7 | ethernet_ping_ipaddr="172.21.3.22" | ||
8 | ethernet_ipaddr=$1 | ||
9 | |||
10 | IFCONFIG=`which ifconfig` | ||
11 | |||
12 | for((num=0; num<16; num++)); | ||
13 | do | ||
14 | ethernet_interface=eth$num | ||
15 | $IFCONFIG $ethernet_interface up | ||
16 | $IFCONFIG | grep $ethernet_interface | ||
17 | if [ $? -eq 0 ]; then | ||
18 | echo "PASS: $ethernet_interface is up" | ||
19 | break | ||
20 | fi | ||
21 | done | ||
22 | |||
23 | if [ $num -eq 16 ]; then | ||
24 | echo "FAIL: $ethernet_interface is not up" | ||
25 | exit 1 | ||
26 | fi | ||
27 | |||
28 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
29 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
30 | fi | ||
31 | |||
32 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
33 | if [ $? -ne 0 ]; then | ||
34 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
35 | exit 1 | ||
36 | else | ||
37 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
38 | fi | ||
39 | |||
40 | mindatasize=56 | ||
41 | maxdatasize=650 | ||
42 | stepsize=100 | ||
43 | iteration=1 | ||
44 | datasize=$mindatasize | ||
45 | logfile=`/bin/mktemp` | ||
46 | statistics=`/bin/mktemp` | ||
47 | error=0 | ||
48 | |||
49 | trap cleanup SIGHUP SIGINT SIGTERM | ||
50 | |||
51 | clean_tasks() { | ||
52 | echo "Executing clean up tasks" | ||
53 | rm -f $logfile $statistics | ||
54 | } | ||
55 | |||
56 | cleanup() { | ||
57 | echo "Aborting script execution" | ||
58 | clean_tasks | ||
59 | exit 0 | ||
60 | } | ||
61 | |||
62 | echo "start ping test for $ethernet_interface..." | ||
63 | |||
64 | while [ $datasize -le $maxdatasize ]; do | ||
65 | for i in `seq 1 $iteration`; do | ||
66 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
67 | ping_err=`echo $?` | ||
68 | echo "" && cat $statistics | grep -r "PING" | ||
69 | cat $statistics | grep -r "received" | ||
70 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
71 | packets_received=`cat $statistics | \ | ||
72 | grep -r "received" | awk '{print$4}'` | ||
73 | |||
74 | # Evaluate possible errors on the ping operation | ||
75 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
76 | error=1 | ||
77 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
78 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
79 | fi | ||
80 | done | ||
81 | let datasize=$datasize+$stepsize | ||
82 | done | ||
83 | |||
84 | # Report failures | ||
85 | if [ $error -eq 1 ]; then | ||
86 | echo -e "=================== error report ===================\n" | ||
87 | cat $logfile | ||
88 | echo -e "====================================================\n" | ||
89 | clean_tasks | ||
90 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
91 | exit 1 | ||
92 | else | ||
93 | clean_tasks | ||
94 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
95 | fi | ||
96 | |||
97 | echo "PASS: $ethernet_interface test passed" exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/acp3448v2/flash b/recipes-test/ddt-runner/files/scripts/acp3448v2/flash new file mode 100755 index 0000000..30c5d06 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/acp3448v2/flash | |||
@@ -0,0 +1,45 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test flash driver function. | ||
4 | |||
5 | if part_num=`cat /proc/mtd | grep -c 'mtd'`; then | ||
6 | echo "PASS: show $part_num partitions" | ||
7 | else | ||
8 | echo "FAIL: show $part_num partitions" | ||
9 | fi | ||
10 | |||
11 | for((part=0; part<$part_num-1; part++)); | ||
12 | do | ||
13 | if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then | ||
14 | echo "PASS: show partition $part debug info" | ||
15 | else | ||
16 | echo "FAIL: show partition $part debug info" | ||
17 | fi | ||
18 | done | ||
19 | |||
20 | let "test_part=part_num-2" | ||
21 | |||
22 | if [ $(flash_erase -j /dev/mtd${test_part} 0 0 | grep -c '100 % complete') ]; then | ||
23 | echo "PASS: erase and format partition ${test_part}" | ||
24 | else | ||
25 | echo "FAIL: erase and format partition ${test_part}" | ||
26 | fi | ||
27 | |||
28 | mkdir -p /mnt/flash | ||
29 | mount -t jffs2 /dev/mtdblock${test_part} /mnt/flash | ||
30 | if [ $? -eq 0 ]; then | ||
31 | echo "PASS: mount partition ${test_part} as /mnt/flash" | ||
32 | else | ||
33 | echo "FAIL: mount partition ${test_part} as /mnt/flash" | ||
34 | fi | ||
35 | |||
36 | cd /mnt/flash | ||
37 | touch test | ||
38 | if [ $(ls | grep -c 'test') ]; then | ||
39 | echo "PASS: touch a file on partition ${test_part}" | ||
40 | else | ||
41 | echo "FAIL: touch a file on partition ${test_part}" | ||
42 | fi | ||
43 | |||
44 | cd ~ | ||
45 | umount /mnt/flash | ||
diff --git a/recipes-test/ddt-runner/files/scripts/acp3448v2/pci-express b/recipes-test/ddt-runner/files/scripts/acp3448v2/pci-express new file mode 100755 index 0000000..b04485f --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/acp3448v2/pci-express | |||
@@ -0,0 +1,109 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth0" | ||
4 | ethernet_ping_ipaddr="172.21.3.22" | ||
5 | ethernet_ipaddr=$1 | ||
6 | |||
7 | #Intel Corporation 82574L Gigabit Network Card (intel e1000e) | ||
8 | vendor_id="8086" | ||
9 | product_id="10d3" | ||
10 | |||
11 | #find vendor id & product id | ||
12 | lspci -nn |grep $vendor_id:$product_id | ||
13 | if [ $? -ne 0 ]; then | ||
14 | echo "FAIL: pci-e ethernet card device does not exist" | ||
15 | exit 1 | ||
16 | else | ||
17 | echo "PASS: got pci-e ethernet card device" | ||
18 | fi | ||
19 | |||
20 | setpci -v -d $vendor_id:$product_id latency_timer=b0 | ||
21 | if [ $? -ne 0 ]; then | ||
22 | echo "FAIL: parameter changes to pci config space failed" | ||
23 | exit 1 | ||
24 | else | ||
25 | echo "PASS: parameter changes to pci config space success" | ||
26 | fi | ||
27 | |||
28 | IFCONFIG=`which ifconfig` | ||
29 | |||
30 | $IFCONFIG $ethernet_interface up | ||
31 | $IFCONFIG | grep $ethernet_interface | ||
32 | if [ $? -ne 0 ]; then | ||
33 | echo "FAIL: pci-e ethernet card device $ethernet_interface is not up" | ||
34 | exit 1 | ||
35 | else | ||
36 | echo "PASS: pci-e ethernet card device $ethernet_interface is up" | ||
37 | fi | ||
38 | |||
39 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
40 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
41 | fi | ||
42 | |||
43 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
44 | if [ $? -ne 0 ]; then | ||
45 | echo "FAIL: ipaddr of pci-e ethernet card device $ethernet_interface setup failed" | ||
46 | exit 1 | ||
47 | else | ||
48 | echo "PASS: ipaddr of pci-e ethernet card device $ethernet_interface setup success" | ||
49 | fi | ||
50 | |||
51 | mindatasize=56 | ||
52 | maxdatasize=650 | ||
53 | stepsize=100 | ||
54 | iteration=1 | ||
55 | datasize=$mindatasize | ||
56 | logfile=`/bin/mktemp` | ||
57 | statistics=`/bin/mktemp` | ||
58 | error=0 | ||
59 | |||
60 | trap cleanup SIGHUP SIGINT SIGTERM | ||
61 | |||
62 | clean_tasks() { | ||
63 | echo "Executing clean up tasks" | ||
64 | rm -f $logfile $statistics | ||
65 | } | ||
66 | |||
67 | cleanup() { | ||
68 | echo "Aborting script execution" | ||
69 | clean_tasks | ||
70 | exit 0 | ||
71 | } | ||
72 | |||
73 | echo "start ping test for pci-e ethernet card device $ethernet_interface..." | ||
74 | |||
75 | while [ $datasize -le $maxdatasize ]; do | ||
76 | for i in `seq 1 $iteration`; do | ||
77 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
78 | ping_err=`echo $?` | ||
79 | echo "" && cat $statistics | grep -r "PING" | ||
80 | cat $statistics | grep -r "received" | ||
81 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
82 | packets_received=`cat $statistics | \ | ||
83 | grep -r "received" | awk '{print$4}'` | ||
84 | |||
85 | # Evaluate possible errors on the ping operation | ||
86 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
87 | error=1 | ||
88 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
89 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
90 | fi | ||
91 | done | ||
92 | let datasize=$datasize+$stepsize | ||
93 | done | ||
94 | |||
95 | # Report failures | ||
96 | if [ $error -eq 1 ]; then | ||
97 | echo -e "=================== error report ===================\n" | ||
98 | cat $logfile | ||
99 | echo -e "====================================================\n" | ||
100 | clean_tasks | ||
101 | echo -e "FAIL: ping test for pci-e ethernet card device $ethernet_interface failed\n" | ||
102 | exit 1 | ||
103 | else | ||
104 | clean_tasks | ||
105 | echo -e "PASS: ping test for pci-e ethernet card device $ethernet_interface success\n" | ||
106 | fi | ||
107 | |||
108 | echo "PASS: pci express test passed" | ||
109 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/acp3448v2/usb b/recipes-test/ddt-runner/files/scripts/acp3448v2/usb new file mode 100755 index 0000000..aad0226 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/acp3448v2/usb | |||
@@ -0,0 +1,100 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test usb functionality for acp3448v2. | ||
4 | # | ||
5 | |||
6 | result=0 | ||
7 | devpath="" | ||
8 | usbinfo="" | ||
9 | |||
10 | usbutils_is_installed=`which lsusb` | ||
11 | if [ -z $usbutils_is_installed ]; then | ||
12 | echo "FAIL: Cannot find lsusb" | ||
13 | exit 1 | ||
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 "$usbdev_num USB device(s) connected" | ||
22 | fi | ||
23 | |||
24 | sd=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'` | ||
25 | if [ -z "$sd" ]; then | ||
26 | echo "FAIL: find sd device" | ||
27 | exit 1 | ||
28 | else | ||
29 | echo "PASS: find sd device" | ||
30 | fi | ||
31 | |||
32 | HDPARM=`which hdparm` | ||
33 | if [ -z $HDPARM ]; then | ||
34 | result=$? | ||
35 | echo "FAIL: find hdparm" | ||
36 | fi | ||
37 | echo "PASS: find hdparm" | ||
38 | |||
39 | for s in $sd | ||
40 | do | ||
41 | devpath=`echo "$s" | awk -F "," '{print "/sys/dev/block/" $1 ":" $2}'` | ||
42 | usbinfo=`ls -l $devpath | grep usb` | ||
43 | |||
44 | if [ -z "$usbinfo" ] ; then | ||
45 | continue | ||
46 | fi | ||
47 | |||
48 | s=`echo "$s" | awk -F "," '{print $3}'` | ||
49 | |||
50 | echo "Testing $s" | ||
51 | $HDPARM -I $s | ||
52 | if [ $? -ne 0 ]; then | ||
53 | result=$? | ||
54 | echo "FAIL: $HDPARM -I $s Detailed/current information directly from $s" | ||
55 | else | ||
56 | echo "PASS: $HDPARM -I $s Detailed/current information directly from $s" | ||
57 | fi | ||
58 | |||
59 | $HDPARM -tT $s | ||
60 | if [ $? -ne 0 ]; then | ||
61 | result=$? | ||
62 | echo "FAIL: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
63 | else | ||
64 | echo "PASS: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
65 | fi | ||
66 | |||
67 | mkdir -p /mnt/usb_tmp | ||
68 | for partition in `ls "$s"[1-9]` | ||
69 | do | ||
70 | echo "Testing $partition" | ||
71 | |||
72 | mount "$partition" /mnt/usb_tmp | ||
73 | if [ $? -ne 0 ]; then | ||
74 | result=$? | ||
75 | echo "FAIL: mount $s" | ||
76 | else | ||
77 | echo "PASS: mount $s" | ||
78 | dd if=/dev/urandom of=/mnt/usb_tmp/writefile bs=1M count=50 | ||
79 | if [ $? -ne 0 ]; then | ||
80 | result=$? | ||
81 | echo "FAIL: write test on $s" | ||
82 | else | ||
83 | echo "PASS: write test on $s" | ||
84 | rm -f /mnt/usb_tmp/writefile | ||
85 | fi | ||
86 | dd if=$s of=/mnt/usb_tmp/readfile bs=1M count=10 | ||
87 | if [ $? -ne 0 ]; then | ||
88 | result=$? | ||
89 | echo "FAIL: read test on $s" | ||
90 | else | ||
91 | echo "PASS: read test on $s" | ||
92 | rm -f /mnt/usb_tmp/readfile | ||
93 | fi | ||
94 | umount /mnt/usb_tmp | ||
95 | fi | ||
96 | done | ||
97 | |||
98 | rm -fr /mnt/usb_tmp | ||
99 | done | ||
100 | exit $result | ||
diff --git a/recipes-test/ddt-runner/files/scripts/b4860qds-64b/ethernet b/recipes-test/ddt-runner/files/scripts/b4860qds-64b/ethernet new file mode 100755 index 0000000..5355f10 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/b4860qds-64b/ethernet | |||
@@ -0,0 +1,88 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth1" | ||
4 | ethernet_ping_ipaddr="172.21.3.22" | ||
5 | ethernet_ipaddr=$1 | ||
6 | |||
7 | IFCONFIG=`which ifconfig` | ||
8 | |||
9 | $IFCONFIG $ethernet_interface up | ||
10 | $IFCONFIG | grep $ethernet_interface | ||
11 | if [ $? -ne 0 ]; then | ||
12 | echo "FAIL: $ethernet_interface is not up" | ||
13 | exit 1 | ||
14 | else | ||
15 | echo "PASS: $ethernet_interface is up" | ||
16 | fi | ||
17 | |||
18 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
19 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
20 | fi | ||
21 | |||
22 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
23 | if [ $? -ne 0 ]; then | ||
24 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
25 | exit 1 | ||
26 | else | ||
27 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
28 | fi | ||
29 | |||
30 | mindatasize=56 | ||
31 | maxdatasize=650 | ||
32 | stepsize=100 | ||
33 | iteration=1 | ||
34 | datasize=$mindatasize | ||
35 | logfile=`/bin/mktemp` | ||
36 | statistics=`/bin/mktemp` | ||
37 | error=0 | ||
38 | |||
39 | trap cleanup SIGHUP SIGINT SIGTERM | ||
40 | |||
41 | clean_tasks() { | ||
42 | echo "Executing clean up tasks" | ||
43 | rm -f $logfile $statistics | ||
44 | } | ||
45 | |||
46 | cleanup() { | ||
47 | echo "Aborting script execution" | ||
48 | clean_tasks | ||
49 | exit 0 | ||
50 | } | ||
51 | |||
52 | echo "start ping test for $ethernet_interface..." | ||
53 | |||
54 | while [ $datasize -le $maxdatasize ]; do | ||
55 | for i in `seq 1 $iteration`; do | ||
56 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
57 | ping_err=`echo $?` | ||
58 | echo "" && cat $statistics | grep -r "PING" | ||
59 | cat $statistics | grep -r "received" | ||
60 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
61 | packets_received=`cat $statistics | \ | ||
62 | grep -r "received" | awk '{print$4}'` | ||
63 | |||
64 | # Evaluate possible errors on the ping operation | ||
65 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
66 | error=1 | ||
67 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
68 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
69 | fi | ||
70 | done | ||
71 | let datasize=$datasize+$stepsize | ||
72 | done | ||
73 | |||
74 | # Report failures | ||
75 | if [ $error -eq 1 ]; then | ||
76 | echo -e "=================== error report ===================\n" | ||
77 | cat $logfile | ||
78 | echo -e "====================================================\n" | ||
79 | clean_tasks | ||
80 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
81 | exit 1 | ||
82 | else | ||
83 | clean_tasks | ||
84 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
85 | fi | ||
86 | |||
87 | echo "PASS: $ethernet_interface test passed" | ||
88 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/b4860qds-64b/flash b/recipes-test/ddt-runner/files/scripts/b4860qds-64b/flash new file mode 100755 index 0000000..5728b73 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/b4860qds-64b/flash | |||
@@ -0,0 +1,20 @@ | |||
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 b4860qds-64b 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 | fi | ||
12 | |||
13 | for((part=0; part<$part_num-1; part++)); | ||
14 | do | ||
15 | if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then | ||
16 | echo "PASS: show partition $part debug info" | ||
17 | else | ||
18 | echo "FAIL: show partition $part debug info" | ||
19 | fi | ||
20 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/b4860qds-64b/i2c b/recipes-test/ddt-runner/files/scripts/b4860qds-64b/i2c new file mode 100755 index 0000000..5b312b9 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/b4860qds-64b/i2c | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then | ||
4 | echo "PASS: found $I2C_ADAPTERS i2c adapters" | ||
5 | else | ||
6 | echo "FAIL: no i2c adapters found" | ||
7 | exit 1 | ||
8 | fi | ||
9 | |||
10 | if [ -z "$adapters" ]; then | ||
11 | adapters=0 | ||
12 | fi | ||
13 | |||
14 | while [ $adapters -lt $I2C_ADAPTERS ] | ||
15 | do | ||
16 | i2cdetect -y $adapters | ||
17 | if [ $? -ne 0 ]; then | ||
18 | echo "FAIL: detect i2c adapter $adapters failed" | ||
19 | else | ||
20 | echo "PASS: detect i2c adapter $adapters success" | ||
21 | fi | ||
22 | adapters=`expr $adapters + 1` | ||
23 | sleep 1 | ||
24 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/b4860qds-64b/rtc b/recipes-test/ddt-runner/files/scripts/b4860qds-64b/rtc new file mode 100755 index 0000000..0d38293 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/b4860qds-64b/rtc | |||
@@ -0,0 +1,42 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | RTC_DEVICE="/dev/rtc" | ||
4 | |||
5 | if [ ! -e $RTC_DEVICE ]; then | ||
6 | echo "FAIL: rtc device does not exist" | ||
7 | exit 1 | ||
8 | else | ||
9 | echo "PASS: rtc device exists" | ||
10 | fi | ||
11 | |||
12 | /sbin/hwclock -f $RTC_DEVICE | ||
13 | if [ $? -ne 0 ]; then | ||
14 | echo "FAIL: rtc device open failed" | ||
15 | exit 1 | ||
16 | else | ||
17 | echo "PASS: rtc device open success" | ||
18 | fi | ||
19 | |||
20 | |||
21 | /sbin/hwclock --systohc | ||
22 | if [ $? -ne 0 ]; then | ||
23 | echo "FAIL: sync system clock and hardware clock failed" | ||
24 | exit 1 | ||
25 | else | ||
26 | echo "PASS: sync system clock and hardware clock success" | ||
27 | fi | ||
28 | |||
29 | RTC_TIME=$(/sbin/hwclock -r |awk '{print $4}') | ||
30 | echo $RTC_TIME | ||
31 | SYS_TIME=$(date +%m/%d/%Y-%X |awk '{print $1}' |awk -F- '{print $2}') | ||
32 | echo $SYS_TIME | ||
33 | |||
34 | if [ "$RTC_TIME" = "$SYS_TIME" ] ; then | ||
35 | echo "PASS: system time same with hardware time" | ||
36 | else | ||
37 | echo "FAIL: system time different with hardware time" | ||
38 | exit 1 | ||
39 | fi | ||
40 | |||
41 | echo "PASS: rtc test successful" | ||
42 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/b4860qds-64b/spi b/recipes-test/ddt-runner/files/scripts/b4860qds-64b/spi new file mode 100755 index 0000000..b03431e --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/b4860qds-64b/spi | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | #An spi flash M25P80 connect to b4860qds-64b cpu by spi bus, so the method | ||
4 | #is to read/write spi flash to verify whether the spi bus driver worked | ||
5 | #or not. | ||
6 | |||
7 | MTD_CHAR_DEVICE="/dev/mtd4" | ||
8 | MTD_BLOCK_DEVICE="/dev/mtdblock4" | ||
9 | |||
10 | if [ ! -e $MTD_CHAR_DEVICE ]; then | ||
11 | echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" | ||
12 | exit 1 | ||
13 | else | ||
14 | echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" | ||
15 | fi | ||
16 | |||
17 | if [ ! -e $MTD_BLOCK_DEVICE ]; then | ||
18 | echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" | ||
19 | exit 1 | ||
20 | else | ||
21 | echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" | ||
22 | fi | ||
23 | |||
24 | /usr/sbin/flash_erase -j $MTD_CHAR_DEVICE 0 0 | ||
25 | if [ $? -ne 0 ]; then | ||
26 | echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" | ||
27 | exit 1 | ||
28 | else | ||
29 | mkdir -p /mnt/spi | ||
30 | mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi | ||
31 | if [ $? -ne 0 ]; then | ||
32 | echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" | ||
33 | exit 1 | ||
34 | else | ||
35 | cp /bin/busybox /mnt/spi | ||
36 | ls /mnt/spi |grep busybox | ||
37 | if [ $? -ne 0 ]; then | ||
38 | echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" | ||
39 | exit 1 | ||
40 | else | ||
41 | umount $MTD_BLOCK_DEVICE | ||
42 | echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" | ||
43 | fi | ||
44 | fi | ||
45 | fi | ||
46 | |||
47 | echo "PASS: spi bus test passed" | ||
48 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9131rdb/ethernet b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/ethernet new file mode 100755 index 0000000..df64e08 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/ethernet | |||
@@ -0,0 +1,89 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test ethernet interface for bsc9131rdb. | ||
3 | |||
4 | ethernet_interface="eth0" | ||
5 | ethernet_ping_ipaddr="172.21.3.22" | ||
6 | ethernet_ipaddr=$1 | ||
7 | |||
8 | IFCONFIG=`which ifconfig` | ||
9 | |||
10 | $IFCONFIG $ethernet_interface up | ||
11 | $IFCONFIG | grep $ethernet_interface | ||
12 | if [ $? -ne 0 ]; then | ||
13 | echo "FAIL: $ethernet_interface is not up" | ||
14 | exit 1 | ||
15 | else | ||
16 | echo "PASS: $ethernet_interface is up" | ||
17 | fi | ||
18 | |||
19 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
20 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
21 | fi | ||
22 | |||
23 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
24 | if [ $? -ne 0 ]; then | ||
25 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
26 | exit 1 | ||
27 | else | ||
28 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
29 | fi | ||
30 | |||
31 | mindatasize=56 | ||
32 | maxdatasize=650 | ||
33 | stepsize=100 | ||
34 | iteration=1 | ||
35 | datasize=$mindatasize | ||
36 | logfile=`/bin/mktemp` | ||
37 | statistics=`/bin/mktemp` | ||
38 | error=0 | ||
39 | |||
40 | trap cleanup SIGHUP SIGINT SIGTERM | ||
41 | |||
42 | clean_tasks() { | ||
43 | echo "Executing clean up tasks" | ||
44 | rm -f $logfile $statistics | ||
45 | } | ||
46 | |||
47 | cleanup() { | ||
48 | echo "Aborting script execution" | ||
49 | clean_tasks | ||
50 | exit 0 | ||
51 | } | ||
52 | |||
53 | echo "start ping test for $ethernet_interface..." | ||
54 | |||
55 | while [ $datasize -le $maxdatasize ]; do | ||
56 | for i in `seq 1 $iteration`; do | ||
57 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
58 | ping_err=`echo $?` | ||
59 | echo "" && cat $statistics | grep -r "PING" | ||
60 | cat $statistics | grep -r "received" | ||
61 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
62 | packets_received=`cat $statistics | \ | ||
63 | grep -r "received" | awk '{print$4}'` | ||
64 | |||
65 | # Evaluate possible errors on the ping operation | ||
66 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
67 | error=1 | ||
68 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
69 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
70 | fi | ||
71 | done | ||
72 | let datasize=$datasize+$stepsize | ||
73 | done | ||
74 | |||
75 | # Report failures | ||
76 | if [ $error -eq 1 ]; then | ||
77 | echo -e "=================== error report ===================\n" | ||
78 | cat $logfile | ||
79 | echo -e "====================================================\n" | ||
80 | clean_tasks | ||
81 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
82 | exit 1 | ||
83 | else | ||
84 | clean_tasks | ||
85 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
86 | fi | ||
87 | |||
88 | echo "PASS: $ethernet_interface test passed" | ||
89 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9131rdb/flash b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/flash new file mode 100755 index 0000000..66631ba --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/flash | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test flash driver functionality. I removed the tests | ||
4 | # which include write operations since all partition are in use in bsc9131rdb | ||
5 | # and there might be possibility of corrupting data even if we backup in test | ||
6 | # script. | ||
7 | |||
8 | if part_num=`cat /proc/mtd | grep -c 'mtd'`; then | ||
9 | echo "PASS: $part_num partitions found" | ||
10 | else | ||
11 | echo "FAIL: $part_num partitions found" | ||
12 | exit 1 | ||
13 | fi | ||
14 | |||
15 | for((part=0; part<$part_num; part++)); | ||
16 | do | ||
17 | if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then | ||
18 | echo "PASS: show partition $part debug info" | ||
19 | else | ||
20 | echo "FAIL: show partition $part debug info" | ||
21 | exit 1 | ||
22 | fi | ||
23 | done | ||
24 | |||
25 | READ_TEST=`find / -name mtd_readtest.ko -print` | ||
26 | |||
27 | if [ ! -e $READ_TEST ]; then | ||
28 | echo "FAIL: $READ_TEST does not exist" | ||
29 | exit 1 | ||
30 | else | ||
31 | echo "PASS: $READ_TEST exists" | ||
32 | fi | ||
33 | |||
34 | for((part=0; part<$part_num; part++)); | ||
35 | do | ||
36 | dmesg -c > NULL | ||
37 | |||
38 | modprobe $READ_TEST dev=$part | ||
39 | |||
40 | bad_num=`dmesg | grep -c 'bad'` | ||
41 | if [ $bad_num -eq 0 ]; then | ||
42 | echo "PASS: read test for partition $part" | ||
43 | else | ||
44 | echo "FAIL: read test for partition $part" | ||
45 | fi | ||
46 | |||
47 | rmmod $READ_TEST | ||
48 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9131rdb/i2c b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/i2c new file mode 100755 index 0000000..c4acd8e --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/i2c | |||
@@ -0,0 +1,75 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test i2c interface for bsc9131rdb | ||
3 | |||
4 | I2C_DETECT=`which i2cdetect` | ||
5 | if [ "x$I2C_DETECT" != "x" ]; then | ||
6 | echo "PASS: i2cdetect found" | ||
7 | else | ||
8 | echo "FAIL: i2cdetect not found" | ||
9 | exit 1 | ||
10 | fi | ||
11 | |||
12 | I2C_SET=`which i2cset` | ||
13 | if [ "x$I2C_SET" != "x" ]; then | ||
14 | echo "PASS: i2cset found" | ||
15 | else | ||
16 | echo "FAIL: i2cset not found" | ||
17 | exit 1 | ||
18 | fi | ||
19 | |||
20 | I2C_GET=`which i2cget` | ||
21 | if [ "x$I2C_GET" != "x" ]; then | ||
22 | echo "PASS: i2cget found" | ||
23 | else | ||
24 | echo "FAIL: i2cget not found" | ||
25 | exit 1 | ||
26 | fi | ||
27 | |||
28 | if I2C_ADAPTERS=`$I2C_DETECT -l |wc -l`; then | ||
29 | echo "PASS: $I2C_ADAPTERS i2c adapters found" | ||
30 | else | ||
31 | echo "FAIL: no i2c adapters found" | ||
32 | exit 1 | ||
33 | fi | ||
34 | |||
35 | adapters=0 | ||
36 | while [ $adapters -lt $I2C_ADAPTERS ] | ||
37 | do | ||
38 | $I2C_DETECT -y $adapters | ||
39 | if [ $? -ne 0 ]; then | ||
40 | echo "FAIL: detect i2c adapter $adapters fail" | ||
41 | else | ||
42 | echo "PASS: detect i2c adapter $adapters success" | ||
43 | fi | ||
44 | adapters=`expr $adapters + 1` | ||
45 | sleep 1 | ||
46 | done | ||
47 | |||
48 | # Area of bus:i2c-0 addr:0x52 is free to read and write | ||
49 | $I2C_SET -y 0 0x52 0 0x55 | ||
50 | if [ $? -eq 0 ]; then | ||
51 | echo "PASS: i2c_set -y 0 0x52 0 0x55 success" | ||
52 | else | ||
53 | echo "FAIL: i2c_set -y 0 0x52 0 0x55 fail" | ||
54 | fi | ||
55 | |||
56 | num=`$I2C_GET -y 0 0x52 0 | grep -c '0x55'` | ||
57 | if [ $num -eq 1 ]; then | ||
58 | echo "PASS: i2c_get -y 0 0x52 0 success" | ||
59 | else | ||
60 | echo "FAIL: i2c_get -y 0 0x52 0 fail" | ||
61 | fi | ||
62 | |||
63 | $I2C_SET -y 0 0x52 0 0xaa | ||
64 | if [ $? -eq 0 ]; then | ||
65 | echo "PASS: i2c_set -y 0 0x52 0 0xaa success" | ||
66 | else | ||
67 | echo "FAIL: i2c_set -y 0 0x52 0 0xaa fail" | ||
68 | fi | ||
69 | |||
70 | num=`$I2C_GET -y 0 0x52 0 | grep -c '0xaa'` | ||
71 | if [ $num -eq 1 ]; then | ||
72 | echo "PASS: i2c_get -y 0 0x52 0 success" | ||
73 | else | ||
74 | echo "FAIL: i2c_get -y 0 0x52 0 fail" | ||
75 | fi | ||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9131rdb/preempt_rt b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/preempt_rt new file mode 100755 index 0000000..111cfa2 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/preempt_rt | |||
@@ -0,0 +1,33 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | #This script is to test PREEMPT RT on target | ||
4 | # | ||
5 | |||
6 | uname -a | grep "PREEMPT RT" | ||
7 | if [ $? -ne 0 ]; then | ||
8 | echo "FAIL: The kernel include real-time patch" | ||
9 | echo 1 | ||
10 | fi | ||
11 | echo "PASS: The kernel include real-time patch" | ||
12 | |||
13 | ps | grep '\(\[irq/\)' | ||
14 | if [ $? -ne 0 ]; then | ||
15 | echo "FAIL: The IRQ handlers are treated by a patched kernel in kernel thread context." | ||
16 | exit 1 | ||
17 | fi | ||
18 | echo "PASS: The IRQ handlers are treated by a patched kernel in kernel thread context." | ||
19 | |||
20 | cyclictest -t5 -p 80 -i 10000 -l 100 | ||
21 | if [ $? -ne 0 ]; then | ||
22 | echo "FAIL: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops." | ||
23 | exit 1 | ||
24 | fi | ||
25 | echo "PASS: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops." | ||
26 | |||
27 | cyclictest -t5 -p 80 -n -i 10000 -l 100 | ||
28 | if [ $? -ne 0 ]; then | ||
29 | echo "FAIL: Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 micro seconds,. 100 loops." | ||
30 | exit 1 | ||
31 | fi | ||
32 | echo "PASS: Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 micro seconds,. 100 loops." | ||
33 | |||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9131rdb/spi b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/spi new file mode 100755 index 0000000..3386d6c --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/spi | |||
@@ -0,0 +1,56 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test spi flash functionality for bsc9131rdb. An spi | ||
3 | # flash M25P80 connect to bsc9131 cpu by spi bus, so the method is to read/write | ||
4 | # spi flash to verify whether the spi bus driver worked or not. | ||
5 | |||
6 | MTD_CHAR_DEVICE="/dev/mtd8" | ||
7 | MTD_BLOCK_DEVICE="/dev/mtdblock8" | ||
8 | |||
9 | FLASH_ERASE=`which flash_erase` | ||
10 | if [ "x$FLASH_ERASE" != "x" ]; then | ||
11 | echo "PASS: flash_erase found" | ||
12 | else | ||
13 | echo "FAIL: flash_erase not found" | ||
14 | exit 1 | ||
15 | fi | ||
16 | |||
17 | if [ ! -e $MTD_CHAR_DEVICE ]; then | ||
18 | echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" | ||
19 | exit 1 | ||
20 | else | ||
21 | echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" | ||
22 | fi | ||
23 | |||
24 | if [ ! -e $MTD_BLOCK_DEVICE ]; then | ||
25 | echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" | ||
26 | exit 1 | ||
27 | else | ||
28 | echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" | ||
29 | fi | ||
30 | |||
31 | $FLASH_ERASE -j $MTD_CHAR_DEVICE 0 0 | ||
32 | if [ $? -ne 0 ]; then | ||
33 | echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" | ||
34 | exit 1 | ||
35 | else | ||
36 | mkdir -p /mnt/spi | ||
37 | mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi | ||
38 | if [ $? -ne 0 ]; then | ||
39 | echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" | ||
40 | exit 1 | ||
41 | else | ||
42 | cp /bin/busybox /mnt/spi | ||
43 | file_num=`ls /mnt/spi |grep -c 'busybox'` | ||
44 | if [ $file_num -eq 1 ]; then | ||
45 | rm /mnt/spi/busybox | ||
46 | umount $MTD_BLOCK_DEVICE | ||
47 | echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" | ||
48 | else | ||
49 | echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" | ||
50 | exit 1 | ||
51 | fi | ||
52 | fi | ||
53 | fi | ||
54 | |||
55 | echo "PASS: spi bus test passed" | ||
56 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9131rdb/watchdog b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/watchdog new file mode 100755 index 0000000..71429fc --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9131rdb/watchdog | |||
@@ -0,0 +1,64 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test watchdog functionality for bsc9131rdb. | ||
4 | |||
5 | WATCHDOG=`which watchdog` | ||
6 | if [ "x$WATCHDOG" != "x" ]; then | ||
7 | echo "PASS: watchdog found" | ||
8 | else | ||
9 | echo "FAIL: watchdog not found" | ||
10 | exit 1 | ||
11 | fi | ||
12 | |||
13 | WATCHDOG_CONF=/etc/watchdog.conf | ||
14 | if [ -f $WATCHDOG_CONF ]; then | ||
15 | echo "PASS: watchdog config file found" | ||
16 | sed -i '23,23 s/#//' $WATCHDOG_CONF | ||
17 | else | ||
18 | echo "FAIL: watchdog config file not found" | ||
19 | exit 1 | ||
20 | fi | ||
21 | |||
22 | $WATCHDOG -v /dev/watchdog | ||
23 | watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` | ||
24 | if [ $watchdog_thread -eq 2 ]; then | ||
25 | echo "PASS: Watchdog daemon started successfully" | ||
26 | else | ||
27 | echo "FAIL: Failed to start watchdog daemon" | ||
28 | exit 1 | ||
29 | fi | ||
30 | |||
31 | sleep 5s | ||
32 | |||
33 | killall watchdog | ||
34 | |||
35 | retry=0 | ||
36 | while [ $retry -lt 10 ] | ||
37 | do | ||
38 | watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` | ||
39 | if [ $watchdog_thread -eq 1 ]; then | ||
40 | echo "PASS: Watchdog daemon stopped successfully" | ||
41 | break; | ||
42 | fi | ||
43 | sleep 1s | ||
44 | retry=`expr $retry + 1` | ||
45 | done | ||
46 | |||
47 | if [ $retry -eq 10 ]; then | ||
48 | echo "FAIL: Failed to stop watchdog daemon" | ||
49 | fi | ||
50 | |||
51 | found=0 | ||
52 | while read line | ||
53 | do | ||
54 | result=`echo $line | grep -c 'still alive after 1 interval'` | ||
55 | if [ $result -eq 1 ]; then | ||
56 | echo "PASS: Watchdog is still alive after 1 interval" | ||
57 | found=1 | ||
58 | fi | ||
59 | done < /var/log/messages | ||
60 | |||
61 | if [ $found -eq 0 ]; then | ||
62 | echo "FAIL: Watchdog is not alive after 1 interval" | ||
63 | fi | ||
64 | |||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9132qds/ethernet b/recipes-test/ddt-runner/files/scripts/bsc9132qds/ethernet new file mode 100755 index 0000000..df64e08 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9132qds/ethernet | |||
@@ -0,0 +1,89 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test ethernet interface for bsc9131rdb. | ||
3 | |||
4 | ethernet_interface="eth0" | ||
5 | ethernet_ping_ipaddr="172.21.3.22" | ||
6 | ethernet_ipaddr=$1 | ||
7 | |||
8 | IFCONFIG=`which ifconfig` | ||
9 | |||
10 | $IFCONFIG $ethernet_interface up | ||
11 | $IFCONFIG | grep $ethernet_interface | ||
12 | if [ $? -ne 0 ]; then | ||
13 | echo "FAIL: $ethernet_interface is not up" | ||
14 | exit 1 | ||
15 | else | ||
16 | echo "PASS: $ethernet_interface is up" | ||
17 | fi | ||
18 | |||
19 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
20 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
21 | fi | ||
22 | |||
23 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
24 | if [ $? -ne 0 ]; then | ||
25 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
26 | exit 1 | ||
27 | else | ||
28 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
29 | fi | ||
30 | |||
31 | mindatasize=56 | ||
32 | maxdatasize=650 | ||
33 | stepsize=100 | ||
34 | iteration=1 | ||
35 | datasize=$mindatasize | ||
36 | logfile=`/bin/mktemp` | ||
37 | statistics=`/bin/mktemp` | ||
38 | error=0 | ||
39 | |||
40 | trap cleanup SIGHUP SIGINT SIGTERM | ||
41 | |||
42 | clean_tasks() { | ||
43 | echo "Executing clean up tasks" | ||
44 | rm -f $logfile $statistics | ||
45 | } | ||
46 | |||
47 | cleanup() { | ||
48 | echo "Aborting script execution" | ||
49 | clean_tasks | ||
50 | exit 0 | ||
51 | } | ||
52 | |||
53 | echo "start ping test for $ethernet_interface..." | ||
54 | |||
55 | while [ $datasize -le $maxdatasize ]; do | ||
56 | for i in `seq 1 $iteration`; do | ||
57 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
58 | ping_err=`echo $?` | ||
59 | echo "" && cat $statistics | grep -r "PING" | ||
60 | cat $statistics | grep -r "received" | ||
61 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
62 | packets_received=`cat $statistics | \ | ||
63 | grep -r "received" | awk '{print$4}'` | ||
64 | |||
65 | # Evaluate possible errors on the ping operation | ||
66 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
67 | error=1 | ||
68 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
69 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
70 | fi | ||
71 | done | ||
72 | let datasize=$datasize+$stepsize | ||
73 | done | ||
74 | |||
75 | # Report failures | ||
76 | if [ $error -eq 1 ]; then | ||
77 | echo -e "=================== error report ===================\n" | ||
78 | cat $logfile | ||
79 | echo -e "====================================================\n" | ||
80 | clean_tasks | ||
81 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
82 | exit 1 | ||
83 | else | ||
84 | clean_tasks | ||
85 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
86 | fi | ||
87 | |||
88 | echo "PASS: $ethernet_interface test passed" | ||
89 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9132qds/flash b/recipes-test/ddt-runner/files/scripts/bsc9132qds/flash new file mode 100755 index 0000000..66631ba --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9132qds/flash | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test flash driver functionality. I removed the tests | ||
4 | # which include write operations since all partition are in use in bsc9131rdb | ||
5 | # and there might be possibility of corrupting data even if we backup in test | ||
6 | # script. | ||
7 | |||
8 | if part_num=`cat /proc/mtd | grep -c 'mtd'`; then | ||
9 | echo "PASS: $part_num partitions found" | ||
10 | else | ||
11 | echo "FAIL: $part_num partitions found" | ||
12 | exit 1 | ||
13 | fi | ||
14 | |||
15 | for((part=0; part<$part_num; part++)); | ||
16 | do | ||
17 | if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then | ||
18 | echo "PASS: show partition $part debug info" | ||
19 | else | ||
20 | echo "FAIL: show partition $part debug info" | ||
21 | exit 1 | ||
22 | fi | ||
23 | done | ||
24 | |||
25 | READ_TEST=`find / -name mtd_readtest.ko -print` | ||
26 | |||
27 | if [ ! -e $READ_TEST ]; then | ||
28 | echo "FAIL: $READ_TEST does not exist" | ||
29 | exit 1 | ||
30 | else | ||
31 | echo "PASS: $READ_TEST exists" | ||
32 | fi | ||
33 | |||
34 | for((part=0; part<$part_num; part++)); | ||
35 | do | ||
36 | dmesg -c > NULL | ||
37 | |||
38 | modprobe $READ_TEST dev=$part | ||
39 | |||
40 | bad_num=`dmesg | grep -c 'bad'` | ||
41 | if [ $bad_num -eq 0 ]; then | ||
42 | echo "PASS: read test for partition $part" | ||
43 | else | ||
44 | echo "FAIL: read test for partition $part" | ||
45 | fi | ||
46 | |||
47 | rmmod $READ_TEST | ||
48 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9132qds/i2c b/recipes-test/ddt-runner/files/scripts/bsc9132qds/i2c new file mode 100755 index 0000000..c4acd8e --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9132qds/i2c | |||
@@ -0,0 +1,75 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test i2c interface for bsc9131rdb | ||
3 | |||
4 | I2C_DETECT=`which i2cdetect` | ||
5 | if [ "x$I2C_DETECT" != "x" ]; then | ||
6 | echo "PASS: i2cdetect found" | ||
7 | else | ||
8 | echo "FAIL: i2cdetect not found" | ||
9 | exit 1 | ||
10 | fi | ||
11 | |||
12 | I2C_SET=`which i2cset` | ||
13 | if [ "x$I2C_SET" != "x" ]; then | ||
14 | echo "PASS: i2cset found" | ||
15 | else | ||
16 | echo "FAIL: i2cset not found" | ||
17 | exit 1 | ||
18 | fi | ||
19 | |||
20 | I2C_GET=`which i2cget` | ||
21 | if [ "x$I2C_GET" != "x" ]; then | ||
22 | echo "PASS: i2cget found" | ||
23 | else | ||
24 | echo "FAIL: i2cget not found" | ||
25 | exit 1 | ||
26 | fi | ||
27 | |||
28 | if I2C_ADAPTERS=`$I2C_DETECT -l |wc -l`; then | ||
29 | echo "PASS: $I2C_ADAPTERS i2c adapters found" | ||
30 | else | ||
31 | echo "FAIL: no i2c adapters found" | ||
32 | exit 1 | ||
33 | fi | ||
34 | |||
35 | adapters=0 | ||
36 | while [ $adapters -lt $I2C_ADAPTERS ] | ||
37 | do | ||
38 | $I2C_DETECT -y $adapters | ||
39 | if [ $? -ne 0 ]; then | ||
40 | echo "FAIL: detect i2c adapter $adapters fail" | ||
41 | else | ||
42 | echo "PASS: detect i2c adapter $adapters success" | ||
43 | fi | ||
44 | adapters=`expr $adapters + 1` | ||
45 | sleep 1 | ||
46 | done | ||
47 | |||
48 | # Area of bus:i2c-0 addr:0x52 is free to read and write | ||
49 | $I2C_SET -y 0 0x52 0 0x55 | ||
50 | if [ $? -eq 0 ]; then | ||
51 | echo "PASS: i2c_set -y 0 0x52 0 0x55 success" | ||
52 | else | ||
53 | echo "FAIL: i2c_set -y 0 0x52 0 0x55 fail" | ||
54 | fi | ||
55 | |||
56 | num=`$I2C_GET -y 0 0x52 0 | grep -c '0x55'` | ||
57 | if [ $num -eq 1 ]; then | ||
58 | echo "PASS: i2c_get -y 0 0x52 0 success" | ||
59 | else | ||
60 | echo "FAIL: i2c_get -y 0 0x52 0 fail" | ||
61 | fi | ||
62 | |||
63 | $I2C_SET -y 0 0x52 0 0xaa | ||
64 | if [ $? -eq 0 ]; then | ||
65 | echo "PASS: i2c_set -y 0 0x52 0 0xaa success" | ||
66 | else | ||
67 | echo "FAIL: i2c_set -y 0 0x52 0 0xaa fail" | ||
68 | fi | ||
69 | |||
70 | num=`$I2C_GET -y 0 0x52 0 | grep -c '0xaa'` | ||
71 | if [ $num -eq 1 ]; then | ||
72 | echo "PASS: i2c_get -y 0 0x52 0 success" | ||
73 | else | ||
74 | echo "FAIL: i2c_get -y 0 0x52 0 fail" | ||
75 | fi | ||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9132qds/preempt_rt b/recipes-test/ddt-runner/files/scripts/bsc9132qds/preempt_rt new file mode 100755 index 0000000..111cfa2 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9132qds/preempt_rt | |||
@@ -0,0 +1,33 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | #This script is to test PREEMPT RT on target | ||
4 | # | ||
5 | |||
6 | uname -a | grep "PREEMPT RT" | ||
7 | if [ $? -ne 0 ]; then | ||
8 | echo "FAIL: The kernel include real-time patch" | ||
9 | echo 1 | ||
10 | fi | ||
11 | echo "PASS: The kernel include real-time patch" | ||
12 | |||
13 | ps | grep '\(\[irq/\)' | ||
14 | if [ $? -ne 0 ]; then | ||
15 | echo "FAIL: The IRQ handlers are treated by a patched kernel in kernel thread context." | ||
16 | exit 1 | ||
17 | fi | ||
18 | echo "PASS: The IRQ handlers are treated by a patched kernel in kernel thread context." | ||
19 | |||
20 | cyclictest -t5 -p 80 -i 10000 -l 100 | ||
21 | if [ $? -ne 0 ]; then | ||
22 | echo "FAIL: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops." | ||
23 | exit 1 | ||
24 | fi | ||
25 | echo "PASS: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops." | ||
26 | |||
27 | cyclictest -t5 -p 80 -n -i 10000 -l 100 | ||
28 | if [ $? -ne 0 ]; then | ||
29 | echo "FAIL: Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 micro seconds,. 100 loops." | ||
30 | exit 1 | ||
31 | fi | ||
32 | echo "PASS: Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 micro seconds,. 100 loops." | ||
33 | |||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9132qds/sdhc b/recipes-test/ddt-runner/files/scripts/bsc9132qds/sdhc new file mode 100644 index 0000000..1530c64 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9132qds/sdhc | |||
@@ -0,0 +1,77 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test SDHC card functionality for bsc9132rdb | ||
3 | |||
4 | DEV="mmc0:e624" | ||
5 | |||
6 | if [ -f /sys/bus/mmc/drivers/mmcblk/bind ]; then | ||
7 | echo "PASS: /sys/bus/mmc/drivers/mmcblk/bind found" | ||
8 | else | ||
9 | echo "FAIL: /sys/bus/mmc/drivers/mmcblk/bind not found" | ||
10 | exit 1 | ||
11 | fi | ||
12 | |||
13 | if [ -f /sys/bus/mmc/drivers/mmcblk/unbind ]; then | ||
14 | echo "PASS: /sys/bus/mmc/drivers/mmcblk/unbind found" | ||
15 | else | ||
16 | echo "FAIL: /sys/bus/mmc/drivers/mmcblk/unbind not found" | ||
17 | exit 1 | ||
18 | fi | ||
19 | |||
20 | if [ -f /sys/bus/mmc/drivers/mmc_test/bind ]; then | ||
21 | echo "PASS: /sys/bus/mmc/drivers/mmc_test/bind found" | ||
22 | else | ||
23 | echo "FAIL: /sys/bus/mmc/drivers/mmc_test/bind not found" | ||
24 | exit 1 | ||
25 | fi | ||
26 | |||
27 | if [ -f /sys/bus/mmc/drivers/mmc_test/unbind ]; then | ||
28 | echo "PASS: /sys/bus/mmc/drivers/mmc_test/unbind found" | ||
29 | else | ||
30 | echo "FAIL: /sys/bus/mmc/drivers/mmc_test/unbind not found" | ||
31 | exit 1 | ||
32 | fi | ||
33 | |||
34 | mount -t debugfs none /sys/kernel/debug | ||
35 | if [ $? -eq 0 ]; then | ||
36 | echo "PASS: successfully mount /sys/kernel/debug" | ||
37 | else | ||
38 | echo "FAIL: failed to mount /sys/kernel/debug" | ||
39 | fi | ||
40 | |||
41 | echo $DEV > /sys/bus/mmc/drivers/mmcblk/unbind | ||
42 | if [ $? -eq 0 ]; then | ||
43 | echo "PASS: successfully unbind mmcblk driver" | ||
44 | else | ||
45 | echo "FAIL: failed to unbind mmcblk driver" | ||
46 | fi | ||
47 | |||
48 | echo $DEV > /sys/bus/mmc/drivers/mmc_test/bind | ||
49 | if [ $? -eq 0 ]; then | ||
50 | echo "PASS: successfully bind mmc_test driver" | ||
51 | else | ||
52 | echo "FAIL: failed to bind mmc_test driver" | ||
53 | fi | ||
54 | |||
55 | # echo 0 means test all supported test cases | ||
56 | fail_num=`echo 0 > /sys/kernel/debug/mmc0/mmc0\:e624/test | grep -E -c 'FAILED|ERROR'` | ||
57 | if [ $fail_num -eq 0 ]; then | ||
58 | echo "PASS: all test cases passed" | ||
59 | else | ||
60 | echo "FAIL: some test cases failed" | ||
61 | fi | ||
62 | |||
63 | cat /sys/kernel/debug/mmc0/mmc0\:e624/test | ||
64 | |||
65 | echo $DEV > /sys/bus/mmc/drivers/mmc_test/unbind | ||
66 | if [ $? -eq 0 ]; then | ||
67 | echo "PASS: successfully unbind mmc_test driver" | ||
68 | else | ||
69 | echo "FAIL: failed to unbind mmc_test driver" | ||
70 | fi | ||
71 | |||
72 | echo $DEV > /sys/bus/mmc/drivers/mmcblk/bind | ||
73 | if [ $? -eq 0 ]; then | ||
74 | echo "PASS: successfully bind mmcblk driver" | ||
75 | else | ||
76 | echo "FAIL: failed to bind mmcblk driver" | ||
77 | fi | ||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9132qds/spi b/recipes-test/ddt-runner/files/scripts/bsc9132qds/spi new file mode 100755 index 0000000..3386d6c --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9132qds/spi | |||
@@ -0,0 +1,56 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test spi flash functionality for bsc9131rdb. An spi | ||
3 | # flash M25P80 connect to bsc9131 cpu by spi bus, so the method is to read/write | ||
4 | # spi flash to verify whether the spi bus driver worked or not. | ||
5 | |||
6 | MTD_CHAR_DEVICE="/dev/mtd8" | ||
7 | MTD_BLOCK_DEVICE="/dev/mtdblock8" | ||
8 | |||
9 | FLASH_ERASE=`which flash_erase` | ||
10 | if [ "x$FLASH_ERASE" != "x" ]; then | ||
11 | echo "PASS: flash_erase found" | ||
12 | else | ||
13 | echo "FAIL: flash_erase not found" | ||
14 | exit 1 | ||
15 | fi | ||
16 | |||
17 | if [ ! -e $MTD_CHAR_DEVICE ]; then | ||
18 | echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" | ||
19 | exit 1 | ||
20 | else | ||
21 | echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" | ||
22 | fi | ||
23 | |||
24 | if [ ! -e $MTD_BLOCK_DEVICE ]; then | ||
25 | echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" | ||
26 | exit 1 | ||
27 | else | ||
28 | echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" | ||
29 | fi | ||
30 | |||
31 | $FLASH_ERASE -j $MTD_CHAR_DEVICE 0 0 | ||
32 | if [ $? -ne 0 ]; then | ||
33 | echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" | ||
34 | exit 1 | ||
35 | else | ||
36 | mkdir -p /mnt/spi | ||
37 | mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi | ||
38 | if [ $? -ne 0 ]; then | ||
39 | echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" | ||
40 | exit 1 | ||
41 | else | ||
42 | cp /bin/busybox /mnt/spi | ||
43 | file_num=`ls /mnt/spi |grep -c 'busybox'` | ||
44 | if [ $file_num -eq 1 ]; then | ||
45 | rm /mnt/spi/busybox | ||
46 | umount $MTD_BLOCK_DEVICE | ||
47 | echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" | ||
48 | else | ||
49 | echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" | ||
50 | exit 1 | ||
51 | fi | ||
52 | fi | ||
53 | fi | ||
54 | |||
55 | echo "PASS: spi bus test passed" | ||
56 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/bsc9132qds/watchdog b/recipes-test/ddt-runner/files/scripts/bsc9132qds/watchdog new file mode 100755 index 0000000..2beb8a6 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9132qds/watchdog | |||
@@ -0,0 +1,64 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test watchdog functionality for bsc9132qds. | ||
4 | |||
5 | WATCHDOG=`which watchdog` | ||
6 | if [ "x$WATCHDOG" != "x" ]; then | ||
7 | echo "PASS: watchdog found" | ||
8 | else | ||
9 | echo "FAIL: watchdog not found" | ||
10 | exit 1 | ||
11 | fi | ||
12 | |||
13 | WATCHDOG_CONF=/etc/watchdog.conf | ||
14 | if [ -f $WATCHDOG_CONF ]; then | ||
15 | echo "PASS: watchdog config file found" | ||
16 | sed -i '23,23 s/#//' $WATCHDOG_CONF | ||
17 | else | ||
18 | echo "FAIL: watchdog config file not found" | ||
19 | exit 1 | ||
20 | fi | ||
21 | |||
22 | $WATCHDOG -v /dev/watchdog | ||
23 | watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` | ||
24 | if [ $watchdog_thread -eq 2 ]; then | ||
25 | echo "PASS: Watchdog daemon started successfully" | ||
26 | else | ||
27 | echo "FAIL: Failed to start watchdog daemon" | ||
28 | exit 1 | ||
29 | fi | ||
30 | |||
31 | sleep 5s | ||
32 | |||
33 | killall watchdog | ||
34 | |||
35 | retry=0 | ||
36 | while [ $retry -lt 10 ] | ||
37 | do | ||
38 | watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` | ||
39 | if [ $watchdog_thread -eq 1 ]; then | ||
40 | echo "PASS: Watchdog daemon stopped successfully" | ||
41 | break; | ||
42 | fi | ||
43 | sleep 1s | ||
44 | retry=`expr $retry + 1` | ||
45 | done | ||
46 | |||
47 | if [ $retry -eq 10 ]; then | ||
48 | echo "FAIL: Failed to stop watchdog daemon" | ||
49 | fi | ||
50 | |||
51 | found=0 | ||
52 | while read line | ||
53 | do | ||
54 | result=`echo $line | grep -c 'still alive after 1 interval'` | ||
55 | if [ $result -eq 1 ]; then | ||
56 | echo "PASS: Watchdog is still alive after 1 interval" | ||
57 | found=1 | ||
58 | fi | ||
59 | done < /var/log/messages | ||
60 | |||
61 | if [ $found -eq 0 ]; then | ||
62 | echo "FAIL: Watchdog is not alive after 1 interval" | ||
63 | fi | ||
64 | |||
diff --git a/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/ethernet b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/ethernet new file mode 100755 index 0000000..de1d427 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/ethernet | |||
@@ -0,0 +1,88 @@ | |||
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 | IFCONFIG=`which ifconfig` | ||
9 | |||
10 | $IFCONFIG $ethernet_interface up | ||
11 | $IFCONFIG | grep $ethernet_interface | ||
12 | if [ $? -ne 0 ]; then | ||
13 | echo "FAIL: $ethernet_interface is not up" | ||
14 | exit 1 | ||
15 | else | ||
16 | echo "PASS: $ethernet_interface is up" | ||
17 | fi | ||
18 | |||
19 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
20 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
21 | fi | ||
22 | |||
23 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
24 | if [ $? -ne 0 ]; then | ||
25 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
26 | exit 1 | ||
27 | else | ||
28 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
29 | fi | ||
30 | |||
31 | mindatasize=56 | ||
32 | maxdatasize=650 | ||
33 | stepsize=100 | ||
34 | iteration=1 | ||
35 | datasize=$mindatasize | ||
36 | logfile=`/bin/mktemp` | ||
37 | statistics=`/bin/mktemp` | ||
38 | error=0 | ||
39 | |||
40 | trap cleanup SIGHUP SIGINT SIGTERM | ||
41 | |||
42 | clean_tasks() { | ||
43 | echo "Executing clean up tasks" | ||
44 | rm -f $logfile $statistics | ||
45 | } | ||
46 | |||
47 | cleanup() { | ||
48 | echo "Aborting script execution" | ||
49 | clean_tasks | ||
50 | exit 0 | ||
51 | } | ||
52 | |||
53 | echo "start ping test for $ethernet_interface..." | ||
54 | |||
55 | while [ $datasize -le $maxdatasize ]; do | ||
56 | for i in `seq 1 $iteration`; do | ||
57 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
58 | ping_err=`echo $?` | ||
59 | echo "" && cat $statistics | grep -r "PING" | ||
60 | cat $statistics | grep -r "received" | ||
61 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
62 | packets_received=`cat $statistics | \ | ||
63 | grep -r "received" | awk '{print$4}'` | ||
64 | |||
65 | # Evaluate possible errors on the ping operation | ||
66 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
67 | error=1 | ||
68 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
69 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
70 | fi | ||
71 | done | ||
72 | let datasize=$datasize+$stepsize | ||
73 | done | ||
74 | |||
75 | # Report failures | ||
76 | if [ $error -eq 1 ]; then | ||
77 | echo -e "=================== error report ===================\n" | ||
78 | cat $logfile | ||
79 | echo -e "====================================================\n" | ||
80 | clean_tasks | ||
81 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
82 | exit 1 | ||
83 | else | ||
84 | clean_tasks | ||
85 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
86 | fi | ||
87 | |||
88 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/flash b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/flash new file mode 100755 index 0000000..dffac6b --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/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/imx6qsabrelite/i2c b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/i2c new file mode 100755 index 0000000..3801e9e --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/i2c | |||
@@ -0,0 +1,42 @@ | |||
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 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/pci-express b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/pci-express new file mode 100755 index 0000000..33189f9 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/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/imx6qsabrelite/rtc b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/rtc new file mode 100755 index 0000000..0d38293 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/rtc | |||
@@ -0,0 +1,42 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | RTC_DEVICE="/dev/rtc" | ||
4 | |||
5 | if [ ! -e $RTC_DEVICE ]; then | ||
6 | echo "FAIL: rtc device does not exist" | ||
7 | exit 1 | ||
8 | else | ||
9 | echo "PASS: rtc device exists" | ||
10 | fi | ||
11 | |||
12 | /sbin/hwclock -f $RTC_DEVICE | ||
13 | if [ $? -ne 0 ]; then | ||
14 | echo "FAIL: rtc device open failed" | ||
15 | exit 1 | ||
16 | else | ||
17 | echo "PASS: rtc device open success" | ||
18 | fi | ||
19 | |||
20 | |||
21 | /sbin/hwclock --systohc | ||
22 | if [ $? -ne 0 ]; then | ||
23 | echo "FAIL: sync system clock and hardware clock failed" | ||
24 | exit 1 | ||
25 | else | ||
26 | echo "PASS: sync system clock and hardware clock success" | ||
27 | fi | ||
28 | |||
29 | RTC_TIME=$(/sbin/hwclock -r |awk '{print $4}') | ||
30 | echo $RTC_TIME | ||
31 | SYS_TIME=$(date +%m/%d/%Y-%X |awk '{print $1}' |awk -F- '{print $2}') | ||
32 | echo $SYS_TIME | ||
33 | |||
34 | if [ "$RTC_TIME" = "$SYS_TIME" ] ; then | ||
35 | echo "PASS: system time same with hardware time" | ||
36 | else | ||
37 | echo "FAIL: system time different with hardware time" | ||
38 | exit 1 | ||
39 | fi | ||
40 | |||
41 | echo "PASS: rtc test successful" | ||
42 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/sata b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/sata new file mode 100755 index 0000000..43a4932 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/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/imx6qsabrelite/sdhc b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/sdhc new file mode 100755 index 0000000..b1bdab2 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/sdhc | |||
@@ -0,0 +1,40 @@ | |||
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 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/spi b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/spi new file mode 100755 index 0000000..a601517 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/spi | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | #An spi flash M25P80 connect to b4860qds-64b cpu by spi bus, so the method | ||
4 | #is to read/write spi flash to verify whether the spi bus driver worked | ||
5 | #or not. | ||
6 | |||
7 | MTD_CHAR_DEVICE="/dev/mtd2" | ||
8 | MTD_BLOCK_DEVICE="/dev/mtdblock2" | ||
9 | |||
10 | if [ ! -e $MTD_CHAR_DEVICE ]; then | ||
11 | echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" | ||
12 | exit 1 | ||
13 | else | ||
14 | echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" | ||
15 | fi | ||
16 | |||
17 | if [ ! -e $MTD_BLOCK_DEVICE ]; then | ||
18 | echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" | ||
19 | exit 1 | ||
20 | else | ||
21 | echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" | ||
22 | fi | ||
23 | |||
24 | /usr/sbin/flash_erase -j $MTD_CHAR_DEVICE 0 0 | ||
25 | if [ $? -ne 0 ]; then | ||
26 | echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" | ||
27 | exit 1 | ||
28 | else | ||
29 | mkdir -p /mnt/spi | ||
30 | mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi | ||
31 | if [ $? -ne 0 ]; then | ||
32 | echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" | ||
33 | exit 1 | ||
34 | else | ||
35 | cp /bin/busybox /mnt/spi | ||
36 | ls /mnt/spi |grep busybox | ||
37 | if [ $? -ne 0 ]; then | ||
38 | echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" | ||
39 | exit 1 | ||
40 | else | ||
41 | umount $MTD_BLOCK_DEVICE | ||
42 | echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" | ||
43 | fi | ||
44 | fi | ||
45 | fi | ||
46 | |||
47 | echo "PASS: spi bus test passed" | ||
48 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/usb b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/usb new file mode 100755 index 0000000..017287f --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/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 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/watchdog b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/watchdog new file mode 100755 index 0000000..165bc12 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/watchdog | |||
@@ -0,0 +1,63 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test watchdog functionality for bsc9131rdb. | ||
4 | |||
5 | WATCHDOG=`which watchdog` | ||
6 | if [ "x$WATCHDOG" != "x" ]; then | ||
7 | echo "PASS: watchdog found" | ||
8 | else | ||
9 | echo "FAIL: watchdog not found" | ||
10 | exit 1 | ||
11 | fi | ||
12 | |||
13 | WATCHDOG_CONF=/etc/watchdog.conf | ||
14 | if [ -f $WATCHDOG_CONF ]; then | ||
15 | echo "PASS: watchdog config file found" | ||
16 | sed -i '23,23 s/#//' $WATCHDOG_CONF | ||
17 | else | ||
18 | echo "FAIL: watchdog config file not found" | ||
19 | exit 1 | ||
20 | fi | ||
21 | |||
22 | $WATCHDOG -v /dev/watchdog | ||
23 | watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` | ||
24 | if [ $watchdog_thread -eq 2 ]; then | ||
25 | echo "PASS: Watchdog daemon started successfully" | ||
26 | else | ||
27 | echo "FAIL: Failed to start watchdog daemon" | ||
28 | exit 1 | ||
29 | fi | ||
30 | |||
31 | sleep 5s | ||
32 | |||
33 | killall watchdog | ||
34 | |||
35 | retry=0 | ||
36 | while [ $retry -lt 10 ] | ||
37 | do | ||
38 | watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` | ||
39 | if [ $watchdog_thread -eq 1 ]; then | ||
40 | echo "PASS: Watchdog daemon stopped successfully" | ||
41 | break; | ||
42 | fi | ||
43 | sleep 1s | ||
44 | retry=`expr $retry + 1` | ||
45 | done | ||
46 | |||
47 | if [ $retry -eq 10 ]; then | ||
48 | echo "FAIL: Failed to stop watchdog daemon" | ||
49 | fi | ||
50 | |||
51 | found=0 | ||
52 | while read line | ||
53 | do | ||
54 | result=`echo $line | grep -c 'still alive after 1 interval'` | ||
55 | if [ $result -eq 1 ]; then | ||
56 | echo "PASS: Watchdog is still alive after 1 interval" | ||
57 | found=1 | ||
58 | fi | ||
59 | done < /var/log/messages | ||
60 | |||
61 | if [ $found -eq 0 ]; then | ||
62 | echo "FAIL: Watchdog is not alive after 1 interval" | ||
63 | fi | ||
diff --git a/recipes-test/ddt-runner/files/scripts/keystone-evm/ethernet b/recipes-test/ddt-runner/files/scripts/keystone-evm/ethernet new file mode 100755 index 0000000..10a74fa --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/keystone-evm/ethernet | |||
@@ -0,0 +1,88 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth1" | ||
4 | #sestord02 ip address | ||
5 | ethernet_ping_ipaddr="172.21.3.22" | ||
6 | ethernet_ipaddr=$1 | ||
7 | |||
8 | IFCONFIG=`which ifconfig` | ||
9 | |||
10 | $IFCONFIG $ethernet_interface up | ||
11 | $IFCONFIG | grep $ethernet_interface | ||
12 | if [ $? -ne 0 ]; then | ||
13 | echo "FAIL: $ethernet_interface is not up" | ||
14 | exit 1 | ||
15 | else | ||
16 | echo "PASS: $ethernet_interface is up" | ||
17 | fi | ||
18 | |||
19 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
20 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
21 | fi | ||
22 | |||
23 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
24 | if [ $? -ne 0 ]; then | ||
25 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
26 | exit 1 | ||
27 | else | ||
28 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
29 | fi | ||
30 | |||
31 | mindatasize=56 | ||
32 | maxdatasize=650 | ||
33 | stepsize=100 | ||
34 | iteration=1 | ||
35 | datasize=$mindatasize | ||
36 | logfile=`/bin/mktemp` | ||
37 | statistics=`/bin/mktemp` | ||
38 | error=0 | ||
39 | |||
40 | trap cleanup SIGHUP SIGINT SIGTERM | ||
41 | |||
42 | clean_tasks() { | ||
43 | echo "Executing clean up tasks" | ||
44 | rm -f $logfile $statistics | ||
45 | } | ||
46 | |||
47 | cleanup() { | ||
48 | echo "Aborting script execution" | ||
49 | clean_tasks | ||
50 | exit 0 | ||
51 | } | ||
52 | |||
53 | echo "start ping test for $ethernet_interface..." | ||
54 | |||
55 | while [ $datasize -le $maxdatasize ]; do | ||
56 | for i in `seq 1 $iteration`; do | ||
57 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
58 | ping_err=`echo $?` | ||
59 | echo "" && cat $statistics | grep -r "PING" | ||
60 | cat $statistics | grep -r "received" | ||
61 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
62 | packets_received=`cat $statistics | \ | ||
63 | grep -r "received" | awk '{print$4}'` | ||
64 | |||
65 | # Evaluate possible errors on the ping operation | ||
66 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
67 | error=1 | ||
68 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
69 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
70 | fi | ||
71 | done | ||
72 | let datasize=$datasize+$stepsize | ||
73 | done | ||
74 | |||
75 | # Report failures | ||
76 | if [ $error -eq 1 ]; then | ||
77 | echo -e "=================== error report ===================\n" | ||
78 | cat $logfile | ||
79 | echo -e "====================================================\n" | ||
80 | clean_tasks | ||
81 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
82 | exit 1 | ||
83 | else | ||
84 | clean_tasks | ||
85 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
86 | fi | ||
87 | |||
88 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/keystone-evm/flash b/recipes-test/ddt-runner/files/scripts/keystone-evm/flash new file mode 100755 index 0000000..ed2a619 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/keystone-evm/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 keystone-evm 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/keystone-evm/i2c b/recipes-test/ddt-runner/files/scripts/keystone-evm/i2c new file mode 100755 index 0000000..fd033bc --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/keystone-evm/i2c | |||
@@ -0,0 +1,44 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test i2c bus functionality for keystone-evm 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/keystone-evm/spi b/recipes-test/ddt-runner/files/scripts/keystone-evm/spi new file mode 100755 index 0000000..bcebef9 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/keystone-evm/spi | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | #An spi flash M25P80 connect to keystone-evm cpu by spi bus, so the method | ||
4 | #is to read/write spi flash to verify whether the spi bus driver worked | ||
5 | #or not. | ||
6 | |||
7 | MTD_CHAR_DEVICE="/dev/mtd4" | ||
8 | MTD_BLOCK_DEVICE="/dev/mtdblock4" | ||
9 | |||
10 | if [ ! -e $MTD_CHAR_DEVICE ]; then | ||
11 | echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" | ||
12 | exit 1 | ||
13 | else | ||
14 | echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" | ||
15 | fi | ||
16 | |||
17 | if [ ! -e $MTD_BLOCK_DEVICE ]; then | ||
18 | echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" | ||
19 | exit 1 | ||
20 | else | ||
21 | echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" | ||
22 | fi | ||
23 | |||
24 | /usr/sbin/flash_erase -j $MTD_CHAR_DEVICE 0 0 | ||
25 | if [ $? -ne 0 ]; then | ||
26 | echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" | ||
27 | exit 1 | ||
28 | else | ||
29 | mkdir -p /mnt/spi | ||
30 | mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi | ||
31 | if [ $? -ne 0 ]; then | ||
32 | echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" | ||
33 | exit 1 | ||
34 | else | ||
35 | cp /bin/busybox /mnt/spi | ||
36 | ls /mnt/spi |grep busybox | ||
37 | if [ $? -ne 0 ]; then | ||
38 | echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" | ||
39 | exit 1 | ||
40 | else | ||
41 | umount $MTD_BLOCK_DEVICE | ||
42 | echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" | ||
43 | fi | ||
44 | fi | ||
45 | fi | ||
46 | |||
47 | echo "PASS: spi bus test passed" | ||
48 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p2020rdb/ethernet b/recipes-test/ddt-runner/files/scripts/p2020rdb/ethernet new file mode 100755 index 0000000..5355f10 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2020rdb/ethernet | |||
@@ -0,0 +1,88 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth1" | ||
4 | ethernet_ping_ipaddr="172.21.3.22" | ||
5 | ethernet_ipaddr=$1 | ||
6 | |||
7 | IFCONFIG=`which ifconfig` | ||
8 | |||
9 | $IFCONFIG $ethernet_interface up | ||
10 | $IFCONFIG | grep $ethernet_interface | ||
11 | if [ $? -ne 0 ]; then | ||
12 | echo "FAIL: $ethernet_interface is not up" | ||
13 | exit 1 | ||
14 | else | ||
15 | echo "PASS: $ethernet_interface is up" | ||
16 | fi | ||
17 | |||
18 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
19 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
20 | fi | ||
21 | |||
22 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
23 | if [ $? -ne 0 ]; then | ||
24 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
25 | exit 1 | ||
26 | else | ||
27 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
28 | fi | ||
29 | |||
30 | mindatasize=56 | ||
31 | maxdatasize=650 | ||
32 | stepsize=100 | ||
33 | iteration=1 | ||
34 | datasize=$mindatasize | ||
35 | logfile=`/bin/mktemp` | ||
36 | statistics=`/bin/mktemp` | ||
37 | error=0 | ||
38 | |||
39 | trap cleanup SIGHUP SIGINT SIGTERM | ||
40 | |||
41 | clean_tasks() { | ||
42 | echo "Executing clean up tasks" | ||
43 | rm -f $logfile $statistics | ||
44 | } | ||
45 | |||
46 | cleanup() { | ||
47 | echo "Aborting script execution" | ||
48 | clean_tasks | ||
49 | exit 0 | ||
50 | } | ||
51 | |||
52 | echo "start ping test for $ethernet_interface..." | ||
53 | |||
54 | while [ $datasize -le $maxdatasize ]; do | ||
55 | for i in `seq 1 $iteration`; do | ||
56 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
57 | ping_err=`echo $?` | ||
58 | echo "" && cat $statistics | grep -r "PING" | ||
59 | cat $statistics | grep -r "received" | ||
60 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
61 | packets_received=`cat $statistics | \ | ||
62 | grep -r "received" | awk '{print$4}'` | ||
63 | |||
64 | # Evaluate possible errors on the ping operation | ||
65 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
66 | error=1 | ||
67 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
68 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
69 | fi | ||
70 | done | ||
71 | let datasize=$datasize+$stepsize | ||
72 | done | ||
73 | |||
74 | # Report failures | ||
75 | if [ $error -eq 1 ]; then | ||
76 | echo -e "=================== error report ===================\n" | ||
77 | cat $logfile | ||
78 | echo -e "====================================================\n" | ||
79 | clean_tasks | ||
80 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
81 | exit 1 | ||
82 | else | ||
83 | clean_tasks | ||
84 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
85 | fi | ||
86 | |||
87 | echo "PASS: $ethernet_interface test passed" | ||
88 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p2020rdb/flash b/recipes-test/ddt-runner/files/scripts/p2020rdb/flash new file mode 100755 index 0000000..302e328 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2020rdb/flash | |||
@@ -0,0 +1,20 @@ | |||
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 p2020rdb 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 | fi | ||
12 | |||
13 | for((part=0; part<$part_num-1; part++)); | ||
14 | do | ||
15 | if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then | ||
16 | echo "PASS: show partition $part debug info" | ||
17 | else | ||
18 | echo "FAIL: show partition $part debug info" | ||
19 | fi | ||
20 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p2020rdb/i2c b/recipes-test/ddt-runner/files/scripts/p2020rdb/i2c new file mode 100755 index 0000000..5b312b9 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2020rdb/i2c | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then | ||
4 | echo "PASS: found $I2C_ADAPTERS i2c adapters" | ||
5 | else | ||
6 | echo "FAIL: no i2c adapters found" | ||
7 | exit 1 | ||
8 | fi | ||
9 | |||
10 | if [ -z "$adapters" ]; then | ||
11 | adapters=0 | ||
12 | fi | ||
13 | |||
14 | while [ $adapters -lt $I2C_ADAPTERS ] | ||
15 | do | ||
16 | i2cdetect -y $adapters | ||
17 | if [ $? -ne 0 ]; then | ||
18 | echo "FAIL: detect i2c adapter $adapters failed" | ||
19 | else | ||
20 | echo "PASS: detect i2c adapter $adapters success" | ||
21 | fi | ||
22 | adapters=`expr $adapters + 1` | ||
23 | sleep 1 | ||
24 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p2020rdb/spi b/recipes-test/ddt-runner/files/scripts/p2020rdb/spi new file mode 100755 index 0000000..fc673ad --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2020rdb/spi | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | #An spi flash M25P80 connect to p2020 cpu by spi bus, so the method | ||
4 | #is to read/write spi flash to verify whether the spi bus driver worked | ||
5 | #or not. | ||
6 | |||
7 | MTD_CHAR_DEVICE="/dev/mtd4" | ||
8 | MTD_BLOCK_DEVICE="/dev/mtdblock4" | ||
9 | |||
10 | if [ ! -e $MTD_CHAR_DEVICE ]; then | ||
11 | echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" | ||
12 | exit 1 | ||
13 | else | ||
14 | echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" | ||
15 | fi | ||
16 | |||
17 | if [ ! -e $MTD_BLOCK_DEVICE ]; then | ||
18 | echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" | ||
19 | exit 1 | ||
20 | else | ||
21 | echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" | ||
22 | fi | ||
23 | |||
24 | /usr/sbin/flash_erase -j $MTD_CHAR_DEVICE 0 0 | ||
25 | if [ $? -ne 0 ]; then | ||
26 | echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" | ||
27 | exit 1 | ||
28 | else | ||
29 | mkdir -p /mnt/spi | ||
30 | mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi | ||
31 | if [ $? -ne 0 ]; then | ||
32 | echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" | ||
33 | exit 1 | ||
34 | else | ||
35 | cp /bin/busybox /mnt/spi | ||
36 | ls /mnt/spi |grep busybox | ||
37 | if [ $? -ne 0 ]; then | ||
38 | echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" | ||
39 | exit 1 | ||
40 | else | ||
41 | umount $MTD_BLOCK_DEVICE | ||
42 | echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" | ||
43 | fi | ||
44 | fi | ||
45 | fi | ||
46 | |||
47 | echo "PASS: spi bus test passed" | ||
48 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p2020rdb/usb b/recipes-test/ddt-runner/files/scripts/p2020rdb/usb new file mode 100755 index 0000000..970e913 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2020rdb/usb | |||
@@ -0,0 +1,100 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test usb functionality for p4080ds. | ||
4 | # | ||
5 | |||
6 | result=0 | ||
7 | devpath="" | ||
8 | usbinfo="" | ||
9 | |||
10 | usbutils_is_installed=`which lsusb` | ||
11 | if [ -z $usbutils_is_installed ]; then | ||
12 | echo "FAIL: Cannot find lsusb" | ||
13 | exit 1 | ||
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 "$usbdev_num USB device(s) connected" | ||
22 | fi | ||
23 | |||
24 | sd=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'` | ||
25 | if [ -z "$sd" ]; then | ||
26 | echo "FAIL: find sd device" | ||
27 | exit 1 | ||
28 | else | ||
29 | echo "PASS: find sd device" | ||
30 | fi | ||
31 | |||
32 | HDPARM=`which hdparm` | ||
33 | if [ -z $HDPARM ]; then | ||
34 | result=$? | ||
35 | echo "FAIL: find hdparm" | ||
36 | fi | ||
37 | echo "PASS: find hdparm" | ||
38 | |||
39 | for s in $sd | ||
40 | do | ||
41 | devpath=`echo "$s" | awk -F "," '{print "/sys/dev/block/" $1 ":" $2}'` | ||
42 | usbinfo=`ls -l $devpath | grep usb` | ||
43 | |||
44 | if [ -z "$usbinfo" ] ; then | ||
45 | continue | ||
46 | fi | ||
47 | |||
48 | s=`echo "$s" | awk -F "," '{print $3}'` | ||
49 | |||
50 | echo "Testing $s" | ||
51 | $HDPARM -I $s | ||
52 | if [ $? -ne 0 ]; then | ||
53 | result=$? | ||
54 | echo "FAIL: $HDPARM -I $s Detailed/current information directly from $s" | ||
55 | else | ||
56 | echo "PASS: $HDPARM -I $s Detailed/current information directly from $s" | ||
57 | fi | ||
58 | |||
59 | $HDPARM -tT $s | ||
60 | if [ $? -ne 0 ]; then | ||
61 | result=$? | ||
62 | echo "FAIL: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
63 | else | ||
64 | echo "PASS: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
65 | fi | ||
66 | |||
67 | mkdir -p /mnt/usb_tmp | ||
68 | for partition in `ls "$s"[1-9]` | ||
69 | do | ||
70 | echo "Testing $partition" | ||
71 | |||
72 | mount "$partition" /mnt/usb_tmp | ||
73 | if [ $? -ne 0 ]; then | ||
74 | result=$? | ||
75 | echo "FAIL: mount $s" | ||
76 | else | ||
77 | echo "PASS: mount $s" | ||
78 | dd if=/dev/urandom of=/mnt/usb_tmp/writefile bs=1M count=50 | ||
79 | if [ $? -ne 0 ]; then | ||
80 | result=$? | ||
81 | echo "FAIL: write test on $s" | ||
82 | else | ||
83 | echo "PASS: write test on $s" | ||
84 | rm -f /mnt/usb_tmp/writefile | ||
85 | fi | ||
86 | dd if=$s of=/mnt/usb_tmp/readfile bs=1M count=10 | ||
87 | if [ $? -ne 0 ]; then | ||
88 | result=$? | ||
89 | echo "FAIL: read test on $s" | ||
90 | else | ||
91 | echo "PASS: read test on $s" | ||
92 | rm -f /mnt/usb_tmp/readfile | ||
93 | fi | ||
94 | umount /mnt/usb_tmp | ||
95 | fi | ||
96 | done | ||
97 | |||
98 | rm -fr /mnt/usb_tmp | ||
99 | done | ||
100 | exit $result | ||
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..10a74fa --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/ethernet | |||
@@ -0,0 +1,88 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth1" | ||
4 | #sestord02 ip address | ||
5 | ethernet_ping_ipaddr="172.21.3.22" | ||
6 | ethernet_ipaddr=$1 | ||
7 | |||
8 | IFCONFIG=`which ifconfig` | ||
9 | |||
10 | $IFCONFIG $ethernet_interface up | ||
11 | $IFCONFIG | grep $ethernet_interface | ||
12 | if [ $? -ne 0 ]; then | ||
13 | echo "FAIL: $ethernet_interface is not up" | ||
14 | exit 1 | ||
15 | else | ||
16 | echo "PASS: $ethernet_interface is up" | ||
17 | fi | ||
18 | |||
19 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
20 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
21 | fi | ||
22 | |||
23 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
24 | if [ $? -ne 0 ]; then | ||
25 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
26 | exit 1 | ||
27 | else | ||
28 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
29 | fi | ||
30 | |||
31 | mindatasize=56 | ||
32 | maxdatasize=650 | ||
33 | stepsize=100 | ||
34 | iteration=1 | ||
35 | datasize=$mindatasize | ||
36 | logfile=`/bin/mktemp` | ||
37 | statistics=`/bin/mktemp` | ||
38 | error=0 | ||
39 | |||
40 | trap cleanup SIGHUP SIGINT SIGTERM | ||
41 | |||
42 | clean_tasks() { | ||
43 | echo "Executing clean up tasks" | ||
44 | rm -f $logfile $statistics | ||
45 | } | ||
46 | |||
47 | cleanup() { | ||
48 | echo "Aborting script execution" | ||
49 | clean_tasks | ||
50 | exit 0 | ||
51 | } | ||
52 | |||
53 | echo "start ping test for $ethernet_interface..." | ||
54 | |||
55 | while [ $datasize -le $maxdatasize ]; do | ||
56 | for i in `seq 1 $iteration`; do | ||
57 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
58 | ping_err=`echo $?` | ||
59 | echo "" && cat $statistics | grep -r "PING" | ||
60 | cat $statistics | grep -r "received" | ||
61 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
62 | packets_received=`cat $statistics | \ | ||
63 | grep -r "received" | awk '{print$4}'` | ||
64 | |||
65 | # Evaluate possible errors on the ping operation | ||
66 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
67 | error=1 | ||
68 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
69 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
70 | fi | ||
71 | done | ||
72 | let datasize=$datasize+$stepsize | ||
73 | done | ||
74 | |||
75 | # Report failures | ||
76 | if [ $error -eq 1 ]; then | ||
77 | echo -e "=================== error report ===================\n" | ||
78 | cat $logfile | ||
79 | echo -e "====================================================\n" | ||
80 | clean_tasks | ||
81 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
82 | exit 1 | ||
83 | else | ||
84 | clean_tasks | ||
85 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
86 | fi | ||
87 | |||
88 | exit 0 | ||
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/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 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p4080ds/ethernet b/recipes-test/ddt-runner/files/scripts/p4080ds/ethernet new file mode 100755 index 0000000..5355f10 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p4080ds/ethernet | |||
@@ -0,0 +1,88 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth1" | ||
4 | ethernet_ping_ipaddr="172.21.3.22" | ||
5 | ethernet_ipaddr=$1 | ||
6 | |||
7 | IFCONFIG=`which ifconfig` | ||
8 | |||
9 | $IFCONFIG $ethernet_interface up | ||
10 | $IFCONFIG | grep $ethernet_interface | ||
11 | if [ $? -ne 0 ]; then | ||
12 | echo "FAIL: $ethernet_interface is not up" | ||
13 | exit 1 | ||
14 | else | ||
15 | echo "PASS: $ethernet_interface is up" | ||
16 | fi | ||
17 | |||
18 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
19 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
20 | fi | ||
21 | |||
22 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
23 | if [ $? -ne 0 ]; then | ||
24 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
25 | exit 1 | ||
26 | else | ||
27 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
28 | fi | ||
29 | |||
30 | mindatasize=56 | ||
31 | maxdatasize=650 | ||
32 | stepsize=100 | ||
33 | iteration=1 | ||
34 | datasize=$mindatasize | ||
35 | logfile=`/bin/mktemp` | ||
36 | statistics=`/bin/mktemp` | ||
37 | error=0 | ||
38 | |||
39 | trap cleanup SIGHUP SIGINT SIGTERM | ||
40 | |||
41 | clean_tasks() { | ||
42 | echo "Executing clean up tasks" | ||
43 | rm -f $logfile $statistics | ||
44 | } | ||
45 | |||
46 | cleanup() { | ||
47 | echo "Aborting script execution" | ||
48 | clean_tasks | ||
49 | exit 0 | ||
50 | } | ||
51 | |||
52 | echo "start ping test for $ethernet_interface..." | ||
53 | |||
54 | while [ $datasize -le $maxdatasize ]; do | ||
55 | for i in `seq 1 $iteration`; do | ||
56 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
57 | ping_err=`echo $?` | ||
58 | echo "" && cat $statistics | grep -r "PING" | ||
59 | cat $statistics | grep -r "received" | ||
60 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
61 | packets_received=`cat $statistics | \ | ||
62 | grep -r "received" | awk '{print$4}'` | ||
63 | |||
64 | # Evaluate possible errors on the ping operation | ||
65 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
66 | error=1 | ||
67 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
68 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
69 | fi | ||
70 | done | ||
71 | let datasize=$datasize+$stepsize | ||
72 | done | ||
73 | |||
74 | # Report failures | ||
75 | if [ $error -eq 1 ]; then | ||
76 | echo -e "=================== error report ===================\n" | ||
77 | cat $logfile | ||
78 | echo -e "====================================================\n" | ||
79 | clean_tasks | ||
80 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
81 | exit 1 | ||
82 | else | ||
83 | clean_tasks | ||
84 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
85 | fi | ||
86 | |||
87 | echo "PASS: $ethernet_interface test passed" | ||
88 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p4080ds/flash b/recipes-test/ddt-runner/files/scripts/p4080ds/flash new file mode 100755 index 0000000..19f95aa --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p4080ds/flash | |||
@@ -0,0 +1,20 @@ | |||
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 p4080ds 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 | fi | ||
12 | |||
13 | for((part=0; part<$part_num-1; part++)); | ||
14 | do | ||
15 | if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then | ||
16 | echo "PASS: show partition $part debug info" | ||
17 | else | ||
18 | echo "FAIL: show partition $part debug info" | ||
19 | fi | ||
20 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p4080ds/i2c b/recipes-test/ddt-runner/files/scripts/p4080ds/i2c new file mode 100755 index 0000000..5b312b9 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p4080ds/i2c | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then | ||
4 | echo "PASS: found $I2C_ADAPTERS i2c adapters" | ||
5 | else | ||
6 | echo "FAIL: no i2c adapters found" | ||
7 | exit 1 | ||
8 | fi | ||
9 | |||
10 | if [ -z "$adapters" ]; then | ||
11 | adapters=0 | ||
12 | fi | ||
13 | |||
14 | while [ $adapters -lt $I2C_ADAPTERS ] | ||
15 | do | ||
16 | i2cdetect -y $adapters | ||
17 | if [ $? -ne 0 ]; then | ||
18 | echo "FAIL: detect i2c adapter $adapters failed" | ||
19 | else | ||
20 | echo "PASS: detect i2c adapter $adapters success" | ||
21 | fi | ||
22 | adapters=`expr $adapters + 1` | ||
23 | sleep 1 | ||
24 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p4080ds/rtc b/recipes-test/ddt-runner/files/scripts/p4080ds/rtc new file mode 100755 index 0000000..0d38293 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p4080ds/rtc | |||
@@ -0,0 +1,42 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | RTC_DEVICE="/dev/rtc" | ||
4 | |||
5 | if [ ! -e $RTC_DEVICE ]; then | ||
6 | echo "FAIL: rtc device does not exist" | ||
7 | exit 1 | ||
8 | else | ||
9 | echo "PASS: rtc device exists" | ||
10 | fi | ||
11 | |||
12 | /sbin/hwclock -f $RTC_DEVICE | ||
13 | if [ $? -ne 0 ]; then | ||
14 | echo "FAIL: rtc device open failed" | ||
15 | exit 1 | ||
16 | else | ||
17 | echo "PASS: rtc device open success" | ||
18 | fi | ||
19 | |||
20 | |||
21 | /sbin/hwclock --systohc | ||
22 | if [ $? -ne 0 ]; then | ||
23 | echo "FAIL: sync system clock and hardware clock failed" | ||
24 | exit 1 | ||
25 | else | ||
26 | echo "PASS: sync system clock and hardware clock success" | ||
27 | fi | ||
28 | |||
29 | RTC_TIME=$(/sbin/hwclock -r |awk '{print $4}') | ||
30 | echo $RTC_TIME | ||
31 | SYS_TIME=$(date +%m/%d/%Y-%X |awk '{print $1}' |awk -F- '{print $2}') | ||
32 | echo $SYS_TIME | ||
33 | |||
34 | if [ "$RTC_TIME" = "$SYS_TIME" ] ; then | ||
35 | echo "PASS: system time same with hardware time" | ||
36 | else | ||
37 | echo "FAIL: system time different with hardware time" | ||
38 | exit 1 | ||
39 | fi | ||
40 | |||
41 | echo "PASS: rtc test successful" | ||
42 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p4080ds/sdhc b/recipes-test/ddt-runner/files/scripts/p4080ds/sdhc new file mode 100755 index 0000000..31a7c2f --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p4080ds/sdhc | |||
@@ -0,0 +1,65 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test sdhc functionality for p4080ds. | ||
3 | # The content of SD will be lost by running this test case. | ||
4 | |||
5 | SDHC_DEVICE="/dev/mmcblk0" | ||
6 | SDHC_DEVICE_PART="/dev/mmcblk0p1" | ||
7 | SFDISK=`which sfdisk` | ||
8 | |||
9 | if [ -e $SDHC_DEVICE ]; then | ||
10 | echo "PASS: $SDHC_DEVICE device exists" | ||
11 | else | ||
12 | echo "FAIL: $SDHC_DEVICE does not exist" | ||
13 | exit 1 | ||
14 | fi | ||
15 | |||
16 | if [ -e $SDHC_DEVICE_PART ]; then | ||
17 | echo "PASS: $SDHC_DEVICE_PART device exists" | ||
18 | elif [ ! -z $SFDISK ]; then | ||
19 | |||
20 | echo "Try to create a partition" | ||
21 | |||
22 | $SFDISK $SDHC_DEVICE << EOF | ||
23 | ,,L | ||
24 | EOF | ||
25 | |||
26 | if [ -e $SDHC_DEVICE_PART ]; then | ||
27 | echo "PASS: $SDHC_DEVICE_PART device exists" | ||
28 | else | ||
29 | echo "FAIL: $SDHC_DEVICE_PART does not exist" | ||
30 | exit 1 | ||
31 | fi | ||
32 | |||
33 | else | ||
34 | echo "FAIL: $SDHC_DEVICE_PART does not exist" | ||
35 | exit 1 | ||
36 | fi | ||
37 | |||
38 | mount |grep mmcblk0p1 | ||
39 | if [ $? -eq 0 ]; then | ||
40 | umount $SDHC_DEVICE_PART | ||
41 | fi | ||
42 | |||
43 | /sbin/mkfs.ext2 $SDHC_DEVICE_PART | ||
44 | if [ $? -ne 0 ]; then | ||
45 | echo "FAIL: format $SDHC_DEVICE_PART fail" | ||
46 | exit 1 | ||
47 | else | ||
48 | mkdir -p /mnt/sdhc | ||
49 | mount $SDHC_DEVICE_PART /mnt/sdhc | ||
50 | if [ $? -ne 0 ]; then | ||
51 | echo "FAIL: mount $SDHC_DEVICE_PART fail" | ||
52 | exit 1 | ||
53 | else | ||
54 | cp /bin/busybox /mnt/sdhc | ||
55 | ls /mnt/sdhc |grep busybox | ||
56 | if [ $? -ne 0 ]; then | ||
57 | echo "FAIL: read or write $SDHC_DEVICE_PART fail" | ||
58 | exit 1 | ||
59 | else | ||
60 | umount $SDHC_DEVICE_PART | ||
61 | echo "PASS: read or write $SDHC_DEVICE_PART success" | ||
62 | fi | ||
63 | fi | ||
64 | fi | ||
65 | |||
diff --git a/recipes-test/ddt-runner/files/scripts/p4080ds/spi b/recipes-test/ddt-runner/files/scripts/p4080ds/spi new file mode 100755 index 0000000..b4df851 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p4080ds/spi | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | #An spi flash M25P80 connect to p4080 cpu by spi bus, so the method | ||
4 | #is to read/write spi flash to verify whether the spi bus driver worked | ||
5 | #or not. | ||
6 | |||
7 | MTD_CHAR_DEVICE="/dev/mtd4" | ||
8 | MTD_BLOCK_DEVICE="/dev/mtdblock4" | ||
9 | |||
10 | if [ ! -e $MTD_CHAR_DEVICE ]; then | ||
11 | echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" | ||
12 | exit 1 | ||
13 | else | ||
14 | echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" | ||
15 | fi | ||
16 | |||
17 | if [ ! -e $MTD_BLOCK_DEVICE ]; then | ||
18 | echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" | ||
19 | exit 1 | ||
20 | else | ||
21 | echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" | ||
22 | fi | ||
23 | |||
24 | /usr/sbin/flash_erase -j $MTD_CHAR_DEVICE 0 0 | ||
25 | if [ $? -ne 0 ]; then | ||
26 | echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" | ||
27 | exit 1 | ||
28 | else | ||
29 | mkdir -p /mnt/spi | ||
30 | mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi | ||
31 | if [ $? -ne 0 ]; then | ||
32 | echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" | ||
33 | exit 1 | ||
34 | else | ||
35 | cp /bin/busybox /mnt/spi | ||
36 | ls /mnt/spi |grep busybox | ||
37 | if [ $? -ne 0 ]; then | ||
38 | echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" | ||
39 | exit 1 | ||
40 | else | ||
41 | umount $MTD_BLOCK_DEVICE | ||
42 | echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" | ||
43 | fi | ||
44 | fi | ||
45 | fi | ||
46 | |||
47 | echo "PASS: spi bus test passed" | ||
48 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/p4080ds/usb b/recipes-test/ddt-runner/files/scripts/p4080ds/usb new file mode 100755 index 0000000..970e913 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p4080ds/usb | |||
@@ -0,0 +1,100 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test usb functionality for p4080ds. | ||
4 | # | ||
5 | |||
6 | result=0 | ||
7 | devpath="" | ||
8 | usbinfo="" | ||
9 | |||
10 | usbutils_is_installed=`which lsusb` | ||
11 | if [ -z $usbutils_is_installed ]; then | ||
12 | echo "FAIL: Cannot find lsusb" | ||
13 | exit 1 | ||
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 "$usbdev_num USB device(s) connected" | ||
22 | fi | ||
23 | |||
24 | sd=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'` | ||
25 | if [ -z "$sd" ]; then | ||
26 | echo "FAIL: find sd device" | ||
27 | exit 1 | ||
28 | else | ||
29 | echo "PASS: find sd device" | ||
30 | fi | ||
31 | |||
32 | HDPARM=`which hdparm` | ||
33 | if [ -z $HDPARM ]; then | ||
34 | result=$? | ||
35 | echo "FAIL: find hdparm" | ||
36 | fi | ||
37 | echo "PASS: find hdparm" | ||
38 | |||
39 | for s in $sd | ||
40 | do | ||
41 | devpath=`echo "$s" | awk -F "," '{print "/sys/dev/block/" $1 ":" $2}'` | ||
42 | usbinfo=`ls -l $devpath | grep usb` | ||
43 | |||
44 | if [ -z "$usbinfo" ] ; then | ||
45 | continue | ||
46 | fi | ||
47 | |||
48 | s=`echo "$s" | awk -F "," '{print $3}'` | ||
49 | |||
50 | echo "Testing $s" | ||
51 | $HDPARM -I $s | ||
52 | if [ $? -ne 0 ]; then | ||
53 | result=$? | ||
54 | echo "FAIL: $HDPARM -I $s Detailed/current information directly from $s" | ||
55 | else | ||
56 | echo "PASS: $HDPARM -I $s Detailed/current information directly from $s" | ||
57 | fi | ||
58 | |||
59 | $HDPARM -tT $s | ||
60 | if [ $? -ne 0 ]; then | ||
61 | result=$? | ||
62 | echo "FAIL: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
63 | else | ||
64 | echo "PASS: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
65 | fi | ||
66 | |||
67 | mkdir -p /mnt/usb_tmp | ||
68 | for partition in `ls "$s"[1-9]` | ||
69 | do | ||
70 | echo "Testing $partition" | ||
71 | |||
72 | mount "$partition" /mnt/usb_tmp | ||
73 | if [ $? -ne 0 ]; then | ||
74 | result=$? | ||
75 | echo "FAIL: mount $s" | ||
76 | else | ||
77 | echo "PASS: mount $s" | ||
78 | dd if=/dev/urandom of=/mnt/usb_tmp/writefile bs=1M count=50 | ||
79 | if [ $? -ne 0 ]; then | ||
80 | result=$? | ||
81 | echo "FAIL: write test on $s" | ||
82 | else | ||
83 | echo "PASS: write test on $s" | ||
84 | rm -f /mnt/usb_tmp/writefile | ||
85 | fi | ||
86 | dd if=$s of=/mnt/usb_tmp/readfile bs=1M count=10 | ||
87 | if [ $? -ne 0 ]; then | ||
88 | result=$? | ||
89 | echo "FAIL: read test on $s" | ||
90 | else | ||
91 | echo "PASS: read test on $s" | ||
92 | rm -f /mnt/usb_tmp/readfile | ||
93 | fi | ||
94 | umount /mnt/usb_tmp | ||
95 | fi | ||
96 | done | ||
97 | |||
98 | rm -fr /mnt/usb_tmp | ||
99 | done | ||
100 | exit $result | ||
diff --git a/recipes-test/ddt-runner/files/scripts/pandaboard/ethernet b/recipes-test/ddt-runner/files/scripts/pandaboard/ethernet new file mode 100755 index 0000000..5355f10 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/pandaboard/ethernet | |||
@@ -0,0 +1,88 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth1" | ||
4 | ethernet_ping_ipaddr="172.21.3.22" | ||
5 | ethernet_ipaddr=$1 | ||
6 | |||
7 | IFCONFIG=`which ifconfig` | ||
8 | |||
9 | $IFCONFIG $ethernet_interface up | ||
10 | $IFCONFIG | grep $ethernet_interface | ||
11 | if [ $? -ne 0 ]; then | ||
12 | echo "FAIL: $ethernet_interface is not up" | ||
13 | exit 1 | ||
14 | else | ||
15 | echo "PASS: $ethernet_interface is up" | ||
16 | fi | ||
17 | |||
18 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
19 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
20 | fi | ||
21 | |||
22 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
23 | if [ $? -ne 0 ]; then | ||
24 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
25 | exit 1 | ||
26 | else | ||
27 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
28 | fi | ||
29 | |||
30 | mindatasize=56 | ||
31 | maxdatasize=650 | ||
32 | stepsize=100 | ||
33 | iteration=1 | ||
34 | datasize=$mindatasize | ||
35 | logfile=`/bin/mktemp` | ||
36 | statistics=`/bin/mktemp` | ||
37 | error=0 | ||
38 | |||
39 | trap cleanup SIGHUP SIGINT SIGTERM | ||
40 | |||
41 | clean_tasks() { | ||
42 | echo "Executing clean up tasks" | ||
43 | rm -f $logfile $statistics | ||
44 | } | ||
45 | |||
46 | cleanup() { | ||
47 | echo "Aborting script execution" | ||
48 | clean_tasks | ||
49 | exit 0 | ||
50 | } | ||
51 | |||
52 | echo "start ping test for $ethernet_interface..." | ||
53 | |||
54 | while [ $datasize -le $maxdatasize ]; do | ||
55 | for i in `seq 1 $iteration`; do | ||
56 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
57 | ping_err=`echo $?` | ||
58 | echo "" && cat $statistics | grep -r "PING" | ||
59 | cat $statistics | grep -r "received" | ||
60 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
61 | packets_received=`cat $statistics | \ | ||
62 | grep -r "received" | awk '{print$4}'` | ||
63 | |||
64 | # Evaluate possible errors on the ping operation | ||
65 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
66 | error=1 | ||
67 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
68 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
69 | fi | ||
70 | done | ||
71 | let datasize=$datasize+$stepsize | ||
72 | done | ||
73 | |||
74 | # Report failures | ||
75 | if [ $error -eq 1 ]; then | ||
76 | echo -e "=================== error report ===================\n" | ||
77 | cat $logfile | ||
78 | echo -e "====================================================\n" | ||
79 | clean_tasks | ||
80 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
81 | exit 1 | ||
82 | else | ||
83 | clean_tasks | ||
84 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
85 | fi | ||
86 | |||
87 | echo "PASS: $ethernet_interface test passed" | ||
88 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/pandaboard/i2c b/recipes-test/ddt-runner/files/scripts/pandaboard/i2c new file mode 100755 index 0000000..5b312b9 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/pandaboard/i2c | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then | ||
4 | echo "PASS: found $I2C_ADAPTERS i2c adapters" | ||
5 | else | ||
6 | echo "FAIL: no i2c adapters found" | ||
7 | exit 1 | ||
8 | fi | ||
9 | |||
10 | if [ -z "$adapters" ]; then | ||
11 | adapters=0 | ||
12 | fi | ||
13 | |||
14 | while [ $adapters -lt $I2C_ADAPTERS ] | ||
15 | do | ||
16 | i2cdetect -y $adapters | ||
17 | if [ $? -ne 0 ]; then | ||
18 | echo "FAIL: detect i2c adapter $adapters failed" | ||
19 | else | ||
20 | echo "PASS: detect i2c adapter $adapters success" | ||
21 | fi | ||
22 | adapters=`expr $adapters + 1` | ||
23 | sleep 1 | ||
24 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/pandaboard/rtc b/recipes-test/ddt-runner/files/scripts/pandaboard/rtc new file mode 100755 index 0000000..0d38293 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/pandaboard/rtc | |||
@@ -0,0 +1,42 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | RTC_DEVICE="/dev/rtc" | ||
4 | |||
5 | if [ ! -e $RTC_DEVICE ]; then | ||
6 | echo "FAIL: rtc device does not exist" | ||
7 | exit 1 | ||
8 | else | ||
9 | echo "PASS: rtc device exists" | ||
10 | fi | ||
11 | |||
12 | /sbin/hwclock -f $RTC_DEVICE | ||
13 | if [ $? -ne 0 ]; then | ||
14 | echo "FAIL: rtc device open failed" | ||
15 | exit 1 | ||
16 | else | ||
17 | echo "PASS: rtc device open success" | ||
18 | fi | ||
19 | |||
20 | |||
21 | /sbin/hwclock --systohc | ||
22 | if [ $? -ne 0 ]; then | ||
23 | echo "FAIL: sync system clock and hardware clock failed" | ||
24 | exit 1 | ||
25 | else | ||
26 | echo "PASS: sync system clock and hardware clock success" | ||
27 | fi | ||
28 | |||
29 | RTC_TIME=$(/sbin/hwclock -r |awk '{print $4}') | ||
30 | echo $RTC_TIME | ||
31 | SYS_TIME=$(date +%m/%d/%Y-%X |awk '{print $1}' |awk -F- '{print $2}') | ||
32 | echo $SYS_TIME | ||
33 | |||
34 | if [ "$RTC_TIME" = "$SYS_TIME" ] ; then | ||
35 | echo "PASS: system time same with hardware time" | ||
36 | else | ||
37 | echo "FAIL: system time different with hardware time" | ||
38 | exit 1 | ||
39 | fi | ||
40 | |||
41 | echo "PASS: rtc test successful" | ||
42 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/pandaboard/sdhc b/recipes-test/ddt-runner/files/scripts/pandaboard/sdhc new file mode 100755 index 0000000..e341ebc --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/pandaboard/sdhc | |||
@@ -0,0 +1,65 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test sdhc functionality for pandaboard. | ||
3 | # The content of SD will be lost by running this test case. | ||
4 | |||
5 | SDHC_DEVICE="/dev/mmcblk0" | ||
6 | SDHC_DEVICE_PART="/dev/mmcblk0p1" | ||
7 | SFDISK=`which sfdisk` | ||
8 | |||
9 | if [ -e $SDHC_DEVICE ]; then | ||
10 | echo "PASS: $SDHC_DEVICE device exists" | ||
11 | else | ||
12 | echo "FAIL: $SDHC_DEVICE does not exist" | ||
13 | exit 1 | ||
14 | fi | ||
15 | |||
16 | if [ -e $SDHC_DEVICE_PART ]; then | ||
17 | echo "PASS: $SDHC_DEVICE_PART device exists" | ||
18 | elif [ ! -z $SFDISK ]; then | ||
19 | |||
20 | echo "Try to create a partition" | ||
21 | |||
22 | $SFDISK $SDHC_DEVICE << EOF | ||
23 | ,,L | ||
24 | EOF | ||
25 | |||
26 | if [ -e $SDHC_DEVICE_PART ]; then | ||
27 | echo "PASS: $SDHC_DEVICE_PART device exists" | ||
28 | else | ||
29 | echo "FAIL: $SDHC_DEVICE_PART does not exist" | ||
30 | exit 1 | ||
31 | fi | ||
32 | |||
33 | else | ||
34 | echo "FAIL: $SDHC_DEVICE_PART does not exist" | ||
35 | exit 1 | ||
36 | fi | ||
37 | |||
38 | mount |grep mmcblk0p1 | ||
39 | if [ $? -eq 0 ]; then | ||
40 | umount $SDHC_DEVICE_PART | ||
41 | fi | ||
42 | |||
43 | /sbin/mkfs.ext2 $SDHC_DEVICE_PART | ||
44 | if [ $? -ne 0 ]; then | ||
45 | echo "FAIL: format $SDHC_DEVICE_PART fail" | ||
46 | exit 1 | ||
47 | else | ||
48 | mkdir -p /mnt/sdhc | ||
49 | mount $SDHC_DEVICE_PART /mnt/sdhc | ||
50 | if [ $? -ne 0 ]; then | ||
51 | echo "FAIL: mount $SDHC_DEVICE_PART fail" | ||
52 | exit 1 | ||
53 | else | ||
54 | cp /bin/busybox /mnt/sdhc | ||
55 | ls /mnt/sdhc |grep busybox | ||
56 | if [ $? -ne 0 ]; then | ||
57 | echo "FAIL: read or write $SDHC_DEVICE_PART fail" | ||
58 | exit 1 | ||
59 | else | ||
60 | umount $SDHC_DEVICE_PART | ||
61 | echo "PASS: read or write $SDHC_DEVICE_PART success" | ||
62 | fi | ||
63 | fi | ||
64 | fi | ||
65 | |||
diff --git a/recipes-test/ddt-runner/files/scripts/pandaboard/usb b/recipes-test/ddt-runner/files/scripts/pandaboard/usb new file mode 100755 index 0000000..15c417a --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/pandaboard/usb | |||
@@ -0,0 +1,100 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test usb functionality for romley-ivb. | ||
4 | # | ||
5 | |||
6 | result=0 | ||
7 | devpath="" | ||
8 | usbinfo="" | ||
9 | |||
10 | usbutils_is_installed=`which lsusb` | ||
11 | if [ -z $usbutils_is_installed ]; then | ||
12 | echo "FAIL: Cannot find lsusb" | ||
13 | exit 1 | ||
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 "$usbdev_num USB device(s) connected" | ||
22 | fi | ||
23 | |||
24 | sd=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'` | ||
25 | if [ -z "$sd" ]; then | ||
26 | echo "FAIL: find sd device" | ||
27 | exit 1 | ||
28 | else | ||
29 | echo "PASS: find sd device" | ||
30 | fi | ||
31 | |||
32 | HDPARM=`which hdparm` | ||
33 | if [ -z $HDPARM ]; then | ||
34 | result=$? | ||
35 | echo "FAIL: find hdparm" | ||
36 | fi | ||
37 | echo "PASS: find hdparm" | ||
38 | |||
39 | for s in $sd | ||
40 | do | ||
41 | devpath=`echo "$s" | awk -F "," '{print "/sys/dev/block/" $1 ":" $2}'` | ||
42 | usbinfo=`ls -l $devpath | grep usb` | ||
43 | |||
44 | if [ -z "$usbinfo" ] ; then | ||
45 | continue | ||
46 | fi | ||
47 | |||
48 | s=`echo "$s" | awk -F "," '{print $3}'` | ||
49 | |||
50 | echo "Testing $s" | ||
51 | $HDPARM -I $s | ||
52 | if [ $? -ne 0 ]; then | ||
53 | result=$? | ||
54 | echo "FAIL: $HDPARM -I $s Detailed/current information directly from $s" | ||
55 | else | ||
56 | echo "PASS: $HDPARM -I $s Detailed/current information directly from $s" | ||
57 | fi | ||
58 | |||
59 | $HDPARM -tT $s | ||
60 | if [ $? -ne 0 ]; then | ||
61 | result=$? | ||
62 | echo "FAIL: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
63 | else | ||
64 | echo "PASS: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
65 | fi | ||
66 | |||
67 | mkdir -p /mnt/usb_tmp | ||
68 | for partition in `ls "$s"[1-9]` | ||
69 | do | ||
70 | echo "Testing $partition" | ||
71 | |||
72 | mount "$partition" /mnt/usb_tmp | ||
73 | if [ $? -ne 0 ]; then | ||
74 | result=$? | ||
75 | echo "FAIL: mount $s" | ||
76 | else | ||
77 | echo "PASS: mount $s" | ||
78 | dd if=/dev/urandom of=/mnt/usb_tmp/writefile bs=1M count=50 | ||
79 | if [ $? -ne 0 ]; then | ||
80 | result=$? | ||
81 | echo "FAIL: write test on $s" | ||
82 | else | ||
83 | echo "PASS: write test on $s" | ||
84 | rm -f /mnt/usb_tmp/writefile | ||
85 | fi | ||
86 | dd if=$s of=/mnt/usb_tmp/readfile bs=1M count=10 | ||
87 | if [ $? -ne 0 ]; then | ||
88 | result=$? | ||
89 | echo "FAIL: read test on $s" | ||
90 | else | ||
91 | echo "PASS: read test on $s" | ||
92 | rm -f /mnt/usb_tmp/readfile | ||
93 | fi | ||
94 | umount /mnt/usb_tmp | ||
95 | fi | ||
96 | done | ||
97 | |||
98 | rm -fr /mnt/usb_tmp | ||
99 | done | ||
100 | exit $result | ||
diff --git a/recipes-test/ddt-runner/files/scripts/proliant-m800/ethernet b/recipes-test/ddt-runner/files/scripts/proliant-m800/ethernet new file mode 100755 index 0000000..5355f10 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/proliant-m800/ethernet | |||
@@ -0,0 +1,88 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth1" | ||
4 | ethernet_ping_ipaddr="172.21.3.22" | ||
5 | ethernet_ipaddr=$1 | ||
6 | |||
7 | IFCONFIG=`which ifconfig` | ||
8 | |||
9 | $IFCONFIG $ethernet_interface up | ||
10 | $IFCONFIG | grep $ethernet_interface | ||
11 | if [ $? -ne 0 ]; then | ||
12 | echo "FAIL: $ethernet_interface is not up" | ||
13 | exit 1 | ||
14 | else | ||
15 | echo "PASS: $ethernet_interface is up" | ||
16 | fi | ||
17 | |||
18 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
19 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
20 | fi | ||
21 | |||
22 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
23 | if [ $? -ne 0 ]; then | ||
24 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
25 | exit 1 | ||
26 | else | ||
27 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
28 | fi | ||
29 | |||
30 | mindatasize=56 | ||
31 | maxdatasize=650 | ||
32 | stepsize=100 | ||
33 | iteration=1 | ||
34 | datasize=$mindatasize | ||
35 | logfile=`/bin/mktemp` | ||
36 | statistics=`/bin/mktemp` | ||
37 | error=0 | ||
38 | |||
39 | trap cleanup SIGHUP SIGINT SIGTERM | ||
40 | |||
41 | clean_tasks() { | ||
42 | echo "Executing clean up tasks" | ||
43 | rm -f $logfile $statistics | ||
44 | } | ||
45 | |||
46 | cleanup() { | ||
47 | echo "Aborting script execution" | ||
48 | clean_tasks | ||
49 | exit 0 | ||
50 | } | ||
51 | |||
52 | echo "start ping test for $ethernet_interface..." | ||
53 | |||
54 | while [ $datasize -le $maxdatasize ]; do | ||
55 | for i in `seq 1 $iteration`; do | ||
56 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
57 | ping_err=`echo $?` | ||
58 | echo "" && cat $statistics | grep -r "PING" | ||
59 | cat $statistics | grep -r "received" | ||
60 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
61 | packets_received=`cat $statistics | \ | ||
62 | grep -r "received" | awk '{print$4}'` | ||
63 | |||
64 | # Evaluate possible errors on the ping operation | ||
65 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
66 | error=1 | ||
67 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
68 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
69 | fi | ||
70 | done | ||
71 | let datasize=$datasize+$stepsize | ||
72 | done | ||
73 | |||
74 | # Report failures | ||
75 | if [ $error -eq 1 ]; then | ||
76 | echo -e "=================== error report ===================\n" | ||
77 | cat $logfile | ||
78 | echo -e "====================================================\n" | ||
79 | clean_tasks | ||
80 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
81 | exit 1 | ||
82 | else | ||
83 | clean_tasks | ||
84 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
85 | fi | ||
86 | |||
87 | echo "PASS: $ethernet_interface test passed" | ||
88 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/proliant-m800/i2c b/recipes-test/ddt-runner/files/scripts/proliant-m800/i2c new file mode 100755 index 0000000..5202950 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/proliant-m800/i2c | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then | ||
4 | echo "PASS: found $I2C_ADAPTERS i2c adapters" | ||
5 | else | ||
6 | echo "FAIL: no i2c adapters found" | ||
7 | exit 1 | ||
8 | fi | ||
9 | |||
10 | if [ -z "$adapters" ]; then | ||
11 | adapters=0 | ||
12 | fi | ||
13 | |||
14 | while [ $adapters -lt $I2C_ADAPTERS ] | ||
15 | do | ||
16 | i2cdetect -y $adapters | ||
17 | if [ $? -ne 0 ]; then | ||
18 | echo "FAIL: detect i2c adapter $adapters failed" | ||
19 | else | ||
20 | echo "PASS: detect i2c adapter $adapters success" | ||
21 | fi | ||
22 | adapters=`expr $adapters + 1` | ||
23 | sleep 1 | ||
24 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/proliant-m800/sata b/recipes-test/ddt-runner/files/scripts/proliant-m800/sata new file mode 100755 index 0000000..25bf15a --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/proliant-m800/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/romley-ivb/ethernet b/recipes-test/ddt-runner/files/scripts/romley-ivb/ethernet new file mode 100755 index 0000000..5355f10 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/romley-ivb/ethernet | |||
@@ -0,0 +1,88 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth1" | ||
4 | ethernet_ping_ipaddr="172.21.3.22" | ||
5 | ethernet_ipaddr=$1 | ||
6 | |||
7 | IFCONFIG=`which ifconfig` | ||
8 | |||
9 | $IFCONFIG $ethernet_interface up | ||
10 | $IFCONFIG | grep $ethernet_interface | ||
11 | if [ $? -ne 0 ]; then | ||
12 | echo "FAIL: $ethernet_interface is not up" | ||
13 | exit 1 | ||
14 | else | ||
15 | echo "PASS: $ethernet_interface is up" | ||
16 | fi | ||
17 | |||
18 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
19 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
20 | fi | ||
21 | |||
22 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
23 | if [ $? -ne 0 ]; then | ||
24 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
25 | exit 1 | ||
26 | else | ||
27 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
28 | fi | ||
29 | |||
30 | mindatasize=56 | ||
31 | maxdatasize=650 | ||
32 | stepsize=100 | ||
33 | iteration=1 | ||
34 | datasize=$mindatasize | ||
35 | logfile=`/bin/mktemp` | ||
36 | statistics=`/bin/mktemp` | ||
37 | error=0 | ||
38 | |||
39 | trap cleanup SIGHUP SIGINT SIGTERM | ||
40 | |||
41 | clean_tasks() { | ||
42 | echo "Executing clean up tasks" | ||
43 | rm -f $logfile $statistics | ||
44 | } | ||
45 | |||
46 | cleanup() { | ||
47 | echo "Aborting script execution" | ||
48 | clean_tasks | ||
49 | exit 0 | ||
50 | } | ||
51 | |||
52 | echo "start ping test for $ethernet_interface..." | ||
53 | |||
54 | while [ $datasize -le $maxdatasize ]; do | ||
55 | for i in `seq 1 $iteration`; do | ||
56 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
57 | ping_err=`echo $?` | ||
58 | echo "" && cat $statistics | grep -r "PING" | ||
59 | cat $statistics | grep -r "received" | ||
60 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
61 | packets_received=`cat $statistics | \ | ||
62 | grep -r "received" | awk '{print$4}'` | ||
63 | |||
64 | # Evaluate possible errors on the ping operation | ||
65 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
66 | error=1 | ||
67 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
68 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
69 | fi | ||
70 | done | ||
71 | let datasize=$datasize+$stepsize | ||
72 | done | ||
73 | |||
74 | # Report failures | ||
75 | if [ $error -eq 1 ]; then | ||
76 | echo -e "=================== error report ===================\n" | ||
77 | cat $logfile | ||
78 | echo -e "====================================================\n" | ||
79 | clean_tasks | ||
80 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
81 | exit 1 | ||
82 | else | ||
83 | clean_tasks | ||
84 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
85 | fi | ||
86 | |||
87 | echo "PASS: $ethernet_interface test passed" | ||
88 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/romley-ivb/rtc b/recipes-test/ddt-runner/files/scripts/romley-ivb/rtc new file mode 100755 index 0000000..0d38293 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/romley-ivb/rtc | |||
@@ -0,0 +1,42 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | RTC_DEVICE="/dev/rtc" | ||
4 | |||
5 | if [ ! -e $RTC_DEVICE ]; then | ||
6 | echo "FAIL: rtc device does not exist" | ||
7 | exit 1 | ||
8 | else | ||
9 | echo "PASS: rtc device exists" | ||
10 | fi | ||
11 | |||
12 | /sbin/hwclock -f $RTC_DEVICE | ||
13 | if [ $? -ne 0 ]; then | ||
14 | echo "FAIL: rtc device open failed" | ||
15 | exit 1 | ||
16 | else | ||
17 | echo "PASS: rtc device open success" | ||
18 | fi | ||
19 | |||
20 | |||
21 | /sbin/hwclock --systohc | ||
22 | if [ $? -ne 0 ]; then | ||
23 | echo "FAIL: sync system clock and hardware clock failed" | ||
24 | exit 1 | ||
25 | else | ||
26 | echo "PASS: sync system clock and hardware clock success" | ||
27 | fi | ||
28 | |||
29 | RTC_TIME=$(/sbin/hwclock -r |awk '{print $4}') | ||
30 | echo $RTC_TIME | ||
31 | SYS_TIME=$(date +%m/%d/%Y-%X |awk '{print $1}' |awk -F- '{print $2}') | ||
32 | echo $SYS_TIME | ||
33 | |||
34 | if [ "$RTC_TIME" = "$SYS_TIME" ] ; then | ||
35 | echo "PASS: system time same with hardware time" | ||
36 | else | ||
37 | echo "FAIL: system time different with hardware time" | ||
38 | exit 1 | ||
39 | fi | ||
40 | |||
41 | echo "PASS: rtc test successful" | ||
42 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/romley-ivb/sata b/recipes-test/ddt-runner/files/scripts/romley-ivb/sata new file mode 100755 index 0000000..25bf15a --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/romley-ivb/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/romley-ivb/usb b/recipes-test/ddt-runner/files/scripts/romley-ivb/usb new file mode 100755 index 0000000..15c417a --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/romley-ivb/usb | |||
@@ -0,0 +1,100 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test usb functionality for romley-ivb. | ||
4 | # | ||
5 | |||
6 | result=0 | ||
7 | devpath="" | ||
8 | usbinfo="" | ||
9 | |||
10 | usbutils_is_installed=`which lsusb` | ||
11 | if [ -z $usbutils_is_installed ]; then | ||
12 | echo "FAIL: Cannot find lsusb" | ||
13 | exit 1 | ||
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 "$usbdev_num USB device(s) connected" | ||
22 | fi | ||
23 | |||
24 | sd=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'` | ||
25 | if [ -z "$sd" ]; then | ||
26 | echo "FAIL: find sd device" | ||
27 | exit 1 | ||
28 | else | ||
29 | echo "PASS: find sd device" | ||
30 | fi | ||
31 | |||
32 | HDPARM=`which hdparm` | ||
33 | if [ -z $HDPARM ]; then | ||
34 | result=$? | ||
35 | echo "FAIL: find hdparm" | ||
36 | fi | ||
37 | echo "PASS: find hdparm" | ||
38 | |||
39 | for s in $sd | ||
40 | do | ||
41 | devpath=`echo "$s" | awk -F "," '{print "/sys/dev/block/" $1 ":" $2}'` | ||
42 | usbinfo=`ls -l $devpath | grep usb` | ||
43 | |||
44 | if [ -z "$usbinfo" ] ; then | ||
45 | continue | ||
46 | fi | ||
47 | |||
48 | s=`echo "$s" | awk -F "," '{print $3}'` | ||
49 | |||
50 | echo "Testing $s" | ||
51 | $HDPARM -I $s | ||
52 | if [ $? -ne 0 ]; then | ||
53 | result=$? | ||
54 | echo "FAIL: $HDPARM -I $s Detailed/current information directly from $s" | ||
55 | else | ||
56 | echo "PASS: $HDPARM -I $s Detailed/current information directly from $s" | ||
57 | fi | ||
58 | |||
59 | $HDPARM -tT $s | ||
60 | if [ $? -ne 0 ]; then | ||
61 | result=$? | ||
62 | echo "FAIL: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
63 | else | ||
64 | echo "PASS: $HDPARM -tT $s Perform device/cache read timings on $s" | ||
65 | fi | ||
66 | |||
67 | mkdir -p /mnt/usb_tmp | ||
68 | for partition in `ls "$s"[1-9]` | ||
69 | do | ||
70 | echo "Testing $partition" | ||
71 | |||
72 | mount "$partition" /mnt/usb_tmp | ||
73 | if [ $? -ne 0 ]; then | ||
74 | result=$? | ||
75 | echo "FAIL: mount $s" | ||
76 | else | ||
77 | echo "PASS: mount $s" | ||
78 | dd if=/dev/urandom of=/mnt/usb_tmp/writefile bs=1M count=50 | ||
79 | if [ $? -ne 0 ]; then | ||
80 | result=$? | ||
81 | echo "FAIL: write test on $s" | ||
82 | else | ||
83 | echo "PASS: write test on $s" | ||
84 | rm -f /mnt/usb_tmp/writefile | ||
85 | fi | ||
86 | dd if=$s of=/mnt/usb_tmp/readfile bs=1M count=10 | ||
87 | if [ $? -ne 0 ]; then | ||
88 | result=$? | ||
89 | echo "FAIL: read test on $s" | ||
90 | else | ||
91 | echo "PASS: read test on $s" | ||
92 | rm -f /mnt/usb_tmp/readfile | ||
93 | fi | ||
94 | umount /mnt/usb_tmp | ||
95 | fi | ||
96 | done | ||
97 | |||
98 | rm -fr /mnt/usb_tmp | ||
99 | done | ||
100 | exit $result | ||
diff --git a/recipes-test/ddt-runner/files/scripts/zc702-zynq7/ethernet b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/ethernet new file mode 100755 index 0000000..5355f10 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/ethernet | |||
@@ -0,0 +1,88 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth1" | ||
4 | ethernet_ping_ipaddr="172.21.3.22" | ||
5 | ethernet_ipaddr=$1 | ||
6 | |||
7 | IFCONFIG=`which ifconfig` | ||
8 | |||
9 | $IFCONFIG $ethernet_interface up | ||
10 | $IFCONFIG | grep $ethernet_interface | ||
11 | if [ $? -ne 0 ]; then | ||
12 | echo "FAIL: $ethernet_interface is not up" | ||
13 | exit 1 | ||
14 | else | ||
15 | echo "PASS: $ethernet_interface is up" | ||
16 | fi | ||
17 | |||
18 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
19 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
20 | fi | ||
21 | |||
22 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
23 | if [ $? -ne 0 ]; then | ||
24 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
25 | exit 1 | ||
26 | else | ||
27 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
28 | fi | ||
29 | |||
30 | mindatasize=56 | ||
31 | maxdatasize=650 | ||
32 | stepsize=100 | ||
33 | iteration=1 | ||
34 | datasize=$mindatasize | ||
35 | logfile=`/bin/mktemp` | ||
36 | statistics=`/bin/mktemp` | ||
37 | error=0 | ||
38 | |||
39 | trap cleanup SIGHUP SIGINT SIGTERM | ||
40 | |||
41 | clean_tasks() { | ||
42 | echo "Executing clean up tasks" | ||
43 | rm -f $logfile $statistics | ||
44 | } | ||
45 | |||
46 | cleanup() { | ||
47 | echo "Aborting script execution" | ||
48 | clean_tasks | ||
49 | exit 0 | ||
50 | } | ||
51 | |||
52 | echo "start ping test for $ethernet_interface..." | ||
53 | |||
54 | while [ $datasize -le $maxdatasize ]; do | ||
55 | for i in `seq 1 $iteration`; do | ||
56 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
57 | ping_err=`echo $?` | ||
58 | echo "" && cat $statistics | grep -r "PING" | ||
59 | cat $statistics | grep -r "received" | ||
60 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
61 | packets_received=`cat $statistics | \ | ||
62 | grep -r "received" | awk '{print$4}'` | ||
63 | |||
64 | # Evaluate possible errors on the ping operation | ||
65 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
66 | error=1 | ||
67 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
68 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
69 | fi | ||
70 | done | ||
71 | let datasize=$datasize+$stepsize | ||
72 | done | ||
73 | |||
74 | # Report failures | ||
75 | if [ $error -eq 1 ]; then | ||
76 | echo -e "=================== error report ===================\n" | ||
77 | cat $logfile | ||
78 | echo -e "====================================================\n" | ||
79 | clean_tasks | ||
80 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
81 | exit 1 | ||
82 | else | ||
83 | clean_tasks | ||
84 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
85 | fi | ||
86 | |||
87 | echo "PASS: $ethernet_interface test passed" | ||
88 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/zc702-zynq7/flash b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/flash new file mode 100755 index 0000000..7fa897c --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/flash | |||
@@ -0,0 +1,20 @@ | |||
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 zc702-zynq7 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 | fi | ||
12 | |||
13 | for((part=0; part<$part_num-1; part++)); | ||
14 | do | ||
15 | if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then | ||
16 | echo "PASS: show partition $part debug info" | ||
17 | else | ||
18 | echo "FAIL: show partition $part debug info" | ||
19 | fi | ||
20 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/zc702-zynq7/i2c b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/i2c new file mode 100755 index 0000000..5b312b9 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/i2c | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then | ||
4 | echo "PASS: found $I2C_ADAPTERS i2c adapters" | ||
5 | else | ||
6 | echo "FAIL: no i2c adapters found" | ||
7 | exit 1 | ||
8 | fi | ||
9 | |||
10 | if [ -z "$adapters" ]; then | ||
11 | adapters=0 | ||
12 | fi | ||
13 | |||
14 | while [ $adapters -lt $I2C_ADAPTERS ] | ||
15 | do | ||
16 | i2cdetect -y $adapters | ||
17 | if [ $? -ne 0 ]; then | ||
18 | echo "FAIL: detect i2c adapter $adapters failed" | ||
19 | else | ||
20 | echo "PASS: detect i2c adapter $adapters success" | ||
21 | fi | ||
22 | adapters=`expr $adapters + 1` | ||
23 | sleep 1 | ||
24 | done | ||
diff --git a/recipes-test/ddt-runner/files/scripts/zc702-zynq7/rtc b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/rtc new file mode 100755 index 0000000..0d38293 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/rtc | |||
@@ -0,0 +1,42 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | RTC_DEVICE="/dev/rtc" | ||
4 | |||
5 | if [ ! -e $RTC_DEVICE ]; then | ||
6 | echo "FAIL: rtc device does not exist" | ||
7 | exit 1 | ||
8 | else | ||
9 | echo "PASS: rtc device exists" | ||
10 | fi | ||
11 | |||
12 | /sbin/hwclock -f $RTC_DEVICE | ||
13 | if [ $? -ne 0 ]; then | ||
14 | echo "FAIL: rtc device open failed" | ||
15 | exit 1 | ||
16 | else | ||
17 | echo "PASS: rtc device open success" | ||
18 | fi | ||
19 | |||
20 | |||
21 | /sbin/hwclock --systohc | ||
22 | if [ $? -ne 0 ]; then | ||
23 | echo "FAIL: sync system clock and hardware clock failed" | ||
24 | exit 1 | ||
25 | else | ||
26 | echo "PASS: sync system clock and hardware clock success" | ||
27 | fi | ||
28 | |||
29 | RTC_TIME=$(/sbin/hwclock -r |awk '{print $4}') | ||
30 | echo $RTC_TIME | ||
31 | SYS_TIME=$(date +%m/%d/%Y-%X |awk '{print $1}' |awk -F- '{print $2}') | ||
32 | echo $SYS_TIME | ||
33 | |||
34 | if [ "$RTC_TIME" = "$SYS_TIME" ] ; then | ||
35 | echo "PASS: system time same with hardware time" | ||
36 | else | ||
37 | echo "FAIL: system time different with hardware time" | ||
38 | exit 1 | ||
39 | fi | ||
40 | |||
41 | echo "PASS: rtc test successful" | ||
42 | exit 0 | ||
diff --git a/recipes-test/ddt-runner/files/scripts/zc702-zynq7/sdhc b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/sdhc new file mode 100755 index 0000000..e341ebc --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/sdhc | |||
@@ -0,0 +1,65 @@ | |||
1 | #!/bin/sh | ||
2 | # This script is used to test sdhc functionality for pandaboard. | ||
3 | # The content of SD will be lost by running this test case. | ||
4 | |||
5 | SDHC_DEVICE="/dev/mmcblk0" | ||
6 | SDHC_DEVICE_PART="/dev/mmcblk0p1" | ||
7 | SFDISK=`which sfdisk` | ||
8 | |||
9 | if [ -e $SDHC_DEVICE ]; then | ||
10 | echo "PASS: $SDHC_DEVICE device exists" | ||
11 | else | ||
12 | echo "FAIL: $SDHC_DEVICE does not exist" | ||
13 | exit 1 | ||
14 | fi | ||
15 | |||
16 | if [ -e $SDHC_DEVICE_PART ]; then | ||
17 | echo "PASS: $SDHC_DEVICE_PART device exists" | ||
18 | elif [ ! -z $SFDISK ]; then | ||
19 | |||
20 | echo "Try to create a partition" | ||
21 | |||
22 | $SFDISK $SDHC_DEVICE << EOF | ||
23 | ,,L | ||
24 | EOF | ||
25 | |||
26 | if [ -e $SDHC_DEVICE_PART ]; then | ||
27 | echo "PASS: $SDHC_DEVICE_PART device exists" | ||
28 | else | ||
29 | echo "FAIL: $SDHC_DEVICE_PART does not exist" | ||
30 | exit 1 | ||
31 | fi | ||
32 | |||
33 | else | ||
34 | echo "FAIL: $SDHC_DEVICE_PART does not exist" | ||
35 | exit 1 | ||
36 | fi | ||
37 | |||
38 | mount |grep mmcblk0p1 | ||
39 | if [ $? -eq 0 ]; then | ||
40 | umount $SDHC_DEVICE_PART | ||
41 | fi | ||
42 | |||
43 | /sbin/mkfs.ext2 $SDHC_DEVICE_PART | ||
44 | if [ $? -ne 0 ]; then | ||
45 | echo "FAIL: format $SDHC_DEVICE_PART fail" | ||
46 | exit 1 | ||
47 | else | ||
48 | mkdir -p /mnt/sdhc | ||
49 | mount $SDHC_DEVICE_PART /mnt/sdhc | ||
50 | if [ $? -ne 0 ]; then | ||
51 | echo "FAIL: mount $SDHC_DEVICE_PART fail" | ||
52 | exit 1 | ||
53 | else | ||
54 | cp /bin/busybox /mnt/sdhc | ||
55 | ls /mnt/sdhc |grep busybox | ||
56 | if [ $? -ne 0 ]; then | ||
57 | echo "FAIL: read or write $SDHC_DEVICE_PART fail" | ||
58 | exit 1 | ||
59 | else | ||
60 | umount $SDHC_DEVICE_PART | ||
61 | echo "PASS: read or write $SDHC_DEVICE_PART success" | ||
62 | fi | ||
63 | fi | ||
64 | fi | ||
65 | |||
diff --git a/recipes-test/ddt-runner/files/scripts/zc702-zynq7/spi b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/spi new file mode 100755 index 0000000..15df9bc --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/zc702-zynq7/spi | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | #An spi flash M25P80 connect to pandaboard cpu by spi bus, so the method | ||
4 | #is to read/write spi flash to verify whether the spi bus driver worked | ||
5 | #or not. | ||
6 | |||
7 | MTD_CHAR_DEVICE="/dev/mtd4" | ||
8 | MTD_BLOCK_DEVICE="/dev/mtdblock4" | ||
9 | |||
10 | if [ ! -e $MTD_CHAR_DEVICE ]; then | ||
11 | echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" | ||
12 | exit 1 | ||
13 | else | ||
14 | echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" | ||
15 | fi | ||
16 | |||
17 | if [ ! -e $MTD_BLOCK_DEVICE ]; then | ||
18 | echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" | ||
19 | exit 1 | ||
20 | else | ||
21 | echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" | ||
22 | fi | ||
23 | |||
24 | /usr/sbin/flash_erase -j $MTD_CHAR_DEVICE 0 0 | ||
25 | if [ $? -ne 0 ]; then | ||
26 | echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" | ||
27 | exit 1 | ||
28 | else | ||
29 | mkdir -p /mnt/spi | ||
30 | mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi | ||
31 | if [ $? -ne 0 ]; then | ||
32 | echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" | ||
33 | exit 1 | ||
34 | else | ||
35 | cp /bin/busybox /mnt/spi | ||
36 | ls /mnt/spi |grep busybox | ||
37 | if [ $? -ne 0 ]; then | ||
38 | echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" | ||
39 | exit 1 | ||
40 | else | ||
41 | umount $MTD_BLOCK_DEVICE | ||
42 | echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" | ||
43 | fi | ||
44 | fi | ||
45 | fi | ||
46 | |||
47 | echo "PASS: spi bus test passed" | ||
48 | exit 0 | ||