summaryrefslogtreecommitdiff
path: root/ubi-utils/scripts
diff options
context:
space:
mode:
authorFrank Haverkamp <haver@vnet.ibm.com>2007-11-24 11:04:50 +0100
committerFrank Haverkamp <haver@vnet.ibm.com>2007-11-24 11:04:50 +0100
commit0d2d0f43b9aa9b08f610169b412fd24a15dea154 (patch)
treeb1a25b9b5e4fbaf79780d60d918b4dd2d74142ed /ubi-utils/scripts
parentdb9cd63b656507b86723500840ec1543fab9c7cf (diff)
ubi-utils: Test-case for unubi
We have no good testcases for this kind of tool yet. Adding a 1st draft. Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Diffstat (limited to 'ubi-utils/scripts')
-rw-r--r--ubi-utils/scripts/unubi_test.sh61
1 files changed, 61 insertions, 0 deletions
diff --git a/ubi-utils/scripts/unubi_test.sh b/ubi-utils/scripts/unubi_test.sh
new file mode 100644
index 0000000..1cbe426
--- /dev/null
+++ b/ubi-utils/scripts/unubi_test.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# Use raw NAND data, extract UBI image and apply tool to it.
+# Test basic functionality.
+#
+# 2007 Frank Haverkamp <haver@vnet.ibm.com>
+#
+
+version=1.0
+
+image=data.mif
+oob=oob.bin
+data=data.bin
+pagesize=2048
+volmax=31
+datadir=unubi_data.bin
+
+echo "Testcase: ${0} Version: ${version}"
+echo
+
+if [ -f $1 ]; then
+ image=${1}
+fi
+
+echo "Testing nand2bin ..."
+echo " Input: ${image}"
+echo " Data: ${data}"
+echo " OOB: ${oob}"
+echo " Pagesize: ${pagesize}"
+
+nand2bin --pagesize ${pagesize} -o ${data} -O ${oob} ${image}
+echo
+
+echo "Testing unubi ..."
+unubi --version
+
+echo "Trying to extract first ${volmax} volumes ..."
+for v in `seq 0 ${volmax}` ; do
+ unubi -r${v} ${data}
+ echo -n "."
+done
+echo "ok"
+
+ls -l unubi_data.bin/
+
+echo "Extracting graphics ..."
+unubi -a ${data}
+
+
+echo "Extracting volume info table ..."
+unubi -i ${data}
+
+echo
+echo "Table 0"
+echo "-------"
+cat ${datadir}/vol_info_table0
+
+echo
+echo "Table 1"
+echo "-------"
+cat ${datadir}/vol_info_table1 \ No newline at end of file