diff options
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/p2041rdb/sdhc')
-rwxr-xr-x | recipes-test/ddt-runner/files/scripts/p2041rdb/sdhc | 41 |
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 | |||
5 | SDHC_DEVICE="/dev/mmcblk0p1" | ||
6 | |||
7 | if [ ! -e $SDHC_DEVICE ]; then | ||
8 | echo "FAIL: $SDHC_DEVICE does not exist" | ||
9 | exit 1 | ||
10 | else | ||
11 | echo "PASS: $SDHC_DEVICE device exists" | ||
12 | fi | ||
13 | |||
14 | mount |grep mmcblk0p1 | ||
15 | if [ $? -eq 0 ]; then | ||
16 | umount $SDHC_DEVICE | ||
17 | fi | ||
18 | |||
19 | /sbin/mkfs.ext2 $SDHC_DEVICE | ||
20 | if [ $? -ne 0 ]; then | ||
21 | echo "FAIL: format $SDHC_DEVICE fail" | ||
22 | exit 1 | ||
23 | else | ||
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 | ||
40 | fi | ||
41 | |||