diff options
author | Bogdan Oprescu <bogdan.oprescu@enea.com> | 2023-11-15 11:09:08 +0200 |
---|---|---|
committer | Bogdan Oprescu <bogdan.oprescu@enea.com> | 2023-11-16 14:26:36 +0200 |
commit | 6da9d81e77b2f56a91a697ac474473e787a58ccf (patch) | |
tree | 170e6a5acc14673fc466a7405d7cc35673bed507 /recipes-test/ddt-runner/files/scripts/t1042rdb/sdhc | |
parent | 2283105d0abe9efa216b018e0d34100e4544ce78 (diff) | |
download | meta-enea-daisy-enea-231026.tar.gz |
T1042RDB: Adding ddt testsdaisy-enea-231026
Signed-off-by: Bogdan Oprescu <bogdan.oprescu@enea.com>
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/t1042rdb/sdhc')
-rwxr-xr-x | recipes-test/ddt-runner/files/scripts/t1042rdb/sdhc | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/recipes-test/ddt-runner/files/scripts/t1042rdb/sdhc b/recipes-test/ddt-runner/files/scripts/t1042rdb/sdhc new file mode 100755 index 0000000..883c572 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/t1042rdb/sdhc | |||
@@ -0,0 +1,42 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # the content of SD will be lost by running this test case. | ||
4 | |||
5 | SDHC_DEVICE="/dev/mmcblk0" | ||
6 | |||
7 | if [ -b "$SDHC_DEVICE" ]; then | ||
8 | echo "PASS: $SDHC_DEVICE device exists" | ||
9 | else | ||
10 | echo "SKIP: $SDHC_DEVICE does not exist" | ||
11 | exit 1 | ||
12 | fi | ||
13 | |||
14 | mount | grep mmcblk0p1 > /dev/null 2>&1 | ||
15 | |||
16 | if [ $? -eq 0 ]; then | ||
17 | umount $SDHC_DEVICE > /dev/null 2>&1 | ||
18 | fi | ||
19 | |||
20 | /sbin/mkfs.ext2 $SDHC_DEVICE > /dev/null 2>&1 | ||
21 | |||
22 | if [ $? -ne 0 ]; then | ||
23 | echo "FAIL: format $SDHC_DEVICE fail" | ||
24 | exit 1 | ||
25 | else | ||
26 | mkdir -p /mnt/sdhc > /dev/null 2>&1 | ||
27 | mount $SDHC_DEVICE /mnt/sdhc > /dev/null 2>&1 | ||
28 | if [ $? -ne 0 ]; then | ||
29 | echo "FAIL: mount $SDHC_DEVICE fail" | ||
30 | exit 1 | ||
31 | else | ||
32 | cp /bin/busybox /mnt/sdhc > /dev/null 2>&1 | ||
33 | ls /mnt/sdhc |grep busybox > /dev/null 2>&1 | ||
34 | if [ $? -ne 0 ]; then | ||
35 | echo "FAIL: read or write $SDHC_DEVICE fail" | ||
36 | exit 1 | ||
37 | else | ||
38 | umount $SDHC_DEVICE > /dev/null 2>&1 | ||
39 | echo "PASS: read or write $SDHC_DEVICE success" | ||
40 | fi | ||
41 | fi | ||
42 | fi | ||