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 --- .../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 +++++++++++++++++++ 4 files changed, 351 insertions(+) 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 (limited to 'recipes-test/ddt-runner/files/scripts/acp3448v2') 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 -- cgit v1.2.3-54-g00ecf