From 2a7348129a42f21095fcd62e47a035f78d254130 Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 12 Dec 2013 17:36:38 +0100 Subject: initial commit of Enea Linux 3.1 Migrated from the internal git server on the dora-enea branch Signed-off-by: Adrian Dudau --- recipes-test/ddt-runner/ddt-runner.bb | 24 +++++ recipes-test/ddt-runner/files/ddt-runner | 19 ++++ .../ddt-runner/files/scripts/acp3448v2/ethernet | 97 ++++++++++++++++++ .../ddt-runner/files/scripts/acp3448v2/flash | 45 +++++++++ .../ddt-runner/files/scripts/acp3448v2/pci-express | 109 +++++++++++++++++++++ .../ddt-runner/files/scripts/acp3448v2/usb | 100 +++++++++++++++++++ .../ddt-runner/files/scripts/bsc9131rdb/ethernet | 89 +++++++++++++++++ .../ddt-runner/files/scripts/bsc9131rdb/flash | 48 +++++++++ .../ddt-runner/files/scripts/bsc9131rdb/i2c | 75 ++++++++++++++ .../ddt-runner/files/scripts/bsc9131rdb/preempt_rt | 33 +++++++ .../ddt-runner/files/scripts/bsc9131rdb/spi | 56 +++++++++++ .../ddt-runner/files/scripts/bsc9131rdb/watchdog | 64 ++++++++++++ .../ddt-runner/files/scripts/bsc9132qds/ethernet | 89 +++++++++++++++++ .../ddt-runner/files/scripts/bsc9132qds/flash | 48 +++++++++ .../ddt-runner/files/scripts/bsc9132qds/i2c | 75 ++++++++++++++ .../ddt-runner/files/scripts/bsc9132qds/preempt_rt | 33 +++++++ .../ddt-runner/files/scripts/bsc9132qds/sdhc | 77 +++++++++++++++ .../ddt-runner/files/scripts/bsc9132qds/spi | 56 +++++++++++ .../ddt-runner/files/scripts/bsc9132qds/watchdog | 64 ++++++++++++ .../ddt-runner/files/scripts/p2020rdb/ethernet | 88 +++++++++++++++++ .../ddt-runner/files/scripts/p2041rdb/ethernet | 88 +++++++++++++++++ .../ddt-runner/files/scripts/p2041rdb/flash | 49 +++++++++ recipes-test/ddt-runner/files/scripts/p2041rdb/i2c | 44 +++++++++ .../ddt-runner/files/scripts/p2041rdb/pci-express | 109 +++++++++++++++++++++ .../ddt-runner/files/scripts/p2041rdb/sata | 81 +++++++++++++++ .../ddt-runner/files/scripts/p2041rdb/sdhc | 41 ++++++++ recipes-test/ddt-runner/files/scripts/p2041rdb/usb | 48 +++++++++ .../ddt-runner/files/scripts/p4080ds/ethernet | 88 +++++++++++++++++ .../ddt-runner/files/scripts/p4080ds/flash | 20 ++++ recipes-test/ddt-runner/files/scripts/p4080ds/i2c | 24 +++++ recipes-test/ddt-runner/files/scripts/p4080ds/rtc | 42 ++++++++ recipes-test/ddt-runner/files/scripts/p4080ds/sdhc | 65 ++++++++++++ recipes-test/ddt-runner/files/scripts/p4080ds/spi | 48 +++++++++ recipes-test/ddt-runner/files/scripts/p4080ds/usb | 100 +++++++++++++++++++ recipes-test/perf-networking/files/perf-networking | 14 +++ .../perf-networking/perf-networking_1.0.bb | 19 ++++ recipes-test/systest-runner/files/systest-runner | 16 +++ recipes-test/systest-runner/files/tests/ltp | 23 +++++ .../systest-runner/files/tests/perf-network | 13 +++ recipes-test/systest-runner/files/tests/posixtest | 40 ++++++++ recipes-test/systest-runner/systest-runner.bb | 28 ++++++ 41 files changed, 2289 insertions(+) create mode 100644 recipes-test/ddt-runner/ddt-runner.bb create mode 100644 recipes-test/ddt-runner/files/ddt-runner create mode 100755 recipes-test/ddt-runner/files/scripts/acp3448v2/ethernet create mode 100755 recipes-test/ddt-runner/files/scripts/acp3448v2/flash create mode 100755 recipes-test/ddt-runner/files/scripts/acp3448v2/pci-express create mode 100755 recipes-test/ddt-runner/files/scripts/acp3448v2/usb create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9131rdb/ethernet create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9131rdb/flash create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9131rdb/i2c create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9131rdb/preempt_rt create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9131rdb/spi create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9131rdb/watchdog create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9132qds/ethernet create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9132qds/flash create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9132qds/i2c create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9132qds/preempt_rt create mode 100644 recipes-test/ddt-runner/files/scripts/bsc9132qds/sdhc create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9132qds/spi create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9132qds/watchdog create mode 100755 recipes-test/ddt-runner/files/scripts/p2020rdb/ethernet create mode 100755 recipes-test/ddt-runner/files/scripts/p2041rdb/ethernet create mode 100755 recipes-test/ddt-runner/files/scripts/p2041rdb/flash create mode 100755 recipes-test/ddt-runner/files/scripts/p2041rdb/i2c create mode 100755 recipes-test/ddt-runner/files/scripts/p2041rdb/pci-express create mode 100755 recipes-test/ddt-runner/files/scripts/p2041rdb/sata create mode 100755 recipes-test/ddt-runner/files/scripts/p2041rdb/sdhc create mode 100755 recipes-test/ddt-runner/files/scripts/p2041rdb/usb create mode 100755 recipes-test/ddt-runner/files/scripts/p4080ds/ethernet create mode 100755 recipes-test/ddt-runner/files/scripts/p4080ds/flash create mode 100755 recipes-test/ddt-runner/files/scripts/p4080ds/i2c create mode 100755 recipes-test/ddt-runner/files/scripts/p4080ds/rtc create mode 100755 recipes-test/ddt-runner/files/scripts/p4080ds/sdhc create mode 100755 recipes-test/ddt-runner/files/scripts/p4080ds/spi create mode 100755 recipes-test/ddt-runner/files/scripts/p4080ds/usb create mode 100755 recipes-test/perf-networking/files/perf-networking create mode 100644 recipes-test/perf-networking/perf-networking_1.0.bb create mode 100644 recipes-test/systest-runner/files/systest-runner create mode 100755 recipes-test/systest-runner/files/tests/ltp create mode 100755 recipes-test/systest-runner/files/tests/perf-network create mode 100755 recipes-test/systest-runner/files/tests/posixtest create mode 100644 recipes-test/systest-runner/systest-runner.bb (limited to 'recipes-test') diff --git a/recipes-test/ddt-runner/ddt-runner.bb b/recipes-test/ddt-runner/ddt-runner.bb new file mode 100644 index 0000000..f6d234e --- /dev/null +++ b/recipes-test/ddt-runner/ddt-runner.bb @@ -0,0 +1,24 @@ +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "file://ddt-runner \ + file://scripts" + +FILES_${PN} += "${libdir}/${PN}" +FILES_${PN} += "${bindir}/ddt-runner" + +do_install () { + install -D ${WORKDIR}/ddt-runner ${D}${bindir}/ddt-runner + if [ -d "${WORKDIR}/scripts/${MACHINE}" ]; then + install -d ${D}${libdir}/${PN}/scripts + for file in ${WORKDIR}/scripts/${MACHINE}/* ; do + install $file ${D}${libdir}/${PN}/scripts + done + fi +} + +do_patch[noexec] = "1" +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_build[noexec] = "1" 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 @@ +#!/bin/sh + +if [[ ! -d "/usr/lib/ddt-runner/scripts" ]]; then + echo "SKIP: No available driver testcase" + exit +fi + +cd /usr/lib/ddt-runner/scripts + +for x in * +do + if [[ -f $x ]]; then + date +%Y-%m-%dT%H:%M + echo "BEGIN: $x" + ./$x + echo "END: $x" + date +%Y-%m-%dT%H:%M + fi +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 @@ +#!/bin/sh +# +# This script is used to test ethernet functionality for acp3448v2. +# + +ethernet_interface="eth0" +ethernet_ping_ipaddr="172.21.3.22" +ethernet_ipaddr=$1 + +IFCONFIG=`which ifconfig` + +for((num=0; num<16; num++)); +do + ethernet_interface=eth$num + $IFCONFIG $ethernet_interface up + $IFCONFIG | grep $ethernet_interface + if [ $? -eq 0 ]; then + echo "PASS: $ethernet_interface is up" + break + fi +done + +if [ $num -eq 16 ]; then + echo "FAIL: $ethernet_interface is not up" + exit 1 +fi + +if [ "x$ethernet_ipaddr" != "x" ]; then + $IFCONFIG $ethernet_interface $ethernet_ipaddr +fi + +$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' +if [ $? -ne 0 ]; then + echo "FAIL: ipaddr of $ethernet_interface setup failed" + exit 1 +else + echo "PASS: ipaddr of $ethernet_interface setup success" +fi + +mindatasize=56 +maxdatasize=650 +stepsize=100 +iteration=1 +datasize=$mindatasize +logfile=`/bin/mktemp` +statistics=`/bin/mktemp` +error=0 + +trap cleanup SIGHUP SIGINT SIGTERM + +clean_tasks() { + echo "Executing clean up tasks" + rm -f $logfile $statistics +} + +cleanup() { + echo "Aborting script execution" + clean_tasks + exit 0 +} + +echo "start ping test for $ethernet_interface..." + +while [ $datasize -le $maxdatasize ]; do + for i in `seq 1 $iteration`; do + ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics + ping_err=`echo $?` + echo "" && cat $statistics | grep -r "PING" + cat $statistics | grep -r "received" + [ `echo $?` -eq 0 ] || packets_received=0 && \ + packets_received=`cat $statistics | \ + grep -r "received" | awk '{print$4}'` + + # Evaluate possible errors on the ping operation + if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then + error=1 + echo -e `cat $statistics | grep -r PING` >> $logfile + echo -e "Size: $datasize Iteration: $i\n" >> $logfile + fi + done + let datasize=$datasize+$stepsize +done + +# Report failures +if [ $error -eq 1 ]; then + echo -e "=================== error report ===================\n" + cat $logfile + echo -e "====================================================\n" + clean_tasks + echo -e "FAIL: ping test for $ethernet_interface failed\n" + exit 1 +else + clean_tasks + echo -e "PASS: ping test for $ethernet_interface success\n" +fi + +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 @@ +#!/bin/sh +# +# This script is used to test flash driver function. + +if part_num=`cat /proc/mtd | grep -c 'mtd'`; then + echo "PASS: show $part_num partitions" +else + echo "FAIL: show $part_num partitions" +fi + +for((part=0; part<$part_num-1; part++)); +do + if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then + echo "PASS: show partition $part debug info" + else + echo "FAIL: show partition $part debug info" + fi +done + +let "test_part=part_num-2" + +if [ $(flash_erase -j /dev/mtd${test_part} 0 0 | grep -c '100 % complete') ]; then + echo "PASS: erase and format partition ${test_part}" +else + echo "FAIL: erase and format partition ${test_part}" +fi + +mkdir -p /mnt/flash +mount -t jffs2 /dev/mtdblock${test_part} /mnt/flash +if [ $? -eq 0 ]; then + echo "PASS: mount partition ${test_part} as /mnt/flash" +else + echo "FAIL: mount partition ${test_part} as /mnt/flash" +fi + +cd /mnt/flash +touch test +if [ $(ls | grep -c 'test') ]; then + echo "PASS: touch a file on partition ${test_part}" +else + echo "FAIL: touch a file on partition ${test_part}" +fi + +cd ~ +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 @@ +#!/bin/sh + +ethernet_interface="eth0" +ethernet_ping_ipaddr="172.21.3.22" +ethernet_ipaddr=$1 + +#Intel Corporation 82574L Gigabit Network Card (intel e1000e) +vendor_id="8086" +product_id="10d3" + +#find vendor id & product id +lspci -nn |grep $vendor_id:$product_id +if [ $? -ne 0 ]; then + echo "FAIL: pci-e ethernet card device does not exist" + exit 1 +else + echo "PASS: got pci-e ethernet card device" +fi + +setpci -v -d $vendor_id:$product_id latency_timer=b0 +if [ $? -ne 0 ]; then + echo "FAIL: parameter changes to pci config space failed" + exit 1 +else + echo "PASS: parameter changes to pci config space success" +fi + +IFCONFIG=`which ifconfig` + +$IFCONFIG $ethernet_interface up +$IFCONFIG | grep $ethernet_interface +if [ $? -ne 0 ]; then + echo "FAIL: pci-e ethernet card device $ethernet_interface is not up" + exit 1 +else + echo "PASS: pci-e ethernet card device $ethernet_interface is up" +fi + +if [ "x$ethernet_ipaddr" != "x" ]; then + $IFCONFIG $ethernet_interface $ethernet_ipaddr +fi + +$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' +if [ $? -ne 0 ]; then + echo "FAIL: ipaddr of pci-e ethernet card device $ethernet_interface setup failed" + exit 1 +else + echo "PASS: ipaddr of pci-e ethernet card device $ethernet_interface setup success" +fi + +mindatasize=56 +maxdatasize=650 +stepsize=100 +iteration=1 +datasize=$mindatasize +logfile=`/bin/mktemp` +statistics=`/bin/mktemp` +error=0 + +trap cleanup SIGHUP SIGINT SIGTERM + +clean_tasks() { + echo "Executing clean up tasks" + rm -f $logfile $statistics +} + +cleanup() { + echo "Aborting script execution" + clean_tasks + exit 0 +} + +echo "start ping test for pci-e ethernet card device $ethernet_interface..." + +while [ $datasize -le $maxdatasize ]; do + for i in `seq 1 $iteration`; do + ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics + ping_err=`echo $?` + echo "" && cat $statistics | grep -r "PING" + cat $statistics | grep -r "received" + [ `echo $?` -eq 0 ] || packets_received=0 && \ + packets_received=`cat $statistics | \ + grep -r "received" | awk '{print$4}'` + + # Evaluate possible errors on the ping operation + if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then + error=1 + echo -e `cat $statistics | grep -r PING` >> $logfile + echo -e "Size: $datasize Iteration: $i\n" >> $logfile + fi + done + let datasize=$datasize+$stepsize +done + +# Report failures +if [ $error -eq 1 ]; then + echo -e "=================== error report ===================\n" + cat $logfile + echo -e "====================================================\n" + clean_tasks + echo -e "FAIL: ping test for pci-e ethernet card device $ethernet_interface failed\n" + exit 1 +else + clean_tasks + echo -e "PASS: ping test for pci-e ethernet card device $ethernet_interface success\n" +fi + +echo "PASS: pci express test passed" +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 @@ +#!/bin/sh +# +# This script is used to test usb functionality for acp3448v2. +# + +result=0 +devpath="" +usbinfo="" + +usbutils_is_installed=`which lsusb` +if [ -z $usbutils_is_installed ]; then + echo "FAIL: Cannot find lsusb" + exit 1 +fi + +usbdev_num=`lsusb | grep -v root\ hub | wc -l` +if [ $usbdev_num -eq 0 ]; then + echo "FAIL: USB device is not connected" + exit 1 +else + echo "$usbdev_num USB device(s) connected" +fi + +sd=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'` +if [ -z "$sd" ]; then + echo "FAIL: find sd device" + exit 1 +else + echo "PASS: find sd device" +fi + +HDPARM=`which hdparm` +if [ -z $HDPARM ]; then + result=$? + echo "FAIL: find hdparm" +fi + echo "PASS: find hdparm" + +for s in $sd +do + devpath=`echo "$s" | awk -F "," '{print "/sys/dev/block/" $1 ":" $2}'` + usbinfo=`ls -l $devpath | grep usb` + + if [ -z "$usbinfo" ] ; then + continue + fi + + s=`echo "$s" | awk -F "," '{print $3}'` + + echo "Testing $s" + $HDPARM -I $s + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: $HDPARM -I $s Detailed/current information directly from $s" + else + echo "PASS: $HDPARM -I $s Detailed/current information directly from $s" + fi + + $HDPARM -tT $s + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: $HDPARM -tT $s Perform device/cache read timings on $s" + else + echo "PASS: $HDPARM -tT $s Perform device/cache read timings on $s" + fi + + mkdir -p /mnt/usb_tmp + for partition in `ls "$s"[1-9]` + do + echo "Testing $partition" + + mount "$partition" /mnt/usb_tmp + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: mount $s" + else + echo "PASS: mount $s" + dd if=/dev/urandom of=/mnt/usb_tmp/writefile bs=1M count=50 + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: write test on $s" + else + echo "PASS: write test on $s" + rm -f /mnt/usb_tmp/writefile + fi + dd if=$s of=/mnt/usb_tmp/readfile bs=1M count=10 + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: read test on $s" + else + echo "PASS: read test on $s" + rm -f /mnt/usb_tmp/readfile + fi + umount /mnt/usb_tmp + fi + done + + rm -fr /mnt/usb_tmp +done +exit $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 @@ +#!/bin/sh +# This script is used to test ethernet interface for bsc9131rdb. + +ethernet_interface="eth0" +ethernet_ping_ipaddr="172.21.3.22" +ethernet_ipaddr=$1 + +IFCONFIG=`which ifconfig` + +$IFCONFIG $ethernet_interface up +$IFCONFIG | grep $ethernet_interface +if [ $? -ne 0 ]; then + echo "FAIL: $ethernet_interface is not up" + exit 1 +else + echo "PASS: $ethernet_interface is up" +fi + +if [ "x$ethernet_ipaddr" != "x" ]; then + $IFCONFIG $ethernet_interface $ethernet_ipaddr +fi + +$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' +if [ $? -ne 0 ]; then + echo "FAIL: ipaddr of $ethernet_interface setup failed" + exit 1 +else + echo "PASS: ipaddr of $ethernet_interface setup success" +fi + +mindatasize=56 +maxdatasize=650 +stepsize=100 +iteration=1 +datasize=$mindatasize +logfile=`/bin/mktemp` +statistics=`/bin/mktemp` +error=0 + +trap cleanup SIGHUP SIGINT SIGTERM + +clean_tasks() { + echo "Executing clean up tasks" + rm -f $logfile $statistics +} + +cleanup() { + echo "Aborting script execution" + clean_tasks + exit 0 +} + +echo "start ping test for $ethernet_interface..." + +while [ $datasize -le $maxdatasize ]; do + for i in `seq 1 $iteration`; do + ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics + ping_err=`echo $?` + echo "" && cat $statistics | grep -r "PING" + cat $statistics | grep -r "received" + [ `echo $?` -eq 0 ] || packets_received=0 && \ + packets_received=`cat $statistics | \ + grep -r "received" | awk '{print$4}'` + + # Evaluate possible errors on the ping operation + if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then + error=1 + echo -e `cat $statistics | grep -r PING` >> $logfile + echo -e "Size: $datasize Iteration: $i\n" >> $logfile + fi + done + let datasize=$datasize+$stepsize +done + +# Report failures +if [ $error -eq 1 ]; then + echo -e "=================== error report ===================\n" + cat $logfile + echo -e "====================================================\n" + clean_tasks + echo -e "FAIL: ping test for $ethernet_interface failed\n" + exit 1 +else + clean_tasks + echo -e "PASS: ping test for $ethernet_interface success\n" +fi + +echo "PASS: $ethernet_interface test passed" +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 @@ +#!/bin/sh +# +# This script is used to test flash driver functionality. I removed the tests +# which include write operations since all partition are in use in bsc9131rdb +# and there might be possibility of corrupting data even if we backup in test +# script. + +if part_num=`cat /proc/mtd | grep -c 'mtd'`; then + echo "PASS: $part_num partitions found" +else + echo "FAIL: $part_num partitions found" + exit 1 +fi + +for((part=0; part<$part_num; part++)); +do + if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then + echo "PASS: show partition $part debug info" + else + echo "FAIL: show partition $part debug info" + exit 1 + fi +done + +READ_TEST=`find / -name mtd_readtest.ko -print` + +if [ ! -e $READ_TEST ]; then + echo "FAIL: $READ_TEST does not exist" + exit 1 +else + echo "PASS: $READ_TEST exists" +fi + +for((part=0; part<$part_num; part++)); +do + dmesg -c > NULL + + modprobe $READ_TEST dev=$part + + bad_num=`dmesg | grep -c 'bad'` + if [ $bad_num -eq 0 ]; then + echo "PASS: read test for partition $part" + else + echo "FAIL: read test for partition $part" + fi + + rmmod $READ_TEST +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 @@ +#!/bin/sh +# This script is used to test i2c interface for bsc9131rdb + +I2C_DETECT=`which i2cdetect` +if [ "x$I2C_DETECT" != "x" ]; then + echo "PASS: i2cdetect found" +else + echo "FAIL: i2cdetect not found" + exit 1 +fi + +I2C_SET=`which i2cset` +if [ "x$I2C_SET" != "x" ]; then + echo "PASS: i2cset found" +else + echo "FAIL: i2cset not found" + exit 1 +fi + +I2C_GET=`which i2cget` +if [ "x$I2C_GET" != "x" ]; then + echo "PASS: i2cget found" +else + echo "FAIL: i2cget not found" + exit 1 +fi + +if I2C_ADAPTERS=`$I2C_DETECT -l |wc -l`; then + echo "PASS: $I2C_ADAPTERS i2c adapters found" +else + echo "FAIL: no i2c adapters found" + exit 1 +fi + +adapters=0 +while [ $adapters -lt $I2C_ADAPTERS ] +do + $I2C_DETECT -y $adapters + if [ $? -ne 0 ]; then + echo "FAIL: detect i2c adapter $adapters fail" + else + echo "PASS: detect i2c adapter $adapters success" + fi + adapters=`expr $adapters + 1` + sleep 1 +done + +# Area of bus:i2c-0 addr:0x52 is free to read and write +$I2C_SET -y 0 0x52 0 0x55 +if [ $? -eq 0 ]; then + echo "PASS: i2c_set -y 0 0x52 0 0x55 success" +else + echo "FAIL: i2c_set -y 0 0x52 0 0x55 fail" +fi + +num=`$I2C_GET -y 0 0x52 0 | grep -c '0x55'` +if [ $num -eq 1 ]; then + echo "PASS: i2c_get -y 0 0x52 0 success" +else + echo "FAIL: i2c_get -y 0 0x52 0 fail" +fi + +$I2C_SET -y 0 0x52 0 0xaa +if [ $? -eq 0 ]; then + echo "PASS: i2c_set -y 0 0x52 0 0xaa success" +else + echo "FAIL: i2c_set -y 0 0x52 0 0xaa fail" +fi + +num=`$I2C_GET -y 0 0x52 0 | grep -c '0xaa'` +if [ $num -eq 1 ]; then + echo "PASS: i2c_get -y 0 0x52 0 success" +else + echo "FAIL: i2c_get -y 0 0x52 0 fail" +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 @@ +#!/bin/sh +# +#This script is to test PREEMPT RT on target +# + +uname -a | grep "PREEMPT RT" +if [ $? -ne 0 ]; then + echo "FAIL: The kernel include real-time patch" + echo 1 +fi + echo "PASS: The kernel include real-time patch" + +ps | grep '\(\[irq/\)' +if [ $? -ne 0 ]; then + echo "FAIL: The IRQ handlers are treated by a patched kernel in kernel thread context." + exit 1 +fi + echo "PASS: The IRQ handlers are treated by a patched kernel in kernel thread context." + +cyclictest -t5 -p 80 -i 10000 -l 100 +if [ $? -ne 0 ]; then + echo "FAIL: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops." + exit 1 +fi + echo "PASS: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops." + +cyclictest -t5 -p 80 -n -i 10000 -l 100 +if [ $? -ne 0 ]; then + echo "FAIL: Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 micro seconds,. 100 loops." + exit 1 +fi + echo "PASS: Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 micro seconds,. 100 loops." + 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 @@ +#!/bin/sh +# This script is used to test spi flash functionality for bsc9131rdb. An spi +# flash M25P80 connect to bsc9131 cpu by spi bus, so the method is to read/write +# spi flash to verify whether the spi bus driver worked or not. + +MTD_CHAR_DEVICE="/dev/mtd8" +MTD_BLOCK_DEVICE="/dev/mtdblock8" + +FLASH_ERASE=`which flash_erase` +if [ "x$FLASH_ERASE" != "x" ]; then + echo "PASS: flash_erase found" +else + echo "FAIL: flash_erase not found" + exit 1 +fi + +if [ ! -e $MTD_CHAR_DEVICE ]; then + echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" + exit 1 +else + echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" +fi + +if [ ! -e $MTD_BLOCK_DEVICE ]; then + echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" + exit 1 +else + echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" +fi + +$FLASH_ERASE -j $MTD_CHAR_DEVICE 0 0 +if [ $? -ne 0 ]; then + echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 +else + mkdir -p /mnt/spi + mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi + if [ $? -ne 0 ]; then + echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 + else + cp /bin/busybox /mnt/spi + file_num=`ls /mnt/spi |grep -c 'busybox'` + if [ $file_num -eq 1 ]; then + rm /mnt/spi/busybox + umount $MTD_BLOCK_DEVICE + echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" + else + echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 + fi + fi +fi + +echo "PASS: spi bus test passed" +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 @@ +#!/bin/sh +# +# This script is used to test watchdog functionality for bsc9131rdb. + +WATCHDOG=`which watchdog` +if [ "x$WATCHDOG" != "x" ]; then + echo "PASS: watchdog found" +else + echo "FAIL: watchdog not found" + exit 1 +fi + +WATCHDOG_CONF=/etc/watchdog.conf +if [ -f $WATCHDOG_CONF ]; then + echo "PASS: watchdog config file found" + sed -i '23,23 s/#//' $WATCHDOG_CONF +else + echo "FAIL: watchdog config file not found" + exit 1 +fi + +$WATCHDOG -v /dev/watchdog +watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` +if [ $watchdog_thread -eq 2 ]; then + echo "PASS: Watchdog daemon started successfully" +else + echo "FAIL: Failed to start watchdog daemon" + exit 1 +fi + +sleep 5s + +killall watchdog + +retry=0 +while [ $retry -lt 10 ] +do + watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` + if [ $watchdog_thread -eq 1 ]; then + echo "PASS: Watchdog daemon stopped successfully" + break; + fi + sleep 1s + retry=`expr $retry + 1` +done + +if [ $retry -eq 10 ]; then + echo "FAIL: Failed to stop watchdog daemon" +fi + +found=0 +while read line +do + result=`echo $line | grep -c 'still alive after 1 interval'` + if [ $result -eq 1 ]; then + echo "PASS: Watchdog is still alive after 1 interval" + found=1 + fi +done < /var/log/messages + +if [ $found -eq 0 ]; then + echo "FAIL: Watchdog is not alive after 1 interval" +fi + 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 @@ +#!/bin/sh +# This script is used to test ethernet interface for bsc9131rdb. + +ethernet_interface="eth0" +ethernet_ping_ipaddr="172.21.3.22" +ethernet_ipaddr=$1 + +IFCONFIG=`which ifconfig` + +$IFCONFIG $ethernet_interface up +$IFCONFIG | grep $ethernet_interface +if [ $? -ne 0 ]; then + echo "FAIL: $ethernet_interface is not up" + exit 1 +else + echo "PASS: $ethernet_interface is up" +fi + +if [ "x$ethernet_ipaddr" != "x" ]; then + $IFCONFIG $ethernet_interface $ethernet_ipaddr +fi + +$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' +if [ $? -ne 0 ]; then + echo "FAIL: ipaddr of $ethernet_interface setup failed" + exit 1 +else + echo "PASS: ipaddr of $ethernet_interface setup success" +fi + +mindatasize=56 +maxdatasize=650 +stepsize=100 +iteration=1 +datasize=$mindatasize +logfile=`/bin/mktemp` +statistics=`/bin/mktemp` +error=0 + +trap cleanup SIGHUP SIGINT SIGTERM + +clean_tasks() { + echo "Executing clean up tasks" + rm -f $logfile $statistics +} + +cleanup() { + echo "Aborting script execution" + clean_tasks + exit 0 +} + +echo "start ping test for $ethernet_interface..." + +while [ $datasize -le $maxdatasize ]; do + for i in `seq 1 $iteration`; do + ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics + ping_err=`echo $?` + echo "" && cat $statistics | grep -r "PING" + cat $statistics | grep -r "received" + [ `echo $?` -eq 0 ] || packets_received=0 && \ + packets_received=`cat $statistics | \ + grep -r "received" | awk '{print$4}'` + + # Evaluate possible errors on the ping operation + if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then + error=1 + echo -e `cat $statistics | grep -r PING` >> $logfile + echo -e "Size: $datasize Iteration: $i\n" >> $logfile + fi + done + let datasize=$datasize+$stepsize +done + +# Report failures +if [ $error -eq 1 ]; then + echo -e "=================== error report ===================\n" + cat $logfile + echo -e "====================================================\n" + clean_tasks + echo -e "FAIL: ping test for $ethernet_interface failed\n" + exit 1 +else + clean_tasks + echo -e "PASS: ping test for $ethernet_interface success\n" +fi + +echo "PASS: $ethernet_interface test passed" +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 @@ +#!/bin/sh +# +# This script is used to test flash driver functionality. I removed the tests +# which include write operations since all partition are in use in bsc9131rdb +# and there might be possibility of corrupting data even if we backup in test +# script. + +if part_num=`cat /proc/mtd | grep -c 'mtd'`; then + echo "PASS: $part_num partitions found" +else + echo "FAIL: $part_num partitions found" + exit 1 +fi + +for((part=0; part<$part_num; part++)); +do + if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then + echo "PASS: show partition $part debug info" + else + echo "FAIL: show partition $part debug info" + exit 1 + fi +done + +READ_TEST=`find / -name mtd_readtest.ko -print` + +if [ ! -e $READ_TEST ]; then + echo "FAIL: $READ_TEST does not exist" + exit 1 +else + echo "PASS: $READ_TEST exists" +fi + +for((part=0; part<$part_num; part++)); +do + dmesg -c > NULL + + modprobe $READ_TEST dev=$part + + bad_num=`dmesg | grep -c 'bad'` + if [ $bad_num -eq 0 ]; then + echo "PASS: read test for partition $part" + else + echo "FAIL: read test for partition $part" + fi + + rmmod $READ_TEST +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 @@ +#!/bin/sh +# This script is used to test i2c interface for bsc9131rdb + +I2C_DETECT=`which i2cdetect` +if [ "x$I2C_DETECT" != "x" ]; then + echo "PASS: i2cdetect found" +else + echo "FAIL: i2cdetect not found" + exit 1 +fi + +I2C_SET=`which i2cset` +if [ "x$I2C_SET" != "x" ]; then + echo "PASS: i2cset found" +else + echo "FAIL: i2cset not found" + exit 1 +fi + +I2C_GET=`which i2cget` +if [ "x$I2C_GET" != "x" ]; then + echo "PASS: i2cget found" +else + echo "FAIL: i2cget not found" + exit 1 +fi + +if I2C_ADAPTERS=`$I2C_DETECT -l |wc -l`; then + echo "PASS: $I2C_ADAPTERS i2c adapters found" +else + echo "FAIL: no i2c adapters found" + exit 1 +fi + +adapters=0 +while [ $adapters -lt $I2C_ADAPTERS ] +do + $I2C_DETECT -y $adapters + if [ $? -ne 0 ]; then + echo "FAIL: detect i2c adapter $adapters fail" + else + echo "PASS: detect i2c adapter $adapters success" + fi + adapters=`expr $adapters + 1` + sleep 1 +done + +# Area of bus:i2c-0 addr:0x52 is free to read and write +$I2C_SET -y 0 0x52 0 0x55 +if [ $? -eq 0 ]; then + echo "PASS: i2c_set -y 0 0x52 0 0x55 success" +else + echo "FAIL: i2c_set -y 0 0x52 0 0x55 fail" +fi + +num=`$I2C_GET -y 0 0x52 0 | grep -c '0x55'` +if [ $num -eq 1 ]; then + echo "PASS: i2c_get -y 0 0x52 0 success" +else + echo "FAIL: i2c_get -y 0 0x52 0 fail" +fi + +$I2C_SET -y 0 0x52 0 0xaa +if [ $? -eq 0 ]; then + echo "PASS: i2c_set -y 0 0x52 0 0xaa success" +else + echo "FAIL: i2c_set -y 0 0x52 0 0xaa fail" +fi + +num=`$I2C_GET -y 0 0x52 0 | grep -c '0xaa'` +if [ $num -eq 1 ]; then + echo "PASS: i2c_get -y 0 0x52 0 success" +else + echo "FAIL: i2c_get -y 0 0x52 0 fail" +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 @@ +#!/bin/sh +# +#This script is to test PREEMPT RT on target +# + +uname -a | grep "PREEMPT RT" +if [ $? -ne 0 ]; then + echo "FAIL: The kernel include real-time patch" + echo 1 +fi + echo "PASS: The kernel include real-time patch" + +ps | grep '\(\[irq/\)' +if [ $? -ne 0 ]; then + echo "FAIL: The IRQ handlers are treated by a patched kernel in kernel thread context." + exit 1 +fi + echo "PASS: The IRQ handlers are treated by a patched kernel in kernel thread context." + +cyclictest -t5 -p 80 -i 10000 -l 100 +if [ $? -ne 0 ]; then + echo "FAIL: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops." + exit 1 +fi + echo "PASS: Test case: POSIX interval timer, Interval 10000 micro seconds,. 100 loops." + +cyclictest -t5 -p 80 -n -i 10000 -l 100 +if [ $? -ne 0 ]; then + echo "FAIL: Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 micro seconds,. 100 loops." + exit 1 +fi + echo "PASS: Test case: clock_nanosleep(TIME_ABSTIME), Interval 10000 micro seconds,. 100 loops." + 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 @@ +#!/bin/sh +# This script is used to test SDHC card functionality for bsc9132rdb + +DEV="mmc0:e624" + +if [ -f /sys/bus/mmc/drivers/mmcblk/bind ]; then + echo "PASS: /sys/bus/mmc/drivers/mmcblk/bind found" +else + echo "FAIL: /sys/bus/mmc/drivers/mmcblk/bind not found" + exit 1 +fi + +if [ -f /sys/bus/mmc/drivers/mmcblk/unbind ]; then + echo "PASS: /sys/bus/mmc/drivers/mmcblk/unbind found" +else + echo "FAIL: /sys/bus/mmc/drivers/mmcblk/unbind not found" + exit 1 +fi + +if [ -f /sys/bus/mmc/drivers/mmc_test/bind ]; then + echo "PASS: /sys/bus/mmc/drivers/mmc_test/bind found" +else + echo "FAIL: /sys/bus/mmc/drivers/mmc_test/bind not found" + exit 1 +fi + +if [ -f /sys/bus/mmc/drivers/mmc_test/unbind ]; then + echo "PASS: /sys/bus/mmc/drivers/mmc_test/unbind found" +else + echo "FAIL: /sys/bus/mmc/drivers/mmc_test/unbind not found" + exit 1 +fi + +mount -t debugfs none /sys/kernel/debug +if [ $? -eq 0 ]; then + echo "PASS: successfully mount /sys/kernel/debug" +else + echo "FAIL: failed to mount /sys/kernel/debug" +fi + +echo $DEV > /sys/bus/mmc/drivers/mmcblk/unbind +if [ $? -eq 0 ]; then + echo "PASS: successfully unbind mmcblk driver" +else + echo "FAIL: failed to unbind mmcblk driver" +fi + +echo $DEV > /sys/bus/mmc/drivers/mmc_test/bind +if [ $? -eq 0 ]; then + echo "PASS: successfully bind mmc_test driver" +else + echo "FAIL: failed to bind mmc_test driver" +fi + +# echo 0 means test all supported test cases +fail_num=`echo 0 > /sys/kernel/debug/mmc0/mmc0\:e624/test | grep -E -c 'FAILED|ERROR'` +if [ $fail_num -eq 0 ]; then + echo "PASS: all test cases passed" +else + echo "FAIL: some test cases failed" +fi + +cat /sys/kernel/debug/mmc0/mmc0\:e624/test + +echo $DEV > /sys/bus/mmc/drivers/mmc_test/unbind +if [ $? -eq 0 ]; then + echo "PASS: successfully unbind mmc_test driver" +else + echo "FAIL: failed to unbind mmc_test driver" +fi + +echo $DEV > /sys/bus/mmc/drivers/mmcblk/bind +if [ $? -eq 0 ]; then + echo "PASS: successfully bind mmcblk driver" +else + echo "FAIL: failed to bind mmcblk driver" +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 @@ +#!/bin/sh +# This script is used to test spi flash functionality for bsc9131rdb. An spi +# flash M25P80 connect to bsc9131 cpu by spi bus, so the method is to read/write +# spi flash to verify whether the spi bus driver worked or not. + +MTD_CHAR_DEVICE="/dev/mtd8" +MTD_BLOCK_DEVICE="/dev/mtdblock8" + +FLASH_ERASE=`which flash_erase` +if [ "x$FLASH_ERASE" != "x" ]; then + echo "PASS: flash_erase found" +else + echo "FAIL: flash_erase not found" + exit 1 +fi + +if [ ! -e $MTD_CHAR_DEVICE ]; then + echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" + exit 1 +else + echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" +fi + +if [ ! -e $MTD_BLOCK_DEVICE ]; then + echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" + exit 1 +else + echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" +fi + +$FLASH_ERASE -j $MTD_CHAR_DEVICE 0 0 +if [ $? -ne 0 ]; then + echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 +else + mkdir -p /mnt/spi + mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi + if [ $? -ne 0 ]; then + echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 + else + cp /bin/busybox /mnt/spi + file_num=`ls /mnt/spi |grep -c 'busybox'` + if [ $file_num -eq 1 ]; then + rm /mnt/spi/busybox + umount $MTD_BLOCK_DEVICE + echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" + else + echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 + fi + fi +fi + +echo "PASS: spi bus test passed" +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 @@ +#!/bin/sh +# +# This script is used to test watchdog functionality for bsc9132qds. + +WATCHDOG=`which watchdog` +if [ "x$WATCHDOG" != "x" ]; then + echo "PASS: watchdog found" +else + echo "FAIL: watchdog not found" + exit 1 +fi + +WATCHDOG_CONF=/etc/watchdog.conf +if [ -f $WATCHDOG_CONF ]; then + echo "PASS: watchdog config file found" + sed -i '23,23 s/#//' $WATCHDOG_CONF +else + echo "FAIL: watchdog config file not found" + exit 1 +fi + +$WATCHDOG -v /dev/watchdog +watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` +if [ $watchdog_thread -eq 2 ]; then + echo "PASS: Watchdog daemon started successfully" +else + echo "FAIL: Failed to start watchdog daemon" + exit 1 +fi + +sleep 5s + +killall watchdog + +retry=0 +while [ $retry -lt 10 ] +do + watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` + if [ $watchdog_thread -eq 1 ]; then + echo "PASS: Watchdog daemon stopped successfully" + break; + fi + sleep 1s + retry=`expr $retry + 1` +done + +if [ $retry -eq 10 ]; then + echo "FAIL: Failed to stop watchdog daemon" +fi + +found=0 +while read line +do + result=`echo $line | grep -c 'still alive after 1 interval'` + if [ $result -eq 1 ]; then + echo "PASS: Watchdog is still alive after 1 interval" + found=1 + fi +done < /var/log/messages + +if [ $found -eq 0 ]; then + echo "FAIL: Watchdog is not alive after 1 interval" +fi + 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 @@ +#!/bin/sh + +ethernet_interface="eth1" +ethernet_ping_ipaddr="172.21.3.22" +ethernet_ipaddr=$1 + +IFCONFIG=`which ifconfig` + +$IFCONFIG $ethernet_interface up +$IFCONFIG | grep $ethernet_interface +if [ $? -ne 0 ]; then + echo "FAIL: $ethernet_interface is not up" + exit 1 +else + echo "PASS: $ethernet_interface is up" +fi + +if [ "x$ethernet_ipaddr" != "x" ]; then + $IFCONFIG $ethernet_interface $ethernet_ipaddr +fi + +$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' +if [ $? -ne 0 ]; then + echo "FAIL: ipaddr of $ethernet_interface setup failed" + exit 1 +else + echo "PASS: ipaddr of $ethernet_interface setup success" +fi + +mindatasize=56 +maxdatasize=650 +stepsize=100 +iteration=1 +datasize=$mindatasize +logfile=`/bin/mktemp` +statistics=`/bin/mktemp` +error=0 + +trap cleanup SIGHUP SIGINT SIGTERM + +clean_tasks() { + echo "Executing clean up tasks" + rm -f $logfile $statistics +} + +cleanup() { + echo "Aborting script execution" + clean_tasks + exit 0 +} + +echo "start ping test for $ethernet_interface..." + +while [ $datasize -le $maxdatasize ]; do + for i in `seq 1 $iteration`; do + ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics + ping_err=`echo $?` + echo "" && cat $statistics | grep -r "PING" + cat $statistics | grep -r "received" + [ `echo $?` -eq 0 ] || packets_received=0 && \ + packets_received=`cat $statistics | \ + grep -r "received" | awk '{print$4}'` + + # Evaluate possible errors on the ping operation + if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then + error=1 + echo -e `cat $statistics | grep -r PING` >> $logfile + echo -e "Size: $datasize Iteration: $i\n" >> $logfile + fi + done + let datasize=$datasize+$stepsize +done + +# Report failures +if [ $error -eq 1 ]; then + echo -e "=================== error report ===================\n" + cat $logfile + echo -e "====================================================\n" + clean_tasks + echo -e "FAIL: ping test for $ethernet_interface failed\n" + exit 1 +else + clean_tasks + echo -e "PASS: ping test for $ethernet_interface success\n" +fi + +echo "PASS: $ethernet_interface test passed" +exit 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 @@ +#!/bin/sh + +ethernet_interface="eth1" +#sestord02 ip address +ethernet_ping_ipaddr="172.21.3.22" +ethernet_ipaddr=$1 + +IFCONFIG=`which ifconfig` + +$IFCONFIG $ethernet_interface up +$IFCONFIG | grep $ethernet_interface +if [ $? -ne 0 ]; then + echo "FAIL: $ethernet_interface is not up" + exit 1 +else + echo "PASS: $ethernet_interface is up" +fi + +if [ "x$ethernet_ipaddr" != "x" ]; then + $IFCONFIG $ethernet_interface $ethernet_ipaddr +fi + +$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' +if [ $? -ne 0 ]; then + echo "FAIL: ipaddr of $ethernet_interface setup failed" + exit 1 +else + echo "PASS: ipaddr of $ethernet_interface setup success" +fi + +mindatasize=56 +maxdatasize=650 +stepsize=100 +iteration=1 +datasize=$mindatasize +logfile=`/bin/mktemp` +statistics=`/bin/mktemp` +error=0 + +trap cleanup SIGHUP SIGINT SIGTERM + +clean_tasks() { + echo "Executing clean up tasks" + rm -f $logfile $statistics +} + +cleanup() { + echo "Aborting script execution" + clean_tasks + exit 0 +} + +echo "start ping test for $ethernet_interface..." + +while [ $datasize -le $maxdatasize ]; do + for i in `seq 1 $iteration`; do + ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics + ping_err=`echo $?` + echo "" && cat $statistics | grep -r "PING" + cat $statistics | grep -r "received" + [ `echo $?` -eq 0 ] || packets_received=0 && \ + packets_received=`cat $statistics | \ + grep -r "received" | awk '{print$4}'` + + # Evaluate possible errors on the ping operation + if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then + error=1 + echo -e `cat $statistics | grep -r PING` >> $logfile + echo -e "Size: $datasize Iteration: $i\n" >> $logfile + fi + done + let datasize=$datasize+$stepsize +done + +# Report failures +if [ $error -eq 1 ]; then + echo -e "=================== error report ===================\n" + cat $logfile + echo -e "====================================================\n" + clean_tasks + echo -e "FAIL: ping test for $ethernet_interface failed\n" + exit 1 +else + clean_tasks + echo -e "PASS: ping test for $ethernet_interface success\n" +fi + +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 @@ +#!/bin/sh +# +# This script is used to test flash driver functionality. I removed the write +# operations since all partition are in use in p2041rdb and there might be +# possibility of corrupting data even if we backup in test script. + +if part_num=`cat /proc/mtd | grep -c 'mtd'`; then + echo "PASS: show $part_num partitions" +else + echo "FAIL: show $part_num partitions" + exit 1 +fi + +for((part=0; part<$part_num; part++)); +do + if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then + echo "PASS: show partition $part debug info" + else + echo "FAIL: show partition $part debug info" + exit 1 + fi +done + +READ_TEST=`find / -name mtd_readtest.ko -print` + +if [ ! -e $READ_TEST ]; then + echo "FAIL: $READ_TEST does not exist" + exit 1 +else + echo "PASS: $READ_TEST exists" +fi + +for((part=0; part<$part_num; part++)); +do + dmesg -c + + insmod $READ_TEST dev=$part + + finish=`dmesg | grep -c 'mtd_readtest: finished'` + if [ $finish -eq 1 ]; then + echo "PASS: read test $part" + else + echo "FAIL: read test $part" + rmmod $READ_TEST + exit 1 + fi + + rmmod $READ_TEST +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 @@ +#!/bin/sh +# This script is used to test i2c bus functionality for p2041rdb board. + +if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then + echo "PASS: found $I2C_ADAPTERS i2c adapters" +else + echo "FAIL: no i2c adapters found" + exit 1 +fi + +if [ -z "$adapters" ]; then + adapters=0 +fi + +while [ $adapters -lt $I2C_ADAPTERS ] +do + i2cdetect -y $adapters + if [ $? -ne 0 ]; then + echo "FAIL: detect i2c adapter $adapters failed" + else + echo "PASS: detect i2c adapter $adapters success" + fi + adapters=`expr $adapters + 1` + sleep 1 +done + +i2cdetect -y 0 +if [ $? -ne 0 ]; then + echo "FAIL: detect i2c bus 0 fail" + exit 1 +else + echo "PASS: detect i2c bus 0 success" +fi + +#i2c bus 0, device address 0x52, DDR3 DIMM Socket 1, SPD EEPROM +i2cdump -f -y 0 0x52 |grep UG51U6400N8SU +if [ $? -ne 0 ]; then + echo "FAIL: read SPD EEPROM on i2c bus 0 fail" + exit 1 +else + echo "PASS: read SPD EEPROM on i2c bus 0 success" +fi + + 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 @@ +#!/bin/sh + +ethernet_interface="eth0" +#sestord02 ip address +ethernet_ping_ipaddr="172.21.3.22" +ethernet_ipaddr=$1 + +#Intel Corporation 82574L Gigabit Network Card (intel e1000e) +vendor_id="8086" +product_id="10d3" + +#find vendor id & product id +lspci -nn |grep $vendor_id:$product_id +if [ $? -ne 0 ]; then + echo "FAIL: pci-e ethernet card device does not exist" + exit 1 +else + echo "PASS: got pci-e ethernet card device" +fi + +setpci -v -d $vendor_id:$product_id latency_timer=b0 +if [ $? -ne 0 ]; then + echo "FAIL: parameter changes to pci config space failed" + exit 1 +else + echo "PASS: parameter changes to pci config space success" +fi + +IFCONFIG=`which ifconfig` + +$IFCONFIG $ethernet_interface up +$IFCONFIG | grep $ethernet_interface +if [ $? -ne 0 ]; then + echo "FAIL: pci-e ethernet card device $ethernet_interface is not up" + exit 1 +else + echo "PASS: pci-e ethernet card device $ethernet_interface is up" +fi + +if [ "x$ethernet_ipaddr" != "x" ]; then + $IFCONFIG $ethernet_interface $ethernet_ipaddr +fi + +$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' +if [ $? -ne 0 ]; then + echo "FAIL: ipaddr of pci-e ethernet card device $ethernet_interface setup failed" + exit 1 +else + echo "PASS: ipaddr of pci-e ethernet card device $ethernet_interface setup success" +fi + +mindatasize=56 +maxdatasize=650 +stepsize=100 +iteration=1 +datasize=$mindatasize +logfile=`/bin/mktemp` +statistics=`/bin/mktemp` +error=0 + +trap cleanup SIGHUP SIGINT SIGTERM + +clean_tasks() { + echo "Executing clean up tasks" + rm -f $logfile $statistics +} + +cleanup() { + echo "Aborting script execution" + clean_tasks + exit 0 +} + +echo "start ping test for pci-e ethernet card device $ethernet_interface..." + +while [ $datasize -le $maxdatasize ]; do + for i in `seq 1 $iteration`; do + ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics + ping_err=`echo $?` + echo "" && cat $statistics | grep -r "PING" + cat $statistics | grep -r "received" + [ `echo $?` -eq 0 ] || packets_received=0 && \ + packets_received=`cat $statistics | \ + grep -r "received" | awk '{print$4}'` + + # Evaluate possible errors on the ping operation + if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then + error=1 + echo -e `cat $statistics | grep -r PING` >> $logfile + echo -e "Size: $datasize Iteration: $i\n" >> $logfile + fi + done + let datasize=$datasize+$stepsize +done + +# Report failures +if [ $error -eq 1 ]; then + echo -e "=================== error report ===================\n" + cat $logfile + echo -e "====================================================\n" + clean_tasks + echo -e "FAIL: ping test for pci-e ethernet card device $ethernet_interface failed\n" + exit 1 +else + clean_tasks + echo -e "PASS: ping test for pci-e ethernet card device $ethernet_interface success\n" +fi + +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 @@ +#!/bin/sh +# +#This script is to test sata devices on target +# +result=0 +devpath="" +satainfo="" +SD=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'` +if [ -z "$SD" ]; then + echo "FAIL: find sata device" + exit 1 +else + echo "PASS: find sata device" +fi +HDPARM=`which hdparm` +if [ -z $HDPARM ]; then + result=$? + echo "FAIL: find hdparm" +fi + echo "PASS: find hdparm" + + +for s in $SD + do + devpath=`echo "$s" | awk -F "," '{print "/sys/dev/block/" $1 ":" $2}'` + satainfo=`ls -l $devpath | grep sata` + + if [ -z "$satainfo" ] ; then + continue + fi + s=`echo "$s" | awk -F "," '{print $3}'` + + echo "testing $s" + $HDPARM -I $s + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: $HDPARM -I $s Detailed/current information directly from $s" + else + echo "PASS: $HDPARM -I $s Detailed/current information directly from $s" + fi + $HDPARM -tT $s + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: $HDPARM -tT $s Perform device/cache read timings on $s" + else + echo "PASS: $HDPARM -tT $s Perform device/cache read timings on $s" + fi + + + mkdir -p /mnt/sata_tmp + for partition in `ls "$s"[1-9]` + do + mount "$partition" /mnt/sata_tmp + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: Mount $s" + else + echo "PASS: Mount $s" + dd if=/dev/urandom of=/mnt/sata_tmp/writefile bs=1M count=50 + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: write test on $s" + else + echo "PASS: write test on $s" + rm -f /mnt/sata_tmp/writefile + fi + dd if=$s of=/mnt/sata_tmp/readfile bs=1M count=10 + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: read test on $s" + else + echo "PASS: read test on $s" + rm -f /mnt/sata_tmp/readfile + fi + umount /mnt/sata_tmp + fi + done + + rm -fr /mnt/sata_tmp +done +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 @@ +#!/bin/sh + +#the content of SD will be lost by running this test case. + +SDHC_DEVICE="/dev/mmcblk0p1" + +if [ ! -e $SDHC_DEVICE ]; then + echo "FAIL: $SDHC_DEVICE does not exist" + exit 1 +else + echo "PASS: $SDHC_DEVICE device exists" +fi + +mount |grep mmcblk0p1 +if [ $? -eq 0 ]; then + umount $SDHC_DEVICE +fi + +/sbin/mkfs.ext2 $SDHC_DEVICE +if [ $? -ne 0 ]; then + echo "FAIL: format $SDHC_DEVICE fail" + exit 1 +else + mkdir -p /mnt/sdhc + mount $SDHC_DEVICE /mnt/sdhc + if [ $? -ne 0 ]; then + echo "FAIL: mount $SDHC_DEVICE fail" + exit 1 + else + cp /bin/busybox /mnt/sdhc + ls /mnt/sdhc |grep busybox + if [ $? -ne 0 ]; then + echo "FAIL: read or write $SDHC_DEVICE fail" + exit 1 + else + umount $SDHC_DEVICE + echo "PASS: read or write $SDHC_DEVICE success" + fi + fi +fi + 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 @@ +#!/bin/sh +# +#This script is to test usb devices on p2041rdb target +# + +USB_DISK=`ls /dev/sd*[1-9] | sort | tail -n 1` + +usbutils_is_installed=`which lsusb` +if [ -z $usbutils_is_installed ]; then + echo "FAIL: Cannot find lsusb" + exit 1 +else + echo "PASS: usbutils found" +fi + +usbdev_num=`lsusb | grep -v root\ hub | wc -l` +if [ $usbdev_num -eq 0 ]; then + echo "FAIL: USB device is not connected" + exit 1 +else + echo "PASS: $usbdev_num USB device(s) connected" +fi + +lsusb | grep -v root\ hub +mkdir -p /mnt/usb_ehci +mount $USB_DISK /mnt/usb_ehci +if [ $? -ne 0 ]; then + echo "FAIL: Mount USB device failed" + exit 1 +else + echo "PASS: Mount USB device succeed" +fi + +echo "Begin test usb device..." +dd if=/dev/urandom of=/mnt/usb_ehci/testfile bs=1M count=50 +if [ $? -ne 0 ]; then + echo "FAIL: test failed" + rm -f /mnt/usb_ehci_testfile + umount /mnt/usb_ehci + rm -fr /mnt/usb_ehci + exit 1 +fi + +echo "PASS: test succeed" +rm -f /mnt/usb_ehci_testfile +umount /mnt/usb_ehci +rm -fr /mnt/usb_ehci +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 @@ +#!/bin/sh + +ethernet_interface="eth1" +ethernet_ping_ipaddr="172.21.3.22" +ethernet_ipaddr=$1 + +IFCONFIG=`which ifconfig` + +$IFCONFIG $ethernet_interface up +$IFCONFIG | grep $ethernet_interface +if [ $? -ne 0 ]; then + echo "FAIL: $ethernet_interface is not up" + exit 1 +else + echo "PASS: $ethernet_interface is up" +fi + +if [ "x$ethernet_ipaddr" != "x" ]; then + $IFCONFIG $ethernet_interface $ethernet_ipaddr +fi + +$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' +if [ $? -ne 0 ]; then + echo "FAIL: ipaddr of $ethernet_interface setup failed" + exit 1 +else + echo "PASS: ipaddr of $ethernet_interface setup success" +fi + +mindatasize=56 +maxdatasize=650 +stepsize=100 +iteration=1 +datasize=$mindatasize +logfile=`/bin/mktemp` +statistics=`/bin/mktemp` +error=0 + +trap cleanup SIGHUP SIGINT SIGTERM + +clean_tasks() { + echo "Executing clean up tasks" + rm -f $logfile $statistics +} + +cleanup() { + echo "Aborting script execution" + clean_tasks + exit 0 +} + +echo "start ping test for $ethernet_interface..." + +while [ $datasize -le $maxdatasize ]; do + for i in `seq 1 $iteration`; do + ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics + ping_err=`echo $?` + echo "" && cat $statistics | grep -r "PING" + cat $statistics | grep -r "received" + [ `echo $?` -eq 0 ] || packets_received=0 && \ + packets_received=`cat $statistics | \ + grep -r "received" | awk '{print$4}'` + + # Evaluate possible errors on the ping operation + if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then + error=1 + echo -e `cat $statistics | grep -r PING` >> $logfile + echo -e "Size: $datasize Iteration: $i\n" >> $logfile + fi + done + let datasize=$datasize+$stepsize +done + +# Report failures +if [ $error -eq 1 ]; then + echo -e "=================== error report ===================\n" + cat $logfile + echo -e "====================================================\n" + clean_tasks + echo -e "FAIL: ping test for $ethernet_interface failed\n" + exit 1 +else + clean_tasks + echo -e "PASS: ping test for $ethernet_interface success\n" +fi + +echo "PASS: $ethernet_interface test passed" +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 @@ +#!/bin/sh +# +# This script is used to test flash driver functionality. I removed the write +# operations since all partition are in use in p4080ds and there might be +# possibility of corrupting data even if we backup in test script. + +if part_num=`cat /proc/mtd | grep -c 'mtd'`; then + echo "PASS: show $part_num partitions" +else + echo "FAIL: show $part_num partitions" +fi + +for((part=0; part<$part_num-1; part++)); +do + if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then + echo "PASS: show partition $part debug info" + else + echo "FAIL: show partition $part debug info" + fi +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 @@ +#!/bin/sh + +if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then + echo "PASS: found $I2C_ADAPTERS i2c adapters" +else + echo "FAIL: no i2c adapters found" + exit 1 +fi + +if [ -z "$adapters" ]; then + adapters=0 +fi + +while [ $adapters -lt $I2C_ADAPTERS ] +do + i2cdetect -y $adapters + if [ $? -ne 0 ]; then + echo "FAIL: detect i2c adapter $adapters failed" + else + echo "PASS: detect i2c adapter $adapters success" + fi + adapters=`expr $adapters + 1` + sleep 1 +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 @@ +#!/bin/sh + +RTC_DEVICE="/dev/rtc" + +if [ ! -e $RTC_DEVICE ]; then + echo "FAIL: rtc device does not exist" + exit 1 +else + echo "PASS: rtc device exists" +fi + +/sbin/hwclock -f $RTC_DEVICE +if [ $? -ne 0 ]; then + echo "FAIL: rtc device open failed" + exit 1 +else + echo "PASS: rtc device open success" +fi + + +/sbin/hwclock --systohc +if [ $? -ne 0 ]; then + echo "FAIL: sync system clock and hardware clock failed" + exit 1 +else + echo "PASS: sync system clock and hardware clock success" +fi + +RTC_TIME=$(/sbin/hwclock -r |awk '{print $4}') +echo $RTC_TIME +SYS_TIME=$(date +%m/%d/%Y-%X |awk '{print $1}' |awk -F- '{print $2}') +echo $SYS_TIME + +if [ "$RTC_TIME" = "$SYS_TIME" ] ; then + echo "PASS: system time same with hardware time" +else + echo "FAIL: system time different with hardware time" + exit 1 +fi + +echo "PASS: rtc test successful" +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 @@ +#!/bin/sh +# This script is used to test sdhc functionality for p4080ds. +# The content of SD will be lost by running this test case. + +SDHC_DEVICE="/dev/mmcblk0" +SDHC_DEVICE_PART="/dev/mmcblk0p1" +SFDISK=`which sfdisk` + +if [ -e $SDHC_DEVICE ]; then + echo "PASS: $SDHC_DEVICE device exists" +else + echo "FAIL: $SDHC_DEVICE does not exist" + exit 1 +fi + +if [ -e $SDHC_DEVICE_PART ]; then + echo "PASS: $SDHC_DEVICE_PART device exists" +elif [ ! -z $SFDISK ]; then + + echo "Try to create a partition" + +$SFDISK $SDHC_DEVICE << EOF +,,L +EOF + + if [ -e $SDHC_DEVICE_PART ]; then + echo "PASS: $SDHC_DEVICE_PART device exists" + else + echo "FAIL: $SDHC_DEVICE_PART does not exist" + exit 1 + fi + +else + echo "FAIL: $SDHC_DEVICE_PART does not exist" + exit 1 +fi + +mount |grep mmcblk0p1 +if [ $? -eq 0 ]; then + umount $SDHC_DEVICE_PART +fi + +/sbin/mkfs.ext2 $SDHC_DEVICE_PART +if [ $? -ne 0 ]; then + echo "FAIL: format $SDHC_DEVICE_PART fail" + exit 1 +else + mkdir -p /mnt/sdhc + mount $SDHC_DEVICE_PART /mnt/sdhc + if [ $? -ne 0 ]; then + echo "FAIL: mount $SDHC_DEVICE_PART fail" + exit 1 + else + cp /bin/busybox /mnt/sdhc + ls /mnt/sdhc |grep busybox + if [ $? -ne 0 ]; then + echo "FAIL: read or write $SDHC_DEVICE_PART fail" + exit 1 + else + umount $SDHC_DEVICE_PART + echo "PASS: read or write $SDHC_DEVICE_PART success" + fi + fi +fi + 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 @@ +#!/bin/sh + +#An spi flash M25P80 connect to p4080 cpu by spi bus, so the method +#is to read/write spi flash to verify whether the spi bus driver worked +#or not. + +MTD_CHAR_DEVICE="/dev/mtd4" +MTD_BLOCK_DEVICE="/dev/mtdblock4" + +if [ ! -e $MTD_CHAR_DEVICE ]; then + echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" + exit 1 +else + echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" +fi + +if [ ! -e $MTD_BLOCK_DEVICE ]; then + echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" + exit 1 +else + echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" +fi + +/usr/sbin/flash_erase -j $MTD_CHAR_DEVICE 0 0 +if [ $? -ne 0 ]; then + echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 +else + mkdir -p /mnt/spi + mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi + if [ $? -ne 0 ]; then + echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 + else + cp /bin/busybox /mnt/spi + ls /mnt/spi |grep busybox + if [ $? -ne 0 ]; then + echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 + else + umount $MTD_BLOCK_DEVICE + echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" + fi + fi +fi + +echo "PASS: spi bus test passed" +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 @@ +#!/bin/sh +# +# This script is used to test usb functionality for p4080ds. +# + +result=0 +devpath="" +usbinfo="" + +usbutils_is_installed=`which lsusb` +if [ -z $usbutils_is_installed ]; then + echo "FAIL: Cannot find lsusb" + exit 1 +fi + +usbdev_num=`lsusb | grep -v root\ hub | wc -l` +if [ $usbdev_num -eq 0 ]; then + echo "FAIL: USB device is not connected" + exit 1 +else + echo "$usbdev_num USB device(s) connected" +fi + +sd=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'` +if [ -z "$sd" ]; then + echo "FAIL: find sd device" + exit 1 +else + echo "PASS: find sd device" +fi + +HDPARM=`which hdparm` +if [ -z $HDPARM ]; then + result=$? + echo "FAIL: find hdparm" +fi + echo "PASS: find hdparm" + +for s in $sd +do + devpath=`echo "$s" | awk -F "," '{print "/sys/dev/block/" $1 ":" $2}'` + usbinfo=`ls -l $devpath | grep usb` + + if [ -z "$usbinfo" ] ; then + continue + fi + + s=`echo "$s" | awk -F "," '{print $3}'` + + echo "Testing $s" + $HDPARM -I $s + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: $HDPARM -I $s Detailed/current information directly from $s" + else + echo "PASS: $HDPARM -I $s Detailed/current information directly from $s" + fi + + $HDPARM -tT $s + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: $HDPARM -tT $s Perform device/cache read timings on $s" + else + echo "PASS: $HDPARM -tT $s Perform device/cache read timings on $s" + fi + + mkdir -p /mnt/usb_tmp + for partition in `ls "$s"[1-9]` + do + echo "Testing $partition" + + mount "$partition" /mnt/usb_tmp + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: mount $s" + else + echo "PASS: mount $s" + dd if=/dev/urandom of=/mnt/usb_tmp/writefile bs=1M count=50 + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: write test on $s" + else + echo "PASS: write test on $s" + rm -f /mnt/usb_tmp/writefile + fi + dd if=$s of=/mnt/usb_tmp/readfile bs=1M count=10 + if [ $? -ne 0 ]; then + result=$? + echo "FAIL: read test on $s" + else + echo "PASS: read test on $s" + rm -f /mnt/usb_tmp/readfile + fi + umount /mnt/usb_tmp + fi + done + + rm -fr /mnt/usb_tmp +done +exit $result diff --git a/recipes-test/perf-networking/files/perf-networking b/recipes-test/perf-networking/files/perf-networking new file mode 100755 index 0000000..f865374 --- /dev/null +++ b/recipes-test/perf-networking/files/perf-networking @@ -0,0 +1,14 @@ +#!/bin/sh +server_ip="172.24.0.50" + +if ping -c1 $server_ip > /dev/null +then +netperf -H $server_ip -t TCP_STREAM +netperf -H $server_ip -t TCP_MAERTS +netperf -H $server_ip -t TCP_RR +netperf -H $server_ip -t TCP_CRR +netperf -H $server_ip -t UDP_STREAM +netperf -H $server_ip -t UDP_RR +else +echo "Error: Server is down!" +fi diff --git a/recipes-test/perf-networking/perf-networking_1.0.bb b/recipes-test/perf-networking/perf-networking_1.0.bb new file mode 100644 index 0000000..aa32a7d --- /dev/null +++ b/recipes-test/perf-networking/perf-networking_1.0.bb @@ -0,0 +1,19 @@ +SUMMARY = "A simple shell script to run network performance tests" +DESCRIPTION = "The perf-networking package installs the perf-networking \ +shell script which runs tests using the netperf package" +SRC_URI += "file://perf-networking" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +RDEPENDS_${PN}= "netperf" + +do_install () { + install -D ${WORKDIR}/perf-networking ${D}${bindir}/perf-networking +} + +do_patch[noexec] = "1" +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_build[noexec] = "1" diff --git a/recipes-test/systest-runner/files/systest-runner b/recipes-test/systest-runner/files/systest-runner new file mode 100644 index 0000000..f549954 --- /dev/null +++ b/recipes-test/systest-runner/files/systest-runner @@ -0,0 +1,16 @@ +#!/bin/sh + +cd /usr/lib/systest-runner/tests >/dev/null + +for x in * +do + echo $x + if [[ -f $x ]]; then + date +%Y-%m-%dT%H:%M + echo "BEGIN: $x" + ./$x + echo "END: $x" + date +%Y-%m-%dT%H:%M + fi +done + diff --git a/recipes-test/systest-runner/files/tests/ltp b/recipes-test/systest-runner/files/tests/ltp new file mode 100755 index 0000000..ebdc32f --- /dev/null +++ b/recipes-test/systest-runner/files/tests/ltp @@ -0,0 +1,23 @@ +#!/bin/sh + +cd /opt/ltp >/dev/null +addgroup nobody +sed -i -e "/mounts | sort -b$/s/$/ | grep -v deleted/" ./testscripts/test_fs_bind.sh + +logname=`date +"%Y_%m_%d_%H_%M_%S"`".log" +./runltp -p -d /tmp -l $logname + +if [ ! -d ./results ]; then + echo "FAIL: no result found" + exit 1 +fi + +cat ./results/$logname | while read line +do + resultLine=`echo $line | grep -c -E "PASS|FAIL"` + if [ $resultLine -eq 1 ]; then + testcase=`echo $line | awk '{print $1}'` + result=`echo $line | awk '{print $2}'` + echo "$result: $testcase" + fi +done diff --git a/recipes-test/systest-runner/files/tests/perf-network b/recipes-test/systest-runner/files/tests/perf-network new file mode 100755 index 0000000..28d88d5 --- /dev/null +++ b/recipes-test/systest-runner/files/tests/perf-network @@ -0,0 +1,13 @@ +#!/bin/sh + +logname=`date +"%Y_%m_%d_%H_%M_%S"`".log" +perf-networking |tee /tmp/$logname + +if grep -Fq "Error:" /tmp/$logname +then + echo "FAIL: Test failed" + exit 1 +else + echo "PASS: Performed the netperf tests" + exit 0 +fi diff --git a/recipes-test/systest-runner/files/tests/posixtest b/recipes-test/systest-runner/files/tests/posixtest new file mode 100755 index 0000000..8da0193 --- /dev/null +++ b/recipes-test/systest-runner/files/tests/posixtest @@ -0,0 +1,40 @@ +#!/bin/sh + +printit() { + echo "" + sed -i -e "s|FAILED:|FAIL:|g" -e "s|UNRESOLVED:|FAIL:|g" -e "s|UNSUPPORTED:|SKIP:|g" -e "s|UNTESTED:|SKIP:|g" $1 + cat $1 | while read line + do + resultLine=`echo $line | grep -c -E "PASS|FAIL"` + if [ $resultLine -eq 1 ]; then + testcase=`echo $line | awk -F: '{print $1}'` + result=`echo $line | awk -F: '{print $3}'` + if [ -n "$testcase" ] && [ -n "$result" ]; then + echo "$result: $testcase" + fi + fi + done +} + +cd /opt/ltp/testcases/open_posix_testsuite >/dev/null + +make test + +FILES=$(find . -name "logfile.*-test") +for f in $FILES +do + printit $f +done + +printf "\n\nRunning POSIX Option Group Feature Tests" +printf "----------------------------------------" + +./bin/run-all-posix-option-group-tests.sh + +FILES=$(find . -name "logfile") +for f in $FILES +do + printit $f +done + + diff --git a/recipes-test/systest-runner/systest-runner.bb b/recipes-test/systest-runner/systest-runner.bb new file mode 100644 index 0000000..01fe054 --- /dev/null +++ b/recipes-test/systest-runner/systest-runner.bb @@ -0,0 +1,28 @@ + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "file://systest-runner \ + file://tests/ltp \ + file://tests/perf-network \ + file://tests/posixtest \ + " + +STEST_PATH="${libdir}/${PN}" + +FILES_${PN} +="${STEST_PATH}" +FILES_${PN} += "${bindir}/systest-runner" + +do_install () { + install -D ${WORKDIR}/systest-runner ${D}${bindir}/systest-runner + install -d ${D}${STEST_PATH}/tests + for file in ${WORKDIR}/tests/* ; do + install $file ${D}${STEST_PATH}/tests + done +} + +do_patch[noexec] = "1" +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_build[noexec] = "1" -- cgit v1.2.3-54-g00ecf