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 --- recipes-test/ddt-runner/files/scripts/p2041rdb/usb | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 recipes-test/ddt-runner/files/scripts/p2041rdb/usb (limited to 'recipes-test/ddt-runner/files/scripts/p2041rdb/usb') diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/usb b/recipes-test/ddt-runner/files/scripts/p2041rdb/usb new file mode 100755 index 0000000..017287f --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/usb @@ -0,0 +1,48 @@ +#!/bin/sh +# +#This script is to test usb devices on p2041rdb target +# + +USB_DISK=`ls /dev/sd*[1-9] | sort | tail -n 1` + +usbutils_is_installed=`which lsusb` +if [ -z $usbutils_is_installed ]; then + echo "FAIL: Cannot find lsusb" + exit 1 +else + echo "PASS: usbutils found" +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 "PASS: $usbdev_num USB device(s) connected" +fi + +lsusb | grep -v root\ hub +mkdir -p /mnt/usb_ehci +mount $USB_DISK /mnt/usb_ehci +if [ $? -ne 0 ]; then + echo "FAIL: Mount USB device failed" + exit 1 +else + echo "PASS: Mount USB device succeed" +fi + +echo "Begin test usb device..." +dd if=/dev/urandom of=/mnt/usb_ehci/testfile bs=1M count=50 +if [ $? -ne 0 ]; then + echo "FAIL: test failed" + rm -f /mnt/usb_ehci_testfile + umount /mnt/usb_ehci + rm -fr /mnt/usb_ehci + exit 1 +fi + +echo "PASS: test succeed" +rm -f /mnt/usb_ehci_testfile +umount /mnt/usb_ehci +rm -fr /mnt/usb_ehci +exit 0 -- cgit v1.2.3-54-g00ecf