Skip to content

Commit e96cee3

Browse files
committed
Drop now-unused sr_disk_for_all_hosts
Signed-off-by: Yann Dirson <[email protected]>
1 parent 56e83c2 commit e96cee3

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

conftest.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -396,41 +396,6 @@ def sr_disk_4k(pytestconfig, host):
396396
f"4KiB block device {disk} must be available for use on master host"
397397
yield disk
398398

399-
@pytest.fixture(scope='session')
400-
def sr_disk_for_all_hosts(pytestconfig, request, host):
401-
"""
402-
Disk DEVICE NAME available on all hosts of FIRST POOL.
403-
404-
Abort if not exactly one --sr_disk. If --sr_disk=auto take any, else
405-
return requested device (abort if not present).
406-
"""
407-
disks = pytestconfig.getoption("sr_disk")
408-
if len(disks) != 1:
409-
pytest.fail("This test requires exactly one --sr-disk parameter")
410-
disk = disks[0]
411-
master_disks = host.available_disks()
412-
assert len(master_disks) > 0, "a free disk device is required on the master host"
413-
414-
if disk != "auto":
415-
assert disk in master_disks, \
416-
f"disk or block device {disk} is either not present or already used on master host"
417-
master_disks = [disk]
418-
419-
candidates = list(master_disks)
420-
for h in host.pool.hosts[1:]:
421-
other_disks = h.available_disks()
422-
candidates = [d for d in candidates if d in other_disks]
423-
424-
if disk == "auto":
425-
assert len(candidates) > 0, \
426-
f"a free disk device is required on all pool members. Pool master has: {' '.join(master_disks)}."
427-
logging.info(f">> Found free disk device(s) on all pool hosts: {' '.join(candidates)}. Using {candidates[0]}.")
428-
else:
429-
assert len(candidates) > 0, \
430-
f"disk or block device {disk} was not found to be present and free on all hosts"
431-
logging.info(f">> Disk or block device {disk} is present and free on all pool members")
432-
yield candidates[0]
433-
434399
@pytest.fixture(scope='session')
435400
def pool_with_unused_disk(host: Host, unused_disks: dict[Host, list[DiskDevName]]) -> Pool:
436401
for h in host.pool.hosts:

0 commit comments

Comments
 (0)