-
Notifications
You must be signed in to change notification settings - Fork 104
[SWDEV-552020/SWDEV-563971] Fail memory partition tests if ASIC supports memory partitions & kmod not installed #2695
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances memory partition testing in AMD SMI by adding proper validation for kernel module (kmod) availability and improving test assertions based on driver reload success. The changes ensure that memory partition tests fail gracefully when kmod is not installed on systems that support memory partitions, rather than allowing tests to pass incorrectly.
Changes:
- Added kmod installation detection to fail tests early when required tooling is missing
- Enhanced test assertions to differentiate between successful driver reloads with/without NPS mode changes
- Improved verbose logging to track memory partition state transitions throughout testing
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
projects/amdsmi/tests/amd_smi_test/functional/memorypartition_read_write.cc
Outdated
Show resolved
Hide resolved
projects/amdsmi/tests/amd_smi_test/functional/memorypartition_read_write.cc
Show resolved
Hide resolved
31d8d19 to
9d542f6
Compare
…rts memory partitions Updates: - Now provide more details on kmod being missing and how to install. - Cleaned up comparison logic, regardless if memory partition set was successful or not.
9d542f6 to
1f74229
Compare
| bool IsKmodInstalled() { | ||
| // Check common paths for modprobe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this function is called more than once, but the answer isn't likely to change between calls, consider nesting the body in a lambda function that initializes a static bool to avoid repeating the investigation, something like this:
bool IsKmodInstalled() {
static bool installed = [] {
// what you already have
}();
return installed;
}Alternatively, if you don't actually need it to be lazy, move the check to a chosen point in the test setup code.
[SWDEV-552020/SWDEV-563971] Fail memory partition tests if ASIC supports memory partitions & kmod not installed
Updates:
successful or not.