test-conftest: Don't prepare disks if test doesn't use them
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
This commit is contained in:
parent
92a8424dd0
commit
4626d87471
@ -169,24 +169,19 @@ def base_prepare(item):
|
||||
LvmConfiguration.remove_filters_from_config()
|
||||
|
||||
raids = Raid.discover()
|
||||
if len(TestRun.disks):
|
||||
for raid in raids:
|
||||
# stop only those RAIDs, which are comprised of test disks
|
||||
if all(
|
||||
map(
|
||||
lambda device: any(
|
||||
map(
|
||||
lambda disk_path: disk_path in device.get_device_id(),
|
||||
[bd.get_device_id() for bd in TestRun.dut.disks],
|
||||
)
|
||||
),
|
||||
raid.array_devices,
|
||||
)
|
||||
):
|
||||
if all(map(lambda device:
|
||||
any(map(lambda disk_path:
|
||||
disk_path in device.get_device_id(),
|
||||
[bd.get_device_id() for bd in TestRun.dut.disks])),
|
||||
raid.array_devices)):
|
||||
raid.remove_partitions()
|
||||
raid.unmount()
|
||||
raid.stop()
|
||||
for device in raid.array_devices:
|
||||
Mdadm.zero_superblock(posixpath.join("/dev", device.get_device_id()))
|
||||
Mdadm.zero_superblock(posixpath.join('/dev', device.get_device_id()))
|
||||
Udev.settle()
|
||||
|
||||
RamDisk.remove_all()
|
||||
|
Loading…
Reference in New Issue
Block a user