From 05ed83c6aefc85a7b69bbff621f9c3db44700d37 Mon Sep 17 00:00:00 2001 From: Karolina Rogowska Date: Wed, 25 Nov 2020 16:29:02 +0100 Subject: [PATCH] fix for RAIDs cleanup in prepare Signed-off-by: Karolina Rogowska --- test/functional/tests/conftest.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/functional/tests/conftest.py b/test/functional/tests/conftest.py index 34523fb..58b24c7 100644 --- a/test/functional/tests/conftest.py +++ b/test/functional/tests/conftest.py @@ -183,13 +183,16 @@ def base_prepare(item): raids = Raid.discover() for raid in raids: # stop only those RAIDs, which are comprised of test disks - if all(map( - lambda d: d.system_path in [bd.system_path for bd in TestRun.dut.disks], - raid.array_devices - )): + if all(map(lambda device: + any(map(lambda disk_path: + disk_path in device.system_path, + [bd.system_path for bd in TestRun.dut.disks])), + raid.array_devices)): raid.umount_all_partitions() raid.remove_partitions() raid.stop() + for device in raid.array_devices: + Mdadm.zero_superblock(device.system_path) for disk in TestRun.dut.disks: disk.umount_all_partitions()