summaryrefslogtreecommitdiff
path: root/ubi-utils/old-tools/scripts/bin2nand2bin_test.sh
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-02-19 14:54:17 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-02-19 16:41:16 +0200
commit86dd9696d3a1acb036d65909d93d73455b8aed3a (patch)
tree9e8bb6797b3bebd0bf83ae1fab2151a6dfeafe6a /ubi-utils/old-tools/scripts/bin2nand2bin_test.sh
parentef644090223e5983ca2492850354c1390e3368d1 (diff)
Revert ubi-tools changes
Restore ubi tools to their "original" state, which means to the state they were before I stareted cleaning them up. Instead, create a "new-utils" subdirectory and move my work there. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/old-tools/scripts/bin2nand2bin_test.sh')
-rw-r--r--ubi-utils/old-tools/scripts/bin2nand2bin_test.sh216
1 files changed, 0 insertions, 216 deletions
diff --git a/ubi-utils/old-tools/scripts/bin2nand2bin_test.sh b/ubi-utils/old-tools/scripts/bin2nand2bin_test.sh
deleted file mode 100644
index 51f048c..0000000
--- a/ubi-utils/old-tools/scripts/bin2nand2bin_test.sh
+++ /dev/null
@@ -1,216 +0,0 @@
-#!/bin/sh
-#
-# Version: 1.1
-# Author: Frank Haverkamp <haver@vnet.ibm.com>
-#
-# Testcase for nand2bin and bin2nand. Generate testdata and inject
-# biterrors. Convert data back and compare with original data.
-#
-# Conversion:
-# bin -> bin2nand -> mif -> nand2bin -> img
-#
-
-inject_biterror=./inject_biterror.pl
-pagesize=2048
-oobsize=64
-
-# Create test data
-dd if=/dev/urandom of=testblock.bin bs=131072 count=1
-
-for layout in IBM MTD ; do
- echo "*** Simple test with $layout layout ..."
-
- echo -n "Convert bin to mif ... "
- bin2nand -l$layout --pagesize=${pagesize} -o testblock.mif testblock.bin
- if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
- else
- echo "ok"
- fi
-
- echo -n "Convert mif to bin ... "
- nand2bin -l$layout --pagesize=${pagesize} -o testblock.img testblock.mif
- if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
- else
- echo "ok"
- fi
-
- echo -n "Comparing data ... "
- diff testblock.bin testblock.img
- if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
- else
- echo "ok"
- fi
-done
-
-echo "*** Test conversion without bitflips ..."
-
-echo -n "Convert bin to mif ... "
-bin2nand --pagesize=${pagesize} -o testblock.mif testblock.bin
-if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
-else
- echo "ok"
-fi
-
-echo -n "Convert mif to bin ... "
-nand2bin --pagesize=${pagesize} -o testblock.img testblock.mif
-if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
-else
- echo "ok"
-fi
-
-echo -n "Comparing data ... "
-diff testblock.bin testblock.img
-if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
-else
- echo "ok"
-fi
-
-echo "*** Test conversion with uncorrectable ECC erors ..."
-echo -n "Inject biterror at offset $ioffs ... "
-${inject_biterror} --offset=0 --bitmask=0x81 \
- --input=testblock.mif \
- --output=testblock_bitflip.mif
-if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
-else
- echo "ok"
-fi
-
-echo "Convert mif to bin ... "
-rm testblock.img
-nand2bin --correct-ecc --pagesize=${pagesize} -o testblock.img \
- testblock_bitflip.mif
-if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
-else
- echo "ok"
-fi
-
-echo -n "Comparing data, must fail due to uncorrectable ECC ... "
-diff testblock.bin testblock.img
-if [ $? -ne "0" ]; then
- echo "ok" # Must fail!
-else
- echo "failed!"
- exit 1
-fi
-
-echo "*** Test bitflips in data ... "
-for offs in `seq 0 255` ; do
-
- cp testblock.mif testblock_bitflip.mif
-
- for xoffs in 0 256 512 768 ; do
- let ioffs=$offs+$xoffs
-
- cp testblock_bitflip.mif testblock_bitflip_tmp.mif
- echo -n "Inject biterror at offset $ioffs ... "
- ${inject_biterror} --offset=${ioffs} --bitmask=0x01 \
- --input=testblock_bitflip_tmp.mif \
- --output=testblock_bitflip.mif
- if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
- else
- echo "ok"
- fi
- done
-
- echo "Convert mif to bin ... "
- rm testblock.img
- nand2bin --correct-ecc --pagesize=${pagesize} -o testblock.img \
- testblock_bitflip.mif
- if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
- else
- echo "ok"
- fi
-
- echo -n "Comparing data ... "
- diff testblock.bin testblock.img
- if [ $? -ne "0" ]; then
- hexdump testblock.bin > testblock.bin.txt
- hexdump testblock.img > testblock.img.txt
- echo "Use tkdiff testblock.bin.txt testblock.img.txt to compare"
- echo "failed!"
- exit 1
- else
- echo "ok"
- fi
-
- # Without correction
- echo "Convert mif to bin ... "
- rm testblock.img
- nand2bin --pagesize=${pagesize} -o testblock.img \
- testblock_bitflip.mif
- if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
- else
- echo "ok"
- fi
-
- echo -n "Comparing data must differ, correction is disabled ... "
- diff testblock.bin testblock.img
- if [ $? -ne "0" ]; then
- echo "ok" # must fail
- else
- echo "failed!"
- exit 1
- fi
-done
-
-echo "*** Test bitflips in OOB data ... "
-for offs in `seq 0 $oobsize` ; do
-
- let ioffs=$pagesize+$offs
-
- echo -n "Inject biterror at offset $ioffs ... "
- ${inject_biterror} --offset=${ioffs} --bitmask=0x01 \
- --input=testblock.mif \
- --output=testblock_bitflip.mif
- if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
- else
- echo "ok"
- fi
-
- echo "Convert mif to bin ... "
- rm testblock.img
- nand2bin --correct-ecc --pagesize=${pagesize} -o testblock.img \
- testblock_bitflip.mif
- if [ $? -ne "0" ]; then
- echo "failed!"
- exit 1
- else
- echo "ok"
- fi
-
- echo -n "Comparing data ... "
- diff testblock.bin testblock.img
- if [ $? -ne "0" ]; then
- hexdump testblock.bin > testblock.bin.txt
- hexdump testblock.img > testblock.img.txt
- echo "Use tkdiff testblock.bin.txt testblock.img.txt to compare"
- echo "failed!"
- exit 1
- else
- echo "ok"
- fi
-done