Attention is currently required from: David Wu, Evan Benn, Hsuan Ting Chen, Hsuan-ting Chen.

Hsuan-ting Chen uploaded patch set #3 to this change.

View Change

The following approvals got outdated and were removed: Code-Review+1 by David Wu, Verified+1 by build bot (Jenkins)

flashrom_tester: Fix partial_lock_test on libflashrom

partial_lock_test (Lock_top_quad, Lock_bottom_quad, Lock_bottom_half,
and Lock_top_half) tries to:
1. Disable HWWP
2. Lock partial
3. Enable HWWP
4. Try to write the locked partial and expect a failure
...

The 4th step only works on flashrom binary since the binary will set
FLASHROM_FLAG_VERIFY_AFTER_WRITE=1 by default and it will error out
while verifying.

But libflashrom does not set any flag beforehand, so it has
FLASHROM_FLAG_VERIFY_AFTER_WRITE=0 and thus it will think the write
command works normally and raise no error. This causes the issue that
flashrom_tester with libflashrom has been failed until today.

To solve this issue, there are two solutions:
1. Take care of the default flags in libflashrom
2. Always pass --noverify to flashrom binary and verify it afterwards.

To make both methods more consistent, I fix it with approach 1.

BUG=b:304439294
BRANCH=none
TEST=flashrom_tester internal --libflashrom Lock_top_quad

Change-Id: I7a8ac0c0984fef3cd9e73ed8d8097ddf429e54b2
Signed-off-by: roccochen@chromium.com <roccochen@chromium.org>
---
M bindings/rust/libflashrom/src/lib.rs
M util/flashrom_tester/Cargo.toml
M util/flashrom_tester/flashrom/src/cmd.rs
M util/flashrom_tester/flashrom/src/flashromlib.rs
M util/flashrom_tester/flashrom/src/lib.rs
M util/flashrom_tester/src/tester.rs
6 files changed, 123 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/04/79304/3

To view, visit change 79304. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I7a8ac0c0984fef3cd9e73ed8d8097ddf429e54b2
Gerrit-Change-Number: 79304
Gerrit-PatchSet: 3
Gerrit-Owner: Hsuan-ting Chen <roccochen@google.com>
Gerrit-Reviewer: David Wu <david_wu@quanta.corp-partner.google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Evan Benn <evanbenn@gmail.com>
Gerrit-Reviewer: Hsuan Ting Chen <roccochen@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Nikolai Artemiev <nartemiev@chromium.org>
Gerrit-Attention: Hsuan Ting Chen <roccochen@chromium.org>
Gerrit-Attention: David Wu <david_wu@quanta.corp-partner.google.com>
Gerrit-Attention: Evan Benn <evanbenn@gmail.com>
Gerrit-Attention: Hsuan-ting Chen <roccochen@google.com>
Gerrit-MessageType: newpatchset