Attention is currently required from: Thomas Heijligen, Evan Benn.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/69539 )
Change subject: tests: Add unmock_io.c
......................................................................
Patch Set 1:
(7 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/69539/comment/400974c9_c8d84192
PS1, Line 7: Add unmock_io.c
Redirect to real I/O to support coverage run
https://review.coreboot.org/c/flashrom/+/69539/comment/1eef9953_5b36b3e7
PS1, Line 8:
: Add functions and a struct that defer the io functions mocked by
: mock_io to the real implementations.
Implement a check that redirects mock io functions to the real implementations. Real I/O functions are needed for the coverage tool to be able to create and write files.
https://review.coreboot.org/c/flashrom/+/69539/comment/ad864346_2eddbbaa
PS1, Line 10: This is to support code coverage.
remove
File tests/unmock_io.c:
https://review.coreboot.org/c/flashrom/+/69539/comment/cbdaff95_219de286
PS1, Line 19: unmock_io
How about `io_real.h` (and `io_real.c`)? this aligns with `io_mock` that we already have.
Function names are all fine, I am specifically about file names
https://review.coreboot.org/c/flashrom/+/69539/comment/eefc0c06_762ea4ef
PS1, Line 25: (void)state;
Just drop this line, none other custom mocks are using it.
This line is used in test methods (there are none in this file).
https://review.coreboot.org/c/flashrom/+/69539/comment/4a6d12f9_310934f6
PS1, Line 43: // Mock ios that defer to the real io functions.
: // These exist so that code coverage can print to real files on disk.
Please format the comment as /* */ and same below
https://review.coreboot.org/c/flashrom/+/69539/comment/bc915c46_9502c822
PS1, Line 61: maybe_unmock_io
Let's add a comment for this function:
> Detects a coverage run and registers real I/O functions instead of mocks so that coverage tools can create and write real files and generate a coverage report.
--
To view, visit https://review.coreboot.org/c/flashrom/+/69539
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0817fce6ea0f53a4c127794a0d8246504675f805
Gerrit-Change-Number: 69539
Gerrit-PatchSet: 1
Gerrit-Owner: Evan Benn <evanbenn(a)google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Evan Benn <evanbenn(a)google.com>
Gerrit-Comment-Date: Thu, 24 Nov 2022 00:12:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Evan Benn.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/69263 )
Change subject: tests: Mock the mode_t variant of open
......................................................................
Patch Set 7:
(2 comments)
File tests/io_mock.h:
https://review.coreboot.org/c/flashrom/+/69263/comment/73dd77c8_11a3484d
PS4, Line 37: #include <fcntl.h>
> this one is posix, and posix says: `The <fcntl.h> header shall define the mode_t` […]
I will try to test
File tests/tests.c:
https://review.coreboot.org/c/flashrom/+/69263/comment/5344f4cd_5e133b3f
PS4, Line 103: mode_t mode = 0;
: if (flags & O_CREAT) {
: va_list ap;
: va_start(ap, flags);
: mode = va_arg(ap, mode_t);
: va_end(ap);
: }
> It has to be in the varargs function. […]
open64 and open64_2 are needed for some of the environments, so we can't remove them. Let's keep as is then.
--
To view, visit https://review.coreboot.org/c/flashrom/+/69263
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8c134e6d36a248d0f51985e389085a9e585fb83d
Gerrit-Change-Number: 69263
Gerrit-PatchSet: 7
Gerrit-Owner: Evan Benn <evanbenn(a)google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Evan Benn <evanbenn(a)google.com>
Gerrit-Comment-Date: Wed, 23 Nov 2022 23:51:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Comment-In-Reply-To: Evan Benn <evanbenn(a)google.com>
Gerrit-MessageType: comment
Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/flashrom/+/69765 )
Change subject: flashrom_tester: Fix unit test error
......................................................................
flashrom_tester: Fix unit test error
Commit 065366d (flashrom_tester: Change timestamp to UTC microsecond)
changed the time format, breaking the unit test. This patch
fixes the unit test.
BUG=None
BRANCH=None
TEST=cargo test
Change-Id: Iba42a9026b41ddb61bb704aa1c26783cd251d787
Signed-off-by: Evan Benn <evanbenn(a)chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69765
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Angel Pons <th3fanbus(a)gmail.com>
Reviewed-by: Peter Marheine <pmarheine(a)chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec(a)chromium.org>
---
M util/flashrom_tester/src/logger.rs
1 file changed, 26 insertions(+), 2 deletions(-)
Approvals:
build bot (Jenkins): Verified
Angel Pons: Looks good to me, approved
Edward O'Callaghan: Looks good to me, approved
Peter Marheine: Looks good to me, but someone else must approve
diff --git a/util/flashrom_tester/src/logger.rs b/util/flashrom_tester/src/logger.rs
index fb26bde..b700c19 100644
--- a/util/flashrom_tester/src/logger.rs
+++ b/util/flashrom_tester/src/logger.rs
@@ -153,9 +153,10 @@
assert_eq!(&buf[..5], "\x1b[35m");
// Time is difficult to test, assume it's formatted okay
+ // Split on the UTC timezone char
assert_eq!(
- &buf[24..],
- " \x1b[33m[ INFO ]\x1b[0m Test message at INFO\n"
+ buf.split_once("Z ").unwrap().1,
+ "\x1b[33m[ INFO ]\x1b[0m Test message at INFO\n"
);
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/69765
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iba42a9026b41ddb61bb704aa1c26783cd251d787
Gerrit-Change-Number: 69765
Gerrit-PatchSet: 3
Gerrit-Owner: Evan Benn <evanbenn(a)google.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: foss(a)volatilesystems.org, Angel Pons.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/69309 )
Change subject: flashchips: Add support for XMC XM25QH128A.
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
> Thought it might have been better to wait for clarity on the commit message before doing that, but I […]
Usually the rule of thumb is: if you mark comments as resolved, you need to upload new patchset which demonstrates that you indeed resolved the comments. Otherwise how do we know what you have in local repo? :)
Gerrit allows to view "incremental" diffs between patchsets, which can be very handy.
Also it is entirely normal to resolve some of the comments (not all of them), and for the remaining ones ask for clarification, not a problem!
--
To view, visit https://review.coreboot.org/c/flashrom/+/69309
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iced40403c6694a55fd648ea2785cdcba21712234
Gerrit-Change-Number: 69309
Gerrit-PatchSet: 2
Gerrit-Owner: foss(a)volatilesystems.org
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: foss(a)volatilesystems.org
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Wed, 23 Nov 2022 23:07:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: foss(a)volatilesystems.org
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Thomas Heijligen, Edward O'Callaghan, Evan Benn.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/69620 )
Change subject: tests: Convert selfcheck to unit tests
......................................................................
Patch Set 6:
(14 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/69620/comment/34556d50_b100b020
PS6, Line 7: Convert
Replace Convert with Add.
We cannot convert selfcheck yet, so it stays. Unit tests are added.
File board_enable.c:
https://review.coreboot.org/c/flashrom/+/69620/comment/47182442_e17a34df
PS6, Line 2527: const size_t board_matches_size = ARRAY_SIZE(board_matches);
Why this can't be in the test code?
File tests/meson.build:
https://review.coreboot.org/c/flashrom/+/69620/comment/ae068992_f1013e8a
PS6, Line 25: well_formed
I would rename all occurrences of "well_formed" into "selfcheck": file names, test methods names etc etc (and don't forget the comments ;)).
The tests are verifying more than just tables being well formed, but also checking valid values in table rows.
And secondly "selfcheck" is almost like a brand name at this stage, so let's keep the name.
File tests/well_formed_tables.c:
https://review.coreboot.org/c/flashrom/+/69620/comment/82af0fc9_ef8cb9b5
PS6, Line 23: name
Maybe rename to prog_name?
https://review.coreboot.org/c/flashrom/+/69620/comment/c152b936_7196a5a1
PS6, Line 26: #assertion
I assume this would print "p is false" which can be confusing. I would add one more parameter to macro, string assertion_name and print that instead. Sp that you can pass "Programmer entry", "Programmer name" etc and have very clear error message.
I would like the error message be very clear to the developer without needing to look into test code. I am happy to have more code if this achieves clearer error messages for test failures.
https://review.coreboot.org/c/flashrom/+/69620/comment/2875c2c3_2c4943c0
PS6, Line 26: is false
is false or NULL
https://review.coreboot.org/c/flashrom/+/69620/comment/ab1dd362_20450fab
PS6, Line 24: do { \
: if (!(assertion)) \
: fail_msg(#assertion " is false for index:%zu name:%s", (index), \
: (name) ? (name) : "unknown"); \
: } while (0)
> I'm confused. Why is this a do-while? Is it really needed? It just runs one time.
I was also confused in the beginning, but then I thought this is probably a trick to avoid swallowing a semicolon https://gcc.gnu.org/onlinedocs/cpp/Swallowing-the-Semicolon.html
but I will let Evan tell us, because he knows for sure!
https://review.coreboot.org/c/flashrom/+/69620/comment/36cb8b6f_9afe64bb
PS6, Line 33: (void)state; /* unused */
Add a new line after `(void)state; /* unused */` and the same for all other test methods.
https://review.coreboot.org/c/flashrom/+/69620/comment/4ddce5ef_ade6c279
PS6, Line 41: if (strcmp("internal", p->name) != 0)
: assert_table(p->devs.note, i, p->name);
Original code has this check for all programmers with p->type == OTHER
Lets keep it as is.
https://review.coreboot.org/c/flashrom/+/69620/comment/6bb0f54d_c2ab5d9d
PS6, Line 51: assert_false(flashchips_size <= 1 || flashchips[flashchips_size - 1].name != NULL);
Break down into two `assert_true`s
https://review.coreboot.org/c/flashrom/+/69620/comment/6b3c7499_d4a6c5b7
PS6, Line 58: }
You missed `selfcheck_eraseblocks` functionality?
It can be one more test method
https://review.coreboot.org/c/flashrom/+/69620/comment/05e52b4e_75f24017
PS6, Line 66: assert_false(board_matches_size <= 1
: || board_matches[board_matches_size - 1].vendor_name != NULL);
Break down into two `assert_true`s
https://review.coreboot.org/c/flashrom/+/69620/comment/7b31618d_0053f817
PS6, Line 83: SKIP_TEST
Indent with tab
https://review.coreboot.org/c/flashrom/+/69620/comment/b5ae9e91_9298d757
PS6, Line 84: // CONFIG_INTERNAL
/* comment */
--
To view, visit https://review.coreboot.org/c/flashrom/+/69620
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I41cd014d9bf909296b6c28e3e00548e6883ff41a
Gerrit-Change-Number: 69620
Gerrit-PatchSet: 6
Gerrit-Owner: Evan Benn <evanbenn(a)google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Evan Benn <evanbenn(a)google.com>
Gerrit-Comment-Date: Wed, 23 Nov 2022 23:02:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Felix Singer <felixsinger(a)posteo.net>
Gerrit-MessageType: comment
Attention is currently required from: Anastasia Klimchuk.
Alexander Goncharov has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/68755 )
Change subject: tests: add probe lifecycle test for ch341a_spi
......................................................................
Patch Set 4:
(1 comment)
File tests/ch341a_spi.c:
https://review.coreboot.org/c/flashrom/+/68755/comment/7f44c8c4_e85392e2
PS3, Line 26: /* Since the test transfers a data that fits in one CH341 packet, we
: don't need an array of these transfers (as is done in the driver code). */
> Please align with code style: https://www.flashrom.org/Development_Guidelines#Coding_style […]
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/68755
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0a2d5591d097435fc69719e1d9bd153433425821
Gerrit-Change-Number: 68755
Gerrit-PatchSet: 4
Gerrit-Owner: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Wed, 23 Nov 2022 14:28:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Alexander Goncharov.
Hello build bot (Jenkins), Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/68755
to look at the new patch set (#4).
Change subject: tests: add probe lifecycle test for ch341a_spi
......................................................................
tests: add probe lifecycle test for ch341a_spi
This test upgrades mocks to simulate a read request. Read buffer
is populated with chip manufacture id and chip model id to emulate
successful probing.
TEST=ninja test
Change-Id: I0a2d5591d097435fc69719e1d9bd153433425821
Signed-off-by: Alexander Goncharov <chat(a)joursoir.net>
---
M tests/ch341a_spi.c
M tests/tests.c
M tests/tests.h
3 files changed, 63 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/55/68755/4
--
To view, visit https://review.coreboot.org/c/flashrom/+/68755
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0a2d5591d097435fc69719e1d9bd153433425821
Gerrit-Change-Number: 68755
Gerrit-PatchSet: 4
Gerrit-Owner: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-MessageType: newpatchset
Attention is currently required from: Felix Singer, Thomas Heijligen, Anastasia Klimchuk.
Alexander Goncharov has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/67664 )
Change subject: tests: add basic lifecycle test for ch341a_spi
......................................................................
Patch Set 10:
(3 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/67664/comment/a20cfcd9_72276b15
PS9, Line 8:
> If you could add test scenarios in commit message, that would be great. I know you run a few: […]
Done
File tests/libusb_wraps.c:
PS5:
> Looks like you are ready to split the patch?
Done
https://review.coreboot.org/c/flashrom/+/67664/comment/95bf28c4_9e03874b
PS5, Line 39: /* https://libusb.sourceforge.io/api-1.0/group__libusb__lib.html#ga5f8376b7a86… */
> I think the time has come, you can remove those
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/67664
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If28fbe09ad685082152aa3a7e8d5a150169aee9e
Gerrit-Change-Number: 67664
Gerrit-PatchSet: 10
Gerrit-Owner: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Wed, 23 Nov 2022 13:58:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Felix Singer <felixsinger(a)posteo.net>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Comment-In-Reply-To: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Thomas Heijligen, Alexander Goncharov.
Hello build bot (Jenkins), Thomas Heijligen, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/67664
to look at the new patch set (#10).
Change subject: tests: add basic lifecycle test for ch341a_spi
......................................................................
tests: add basic lifecycle test for ch341a_spi
TEST=the following scenarios run tests successfully
1) ch341a_spi is enabled
result: all tests run and pass, including ch341a
2) ch341a_spi is disabled
result: ch341a_spi test is skipped, the rest of tests run and pass
3) libusb isn't presented in the system
result: tests for usb programmers are skipped, the rest of tests run
normally
Change-Id: If28fbe09ad685082152aa3a7e8d5a150169aee9e
Signed-off-by: Alexander Goncharov <chat(a)joursoir.net>
---
M meson.build
A tests/ch341a_spi.c
M tests/tests.c
M tests/tests.h
M tests/usb_unittests.h
5 files changed, 120 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/64/67664/10
--
To view, visit https://review.coreboot.org/c/flashrom/+/67664
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If28fbe09ad685082152aa3a7e8d5a150169aee9e
Gerrit-Change-Number: 67664
Gerrit-PatchSet: 10
Gerrit-Owner: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-MessageType: newpatchset