David Hendricks has uploaded this change for review. ( https://review.coreboot.org/23025
Change subject: Hack up test_v2.sh to work better with upstream ......................................................................
Hack up test_v2.sh to work better with upstream
Hacks applied on top of chromiumos version of test_v2.sh to get the script running.
Change-Id: I9ace99fdb8d779804fe1887fe49f6409f8aff02e Signed-off-by: David Hendricks dhendricks@fb.com --- M tests/tests_v2/test_v2.sh 1 file changed, 38 insertions(+), 28 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/25/23025/1
diff --git a/tests/tests_v2/test_v2.sh b/tests/tests_v2/test_v2.sh index bf240d7..614cb7e 100755 --- a/tests/tests_v2/test_v2.sh +++ b/tests/tests_v2/test_v2.sh @@ -458,14 +458,15 @@ exit $EXIT_FAILURE fi
-# -# Setup. -# -grep -rH 'projectname = .*flashrom' .git/config >/dev/null 2>&1 -if [ $? -ne 0 ]; then - printf "Script must be run from root of flashrom directory\n" - exit $EXIT_FAILURE -fi +# FIXME(dhendrix): projectname seems to be something repo adds +## +## Setup. +## +#grep -rH 'projectname = .*flashrom' .git/config >/dev/null 2>&1 +#if [ $? -ne 0 ]; then +# printf "Script must be run from root of flashrom directory\n" +# exit $EXIT_FAILURE +#fi
if [ -z "$OLD_FLASHROM" ]; then if [ $DO_REMOTE -eq 1 ]; then @@ -480,18 +481,19 @@ exit $EXIT_FAILURE fi
-# Check if both flashrom binaries support logging -scmd $DO_REMOTE "$OLD_FLASHROM $PRIMARY_OPTS --flash-name -o ${TMPDIR}/flash_name.txt" -if [ $? -ne 0 ]; then - printf "Old flashrom binary does not support logging.\n" - exit $EXIT_FAILURE -fi -scmd $DO_REMOTE "$NEW_FLASHROM $PRIMARY_OPTS --flash-name -o ${TMPDIR}/flash_name.txt" -if [ $? -ne 0 ]; then - printf "New flashrom binary does not support logging.\n" - exit $EXIT_FAILURE -fi -scmd $DO_REMOTE "rm -f ${TMPDIR}/flash_name.txt" +# FIXME(dhendrix): need to find a test other than --flash-name +## Check if both flashrom binaries support logging +#scmd $DO_REMOTE "$OLD_FLASHROM $PRIMARY_OPTS --flash-name -o ${TMPDIR}/flash_name.txt" +#if [ $? -ne 0 ]; then +# printf "Old flashrom binary does not support logging.\n" +# exit $EXIT_FAILURE +#fi +#scmd $DO_REMOTE "$NEW_FLASHROM $PRIMARY_OPTS --flash-name -o ${TMPDIR}/flash_name.txt" +#if [ $? -ne 0 ]; then +# printf "New flashrom binary does not support logging.\n" +# exit $EXIT_FAILURE +#fi +#scmd $DO_REMOTE "rm -f ${TMPDIR}/flash_name.txt"
# print $1 and store it in the script log file print_and_log() @@ -597,9 +599,12 @@ # # Now the fun begins. # -cmd $DO_REMOTE "$NEW_FLASHROM $PRIMARY_OPTS --get-size" "${LOCAL_TMPDIR}/chip_size.txt" +# FIXME(dhendrix): --get-size... +#cmd $DO_REMOTE "$NEW_FLASHROM $PRIMARY_OPTS --get-size" "${LOCAL_TMPDIR}/chip_size.txt" +#tmp=$(cat ${LOCAL_TMPDIR}/chip_size.txt) +#cmd $DO_REMOTE "$OLD_FLASHROM $PRIMARY_OPTS --get-size" "${LOCAL_TMPDIR}/chip_size.txt" +echo "8388608" > "${LOCAL_TMPDIR}/chip_size.txt" tmp=$(cat ${LOCAL_TMPDIR}/chip_size.txt) -cmd $DO_REMOTE "$OLD_FLASHROM $PRIMARY_OPTS --get-size" "${LOCAL_TMPDIR}/chip_size.txt" CHIP_SIZE=$(cat ${LOCAL_TMPDIR}/chip_size.txt) CHIP_SIZE_KB=$(($CHIP_SIZE / $K)) CHIP_SIZE_HALF=$(($CHIP_SIZE / 2)) @@ -732,9 +737,12 @@ printf "%06x:%06x region\n" $1 $(($1 + $2 - 1)) > "${LOCAL_TMPDIR}/${layout}" if [ $DO_REMOTE -eq 1 ]; then copy_to_remote "$layout" ; fi
- flashrom_log_scmd $DO_REMOTE "$NEW_FLASHROM $PRIMARY_OPTS -r -l ${TMPDIR}/${layout} --ignore-fmap -i region:${cmp1}" "double_read_1" + # FIXME(dhendrix): --ignore-fmap +# flashrom_log_scmd $DO_REMOTE "$NEW_FLASHROM $PRIMARY_OPTS -r -l ${TMPDIR}/${layout} --ignore-fmap -i region:${cmp1}" "double_read_1" + flashrom_log_scmd $DO_REMOTE "$NEW_FLASHROM $PRIMARY_OPTS -r -l ${TMPDIR}/${layout} -i region:${cmp1}" "double_read_1" # FIXME: second (or maybe third?) read should be done using secondary programmer, if applicable. - flashrom_log_scmd $DO_REMOTE "$NEW_FLASHROM $PRIMARY_OPTS -r -l ${TMPDIR}/${layout} --ignore-fmap -i region:${cmp2}" "double_read_2" +# flashrom_log_scmd $DO_REMOTE "$NEW_FLASHROM $PRIMARY_OPTS -r -l ${TMPDIR}/${layout} --ignore-fmap -i region:${cmp2}" "double_read_2" + flashrom_log_scmd $DO_REMOTE "$NEW_FLASHROM $PRIMARY_OPTS -r -l ${TMPDIR}/${layout} -i region:${cmp2}" "double_read_2" scmd $DO_REMOTE "cmp $cmp1 $cmp2" if [ $? -ne 0 ]; then test_fail "Double-read test failed, aborting." @@ -772,16 +780,18 @@ # $1: Region name partial_write_test() { - local opts="--fast-verify" +# local opts="--fast-verify" + local opts="--noverify-all" local secondary_opts="" # for secondary programmer local region_name="$1" local filename="" local test_num=0 local prev_test_num=0
- if [ $REGION_MODE -ne $REGION_MODE_FLASHMAP ]; then - opts="$opts --ignore-fmap" - fi +# # FIXME(dhendrix): --ignore-fmap +# if [ $REGION_MODE -ne $REGION_MODE_FLASHMAP ]; then +# #opts="$opts --ignore-fmap" +# fi
if [ $TEST_TYPE -eq $TEST_TYPE_SINGLE ]; then if [ $REGION_MODE -eq $REGION_MODE_LAYOUT ]; then