Fix mdadm --zero-superblock problem in cleanup

Cleanup handled mounted partitions but not the whole device

Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
This commit is contained in:
Daniel Madej 2024-10-04 08:46:57 +02:00
parent 188e42b752
commit c2662072a4

View File

@ -264,6 +264,7 @@ def base_prepare(item):
raid.array_devices)): raid.array_devices)):
raid.umount_all_partitions() raid.umount_all_partitions()
raid.remove_partitions() raid.remove_partitions()
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()))
@ -279,9 +280,9 @@ def base_prepare(item):
) )
disk.umount_all_partitions() 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.remove_partitions()
disk.unmount()
Mdadm.zero_superblock(posixpath.join('/dev', disk.get_device_id()))
create_partition_table(disk, PartitionTable.gpt) create_partition_table(disk, PartitionTable.gpt)
TestRun.usr.already_updated = True TestRun.usr.already_updated = True