Skip to content

Commit 6b5af7e

Browse files
committed
Drop now-unused sr_disk_for_all_hosts
Signed-off-by: Yann Dirson <[email protected]>
1 parent 1f201d8 commit 6b5af7e

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

conftest.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -383,40 +383,6 @@ def sr_disk_4k(pytestconfig, host):
383383
f"4KiB block device {disk} must be available for use on master host"
384384
yield disk
385385

386-
@pytest.fixture(scope='session')
387-
def sr_disk_for_all_hosts(pytestconfig, request, host):
388-
"""sr_disk_for_all_hosts
389-
390-
Return a single DEVICE NAME of a disk available on all hosts of
391-
FIRST POOL with that name.
392-
"""
393-
disks = pytestconfig.getoption("sr_disk")
394-
if len(disks) != 1:
395-
pytest.fail("This test requires exactly one --sr-disk parameter")
396-
disk = disks[0]
397-
master_disks = host.available_disks()
398-
assert len(master_disks) > 0, "a free disk device is required on the master host"
399-
400-
if disk != "auto":
401-
assert disk in master_disks, \
402-
f"disk or block device {disk} is either not present or already used on master host"
403-
master_disks = [disk]
404-
405-
candidates = list(master_disks)
406-
for h in host.pool.hosts[1:]:
407-
other_disks = h.available_disks()
408-
candidates = [d for d in candidates if d in other_disks]
409-
410-
if disk == "auto":
411-
assert len(candidates) > 0, \
412-
f"a free disk device is required on all pool members. Pool master has: {' '.join(master_disks)}."
413-
logging.info(f">> Found free disk device(s) on all pool hosts: {' '.join(candidates)}. Using {candidates[0]}.")
414-
else:
415-
assert len(candidates) > 0, \
416-
f"disk or block device {disk} was not found to be present and free on all hosts"
417-
logging.info(f">> Disk or block device {disk} is present and free on all pool members")
418-
yield candidates[0]
419-
420386
@pytest.fixture(scope='session')
421387
def pool_with_unused_disk(host: Host, unused_disks: dict[Host, list[DiskDevName]]) -> Pool:
422388
for h in host.pool.hosts:

0 commit comments

Comments
 (0)