summaryrefslogtreecommitdiffstats
path: root/recipes-test/ddt-runner/files/scripts/p2041rdb/sdhc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/p2041rdb/sdhc')
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p2041rdb/sdhc41
1 files changed, 41 insertions, 0 deletions
diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/sdhc b/recipes-test/ddt-runner/files/scripts/p2041rdb/sdhc
new file mode 100755
index 0000000..bc3026b
--- /dev/null
+++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/sdhc
@@ -0,0 +1,41 @@
1#!/bin/sh
2
3#the content of SD will be lost by running this test case.
4
5SDHC_DEVICE="/dev/mmcblk0p1"
6
7if [ ! -e $SDHC_DEVICE ]; then
8 echo "FAIL: $SDHC_DEVICE does not exist"
9 exit 1
10else
11 echo "PASS: $SDHC_DEVICE device exists"
12fi
13
14mount |grep mmcblk0p1
15if [ $? -eq 0 ]; then
16 umount $SDHC_DEVICE
17fi
18
19/sbin/mkfs.ext2 $SDHC_DEVICE
20if [ $? -ne 0 ]; then
21 echo "FAIL: format $SDHC_DEVICE fail"
22 exit 1
23else
24 mkdir -p /mnt/sdhc
25 mount $SDHC_DEVICE /mnt/sdhc
26 if [ $? -ne 0 ]; then
27 echo "FAIL: mount $SDHC_DEVICE fail"
28 exit 1
29 else
30 cp /bin/busybox /mnt/sdhc
31 ls /mnt/sdhc |grep busybox
32 if [ $? -ne 0 ]; then
33 echo "FAIL: read or write $SDHC_DEVICE fail"
34 exit 1
35 else
36 umount $SDHC_DEVICE
37 echo "PASS: read or write $SDHC_DEVICE success"
38 fi
39 fi
40fi
41