Skip to content

SNP Integration Test: Improve Clarity #1621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 2, 2025
Merged

SNP Integration Test: Improve Clarity #1621

merged 11 commits into from
Jun 2, 2025

Conversation

phip1611
Copy link
Member

@phip1611 phip1611 commented Apr 11, 2025

TL;DR: This adds more clarity to facilitate future debugging and improvements for #1617.

Wow, working on #1617 was an unexpected major time sink. The problem is that if snp::test runs before pxe::test, snp.receive() receives an Ethernet ARP package rather than a Ethernet IPv4 packet.

I tried two solutions:

  • perform DHCP in SNP via PXEBaseCode protocol
  • Send a raw ethernet frame

I've got none of the approaches to work, unfortunately. So instead, this adds more clarity to ease future debugging and improvements. Relates to #1617 opened by @kraxel.

Steps to Undraft

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

@phip1611 phip1611 self-assigned this Apr 11, 2025
@phip1611 phip1611 marked this pull request as draft April 11, 2025 07:24
@phip1611 phip1611 force-pushed the snp-test branch 2 times, most recently from ca3266b to e24e342 Compare April 15, 2025 10:33
@phip1611 phip1611 changed the title xxx fix snp test: make it idempotent and remove magic values SNP Integration Test: Improve Clarity Apr 15, 2025
@phip1611 phip1611 marked this pull request as ready for review April 15, 2025 10:39
@phip1611 phip1611 requested a review from nicholasbishop April 15, 2025 10:44
@phip1611 phip1611 force-pushed the snp-test branch 2 times, most recently from 6c758f5 to ff20426 Compare April 15, 2025 10:53
@kraxel
Copy link
Contributor

kraxel commented Apr 15, 2025

FYI: I wouldn't count on interrupt status returning anything useful. I'm actually somewhat surprised to find this in the SNP spec (without much details what the expected behavior is). UEFI does not use interrupts (except timer) and handles devices in polling mode. So there is little reason for uefi drivers to configure device interrupt registers in the first place.

@phip1611 phip1611 force-pushed the snp-test branch 5 times, most recently from ad4b06f to 2c881ba Compare April 19, 2025 09:43
@phip1611 phip1611 mentioned this pull request Apr 19, 2025
2 tasks
@phip1611 phip1611 marked this pull request as draft May 11, 2025 14:19
@phip1611 phip1611 marked this pull request as ready for review May 19, 2025 19:58
@phip1611 phip1611 requested a review from nicholasbishop May 19, 2025 19:58
@phip1611 phip1611 marked this pull request as draft May 31, 2025 07:21
@phip1611 phip1611 force-pushed the snp-test branch 2 times, most recently from c7082b8 to 154b691 Compare May 31, 2025 07:52
@phip1611 phip1611 marked this pull request as ready for review May 31, 2025 07:52
@phip1611
Copy link
Member Author

phip1611 commented May 31, 2025

I gave it another shot. I know that this doesn't change any of the underlying problems of the test (#1617), but I hope this helps the next person to not waste the same amount of hours in the test as I did.

@phip1611 phip1611 force-pushed the snp-test branch 3 times, most recently from 92ef5c0 to d71d5dc Compare May 31, 2025 08:07
@phip1611 phip1611 marked this pull request as draft May 31, 2025 08:16
@phip1611 phip1611 requested a review from nicholasbishop May 31, 2025 17:57
@phip1611 phip1611 marked this pull request as ready for review May 31, 2025 17:57
phip1611 added 3 commits May 31, 2025 19:58
This helps to identify the network interface in integration tests.
Although the changes look big, most things were just reordered
(moved out of the loop body) and decoupled. The function finding
the proper handle verifies the interface has the right MAC, to
prevent failure and ease debugging.
phip1611 added 7 commits May 31, 2025 19:59
snp::test() can now be called multiple times in a row
The new function makes debugging of unexpected packages (e.g. ARP)
much easier detectable.
Properly deconstruct the response. This improves the maintainability of
this test and to better understand what is going on.
We still have the unfortunate situation that the SNP test
depends on DHCP of the PXE test, but now it is much clearer
how the UDP packet is sent via Ethernet and how the echo
service is used.
@nicholasbishop nicholasbishop added this pull request to the merge queue Jun 2, 2025
Merged via the queue into main with commit 70a63b8 Jun 2, 2025
20 checks passed
@nicholasbishop nicholasbishop deleted the snp-test branch June 2, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants