1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

flashrom_tester: lock_test: Make the logic clear and explicit

Document clearly what the test is doing and expects. Do not use the
push() function as it confuses the logs in the case of error.

BUG=b:258357944
BRANCH=None
TEST=flashrom_tester --libflashrom host Lock

Change-Id: Ibad559a8ff9696fd91f45bca9d9ceb6e90c41393
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69400
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Evan Benn 2022-11-09 16:01:58 +11:00 committed by Edward O'Callaghan
parent d1c7dc0a0a
commit e456b496d2

View File

@ -199,12 +199,12 @@ fn lock_test(env: &mut TestEnv) -> TestResult {
}
env.wp.set_hw(false)?.set_sw(true)?;
// Toggling software WP off should work when hardware is off.
// Then enable again for another go.
env.wp.push().set_sw(false)?;
// Toggling software WP off should work when hardware WP is off.
// Then enable software WP again for the next test.
env.wp.set_sw(false)?.set_sw(true)?;
// Toggling software WP off should not work when hardware WP is on.
env.wp.set_hw(true)?;
// Clearing should fail when hardware is enabled
if env.wp.set_sw(false).is_ok() {
return Err("Software WP was reset despite hardware WP being enabled".into());
}