summaryrefslogtreecommitdiffstats
path: root/recipes-test/ddt-runner/files/scripts/bsc9132qds
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/bsc9132qds')
-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
7 files changed, 442 insertions, 0 deletions
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