summaryrefslogtreecommitdiffstats
path: root/recipes-test/ddt-runner/files
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-test/ddt-runner/files')
-rw-r--r--recipes-test/ddt-runner/files/ddt-runner19
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/acp3448v2/ethernet97
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/acp3448v2/flash45
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/acp3448v2/pci-express109
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/acp3448v2/usb100
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9131rdb/ethernet89
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9131rdb/flash48
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9131rdb/i2c75
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9131rdb/preempt_rt33
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9131rdb/spi56
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9131rdb/watchdog64
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9132qds/ethernet89
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9132qds/flash48
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9132qds/i2c75
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9132qds/preempt_rt33
-rw-r--r--recipes-test/ddt-runner/files/scripts/bsc9132qds/sdhc77
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9132qds/spi56
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/bsc9132qds/watchdog64
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p2020rdb/ethernet88
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p2041rdb/ethernet88
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p2041rdb/flash49
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p2041rdb/i2c44
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p2041rdb/pci-express109
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p2041rdb/sata81
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p2041rdb/sdhc41
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p2041rdb/usb48
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p4080ds/ethernet88
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p4080ds/flash20
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p4080ds/i2c24
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p4080ds/rtc42
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p4080ds/sdhc65
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p4080ds/spi48
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p4080ds/usb100
33 files changed, 2112 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
3if [[ ! -d "/usr/lib/ddt-runner/scripts" ]]; then
4 echo "SKIP: No available driver testcase"
5 exit
6fi
7
8cd /usr/lib/ddt-runner/scripts
9
10for x in *
11do
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
19done
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
6ethernet_interface="eth0"
7ethernet_ping_ipaddr="172.21.3.22"
8ethernet_ipaddr=$1
9
10IFCONFIG=`which ifconfig`
11
12for((num=0; num<16; num++));
13do
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
21done
22
23if [ $num -eq 16 ]; then
24 echo "FAIL: $ethernet_interface is not up"
25 exit 1
26fi
27
28if [ "x$ethernet_ipaddr" != "x" ]; then
29 $IFCONFIG $ethernet_interface $ethernet_ipaddr
30fi
31
32$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}'
33if [ $? -ne 0 ]; then
34 echo "FAIL: ipaddr of $ethernet_interface setup failed"
35 exit 1
36else
37 echo "PASS: ipaddr of $ethernet_interface setup success"
38fi
39
40mindatasize=56
41maxdatasize=650
42stepsize=100
43iteration=1
44datasize=$mindatasize
45logfile=`/bin/mktemp`
46statistics=`/bin/mktemp`
47error=0
48
49trap cleanup SIGHUP SIGINT SIGTERM
50
51clean_tasks() {
52 echo "Executing clean up tasks"
53 rm -f $logfile $statistics
54}
55
56cleanup() {
57 echo "Aborting script execution"
58 clean_tasks
59 exit 0
60}
61
62echo "start ping test for $ethernet_interface..."
63
64while [ $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
82done
83
84# Report failures
85if [ $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
92else
93 clean_tasks
94 echo -e "PASS: ping test for $ethernet_interface success\n"
95fi
96
97echo "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
5if part_num=`cat /proc/mtd | grep -c 'mtd'`; then
6 echo "PASS: show $part_num partitions"
7else
8 echo "FAIL: show $part_num partitions"
9fi
10
11for((part=0; part<$part_num-1; part++));
12do
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
18done
19
20let "test_part=part_num-2"
21
22if [ $(flash_erase -j /dev/mtd${test_part} 0 0 | grep -c '100 % complete') ]; then
23 echo "PASS: erase and format partition ${test_part}"
24else
25 echo "FAIL: erase and format partition ${test_part}"
26fi
27
28mkdir -p /mnt/flash
29mount -t jffs2 /dev/mtdblock${test_part} /mnt/flash
30if [ $? -eq 0 ]; then
31 echo "PASS: mount partition ${test_part} as /mnt/flash"
32else
33 echo "FAIL: mount partition ${test_part} as /mnt/flash"
34fi
35
36cd /mnt/flash
37touch test
38if [ $(ls | grep -c 'test') ]; then
39 echo "PASS: touch a file on partition ${test_part}"
40else
41 echo "FAIL: touch a file on partition ${test_part}"
42fi
43
44cd ~
45umount /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
3ethernet_interface="eth0"
4ethernet_ping_ipaddr="172.21.3.22"
5ethernet_ipaddr=$1
6
7#Intel Corporation 82574L Gigabit Network Card (intel e1000e)
8vendor_id="8086"
9product_id="10d3"
10
11#find vendor id & product id
12lspci -nn |grep $vendor_id:$product_id
13if [ $? -ne 0 ]; then
14 echo "FAIL: pci-e ethernet card device does not exist"
15 exit 1
16else
17 echo "PASS: got pci-e ethernet card device"
18fi
19
20setpci -v -d $vendor_id:$product_id latency_timer=b0
21if [ $? -ne 0 ]; then
22 echo "FAIL: parameter changes to pci config space failed"
23 exit 1
24else
25 echo "PASS: parameter changes to pci config space success"
26fi
27
28IFCONFIG=`which ifconfig`
29
30$IFCONFIG $ethernet_interface up
31$IFCONFIG | grep $ethernet_interface
32if [ $? -ne 0 ]; then
33 echo "FAIL: pci-e ethernet card device $ethernet_interface is not up"
34 exit 1
35else
36 echo "PASS: pci-e ethernet card device $ethernet_interface is up"
37fi
38
39if [ "x$ethernet_ipaddr" != "x" ]; then
40 $IFCONFIG $ethernet_interface $ethernet_ipaddr
41fi
42
43$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}'
44if [ $? -ne 0 ]; then
45 echo "FAIL: ipaddr of pci-e ethernet card device $ethernet_interface setup failed"
46 exit 1
47else
48 echo "PASS: ipaddr of pci-e ethernet card device $ethernet_interface setup success"
49fi
50
51mindatasize=56
52maxdatasize=650
53stepsize=100
54iteration=1
55datasize=$mindatasize
56logfile=`/bin/mktemp`
57statistics=`/bin/mktemp`
58error=0
59
60trap cleanup SIGHUP SIGINT SIGTERM
61
62clean_tasks() {
63 echo "Executing clean up tasks"
64 rm -f $logfile $statistics
65}
66
67cleanup() {
68 echo "Aborting script execution"
69 clean_tasks
70 exit 0
71}
72
73echo "start ping test for pci-e ethernet card device $ethernet_interface..."
74
75while [ $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
93done
94
95# Report failures
96if [ $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
103else
104 clean_tasks
105 echo -e "PASS: ping test for pci-e ethernet card device $ethernet_interface success\n"
106fi
107
108echo "PASS: pci express test passed"
109exit 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
6result=0
7devpath=""
8usbinfo=""
9
10usbutils_is_installed=`which lsusb`
11if [ -z $usbutils_is_installed ]; then
12 echo "FAIL: Cannot find lsusb"
13 exit 1
14fi
15
16usbdev_num=`lsusb | grep -v root\ hub | wc -l`
17if [ $usbdev_num -eq 0 ]; then
18 echo "FAIL: USB device is not connected"
19 exit 1
20else
21 echo "$usbdev_num USB device(s) connected"
22fi
23
24sd=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'`
25if [ -z "$sd" ]; then
26 echo "FAIL: find sd device"
27 exit 1
28else
29 echo "PASS: find sd device"
30fi
31
32HDPARM=`which hdparm`
33if [ -z $HDPARM ]; then
34 result=$?
35 echo "FAIL: find hdparm"
36fi
37 echo "PASS: find hdparm"
38
39for s in $sd
40do
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
99done
100exit $result
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
4ethernet_interface="eth0"
5ethernet_ping_ipaddr="172.21.3.22"
6ethernet_ipaddr=$1
7
8IFCONFIG=`which ifconfig`
9
10$IFCONFIG $ethernet_interface up
11$IFCONFIG | grep $ethernet_interface
12if [ $? -ne 0 ]; then
13 echo "FAIL: $ethernet_interface is not up"
14 exit 1
15else
16 echo "PASS: $ethernet_interface is up"
17fi
18
19if [ "x$ethernet_ipaddr" != "x" ]; then
20 $IFCONFIG $ethernet_interface $ethernet_ipaddr
21fi
22
23$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}'
24if [ $? -ne 0 ]; then
25 echo "FAIL: ipaddr of $ethernet_interface setup failed"
26 exit 1
27else
28 echo "PASS: ipaddr of $ethernet_interface setup success"
29fi
30
31mindatasize=56
32maxdatasize=650
33stepsize=100
34iteration=1
35datasize=$mindatasize
36logfile=`/bin/mktemp`
37statistics=`/bin/mktemp`
38error=0
39
40trap cleanup SIGHUP SIGINT SIGTERM
41
42clean_tasks() {
43 echo "Executing clean up tasks"
44 rm -f $logfile $statistics
45}
46
47cleanup() {
48 echo "Aborting script execution"
49 clean_tasks
50 exit 0
51}
52
53echo "start ping test for $ethernet_interface..."
54
55while [ $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
73done
74
75# Report failures
76if [ $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
83else
84 clean_tasks
85 echo -e "PASS: ping test for $ethernet_interface success\n"
86fi
87
88echo "PASS: $ethernet_interface test passed"
89exit 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
8if part_num=`cat /proc/mtd | grep -c 'mtd'`; then
9 echo "PASS: $part_num partitions found"
10else
11 echo "FAIL: $part_num partitions found"
12 exit 1
13fi
14
15for((part=0; part<$part_num; part++));
16do
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
23done
24
25READ_TEST=`find / -name mtd_readtest.ko -print`
26
27if [ ! -e $READ_TEST ]; then
28 echo "FAIL: $READ_TEST does not exist"
29 exit 1
30else
31 echo "PASS: $READ_TEST exists"
32fi
33
34for((part=0; part<$part_num; part++));
35do
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
48done
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
4I2C_DETECT=`which i2cdetect`
5if [ "x$I2C_DETECT" != "x" ]; then
6 echo "PASS: i2cdetect found"
7else
8 echo "FAIL: i2cdetect not found"
9 exit 1
10fi
11
12I2C_SET=`which i2cset`
13if [ "x$I2C_SET" != "x" ]; then
14 echo "PASS: i2cset found"
15else
16 echo "FAIL: i2cset not found"
17 exit 1
18fi
19
20I2C_GET=`which i2cget`
21if [ "x$I2C_GET" != "x" ]; then
22 echo "PASS: i2cget found"
23else
24 echo "FAIL: i2cget not found"
25 exit 1
26fi
27
28if I2C_ADAPTERS=`$I2C_DETECT -l |wc -l`; then
29 echo "PASS: $I2C_ADAPTERS i2c adapters found"
30else
31 echo "FAIL: no i2c adapters found"
32 exit 1
33fi
34
35adapters=0
36while [ $adapters -lt $I2C_ADAPTERS ]
37do
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
46done
47
48# Area of bus:i2c-0 addr:0x52 is free to read and write
49$I2C_SET -y 0 0x52 0 0x55
50if [ $? -eq 0 ]; then
51 echo "PASS: i2c_set -y 0 0x52 0 0x55 success"
52else
53 echo "FAIL: i2c_set -y 0 0x52 0 0x55 fail"
54fi
55
56num=`$I2C_GET -y 0 0x52 0 | grep -c '0x55'`
57if [ $num -eq 1 ]; then
58 echo "PASS: i2c_get -y 0 0x52 0 success"
59else
60 echo "FAIL: i2c_get -y 0 0x52 0 fail"
61fi
62
63$I2C_SET -y 0 0x52 0 0xaa
64if [ $? -eq 0 ]; then
65 echo "PASS: i2c_set -y 0 0x52 0 0xaa success"
66else
67 echo "FAIL: i2c_set -y 0 0x52 0 0xaa fail"
68fi
69
70num=`$I2C_GET -y 0 0x52 0 | grep -c '0xaa'`
71if [ $num -eq 1 ]; then
72 echo "PASS: i2c_get -y 0 0x52 0 success"
73else
74 echo "FAIL: i2c_get -y 0 0x52 0 fail"
75fi
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
6uname -a | grep "PREEMPT RT"
7if [ $? -ne 0 ]; then
8 echo "FAIL: The kernel include real-time patch"
9 echo 1
10fi
11 echo "PASS: The kernel include real-time patch"
12
13ps | grep '\(\[irq/\)'
14if [ $? -ne 0 ]; then
15 echo "FAIL: The IRQ handlers are treated by a patched kernel in kernel thread context."
16 exit 1
17fi
18 echo "PASS: The IRQ handlers are treated by a patched kernel in kernel thread context."
19
20cyclictest -t5 -p 80 -i 10000 -l 100
21if [ $? -ne 0 ]; then
22 echo "FAIL: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops."
23 exit 1
24fi
25 echo "PASS: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops."
26
27cyclictest -t5 -p 80 -n -i 10000 -l 100
28if [ $? -ne 0 ]; then
29 echo "FAIL: Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 micro seconds,. 100 loops."
30 exit 1
31fi
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
6MTD_CHAR_DEVICE="/dev/mtd8"
7MTD_BLOCK_DEVICE="/dev/mtdblock8"
8
9FLASH_ERASE=`which flash_erase`
10if [ "x$FLASH_ERASE" != "x" ]; then
11 echo "PASS: flash_erase found"
12else
13 echo "FAIL: flash_erase not found"
14 exit 1
15fi
16
17if [ ! -e $MTD_CHAR_DEVICE ]; then
18 echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist"
19 exit 1
20else
21 echo "PASS: spi flash device $MTD_CHAR_DEVICE exists"
22fi
23
24if [ ! -e $MTD_BLOCK_DEVICE ]; then
25 echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist"
26 exit 1
27else
28 echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists"
29fi
30
31$FLASH_ERASE -j $MTD_CHAR_DEVICE 0 0
32if [ $? -ne 0 ]; then
33 echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail"
34 exit 1
35else
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
53fi
54
55echo "PASS: spi bus test passed"
56exit 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
5WATCHDOG=`which watchdog`
6if [ "x$WATCHDOG" != "x" ]; then
7 echo "PASS: watchdog found"
8else
9 echo "FAIL: watchdog not found"
10 exit 1
11fi
12
13WATCHDOG_CONF=/etc/watchdog.conf
14if [ -f $WATCHDOG_CONF ]; then
15 echo "PASS: watchdog config file found"
16 sed -i '23,23 s/#//' $WATCHDOG_CONF
17else
18 echo "FAIL: watchdog config file not found"
19 exit 1
20fi
21
22$WATCHDOG -v /dev/watchdog
23watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'`
24if [ $watchdog_thread -eq 2 ]; then
25 echo "PASS: Watchdog daemon started successfully"
26else
27 echo "FAIL: Failed to start watchdog daemon"
28 exit 1
29fi
30
31sleep 5s
32
33killall watchdog
34
35retry=0
36while [ $retry -lt 10 ]
37do
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`
45done
46
47if [ $retry -eq 10 ]; then
48 echo "FAIL: Failed to stop watchdog daemon"
49fi
50
51found=0
52while read line
53do
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
59done < /var/log/messages
60
61if [ $found -eq 0 ]; then
62 echo "FAIL: Watchdog is not alive after 1 interval"
63fi
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
4ethernet_interface="eth0"
5ethernet_ping_ipaddr="172.21.3.22"
6ethernet_ipaddr=$1
7
8IFCONFIG=`which ifconfig`
9
10$IFCONFIG $ethernet_interface up
11$IFCONFIG | grep $ethernet_interface
12if [ $? -ne 0 ]; then
13 echo "FAIL: $ethernet_interface is not up"
14 exit 1
15else
16 echo "PASS: $ethernet_interface is up"
17fi
18
19if [ "x$ethernet_ipaddr" != "x" ]; then
20 $IFCONFIG $ethernet_interface $ethernet_ipaddr
21fi
22
23$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}'
24if [ $? -ne 0 ]; then
25 echo "FAIL: ipaddr of $ethernet_interface setup failed"
26 exit 1
27else
28 echo "PASS: ipaddr of $ethernet_interface setup success"
29fi
30
31mindatasize=56
32maxdatasize=650
33stepsize=100
34iteration=1
35datasize=$mindatasize
36logfile=`/bin/mktemp`
37statistics=`/bin/mktemp`
38error=0
39
40trap cleanup SIGHUP SIGINT SIGTERM
41
42clean_tasks() {
43 echo "Executing clean up tasks"
44 rm -f $logfile $statistics
45}
46
47cleanup() {
48 echo "Aborting script execution"
49 clean_tasks
50 exit 0
51}
52
53echo "start ping test for $ethernet_interface..."
54
55while [ $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
73done
74
75# Report failures
76if [ $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
83else
84 clean_tasks
85 echo -e "PASS: ping test for $ethernet_interface success\n"
86fi
87
88echo "PASS: $ethernet_interface test passed"
89exit 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
8if part_num=`cat /proc/mtd | grep -c 'mtd'`; then
9 echo "PASS: $part_num partitions found"
10else
11 echo "FAIL: $part_num partitions found"
12 exit 1
13fi
14
15for((part=0; part<$part_num; part++));
16do
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
23done
24
25READ_TEST=`find / -name mtd_readtest.ko -print`
26
27if [ ! -e $READ_TEST ]; then
28 echo "FAIL: $READ_TEST does not exist"
29 exit 1
30else
31 echo "PASS: $READ_TEST exists"
32fi
33
34for((part=0; part<$part_num; part++));
35do
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
48done
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
4I2C_DETECT=`which i2cdetect`
5if [ "x$I2C_DETECT" != "x" ]; then
6 echo "PASS: i2cdetect found"
7else
8 echo "FAIL: i2cdetect not found"
9 exit 1
10fi
11
12I2C_SET=`which i2cset`
13if [ "x$I2C_SET" != "x" ]; then
14 echo "PASS: i2cset found"
15else
16 echo "FAIL: i2cset not found"
17 exit 1
18fi
19
20I2C_GET=`which i2cget`
21if [ "x$I2C_GET" != "x" ]; then
22 echo "PASS: i2cget found"
23else
24 echo "FAIL: i2cget not found"
25 exit 1
26fi
27
28if I2C_ADAPTERS=`$I2C_DETECT -l |wc -l`; then
29 echo "PASS: $I2C_ADAPTERS i2c adapters found"
30else
31 echo "FAIL: no i2c adapters found"
32 exit 1
33fi
34
35adapters=0
36while [ $adapters -lt $I2C_ADAPTERS ]
37do
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
46done
47
48# Area of bus:i2c-0 addr:0x52 is free to read and write
49$I2C_SET -y 0 0x52 0 0x55
50if [ $? -eq 0 ]; then
51 echo "PASS: i2c_set -y 0 0x52 0 0x55 success"
52else
53 echo "FAIL: i2c_set -y 0 0x52 0 0x55 fail"
54fi
55
56num=`$I2C_GET -y 0 0x52 0 | grep -c '0x55'`
57if [ $num -eq 1 ]; then
58 echo "PASS: i2c_get -y 0 0x52 0 success"
59else
60 echo "FAIL: i2c_get -y 0 0x52 0 fail"
61fi
62
63$I2C_SET -y 0 0x52 0 0xaa
64if [ $? -eq 0 ]; then
65 echo "PASS: i2c_set -y 0 0x52 0 0xaa success"
66else
67 echo "FAIL: i2c_set -y 0 0x52 0 0xaa fail"
68fi
69
70num=`$I2C_GET -y 0 0x52 0 | grep -c '0xaa'`
71if [ $num -eq 1 ]; then
72 echo "PASS: i2c_get -y 0 0x52 0 success"
73else
74 echo "FAIL: i2c_get -y 0 0x52 0 fail"
75fi
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
6uname -a | grep "PREEMPT RT"
7if [ $? -ne 0 ]; then
8 echo "FAIL: The kernel include real-time patch"
9 echo 1
10fi
11 echo "PASS: The kernel include real-time patch"
12
13ps | grep '\(\[irq/\)'
14if [ $? -ne 0 ]; then
15 echo "FAIL: The IRQ handlers are treated by a patched kernel in kernel thread context."
16 exit 1
17fi
18 echo "PASS: The IRQ handlers are treated by a patched kernel in kernel thread context."
19
20cyclictest -t5 -p 80 -i 10000 -l 100
21if [ $? -ne 0 ]; then
22 echo "FAIL: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops."
23 exit 1
24fi
25 echo "PASS: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops."
26
27cyclictest -t5 -p 80 -n -i 10000 -l 100
28if [ $? -ne 0 ]; then
29 echo "FAIL: Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 micro seconds,. 100 loops."
30 exit 1
31fi
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
4DEV="mmc0:e624"
5
6if [ -f /sys/bus/mmc/drivers/mmcblk/bind ]; then
7 echo "PASS: /sys/bus/mmc/drivers/mmcblk/bind found"
8else
9 echo "FAIL: /sys/bus/mmc/drivers/mmcblk/bind not found"
10 exit 1
11fi
12
13if [ -f /sys/bus/mmc/drivers/mmcblk/unbind ]; then
14 echo "PASS: /sys/bus/mmc/drivers/mmcblk/unbind found"
15else
16 echo "FAIL: /sys/bus/mmc/drivers/mmcblk/unbind not found"
17 exit 1
18fi
19
20if [ -f /sys/bus/mmc/drivers/mmc_test/bind ]; then
21 echo "PASS: /sys/bus/mmc/drivers/mmc_test/bind found"
22else
23 echo "FAIL: /sys/bus/mmc/drivers/mmc_test/bind not found"
24 exit 1
25fi
26
27if [ -f /sys/bus/mmc/drivers/mmc_test/unbind ]; then
28 echo "PASS: /sys/bus/mmc/drivers/mmc_test/unbind found"
29else
30 echo "FAIL: /sys/bus/mmc/drivers/mmc_test/unbind not found"
31 exit 1
32fi
33
34mount -t debugfs none /sys/kernel/debug
35if [ $? -eq 0 ]; then
36 echo "PASS: successfully mount /sys/kernel/debug"
37else
38 echo "FAIL: failed to mount /sys/kernel/debug"
39fi
40
41echo $DEV > /sys/bus/mmc/drivers/mmcblk/unbind
42if [ $? -eq 0 ]; then
43 echo "PASS: successfully unbind mmcblk driver"
44else
45 echo "FAIL: failed to unbind mmcblk driver"
46fi
47
48echo $DEV > /sys/bus/mmc/drivers/mmc_test/bind
49if [ $? -eq 0 ]; then
50 echo "PASS: successfully bind mmc_test driver"
51else
52 echo "FAIL: failed to bind mmc_test driver"
53fi
54
55# echo 0 means test all supported test cases
56fail_num=`echo 0 > /sys/kernel/debug/mmc0/mmc0\:e624/test | grep -E -c 'FAILED|ERROR'`
57if [ $fail_num -eq 0 ]; then
58 echo "PASS: all test cases passed"
59else
60 echo "FAIL: some test cases failed"
61fi
62
63cat /sys/kernel/debug/mmc0/mmc0\:e624/test
64
65echo $DEV > /sys/bus/mmc/drivers/mmc_test/unbind
66if [ $? -eq 0 ]; then
67 echo "PASS: successfully unbind mmc_test driver"
68else
69 echo "FAIL: failed to unbind mmc_test driver"
70fi
71
72echo $DEV > /sys/bus/mmc/drivers/mmcblk/bind
73if [ $? -eq 0 ]; then
74 echo "PASS: successfully bind mmcblk driver"
75else
76 echo "FAIL: failed to bind mmcblk driver"
77fi
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
6MTD_CHAR_DEVICE="/dev/mtd8"
7MTD_BLOCK_DEVICE="/dev/mtdblock8"
8
9FLASH_ERASE=`which flash_erase`
10if [ "x$FLASH_ERASE" != "x" ]; then
11 echo "PASS: flash_erase found"
12else
13 echo "FAIL: flash_erase not found"
14 exit 1
15fi
16
17if [ ! -e $MTD_CHAR_DEVICE ]; then
18 echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist"
19 exit 1
20else
21 echo "PASS: spi flash device $MTD_CHAR_DEVICE exists"
22fi
23
24if [ ! -e $MTD_BLOCK_DEVICE ]; then
25 echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist"
26 exit 1
27else
28 echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists"
29fi
30
31$FLASH_ERASE -j $MTD_CHAR_DEVICE 0 0
32if [ $? -ne 0 ]; then
33 echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail"
34 exit 1
35else
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
53fi
54
55echo "PASS: spi bus test passed"
56exit 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
5WATCHDOG=`which watchdog`
6if [ "x$WATCHDOG" != "x" ]; then
7 echo "PASS: watchdog found"
8else
9 echo "FAIL: watchdog not found"
10 exit 1
11fi
12
13WATCHDOG_CONF=/etc/watchdog.conf
14if [ -f $WATCHDOG_CONF ]; then
15 echo "PASS: watchdog config file found"
16 sed -i '23,23 s/#//' $WATCHDOG_CONF
17else
18 echo "FAIL: watchdog config file not found"
19 exit 1
20fi
21
22$WATCHDOG -v /dev/watchdog
23watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'`
24if [ $watchdog_thread -eq 2 ]; then
25 echo "PASS: Watchdog daemon started successfully"
26else
27 echo "FAIL: Failed to start watchdog daemon"
28 exit 1
29fi
30
31sleep 5s
32
33killall watchdog
34
35retry=0
36while [ $retry -lt 10 ]
37do
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`
45done
46
47if [ $retry -eq 10 ]; then
48 echo "FAIL: Failed to stop watchdog daemon"
49fi
50
51found=0
52while read line
53do
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
59done < /var/log/messages
60
61if [ $found -eq 0 ]; then
62 echo "FAIL: Watchdog is not alive after 1 interval"
63fi
64
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
3ethernet_interface="eth1"
4ethernet_ping_ipaddr="172.21.3.22"
5ethernet_ipaddr=$1
6
7IFCONFIG=`which ifconfig`
8
9$IFCONFIG $ethernet_interface up
10$IFCONFIG | grep $ethernet_interface
11if [ $? -ne 0 ]; then
12 echo "FAIL: $ethernet_interface is not up"
13 exit 1
14else
15 echo "PASS: $ethernet_interface is up"
16fi
17
18if [ "x$ethernet_ipaddr" != "x" ]; then
19 $IFCONFIG $ethernet_interface $ethernet_ipaddr
20fi
21
22$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}'
23if [ $? -ne 0 ]; then
24 echo "FAIL: ipaddr of $ethernet_interface setup failed"
25 exit 1
26else
27 echo "PASS: ipaddr of $ethernet_interface setup success"
28fi
29
30mindatasize=56
31maxdatasize=650
32stepsize=100
33iteration=1
34datasize=$mindatasize
35logfile=`/bin/mktemp`
36statistics=`/bin/mktemp`
37error=0
38
39trap cleanup SIGHUP SIGINT SIGTERM
40
41clean_tasks() {
42 echo "Executing clean up tasks"
43 rm -f $logfile $statistics
44}
45
46cleanup() {
47 echo "Aborting script execution"
48 clean_tasks
49 exit 0
50}
51
52echo "start ping test for $ethernet_interface..."
53
54while [ $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
72done
73
74# Report failures
75if [ $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
82else
83 clean_tasks
84 echo -e "PASS: ping test for $ethernet_interface success\n"
85fi
86
87echo "PASS: $ethernet_interface test passed"
88exit 0
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
3ethernet_interface="eth1"
4#sestord02 ip address
5ethernet_ping_ipaddr="172.21.3.22"
6ethernet_ipaddr=$1
7
8IFCONFIG=`which ifconfig`
9
10$IFCONFIG $ethernet_interface up
11$IFCONFIG | grep $ethernet_interface
12if [ $? -ne 0 ]; then
13 echo "FAIL: $ethernet_interface is not up"
14 exit 1
15else
16 echo "PASS: $ethernet_interface is up"
17fi
18
19if [ "x$ethernet_ipaddr" != "x" ]; then
20 $IFCONFIG $ethernet_interface $ethernet_ipaddr
21fi
22
23$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}'
24if [ $? -ne 0 ]; then
25 echo "FAIL: ipaddr of $ethernet_interface setup failed"
26 exit 1
27else
28 echo "PASS: ipaddr of $ethernet_interface setup success"
29fi
30
31mindatasize=56
32maxdatasize=650
33stepsize=100
34iteration=1
35datasize=$mindatasize
36logfile=`/bin/mktemp`
37statistics=`/bin/mktemp`
38error=0
39
40trap cleanup SIGHUP SIGINT SIGTERM
41
42clean_tasks() {
43 echo "Executing clean up tasks"
44 rm -f $logfile $statistics
45}
46
47cleanup() {
48 echo "Aborting script execution"
49 clean_tasks
50 exit 0
51}
52
53echo "start ping test for $ethernet_interface..."
54
55while [ $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
73done
74
75# Report failures
76if [ $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
83else
84 clean_tasks
85 echo -e "PASS: ping test for $ethernet_interface success\n"
86fi
87
88exit 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
7if part_num=`cat /proc/mtd | grep -c 'mtd'`; then
8 echo "PASS: show $part_num partitions"
9else
10 echo "FAIL: show $part_num partitions"
11 exit 1
12fi
13
14for((part=0; part<$part_num; part++));
15do
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
22done
23
24READ_TEST=`find / -name mtd_readtest.ko -print`
25
26if [ ! -e $READ_TEST ]; then
27 echo "FAIL: $READ_TEST does not exist"
28 exit 1
29else
30 echo "PASS: $READ_TEST exists"
31fi
32
33for((part=0; part<$part_num; part++));
34do
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
49done
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
4if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then
5 echo "PASS: found $I2C_ADAPTERS i2c adapters"
6else
7 echo "FAIL: no i2c adapters found"
8 exit 1
9fi
10
11if [ -z "$adapters" ]; then
12 adapters=0
13fi
14
15while [ $adapters -lt $I2C_ADAPTERS ]
16do
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
25done
26
27i2cdetect -y 0
28if [ $? -ne 0 ]; then
29 echo "FAIL: detect i2c bus 0 fail"
30 exit 1
31else
32 echo "PASS: detect i2c bus 0 success"
33fi
34
35#i2c bus 0, device address 0x52, DDR3 DIMM Socket 1, SPD EEPROM
36i2cdump -f -y 0 0x52 |grep UG51U6400N8SU
37if [ $? -ne 0 ]; then
38 echo "FAIL: read SPD EEPROM on i2c bus 0 fail"
39 exit 1
40else
41 echo "PASS: read SPD EEPROM on i2c bus 0 success"
42fi
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
3ethernet_interface="eth0"
4#sestord02 ip address
5ethernet_ping_ipaddr="172.21.3.22"
6ethernet_ipaddr=$1
7
8#Intel Corporation 82574L Gigabit Network Card (intel e1000e)
9vendor_id="8086"
10product_id="10d3"
11
12#find vendor id & product id
13lspci -nn |grep $vendor_id:$product_id
14if [ $? -ne 0 ]; then
15 echo "FAIL: pci-e ethernet card device does not exist"
16 exit 1
17else
18 echo "PASS: got pci-e ethernet card device"
19fi
20
21setpci -v -d $vendor_id:$product_id latency_timer=b0
22if [ $? -ne 0 ]; then
23 echo "FAIL: parameter changes to pci config space failed"
24 exit 1
25else
26 echo "PASS: parameter changes to pci config space success"
27fi
28
29IFCONFIG=`which ifconfig`
30
31$IFCONFIG $ethernet_interface up
32$IFCONFIG | grep $ethernet_interface
33if [ $? -ne 0 ]; then
34 echo "FAIL: pci-e ethernet card device $ethernet_interface is not up"
35 exit 1
36else
37 echo "PASS: pci-e ethernet card device $ethernet_interface is up"
38fi
39
40if [ "x$ethernet_ipaddr" != "x" ]; then
41 $IFCONFIG $ethernet_interface $ethernet_ipaddr
42fi
43
44$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}'
45if [ $? -ne 0 ]; then
46 echo "FAIL: ipaddr of pci-e ethernet card device $ethernet_interface setup failed"
47 exit 1
48else
49 echo "PASS: ipaddr of pci-e ethernet card device $ethernet_interface setup success"
50fi
51
52mindatasize=56
53maxdatasize=650
54stepsize=100
55iteration=1
56datasize=$mindatasize
57logfile=`/bin/mktemp`
58statistics=`/bin/mktemp`
59error=0
60
61trap cleanup SIGHUP SIGINT SIGTERM
62
63clean_tasks() {
64 echo "Executing clean up tasks"
65 rm -f $logfile $statistics
66}
67
68cleanup() {
69 echo "Aborting script execution"
70 clean_tasks
71 exit 0
72}
73
74echo "start ping test for pci-e ethernet card device $ethernet_interface..."
75
76while [ $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
94done
95
96# Report failures
97if [ $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
104else
105 clean_tasks
106 echo -e "PASS: ping test for pci-e ethernet card device $ethernet_interface success\n"
107fi
108
109exit 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#
5result=0
6devpath=""
7satainfo=""
8SD=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'`
9if [ -z "$SD" ]; then
10 echo "FAIL: find sata device"
11 exit 1
12else
13 echo "PASS: find sata device"
14fi
15HDPARM=`which hdparm`
16if [ -z $HDPARM ]; then
17 result=$?
18 echo "FAIL: find hdparm"
19fi
20 echo "PASS: find hdparm"
21
22
23for 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
80done
81exit $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
5SDHC_DEVICE="/dev/mmcblk0p1"
6
7if [ ! -e $SDHC_DEVICE ]; then
8 echo "FAIL: $SDHC_DEVICE does not exist"
9 exit 1
10else
11 echo "PASS: $SDHC_DEVICE device exists"
12fi
13
14mount |grep mmcblk0p1
15if [ $? -eq 0 ]; then
16 umount $SDHC_DEVICE
17fi
18
19/sbin/mkfs.ext2 $SDHC_DEVICE
20if [ $? -ne 0 ]; then
21 echo "FAIL: format $SDHC_DEVICE fail"
22 exit 1
23else
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
40fi
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
6USB_DISK=`ls /dev/sd*[1-9] | sort | tail -n 1`
7
8usbutils_is_installed=`which lsusb`
9if [ -z $usbutils_is_installed ]; then
10 echo "FAIL: Cannot find lsusb"
11 exit 1
12else
13 echo "PASS: usbutils found"
14fi
15
16usbdev_num=`lsusb | grep -v root\ hub | wc -l`
17if [ $usbdev_num -eq 0 ]; then
18 echo "FAIL: USB device is not connected"
19 exit 1
20else
21 echo "PASS: $usbdev_num USB device(s) connected"
22fi
23
24lsusb | grep -v root\ hub
25mkdir -p /mnt/usb_ehci
26mount $USB_DISK /mnt/usb_ehci
27if [ $? -ne 0 ]; then
28 echo "FAIL: Mount USB device failed"
29 exit 1
30else
31 echo "PASS: Mount USB device succeed"
32fi
33
34echo "Begin test usb device..."
35dd if=/dev/urandom of=/mnt/usb_ehci/testfile bs=1M count=50
36if [ $? -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
42fi
43
44echo "PASS: test succeed"
45rm -f /mnt/usb_ehci_testfile
46umount /mnt/usb_ehci
47rm -fr /mnt/usb_ehci
48exit 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
3ethernet_interface="eth1"
4ethernet_ping_ipaddr="172.21.3.22"
5ethernet_ipaddr=$1
6
7IFCONFIG=`which ifconfig`
8
9$IFCONFIG $ethernet_interface up
10$IFCONFIG | grep $ethernet_interface
11if [ $? -ne 0 ]; then
12 echo "FAIL: $ethernet_interface is not up"
13 exit 1
14else
15 echo "PASS: $ethernet_interface is up"
16fi
17
18if [ "x$ethernet_ipaddr" != "x" ]; then
19 $IFCONFIG $ethernet_interface $ethernet_ipaddr
20fi
21
22$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}'
23if [ $? -ne 0 ]; then
24 echo "FAIL: ipaddr of $ethernet_interface setup failed"
25 exit 1
26else
27 echo "PASS: ipaddr of $ethernet_interface setup success"
28fi
29
30mindatasize=56
31maxdatasize=650
32stepsize=100
33iteration=1
34datasize=$mindatasize
35logfile=`/bin/mktemp`
36statistics=`/bin/mktemp`
37error=0
38
39trap cleanup SIGHUP SIGINT SIGTERM
40
41clean_tasks() {
42 echo "Executing clean up tasks"
43 rm -f $logfile $statistics
44}
45
46cleanup() {
47 echo "Aborting script execution"
48 clean_tasks
49 exit 0
50}
51
52echo "start ping test for $ethernet_interface..."
53
54while [ $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
72done
73
74# Report failures
75if [ $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
82else
83 clean_tasks
84 echo -e "PASS: ping test for $ethernet_interface success\n"
85fi
86
87echo "PASS: $ethernet_interface test passed"
88exit 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
7if part_num=`cat /proc/mtd | grep -c 'mtd'`; then
8 echo "PASS: show $part_num partitions"
9else
10 echo "FAIL: show $part_num partitions"
11fi
12
13for((part=0; part<$part_num-1; part++));
14do
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
20done
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
3if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then
4 echo "PASS: found $I2C_ADAPTERS i2c adapters"
5else
6 echo "FAIL: no i2c adapters found"
7 exit 1
8fi
9
10if [ -z "$adapters" ]; then
11 adapters=0
12fi
13
14while [ $adapters -lt $I2C_ADAPTERS ]
15do
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
24done
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
3RTC_DEVICE="/dev/rtc"
4
5if [ ! -e $RTC_DEVICE ]; then
6 echo "FAIL: rtc device does not exist"
7 exit 1
8else
9 echo "PASS: rtc device exists"
10fi
11
12/sbin/hwclock -f $RTC_DEVICE
13if [ $? -ne 0 ]; then
14 echo "FAIL: rtc device open failed"
15 exit 1
16else
17 echo "PASS: rtc device open success"
18fi
19
20
21/sbin/hwclock --systohc
22if [ $? -ne 0 ]; then
23 echo "FAIL: sync system clock and hardware clock failed"
24 exit 1
25else
26 echo "PASS: sync system clock and hardware clock success"
27fi
28
29RTC_TIME=$(/sbin/hwclock -r |awk '{print $4}')
30echo $RTC_TIME
31SYS_TIME=$(date +%m/%d/%Y-%X |awk '{print $1}' |awk -F- '{print $2}')
32echo $SYS_TIME
33
34if [ "$RTC_TIME" = "$SYS_TIME" ] ; then
35 echo "PASS: system time same with hardware time"
36else
37 echo "FAIL: system time different with hardware time"
38 exit 1
39fi
40
41echo "PASS: rtc test successful"
42exit 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
5SDHC_DEVICE="/dev/mmcblk0"
6SDHC_DEVICE_PART="/dev/mmcblk0p1"
7SFDISK=`which sfdisk`
8
9if [ -e $SDHC_DEVICE ]; then
10 echo "PASS: $SDHC_DEVICE device exists"
11else
12 echo "FAIL: $SDHC_DEVICE does not exist"
13 exit 1
14fi
15
16if [ -e $SDHC_DEVICE_PART ]; then
17 echo "PASS: $SDHC_DEVICE_PART device exists"
18elif [ ! -z $SFDISK ]; then
19
20 echo "Try to create a partition"
21
22$SFDISK $SDHC_DEVICE << EOF
23,,L
24EOF
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
33else
34 echo "FAIL: $SDHC_DEVICE_PART does not exist"
35 exit 1
36fi
37
38mount |grep mmcblk0p1
39if [ $? -eq 0 ]; then
40 umount $SDHC_DEVICE_PART
41fi
42
43/sbin/mkfs.ext2 $SDHC_DEVICE_PART
44if [ $? -ne 0 ]; then
45 echo "FAIL: format $SDHC_DEVICE_PART fail"
46 exit 1
47else
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
64fi
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
7MTD_CHAR_DEVICE="/dev/mtd4"
8MTD_BLOCK_DEVICE="/dev/mtdblock4"
9
10if [ ! -e $MTD_CHAR_DEVICE ]; then
11 echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist"
12 exit 1
13else
14 echo "PASS: spi flash device $MTD_CHAR_DEVICE exists"
15fi
16
17if [ ! -e $MTD_BLOCK_DEVICE ]; then
18 echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist"
19 exit 1
20else
21 echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists"
22fi
23
24/usr/sbin/flash_erase -j $MTD_CHAR_DEVICE 0 0
25if [ $? -ne 0 ]; then
26 echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail"
27 exit 1
28else
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
45fi
46
47echo "PASS: spi bus test passed"
48exit 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
6result=0
7devpath=""
8usbinfo=""
9
10usbutils_is_installed=`which lsusb`
11if [ -z $usbutils_is_installed ]; then
12 echo "FAIL: Cannot find lsusb"
13 exit 1
14fi
15
16usbdev_num=`lsusb | grep -v root\ hub | wc -l`
17if [ $usbdev_num -eq 0 ]; then
18 echo "FAIL: USB device is not connected"
19 exit 1
20else
21 echo "$usbdev_num USB device(s) connected"
22fi
23
24sd=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'`
25if [ -z "$sd" ]; then
26 echo "FAIL: find sd device"
27 exit 1
28else
29 echo "PASS: find sd device"
30fi
31
32HDPARM=`which hdparm`
33if [ -z $HDPARM ]; then
34 result=$?
35 echo "FAIL: find hdparm"
36fi
37 echo "PASS: find hdparm"
38
39for s in $sd
40do
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
99done
100exit $result