From cd3411088f6bb4393d79c50b5f7eef3f11a83435 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 10 Oct 2014 00:31:33 +0200 Subject: initial commit for Enea Linux 4.0-140929 Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea --- .../ddt-runner/files/scripts/acp3448v2/flash | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 recipes-test/ddt-runner/files/scripts/acp3448v2/flash (limited to 'recipes-test/ddt-runner/files/scripts/acp3448v2/flash') diff --git a/recipes-test/ddt-runner/files/scripts/acp3448v2/flash b/recipes-test/ddt-runner/files/scripts/acp3448v2/flash new file mode 100755 index 0000000..30c5d06 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/acp3448v2/flash @@ -0,0 +1,45 @@ +#!/bin/sh +# +# This script is used to test flash driver function. + +if part_num=`cat /proc/mtd | grep -c 'mtd'`; then + echo "PASS: show $part_num partitions" +else + echo "FAIL: show $part_num partitions" +fi + +for((part=0; part<$part_num-1; part++)); +do + if [ $(mtd_debug info /dev/mtd$part | grep -c 'mtd.type') ]; then + echo "PASS: show partition $part debug info" + else + echo "FAIL: show partition $part debug info" + fi +done + +let "test_part=part_num-2" + +if [ $(flash_erase -j /dev/mtd${test_part} 0 0 | grep -c '100 % complete') ]; then + echo "PASS: erase and format partition ${test_part}" +else + echo "FAIL: erase and format partition ${test_part}" +fi + +mkdir -p /mnt/flash +mount -t jffs2 /dev/mtdblock${test_part} /mnt/flash +if [ $? -eq 0 ]; then + echo "PASS: mount partition ${test_part} as /mnt/flash" +else + echo "FAIL: mount partition ${test_part} as /mnt/flash" +fi + +cd /mnt/flash +touch test +if [ $(ls | grep -c 'test') ]; then + echo "PASS: touch a file on partition ${test_part}" +else + echo "FAIL: touch a file on partition ${test_part}" +fi + +cd ~ +umount /mnt/flash -- cgit v1.2.3-54-g00ecf