Skip to content

Commit 0e683da

Browse files
committed
Drop now-unused sr_disks_for_all_hosts
Signed-off-by: Yann Dirson <[email protected]>
1 parent c0c789c commit 0e683da

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

conftest.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -443,48 +443,6 @@ def pool_with_unused_disk(host: Host, unused_disks: dict[Host, list[DiskDevName]
443443
assert unused_disks[h], f"host {h} does not have any unused disk"
444444
return host.pool
445445

446-
@pytest.fixture(scope='session')
447-
def sr_disks_for_all_hosts(pytestconfig, request, host):
448-
"""
449-
List of disk DEVICE NAMES available on all hosts of FIRST POOL.
450-
451-
Abort if no --sr_disk. If one --sr_disk=auto given, return names of all
452-
"available" disk device occuring on all hosts in the pool and
453-
IGNORE ALL OTHER --sr_disk; else return all devices on commandline (abort
454-
if any is not present or not "available").
455-
"""
456-
disks = pytestconfig.getoption("sr_disk")
457-
assert len(disks) > 0, "This test requires at least one --sr-disk parameter"
458-
# Fetch available disks on the master host
459-
master_disks = host.available_disks()
460-
assert len(master_disks) > 0, "a free disk device is required on the master host"
461-
462-
if "auto" in disks:
463-
candidates = list(master_disks)
464-
else:
465-
# Validate that all specified disks exist on the master host
466-
for disk in disks:
467-
assert disk in master_disks, \
468-
f"Disk or block device {disk} is either not present or already used on the master host"
469-
candidates = list(disks)
470-
471-
# Check if all disks are available on all hosts in the pool
472-
for h in host.pool.hosts[1:]:
473-
other_disks = h.available_disks()
474-
candidates = [d for d in candidates if d in other_disks]
475-
476-
if "auto" in disks:
477-
# Automatically select disks if "auto" is passed
478-
assert len(candidates) > 0, \
479-
f"Free disk devices are required on all pool members. Pool master has: {' '.join(master_disks)}."
480-
logging.info(">> Using free disk device(s) on all pool hosts: %s.", candidates)
481-
else:
482-
# Ensure specified disks are free on all hosts
483-
assert len(candidates) == len(disks), \
484-
f"Some specified disks ({', '.join(disks)}) are not free or available on all hosts."
485-
logging.info(">> Disk(s) %s are present and free on all pool members", candidates)
486-
yield candidates
487-
488446
@pytest.fixture(scope='module')
489447
def vm_ref(request):
490448
ref = request.param

0 commit comments

Comments
 (0)