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()
|
LvmConfiguration.remove_filters_from_config()
|
||||||
|
|
||||||
raids = Raid.discover()
|
raids = Raid.discover()
|
||||||
|
if len(TestRun.disks):
|
||||||
for raid in raids:
|
for raid in raids:
|
||||||
# stop only those RAIDs, which are comprised of test disks
|
# stop only those RAIDs, which are comprised of test disks
|
||||||
if all(
|
if all(map(lambda device:
|
||||||
map(
|
any(map(lambda disk_path:
|
||||||
lambda device: any(
|
disk_path in device.get_device_id(),
|
||||||
map(
|
[bd.get_device_id() for bd in TestRun.dut.disks])),
|
||||||
lambda disk_path: disk_path in device.get_device_id(),
|
raid.array_devices)):
|
||||||
[bd.get_device_id() for bd in TestRun.dut.disks],
|
|
||||||
)
|
|
||||||
),
|
|
||||||
raid.array_devices,
|
|
||||||
)
|
|
||||||
):
|
|
||||||
raid.remove_partitions()
|
raid.remove_partitions()
|
||||||
raid.unmount()
|
raid.unmount()
|
||||||
raid.stop()
|
raid.stop()
|
||||||
for device in raid.array_devices:
|
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()
|
Udev.settle()
|
||||||
|
|
||||||
RamDisk.remove_all()
|
RamDisk.remove_all()
|
||||||
|
Loading…
Reference in New Issue
Block a user