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