Skip to content

Commit

Permalink
test: add sysfs test with empty sysfs directory
Browse files Browse the repository at this point in the history
Create a sysfs test where /sys/class/nvme and /sys/class/nvme-subsystem
don't exist, simulating the nvme_core module being unloaded.
Ensure nvme_scan_topology() is successful and creates an empty tree.

Signed-off-by: Caleb Sander Mateos <[email protected]>
  • Loading branch information
calebsander committed Mar 19, 2024
1 parent 38301b0 commit 88681d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions test/sysfs/data/nvme-sysfs-empty.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"hosts":[
]
}
Binary file added test/sysfs/data/nvme-sysfs-empty.tar.xz
Binary file not shown.
3 changes: 2 additions & 1 deletion test/sysfs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ sysfs = executable(
)

sysfs_files= [
'nvme-sysfs-tw-carbon-6.8.0-rc1+'
'nvme-sysfs-tw-carbon-6.8.0-rc1+',
'nvme-sysfs-empty',
]

setup = find_program('setup.sh')
Expand Down

0 comments on commit 88681d9

Please sign in to comment.