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/p2041rdb/sata | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 recipes-test/ddt-runner/files/scripts/p2041rdb/sata (limited to 'recipes-test/ddt-runner/files/scripts/p2041rdb/sata') 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 -- cgit v1.2.3-54-g00ecf