diff options
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/acp3448v2')
4 files changed, 351 insertions, 0 deletions
diff --git a/recipes-test/ddt-runner/files/scripts/acp3448v2/ethernet b/recipes-test/ddt-runner/files/scripts/acp3448v2/ethernet new file mode 100755 index 0000000..10a16b4 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/acp3448v2/ethernet | |||
@@ -0,0 +1,97 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test ethernet functionality for acp3448v2. | ||
4 | # | ||
5 | |||
6 | ethernet_interface="eth0" | ||
7 | ethernet_ping_ipaddr="172.21.3.22" | ||
8 | ethernet_ipaddr=$1 | ||
9 | |||
10 | IFCONFIG=`which ifconfig` | ||
11 | |||
12 | for((num=0; num<16; num++)); | ||
13 | do | ||
14 | ethernet_interface=eth$num | ||
15 | $IFCONFIG $ethernet_interface up | ||
16 | $IFCONFIG | grep $ethernet_interface | ||
17 | if [ $? -eq 0 ]; then | ||
18 | echo "PASS: $ethernet_interface is up" | ||
19 | break | ||
20 | fi | ||
21 | done | ||
22 | |||
23 | if [ $num -eq 16 ]; then | ||
24 | echo "FAIL: $ethernet_interface is not up" | ||
25 | exit 1 | ||
26 | fi | ||
27 | |||
28 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
29 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
30 | fi | ||
31 | |||
32 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
33 | if [ $? -ne 0 ]; then | ||
34 | echo "FAIL: ipaddr of $ethernet_interface setup failed" | ||
35 | exit 1 | ||
36 | else | ||
37 | echo "PASS: ipaddr of $ethernet_interface setup success" | ||
38 | fi | ||
39 | |||
40 | mindatasize=56 | ||
41 | maxdatasize=650 | ||
42 | stepsize=100 | ||
43 | iteration=1 | ||
44 | datasize=$mindatasize | ||
45 | logfile=`/bin/mktemp` | ||
46 | statistics=`/bin/mktemp` | ||
47 | error=0 | ||
48 | |||
49 | trap cleanup SIGHUP SIGINT SIGTERM | ||
50 | |||
51 | clean_tasks() { | ||
52 | echo "Executing clean up tasks" | ||
53 | rm -f $logfile $statistics | ||
54 | } | ||
55 | |||
56 | cleanup() { | ||
57 | echo "Aborting script execution" | ||
58 | clean_tasks | ||
59 | exit 0 | ||
60 | } | ||
61 | |||
62 | echo "start ping test for $ethernet_interface..." | ||
63 | |||
64 | while [ $datasize -le $maxdatasize ]; do | ||
65 | for i in `seq 1 $iteration`; do | ||
66 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
67 | ping_err=`echo $?` | ||
68 | echo "" && cat $statistics | grep -r "PING" | ||
69 | cat $statistics | grep -r "received" | ||
70 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
71 | packets_received=`cat $statistics | \ | ||
72 | grep -r "received" | awk '{print$4}'` | ||
73 | |||
74 | # Evaluate possible errors on the ping operation | ||
75 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
76 | error=1 | ||
77 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
78 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
79 | fi | ||
80 | done | ||
81 | let datasize=$datasize+$stepsize | ||
82 | done | ||
83 | |||
84 | # Report failures | ||
85 | if [ $error -eq 1 ]; then | ||
86 | echo -e "=================== error report ===================\n" | ||
87 | cat $logfile | ||
88 | echo -e "====================================================\n" | ||
89 | clean_tasks | ||
90 | echo -e "FAIL: ping test for $ethernet_interface failed\n" | ||
91 | exit 1 | ||
92 | else | ||
93 | clean_tasks | ||
94 | echo -e "PASS: ping test for $ethernet_interface success\n" | ||
95 | fi | ||
96 | |||
97 | 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 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test flash driver function. | ||
4 | |||
5 | if part_num=`cat /proc/mtd | grep -c 'mtd'`; then | ||
6 | echo "PASS: show $part_num partitions" | ||
7 | else | ||
8 | echo "FAIL: show $part_num partitions" | ||
9 | fi | ||
10 | |||
11 | for((part=0; part<$part_num-1; part++)); | ||
12 | do | ||
13 | if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then | ||
14 | echo "PASS: show partition $part debug info" | ||
15 | else | ||
16 | echo "FAIL: show partition $part debug info" | ||
17 | fi | ||
18 | done | ||
19 | |||
20 | let "test_part=part_num-2" | ||
21 | |||
22 | if [ $(flash_erase -j /dev/mtd${test_part} 0 0 | grep -c '100 % complete') ]; then | ||
23 | echo "PASS: erase and format partition ${test_part}" | ||
24 | else | ||
25 | echo "FAIL: erase and format partition ${test_part}" | ||
26 | fi | ||
27 | |||
28 | mkdir -p /mnt/flash | ||
29 | mount -t jffs2 /dev/mtdblock${test_part} /mnt/flash | ||
30 | if [ $? -eq 0 ]; then | ||
31 | echo "PASS: mount partition ${test_part} as /mnt/flash" | ||
32 | else | ||
33 | echo "FAIL: mount partition ${test_part} as /mnt/flash" | ||
34 | fi | ||
35 | |||
36 | cd /mnt/flash | ||
37 | touch test | ||
38 | if [ $(ls | grep -c 'test') ]; then | ||
39 | echo "PASS: touch a file on partition ${test_part}" | ||
40 | else | ||
41 | echo "FAIL: touch a file on partition ${test_part}" | ||
42 | fi | ||
43 | |||
44 | cd ~ | ||
45 | 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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ethernet_interface="eth0" | ||
4 | ethernet_ping_ipaddr="172.21.3.22" | ||
5 | ethernet_ipaddr=$1 | ||
6 | |||
7 | #Intel Corporation 82574L Gigabit Network Card (intel e1000e) | ||
8 | vendor_id="8086" | ||
9 | product_id="10d3" | ||
10 | |||
11 | #find vendor id & product id | ||
12 | lspci -nn |grep $vendor_id:$product_id | ||
13 | if [ $? -ne 0 ]; then | ||
14 | echo "FAIL: pci-e ethernet card device does not exist" | ||
15 | exit 1 | ||
16 | else | ||
17 | echo "PASS: got pci-e ethernet card device" | ||
18 | fi | ||
19 | |||
20 | setpci -v -d $vendor_id:$product_id latency_timer=b0 | ||
21 | if [ $? -ne 0 ]; then | ||
22 | echo "FAIL: parameter changes to pci config space failed" | ||
23 | exit 1 | ||
24 | else | ||
25 | echo "PASS: parameter changes to pci config space success" | ||
26 | fi | ||
27 | |||
28 | IFCONFIG=`which ifconfig` | ||
29 | |||
30 | $IFCONFIG $ethernet_interface up | ||
31 | $IFCONFIG | grep $ethernet_interface | ||
32 | if [ $? -ne 0 ]; then | ||
33 | echo "FAIL: pci-e ethernet card device $ethernet_interface is not up" | ||
34 | exit 1 | ||
35 | else | ||
36 | echo "PASS: pci-e ethernet card device $ethernet_interface is up" | ||
37 | fi | ||
38 | |||
39 | if [ "x$ethernet_ipaddr" != "x" ]; then | ||
40 | $IFCONFIG $ethernet_interface $ethernet_ipaddr | ||
41 | fi | ||
42 | |||
43 | $IFCONFIG $ethernet_interface |grep 'inet addr:' |sed -e 's@inet addr:@@' |sed q | awk '{print $1}' | ||
44 | if [ $? -ne 0 ]; then | ||
45 | echo "FAIL: ipaddr of pci-e ethernet card device $ethernet_interface setup failed" | ||
46 | exit 1 | ||
47 | else | ||
48 | echo "PASS: ipaddr of pci-e ethernet card device $ethernet_interface setup success" | ||
49 | fi | ||
50 | |||
51 | mindatasize=56 | ||
52 | maxdatasize=650 | ||
53 | stepsize=100 | ||
54 | iteration=1 | ||
55 | datasize=$mindatasize | ||
56 | logfile=`/bin/mktemp` | ||
57 | statistics=`/bin/mktemp` | ||
58 | error=0 | ||
59 | |||
60 | trap cleanup SIGHUP SIGINT SIGTERM | ||
61 | |||
62 | clean_tasks() { | ||
63 | echo "Executing clean up tasks" | ||
64 | rm -f $logfile $statistics | ||
65 | } | ||
66 | |||
67 | cleanup() { | ||
68 | echo "Aborting script execution" | ||
69 | clean_tasks | ||
70 | exit 0 | ||
71 | } | ||
72 | |||
73 | echo "start ping test for pci-e ethernet card device $ethernet_interface..." | ||
74 | |||
75 | while [ $datasize -le $maxdatasize ]; do | ||
76 | for i in `seq 1 $iteration`; do | ||
77 | ping -c 1 -s $datasize $ethernet_ping_ipaddr > $statistics | ||
78 | ping_err=`echo $?` | ||
79 | echo "" && cat $statistics | grep -r "PING" | ||
80 | cat $statistics | grep -r "received" | ||
81 | [ `echo $?` -eq 0 ] || packets_received=0 && \ | ||
82 | packets_received=`cat $statistics | \ | ||
83 | grep -r "received" | awk '{print$4}'` | ||
84 | |||
85 | # Evaluate possible errors on the ping operation | ||
86 | if [ $ping_err -ne 0 ] || [ $packets_received -eq 0 ]; then | ||
87 | error=1 | ||
88 | echo -e `cat $statistics | grep -r PING` >> $logfile | ||
89 | echo -e "Size: $datasize Iteration: $i\n" >> $logfile | ||
90 | fi | ||
91 | done | ||
92 | let datasize=$datasize+$stepsize | ||
93 | done | ||
94 | |||
95 | # Report failures | ||
96 | if [ $error -eq 1 ]; then | ||
97 | echo -e "=================== error report ===================\n" | ||
98 | cat $logfile | ||
99 | echo -e "====================================================\n" | ||
100 | clean_tasks | ||
101 | echo -e "FAIL: ping test for pci-e ethernet card device $ethernet_interface failed\n" | ||
102 | exit 1 | ||
103 | else | ||
104 | clean_tasks | ||
105 | echo -e "PASS: ping test for pci-e ethernet card device $ethernet_interface success\n" | ||
106 | fi | ||
107 | |||
108 | echo "PASS: pci express test passed" | ||
109 | 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 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This script is used to test usb functionality for acp3448v2. | ||
4 | # | ||
5 | |||
6 | result=0 | ||
7 | devpath="" | ||
8 | usbinfo="" | ||
9 | |||
10 | usbutils_is_installed=`which lsusb` | ||
11 | if [ -z $usbutils_is_installed ]; then | ||
12 | echo "FAIL: Cannot find lsusb" | ||
13 | exit 1 | ||
14 | fi | ||
15 | |||
16 | usbdev_num=`lsusb | grep -v root\ hub | wc -l` | ||
17 | if [ $usbdev_num -eq 0 ]; then | ||
18 | echo "FAIL: USB device is not connected" | ||
19 | exit 1 | ||
20 | else | ||
21 | echo "$usbdev_num USB device(s) connected" | ||
22 | fi | ||
23 | |||
24 | sd=`ls -l /dev/sd[^0-9] | awk '{print $5 $6 "," $10}'` | ||
25 | if [ -z "$sd" ]; then | ||
26 | echo "FAIL: find sd device" | ||
27 | exit 1 | ||
28 | else | ||
29 | echo "PASS: find sd device" | ||
30 | fi | ||
31 | |||
32 | HDPARM=`which hdparm` | ||
33 | if [ -z $HDPARM ]; then | ||
34 | result=$? | ||
35 | echo "FAIL: find hdparm" | ||
36 | fi | ||
37 | echo "PASS: find hdparm" | ||
38 | |||
39 | for s in $sd | ||
40 | do | ||
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 | ||
99 | done | ||
100 | exit $result | ||