From cd3411088f6bb4393d79c50b5f7eef3f11a83435 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 10 Oct 2014 00:31:33 +0200 Subject: initial commit for Enea Linux 4.0-140929 Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea --- .../ddt-runner/files/scripts/proliant-m800/sata | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 recipes-test/ddt-runner/files/scripts/proliant-m800/sata (limited to 'recipes-test/ddt-runner/files/scripts/proliant-m800/sata') diff --git a/recipes-test/ddt-runner/files/scripts/proliant-m800/sata b/recipes-test/ddt-runner/files/scripts/proliant-m800/sata new file mode 100755 index 0000000..25bf15a --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/proliant-m800/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