[M] Change in flashrom[main]: flashrom_tester: Fix partial_lock_test on libflashrom

Attention is currently required from: Anastasia Klimchuk, Edward O'Callaghan, Evan Benn. Hsuan-ting Chen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/79304?usp=email ) Change subject: flashrom_tester: Fix partial_lock_test on libflashrom ...................................................................... Patch Set 4: (1 comment) File util/flashrom_tester/flashrom/src/cmd.rs: https://review.coreboot.org/c/flashrom/+/79304/comment/96ba8561_f2faa87d : PS3, Line 301: // TODO From a syntax perspective: In Rust, `pub trait Flashrom` is an interface that defines method signatures, such as `write_from_file()` and `wp_range()`. We have two structs, `pub struct FlashromLib` (from `util/flashrom_tester/flashrom/src/flashromlib.rs`) and `pub struct FlashromCmd` (from `util/flashrom_tester/flashrom/src/cmd.rs`), that implement the `Flashrom` trait. This enables polymorphism. To prevent runtime errors, both `FlashromLib` and `FlashromCmd` must implement the `fn set_flags()` method from the `Flashrom` trait. --- From the `flashrom_tester`'s perspective: flashrom_tester supports two execution scenarios: "cmd" and "lib". lib: In this scenario, a `flashrom_lib` instance is created at the beginning of the test. Its constructor (link to constructor: [gerrit]( https://review.coreboot.org/c/flashrom/+/79304/4/util/flashrom_tester/src/te...)) should set default flags that will be used by all commands with `set_flags()`. cmd: Methods are interpreted as sequences of flashrom commands. Each command resets flags to default values (link to cli_classic: [github](https://github.com/flashrom/flashrom/blob/main/cli_classic.c#L1226)). Therefore, no action is needed within set_flags(). ---
I am not sure whether we get votes from Ed and Evan, maybe not, I will try to finish review by myself, so that's why I am having questions :)
Thanks! I am not deeply familiar with `flashrom_tester` or Rust either, but I'll try to answer all the further questions. -- To view, visit https://review.coreboot.org/c/flashrom/+/79304?usp=email To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: main Gerrit-Change-Id: I7a8ac0c0984fef3cd9e73ed8d8097ddf429e54b2 Gerrit-Change-Number: 79304 Gerrit-PatchSet: 4 Gerrit-Owner: Hsuan-ting Chen <roccochen@google.com> Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org> 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: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-CC: Hsuan Ting Chen <roccochen@chromium.org> Gerrit-CC: Nikolai Artemiev <nartemiev@chromium.org> Gerrit-Attention: Evan Benn <evanbenn@gmail.com> Gerrit-Attention: Edward O'Callaghan <quasisec@chromium.org> Gerrit-Attention: Anastasia Klimchuk <aklm@chromium.org> Gerrit-Comment-Date: Tue, 30 Jan 2024 08:27:49 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: Hsuan-ting Chen <roccochen@google.com> Comment-In-Reply-To: Anastasia Klimchuk <aklm@chromium.org> Gerrit-MessageType: comment
participants (1)
-
Hsuan-ting Chen (Code Review)