-
Notifications
You must be signed in to change notification settings - Fork 6
Disk fixtures rework #330
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
Disk fixtures rework #330
Conversation
ac95623
to
1f72326
Compare
Last push:
|
0c6c08c
to
6642deb
Compare
18ad9aa
to
c1c6bfb
Compare
21fe576
to
12f840e
Compare
Last push squashes fixups from fixing issues discovered during CI runs. |
# Create and destroy tested in the same test to leave the host as unchanged as possible | ||
sr = host.sr_create('largeblock', "LARGEBLOCK-local-SR-test", {'device': '/dev/' + sr_disk_4k}, verify=True) | ||
sr_disk = unused_4k_disks[host][0]["name"] |
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.
We could have a function to get a device path from a BlockDeviceInfo
since we do a lot for tests
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.
I'm not sure .name()
brings a log over ["name"]
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.
I wasn't talking about only name but to get the device path too.
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.
Not sure I get what you mean, but that sounds like an improvement that can be done later?
Those info typically don't change over the course of a test session, but Host.rescan_block_devices_info() is provided for when we'll have more sophisticated test cases. We use a custom TypedDict to be able to use this type more largely in upcoming commits. Reimplements disks() and available_disks() on top of this. Signed-off-by: Yann Dirson <[email protected]>
This method was not used since 7435c99 (largeblock: add tests largeblock driver + fixture), this repurposes it for a new life. Signed-off-by: Yann Dirson <[email protected]>
… pool Signed-off-by: Yann Dirson <[email protected]>
…_disk Signed-off-by: Yann Dirson <[email protected]>
Fills the role of --sr_disk, except that: - it is per-host - the default is "all disks", use empty device list to forbid all disks on a host Signed-off-by: Yann Dirson <[email protected]>
For some reason pyright would not consider the type known otherwise. Also use unquoted type hint, since we have deferred annotations and we use it that way in all other places. Signed-off-by: Yann Dirson <[email protected]>
…disk Signed-off-by: Yann Dirson <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
Only used for everything ZFS Signed-off-by: Yann Dirson <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
The old options had been missed and kept as no-op, which should not be a problem for any caller using "auto" (which was anyway the only sensible choice for a generic script). Signed-off-by: Yann Dirson <[email protected]>
This replaces the existing disk fixtures, which rely on the assumption that we can take a dom0 device name on the pool master, and expect to find it across the whole pool with the same meaning. This was causing issues for GlusterFS and Linstor tests when some hosts in the test pool get their disk device names swapped after a reboot.
The old mechanism used a mandatory
--sr_disk
flag to control the behavior of varioussr_disk*
fixtures, with little code-sharing. The new one is based on a centraldisks
fixture to properly introspect the pool's disks, which comes with its own--disks
flag to filter which disks to expose to the tests, but by default exposes all of them. It then uses additional fixtures to filter disks using different criteria (for now: availability and blocksize of the disk), and then some pool-level fixtures allowing testing of distributed SR without risking to (try to) use the wrong disk.Builds on: