diff options
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/p2041rdb/flash')
| -rwxr-xr-x | recipes-test/ddt-runner/files/scripts/p2041rdb/flash | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/flash b/recipes-test/ddt-runner/files/scripts/p2041rdb/flash new file mode 100755 index 0000000..2d10600 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/flash | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # This script is used to test flash driver functionality. I removed the write | ||
| 4 | # operations since all partition are in use in p2041rdb and there might be | ||
| 5 | # possibility of corrupting data even if we backup in test script. | ||
| 6 | |||
| 7 | if part_num=`cat /proc/mtd | grep -c 'mtd'`; then | ||
| 8 | echo "PASS: show $part_num partitions" | ||
| 9 | else | ||
| 10 | echo "FAIL: show $part_num partitions" | ||
| 11 | exit 1 | ||
| 12 | fi | ||
| 13 | |||
| 14 | for((part=0; part<$part_num; part++)); | ||
| 15 | do | ||
| 16 | if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then | ||
| 17 | echo "PASS: show partition $part debug info" | ||
| 18 | else | ||
| 19 | echo "FAIL: show partition $part debug info" | ||
| 20 | exit 1 | ||
| 21 | fi | ||
| 22 | done | ||
| 23 | |||
| 24 | READ_TEST=`find / -name mtd_readtest.ko -print` | ||
| 25 | |||
| 26 | if [ ! -e $READ_TEST ]; then | ||
| 27 | echo "FAIL: $READ_TEST does not exist" | ||
| 28 | exit 1 | ||
| 29 | else | ||
| 30 | echo "PASS: $READ_TEST exists" | ||
| 31 | fi | ||
| 32 | |||
| 33 | for((part=0; part<$part_num; part++)); | ||
| 34 | do | ||
| 35 | dmesg -c | ||
| 36 | |||
| 37 | insmod $READ_TEST dev=$part | ||
| 38 | |||
| 39 | finish=`dmesg | grep -c 'mtd_readtest: finished'` | ||
| 40 | if [ $finish -eq 1 ]; then | ||
| 41 | echo "PASS: read test $part" | ||
| 42 | else | ||
| 43 | echo "FAIL: read test $part" | ||
| 44 | rmmod $READ_TEST | ||
| 45 | exit 1 | ||
| 46 | fi | ||
| 47 | |||
| 48 | rmmod $READ_TEST | ||
| 49 | done | ||
