[NEW] Add Zoned Block Device (ZBD) support to blockdevice module#823
Open
xsub wants to merge 1 commit into
Open
[NEW] Add Zoned Block Device (ZBD) support to blockdevice module#823xsub wants to merge 1 commit into
xsub wants to merge 1 commit into
Conversation
Author
|
Hey Testinfra team! Here's a small update for the blockdevice module to support Zoned Block Devices (ZBD). It adds a few properties like is_zoned, zoned_type, and various ZBD limits (max open zones, etc.). Hope you find it useful. Thanks, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
With the growing adoption of SMR (Shingled Magnetic Recording) HDDs and NVMe ZNS (Zoned Namespace) drives, it's becoming more common to configure and test infrastructure that relies on Zoned Block Devices (ZBD). This PR extends the
blockdevicemodule to allow querying ZBD-specific properties directly from Testinfra.Changes
This PR adds support for ZBD properties in
LinuxBlockDeviceby safely querying the Linux kernel'ssysfs(/sys/block/<dev>/queue/).New properties added:
is_zoned(bool)zoned_type(e.g.,"none","host-managed","host-aware")zoned_chunk_sectorszoned_nr_zoneszone_append_max_bytesmax_open_zonesmax_active_zonesImplementation details:
cat) and relying on exit codes or kernel version parsing, the code simply checks if the relevantsysfsfile exists usinghost.file().existsand reads its content.max_active_zones), the module gracefully returnsNonefor these specific attributes and"none"forzoned_type. It won't break existing tests.@propertydecorators for a clean API.Usage Example