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

udev: Improve testability and tests #582

Merged
merged 4 commits into from May 22, 2023

Conversation

diconico07
Copy link
Contributor

What this PR does / why we need it:
As indicated in #564 the new grouping behavior could get more test coverage.
This PR moves the grouping logic to a separate function and adds relevant tests.

Special notes for your reviewer:

If applicable:

  • this PR has an associated PR with documentation in akri-docs
  • this PR contains unit tests
  • added code adheres to standard Rust formatting (cargo fmt)
  • code builds properly (cargo build)
  • code is free of common mistakes (cargo clippy)
  • all Akri tests succeed (cargo test)
  • inline documentation builds (cargo doc)
  • all commits pass the DCO bot check by being signed off -- see the failing DCO check for instructions on how to retroactively sign commits

@diconico07 diconico07 force-pushed the improve-udev-handler-tests branch 2 times, most recently from 951459e to ffb24d8 Compare April 19, 2023 07:36
@kate-goldenring
Copy link
Contributor

Thanks @diconico07! Can we add a test of trying to insert a device that has already been inserted (namely the upper most parent) just to ensure there is no duplication in the case where a second udev rule matches with the same device as the first.

@diconico07
Copy link
Contributor Author

Thanks @kate-goldenring you just found a missing piece in the implementation 😅 .
I'll add a commit to handle this (and the test you mentioned).

@kate-goldenring
Copy link
Contributor

@diconico07 feel free to bump the version and merge whenever

As indicated in project-akri#564 the new grouping behavior could get more test
coverage. This commit moves the grouping logic to a separate function
and adds relevant tests.

Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
This commit prevents duplicate device node from being listed when
multiple rules match the same devices.

This fixes a regression introduced by project-akri#564.

Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
@diconico07 diconico07 merged commit 1d8189b into project-akri:main May 22, 2023
51 checks passed
@diconico07 diconico07 deleted the improve-udev-handler-tests branch May 22, 2023 12:48
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.

None yet

2 participants