From c2662072a43b7574931a4114399419958ba4abc9 Mon Sep 17 00:00:00 2001 From: Daniel Madej Date: Fri, 4 Oct 2024 08:46:57 +0200 Subject: [PATCH 1/2] Fix mdadm --zero-superblock problem in cleanup Cleanup handled mounted partitions but not the whole device Signed-off-by: Daniel Madej --- test/functional/tests/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/functional/tests/conftest.py b/test/functional/tests/conftest.py index fb3be0d..d501bb7 100644 --- a/test/functional/tests/conftest.py +++ b/test/functional/tests/conftest.py @@ -264,6 +264,7 @@ def base_prepare(item): raid.array_devices)): raid.umount_all_partitions() raid.remove_partitions() + raid.unmount() raid.stop() for device in raid.array_devices: Mdadm.zero_superblock(posixpath.join('/dev', device.get_device_id())) @@ -279,9 +280,9 @@ def base_prepare(item): ) disk.umount_all_partitions() - Mdadm.zero_superblock(posixpath.join('/dev', disk.get_device_id())) - TestRun.executor.run_expect_success("udevadm settle") disk.remove_partitions() + disk.unmount() + Mdadm.zero_superblock(posixpath.join('/dev', disk.get_device_id())) create_partition_table(disk, PartitionTable.gpt) TestRun.usr.already_updated = True From 0999e601b8710c983452133ed66576d3b57455fd Mon Sep 17 00:00:00 2001 From: Daniel Madej Date: Fri, 4 Oct 2024 08:58:35 +0200 Subject: [PATCH 2/2] Remove redundant unmount remove_partitions() includes unmounting them Signed-off-by: Daniel Madej --- test/functional/tests/conftest.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/functional/tests/conftest.py b/test/functional/tests/conftest.py index d501bb7..9c3017e 100644 --- a/test/functional/tests/conftest.py +++ b/test/functional/tests/conftest.py @@ -262,7 +262,6 @@ def base_prepare(item): disk_path in device.get_device_id(), [bd.get_device_id() for bd in TestRun.dut.disks])), raid.array_devices)): - raid.umount_all_partitions() raid.remove_partitions() raid.unmount() raid.stop() @@ -278,8 +277,6 @@ def base_prepare(item): f"Serial for {disk.path} doesn't match the one from the config." f"Serial from config {disk.serial_number}, actual serial {disk_serial}" ) - - disk.umount_all_partitions() disk.remove_partitions() disk.unmount() Mdadm.zero_superblock(posixpath.join('/dev', disk.get_device_id()))