David Hendricks has uploaded a new change for review. ( https://review.coreboot.org/19341 )
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, 37 insertions(+), 28 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/41/19341/1
diff --git a/tests/tests_v2/test_v2.sh b/tests/tests_v2/test_v2.sh index 4c15c36..4f29c7d 100755 --- a/tests/tests_v2/test_v2.sh +++ b/tests/tests_v2/test_v2.sh @@ -129,7 +129,7 @@ -s, --secondary-programmer <parameters> Secondary programmer options. -t, --type <arg> - Test type (single, endurance, writeprotect). + Test type (single, endurance, writeprotect). -u, --upload-results Upload results to flashrom.org. -v, --voltage @@ -456,14 +456,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 @@ -478,18 +479,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() @@ -595,9 +597,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)) @@ -730,9 +735,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." @@ -777,9 +785,10 @@ 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