@@ -443,48 +443,6 @@ def pool_with_unused_disk(host: Host, unused_disks: dict[Host, list[DiskDevName]
443
443
assert unused_disks [h ], f"host { h } does not have any unused disk"
444
444
return host .pool
445
445
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
-
488
446
@pytest .fixture (scope = 'module' )
489
447
def vm_ref (request ):
490
448
ref = request .param
0 commit comments