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

Add sysfs tests #775

Merged
merged 5 commits into from
Feb 2, 2024
Merged

Add sysfs tests #775

merged 5 commits into from
Feb 2, 2024

Conversation

igaw
Copy link
Collaborator

@igaw igaw commented Jan 30, 2024

With the limitation gone that we have to do IOCTLs to parse the topology, let's add infrastructure to tests this code in the CI build.

Fixes: #759

This function is available since the 1.0 release. Export it.

Signed-off-by: Daniel Wagner <[email protected]>
igaw added 3 commits January 31, 2024 12:42
Allow the user to select the output filedescriptor instead always
dumping it to stdout.

This allows to write the output to a file.

Signed-off-by: Daniel Wagner <[email protected]>
In order to be able to test the topology scan code, make the
lookup paths flexible. Check if the LIBNVME_SYSFS_PATH environment
variable is set and if so use this as base path.

We could also introduce a setter for this, but this is really
a debugging interface and thus I don't really want it to be
visible in the public API.

Signed-off-by: Daniel Wagner <[email protected]>
In order to be able to test the topology scan code, allow
hostnqn and hostid to be controlled via an environment variable.

This is just for testing purposes, thus don't mention it.

Signed-off-by: Daniel Wagner <[email protected]>
@igaw igaw force-pushed the add-sysfs-tests branch 2 times, most recently from 6e89367 to 89afed9 Compare January 31, 2024 11:44
The library is able to scan the topology from a simple copy of
sysfs. There is no need to do any IOCTL, thus we can start test to
tree code.

This provides just the basic building blocks.

Signed-off-by: Daniel Wagner <[email protected]>
@igaw igaw merged commit 154c374 into linux-nvme:master Feb 2, 2024
14 checks passed
@igaw igaw deleted the add-sysfs-tests branch February 2, 2024 07:28
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.

add unit test for tree's scan subsystem code
1 participant