summaryrefslogtreecommitdiffstats
path: root/recipes-test/ddt-runner/files/scripts/pandaboard
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/pandaboard')
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/pandaboard/ethernet88
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/pandaboard/i2c24
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/pandaboard/rtc42
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/pandaboard/sdhc65
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/pandaboard/usb100
5 files changed, 0 insertions, 319 deletions
diff --git a/recipes-test/ddt-runner/files/scripts/pandaboard/ethernet b/recipes-test/ddt-runner/files/scripts/pandaboard/ethernet
deleted file mode 100755
index 5355f10..0000000
--- a/recipes-test/ddt-runner/files/scripts/pandaboard/ethernet
+++ /dev/null
@@ -1,88 +0,0 @@
1#!/bin/sh
2
3ethernet_interface="eth1"
4ethernet_ping_ipaddr="172.21.3.22"
5ethernet_ipaddr=$1
6
7IFCONFIG=`which ifconfig`
8
9$IFCONFIG $ethernet_interface up
10$IFCONFIG | grep $ethernet_interface
11if [ $? -ne 0 ]; then
12 echo "FAIL: $ethernet_interface is not up"
13 exit 1
14else
15 echo "PASS: $ethernet_interface is up"
16fi
17
18if [ "x$ethernet_ipaddr" != "x" ]; then
19 $IFCONFIG $ethernet_interface $ethernet_ipaddr
20fi
21
22$IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}'
23if [ $? -ne 0 ]; then
24 echo "FAIL: ipaddr of $ethernet_interface setup failed"
25 exit 1
26else
27 echo "PASS: ipaddr of $ethernet_interface setup success"
28fi
29
30mindatasize=56
31maxdatasize=650
32stepsize=100
33iteration=1
34datasize=$mindatasize
35logfile=`/bin/mktemp`
36statistics=`/bin/mktemp`
37error=0
38
39trap cleanup SIGHUP SIGINT SIGTERM
40
41clean_tasks() {
42 echo "Executing clean up tasks"
43 rm -f $logfile $statistics
44}
45
46cleanup() {
47 echo "Aborting script execution"
48 clean_tasks
49 exit 0
50}
51
52echo "start ping test for $ethernet_interface..."
53
54while [ $datasize -le $maxdatasize ]; do
55 for i in `seq 1 $iteration`; do
56 ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics
57 ping_err=`echo $?`
58 echo "" && cat $statistics | grep -r "PING"
59 cat $statistics | grep -r "received"
60 [ `echo $?` -eq 0 ] || packets_received=0 && \
61 packets_received=`cat $statistics | \
62 grep -r "received" | awk '{print$4}'`
63
64 # Evaluate possible errors on the ping operation
65 if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then
66 error=1
67 echo -e `cat $statistics | grep -r PING` >> $logfile
68 echo -e "Size: $datasize Iteration: $i\n" >> $logfile
69 fi
70 done
71 let datasize=$datasize+$stepsize
72done
73
74# Report failures
75if [ $error -eq 1 ]; then
76 echo -e "=================== error report ===================\n"
77 cat $logfile
78 echo -e "====================================================\n"
79 clean_tasks
80 echo -e "FAIL: ping test for $ethernet_interface failed\n"
81 exit 1
82else
83 clean_tasks
84 echo -e "PASS: ping test for $ethernet_interface success\n"
85fi
86
87echo "PASS: $ethernet_interface test passed"
88exit 0
diff --git a/recipes-test/ddt-runner/files/scripts/pandaboard/i2c b/recipes-test/ddt-runner/files/scripts/pandaboard/i2c
deleted file mode 100755
index 5b312b9..0000000
--- a/recipes-test/ddt-runner/files/scripts/pandaboard/i2c
+++ /dev/null
@@ -1,24 +0,0 @@
1#!/bin/sh
2
3if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then
4 echo "PASS: found $I2C_ADAPTERS i2c adapters"
5else
6 echo "FAIL: no i2c adapters found"
7 exit 1
8fi
9
10if [ -z "$adapters" ]; then
11 adapters=0
12fi
13
14while [ $adapters -lt $I2C_ADAPTERS ]
15do
16 i2cdetect -y $adapters
17 if [ $? -ne 0 ]; then
18 echo "FAIL: detect i2c adapter $adapters failed"
19 else
20 echo "PASS: detect i2c adapter $adapters success"
21 fi
22 adapters=`expr $adapters + 1`
23 sleep 1
24done
diff --git a/recipes-test/ddt-runner/files/scripts/pandaboard/rtc b/recipes-test/ddt-runner/files/scripts/pandaboard/rtc
deleted file mode 100755
index 0d38293..0000000
--- a/recipes-test/ddt-runner/files/scripts/pandaboard/rtc
+++ /dev/null
@@ -1,42 +0,0 @@
1#!/bin/sh
2
3RTC_DEVICE="/dev/rtc"
4
5if [ ! -e $RTC_DEVICE ]; then
6 echo "FAIL: rtc device does not exist"
7 exit 1
8else
9 echo "PASS: rtc device exists"
10fi
11
12/sbin/hwclock -f $RTC_DEVICE
13if [ $? -ne 0 ]; then
14 echo "FAIL: rtc device open failed"
15 exit 1
16else
17 echo "PASS: rtc device open success"
18fi
19
20
21/sbin/hwclock --systohc
22if [ $? -ne 0 ]; then
23 echo "FAIL: sync system clock and hardware clock failed"
24 exit 1
25else
26 echo "PASS: sync system clock and hardware clock success"
27fi
28
29RTC_TIME=$(/sbin/hwclock -r |awk '{print $4}')
30echo $RTC_TIME
31SYS_TIME=$(date +%m/%d/%Y-%X |awk '{print $1}' |awk -F- '{print $2}')
32echo $SYS_TIME
33
34if [ "$RTC_TIME" = "$SYS_TIME" ] ; then
35 echo "PASS: system time same with hardware time"
36else
37 echo "FAIL: system time different with hardware time"
38 exit 1
39fi
40
41echo "PASS: rtc test successful"
42exit 0
diff --git a/recipes-test/ddt-runner/files/scripts/pandaboard/sdhc b/recipes-test/ddt-runner/files/scripts/pandaboard/sdhc
deleted file mode 100755
index e341ebc..0000000
--- a/recipes-test/ddt-runner/files/scripts/pandaboard/sdhc
+++ /dev/null
@@ -1,65 +0,0 @@
1#!/bin/sh
2# This script is used to test sdhc functionality for pandaboard.
3# The content of SD will be lost by running this test case.
4
5SDHC_DEVICE="/dev/mmcblk0"
6SDHC_DEVICE_PART="/dev/mmcblk0p1"
7SFDISK=`which sfdisk`
8
9if [ -e $SDHC_DEVICE ]; then
10 echo "PASS: $SDHC_DEVICE device exists"
11else
12 echo "FAIL: $SDHC_DEVICE does not exist"
13 exit 1
14fi
15
16if [ -e $SDHC_DEVICE_PART ]; then
17 echo "PASS: $SDHC_DEVICE_PART device exists"
18elif [ ! -z $SFDISK ]; then
19
20 echo "Try to create a partition"
21
22$SFDISK $SDHC_DEVICE << EOF
23,,L
24EOF
25
26 if [ -e $SDHC_DEVICE_PART ]; then
27 echo "PASS: $SDHC_DEVICE_PART device exists"
28 else
29 echo "FAIL: $SDHC_DEVICE_PART does not exist"
30 exit 1
31 fi
32
33else
34 echo "FAIL: $SDHC_DEVICE_PART does not exist"
35 exit 1
36fi
37
38mount |grep mmcblk0p1
39if [ $? -eq 0 ]; then
40 umount $SDHC_DEVICE_PART
41fi
42
43/sbin/mkfs.ext2 $SDHC_DEVICE_PART
44if [ $? -ne 0 ]; then
45 echo "FAIL: format $SDHC_DEVICE_PART fail"
46 exit 1
47else
48 mkdir -p /mnt/sdhc
49 mount $SDHC_DEVICE_PART /mnt/sdhc
50 if [ $? -ne 0 ]; then
51 echo "FAIL: mount $SDHC_DEVICE_PART fail"
52 exit 1
53 else
54 cp /bin/busybox /mnt/sdhc
55 ls /mnt/sdhc |grep busybox
56 if [ $? -ne 0 ]; then
57 echo "FAIL: read or write $SDHC_DEVICE_PART fail"
58 exit 1
59 else
60 umount $SDHC_DEVICE_PART
61 echo "PASS: read or write $SDHC_DEVICE_PART success"
62 fi
63 fi
64fi
65
diff --git a/recipes-test/ddt-runner/files/scripts/pandaboard/usb b/recipes-test/ddt-runner/files/scripts/pandaboard/usb
deleted file mode 100755
index 15c417a..0000000
--- a/recipes-test/ddt-runner/files/scripts/pandaboard/usb
+++ /dev/null
@@ -1,100 +0,0 @@
1#!/bin/sh
2#
3# This script is used to test usb functionality for romley-ivb.
4#
5
6result=0
7devpath=""
8usbinfo=""
9
10usbutils_is_installed=`which lsusb`
11if [ -z $usbutils_is_installed ]; then
12 echo "FAIL: Cannot find lsusb"
13 exit 1
14fi
15
16usbdev_num=`lsusb | grep -v root\ hub | wc -l`
17if [ $usbdev_num -eq 0 ]; then
18 echo "FAIL: USB device is not connected"
19 exit 1
20else
21 echo "$usbdev_num USB device(s) connected"
22fi
23
24sd=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'`
25if [ -z "$sd" ]; then
26 echo "FAIL: find sd device"
27 exit 1
28else
29 echo "PASS: find sd device"
30fi
31
32HDPARM=`which hdparm`
33if [ -z $HDPARM ]; then
34 result=$?
35 echo "FAIL: find hdparm"
36fi
37 echo "PASS: find hdparm"
38
39for s in $sd
40do
41 devpath=`echo "$s" | awk -F "," '{print "/sys/dev/block/" $1 ":" $2}'`
42 usbinfo=`ls -l $devpath | grep usb`
43
44 if [ -z "$usbinfo" ] ; then
45 continue
46 fi
47
48 s=`echo "$s" | awk -F "," '{print $3}'`
49
50 echo "Testing $s"
51 $HDPARM -I $s
52 if [ $? -ne 0 ]; then
53 result=$?
54 echo "FAIL: $HDPARM -I $s Detailed/current information directly from $s"
55 else
56 echo "PASS: $HDPARM -I $s Detailed/current information directly from $s"
57 fi
58
59 $HDPARM -tT $s
60 if [ $? -ne 0 ]; then
61 result=$?
62 echo "FAIL: $HDPARM -tT $s Perform device/cache read timings on $s"
63 else
64 echo "PASS: $HDPARM -tT $s Perform device/cache read timings on $s"
65 fi
66
67 mkdir -p /mnt/usb_tmp
68 for partition in `ls "$s"[1-9]`
69 do
70 echo "Testing $partition"
71
72 mount "$partition" /mnt/usb_tmp
73 if [ $? -ne 0 ]; then
74 result=$?
75 echo "FAIL: mount $s"
76 else
77 echo "PASS: mount $s"
78 dd if=/dev/urandom of=/mnt/usb_tmp/writefile bs=1M count=50
79 if [ $? -ne 0 ]; then
80 result=$?
81 echo "FAIL: write test on $s"
82 else
83 echo "PASS: write test on $s"
84 rm -f /mnt/usb_tmp/writefile
85 fi
86 dd if=$s of=/mnt/usb_tmp/readfile bs=1M count=10
87 if [ $? -ne 0 ]; then
88 result=$?
89 echo "FAIL: read test on $s"
90 else
91 echo "PASS: read test on $s"
92 rm -f /mnt/usb_tmp/readfile
93 fi
94 umount /mnt/usb_tmp
95 fi
96 done
97
98 rm -fr /mnt/usb_tmp
99done
100exit $result