Skip to content
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

Improvements to the EMAC test #429

Open
wants to merge 2 commits into
base: dev/emac-mem-manager-improvements
Choose a base branch
from

Conversation

multiplemonomials
Copy link
Collaborator

Summary of changes

This PR does some refactoring and rewriting to improve the EMAC test. I have been working with this test suite a lot the last month or two and ended up making a number of fixes. This includes:

  • Adding C structs that model the CTP packet format, so we can use those to read & write packets instead of just juggling all the pointers manually
  • Making several of the tests slightly shorter and less verbose to make the test quicker to run
  • Improving the multicast test to test removing addresses from the multicast filter
  • Making some variable names and prints easier to understand

Impact of changes

Migration actions required

Documentation


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

@@ -55,7 +55,7 @@ void test_emac_unicast_long_cb(int opt)

// Echo response received
if (opt == INPUT) {
if (++test_step > 50000) {
if (++test_step > 10000) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

50000 iterations made this test very long, and frankly I don't really see the point because there are only 1500 possible lengths that a packet can be, and that's more than enough to fuzz all of them.


emac_if_add_echo_server_addr(&eth_input_frame_data[6]);
if (trace_level & TRACE_ETH_FRAMES) {
printf("INP> LEN %i\r\n\r\n", length);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this so it will always print that a frame was received regardless of whether its format was correct, for ease of debugging

@multiplemonomials multiplemonomials force-pushed the dev/emac-mem-manager-improvements branch from 6b06a72 to 2cf8902 Compare January 26, 2025 22:05
@multiplemonomials multiplemonomials force-pushed the dev/emac-test-improvements branch from 21744e4 to 75e4ec6 Compare January 26, 2025 23:19
@multiplemonomials
Copy link
Collaborator Author

Ran the new EMAC test on K64F and NUCLEO_F429ZI. It works good! It correctly detected broken multicast filtering on both boards. The STM32F4 issue will be fixed in my next PR, but the K64F one is a longer term project as it's simply unimplemented.

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.

2 participants