summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@google.com>2010-11-02 03:03:38 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-11-02 03:03:38 +0000
commit738f8e275609455187ae2d70c14e6e527e3210bc (patch)
tree8ab742372a275b179dba62a9859b06fe43424e69 /util
parenteb6337f7527450b58658d271a077cd7fc02c1d5b (diff)
downloadflashrom-738f8e275609455187ae2d70c14e6e527e3210bc.tar.gz
flashrom-738f8e275609455187ae2d70c14e6e527e3210bc.tar.bz2
flashrom-738f8e275609455187ae2d70c14e6e527e3210bc.zip
Add a line of output for each iteration of the torture test
This serves as a sort of progress indicator. The output looks like this:: localhost ~ # flashrom="./flashrom" sh flashrom_partial_write_test.sh testing flashrom binary: ./flashrom Running test in /tmp/tmp.4xPejwaADU ffh pattern written in ff_4k.bin 00h pattern written in 00_4k.bin Reading BIOS image Original image saved as bios.bin aligned region 0 test: passed ... aligned region 15 test: passed unaligned region 0 test: passed ... unaligned region 15 test: passed Result: PASSED restoring original bios image using system's flashrom test files remain in /tmp/tmp.4xPejwaADU Corresponding to flashrom svn r1222. Signed-off-by: David Hendricks <dhendrix@google.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'util')
-rwxr-xr-xutil/flashrom_partial_write_test.sh26
1 files changed, 16 insertions, 10 deletions
diff --git a/util/flashrom_partial_write_test.sh b/util/flashrom_partial_write_test.sh
index d5413b801..69a692351 100755
--- a/util/flashrom_partial_write_test.sh
+++ b/util/flashrom_partial_write_test.sh
@@ -92,6 +92,12 @@ echo "Original image saved as ${BIOS}"
# $1: exit code
do_exit() {
+ if [ ${1} -eq ${EXIT_FAILURE} ] ; then
+ echo "Result: FAILED"
+ else
+ echo "Result: PASSED"
+ fi
+
echo "restoring original bios image using system's flashrom"
flashrom ${FLASHROM_PARAM} -w "$BIOS"
echo "test files remain in ${TMPDIR}"
@@ -159,14 +165,14 @@ echo "
cp "$BIOS" "$TESTFILE"
i=0
while [ $i -lt $NUM_REGIONS ] ; do
+ echo -n "aligned region ${i} test: "
offset=$((${i} * 8192))
dd if=${ZERO_4K} of=${TESTFILE} bs=1 conv=notrunc seek=${offset} 2> /dev/null
dd if=${FF_4K} of=${TESTFILE} bs=1 conv=notrunc seek=$((${offset} + 4096)) 2> /dev/null
./flashrom ${FLASHROM_PARAM} -l layout_4k_aligned.txt -i 00_${i} -i ff_${i} -w "$TESTFILE" > /dev/null
if [ "$?" != "0" ] ; then
- echo "partial flash failed on iteration ${i}"
- echo "Result: FAIL"
+ echo "failed to flash region"
do_exit "$EXIT_FAILURE"
fi
@@ -175,13 +181,13 @@ while [ $i -lt $NUM_REGIONS ] ; do
flashrom ${FLASHROM_PARAM} -r difftest.bin > /dev/null
diff -q difftest.bin "$TESTFILE"
if [ "$?" != "0" ] ; then
- echo "diff test failed on iteration ${i}"
- echo "Result: FAIL"
+ echo "failed diff test"
do_exit "$EXIT_FAILURE"
fi
rm -f difftest.bin
i=$((${i} + 1))
+ echo "passed"
done
# Make a layout - 4K regions on 4.5K boundaries. This will help find problems
@@ -245,11 +251,13 @@ echo "
" > layout_unaligned.txt
# reset the test file and ROM to the original state
-flashrom ${FLASHROM_PARAM} -w "$BIOS"
+flashrom ${FLASHROM_PARAM} -w "$BIOS" > /dev/null
cp "$BIOS" "$TESTFILE"
i=0
while [ $i -lt $NUM_REGIONS ] ; do
+ echo -n "unaligned region ${i} test: "
+
offset=$(($((${i} * 8192)) + 2048))
# Protect against too long write
writelen=4096
@@ -264,8 +272,7 @@ while [ $i -lt $NUM_REGIONS ] ; do
./flashrom ${FLASHROM_PARAM} -l layout_unaligned.txt -i 00_${i} -i ff_${i} -w "$TESTFILE" > /dev/null
if [ "$?" != "0" ] ; then
- echo "partial flash failed on iteration ${i}"
- echo "Result: FAIL"
+ echo "failed to flash region"
do_exit "$EXIT_FAILURE"
fi
@@ -274,14 +281,13 @@ while [ $i -lt $NUM_REGIONS ] ; do
flashrom ${FLASHROM_PARAM} -r difftest.bin > /dev/null
diff -q difftest.bin "$TESTFILE"
if [ "$?" != "0" ] ; then
- echo "diff test failed on iteration ${i}"
- echo "Result: FAIL"
+ echo "failed diff test"
do_exit "$EXIT_FAILURE"
fi
rm -f difftest.bin
i=$((${i} + 1))
+ echo "passed"
done
-echo "Result: PASS"
do_exit "$EXIT_SUCCESS"