firmware_LockedME: accomodate new flashrom behavior
Recent changes to the CrOS version of flashrom result in writes to
flash regions protected by the PCH (when instructed by the contents of
SI_DESC) to not result in a failed exit status, but still fail to
write* (good) and log an access failure (observed on both an Intel big
core SoC and Intel small core SoC).
The CrOS flashrom maintainer should make some level of effort to couple
flashrom behavior changes with faft: so, if the behavior changes back to
an exit status of zero, this change should be reverted at the same time
(it should be innocuous in that case, but to avoid build up of detritus
in this test).
*fail to write observation is based on the log of the access failure and
read attempts of protected regions still being all ones.
BUG=b:110839551, b:110572221
TEST=Ran against a small core DUT (epaullete) with a locked TXE (passed
as would be expected). Ran against a big core DUT (pantheon) with the
manufacturing mode check commented out (failed as expected with SI_DESC
detected as writeable).
Change-Id: I83ec216fcb6018961077a3052d54b771a2ec4182
Reviewed-on: https://chromium-review.googlesource.com/1116192
Commit-Ready: Kevin Shelton <kmshelton@chromium.org>
Tested-by: Kevin Shelton <kmshelton@chromium.org>
Reviewed-by: Martin Roth <martinroth@chromium.org>
diff --git a/client/site_tests/firmware_LockedME/firmware_LockedME.py b/client/site_tests/firmware_LockedME/firmware_LockedME.py
index dce9a46..6470761 100644
--- a/client/site_tests/firmware_LockedME/firmware_LockedME.py
+++ b/client/site_tests/firmware_LockedME/firmware_LockedME.py
@@ -9,6 +9,10 @@
from autotest_lib.client.bin import test, utils
from autotest_lib.client.common_lib import error
+FLASHROM_ACCESS_FAILED_TOKEN = ('Could not fully verify due to access error, '
+ 'ignoring')
+
+
class firmware_LockedME(test.test):
# Needed by autotest
version = 1
@@ -51,11 +55,12 @@
size = os.stat(sectname).st_size
utils.run('dd', args=('if=/dev/urandom', 'of=newdata',
'count=1', 'bs=%d' % (size)))
- r = self.flashrom(args=('-w', self.BIOS_FILE,
+ r = self.flashrom(args=('-V', '-w', self.BIOS_FILE,
'-i' , '%s:newdata' % (sectname),
'--fast-verify'),
ignore_status=True)
- if not r.exit_status:
+ if (not r.exit_status and
+ FLASHROM_ACCESS_FAILED_TOKEN not in r.stdout):
logging.info('Oops, it worked! Put it back...')
self.flashrom(args=('-w', self.BIOS_FILE,
'-i', '%s:%s' % (sectname, sectname),