File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#
22# Copyright(c) 2019-2022 Intel Corporation
33# Copyright(c) 2023-2025 Huawei Technologies Co., Ltd.
4+ # Copyright(c) 2026 Unvertical
45# SPDX-License-Identifier: BSD-3-Clause
56#
67
@@ -254,8 +255,11 @@ def remove_partitions(device):
254255
255256 TestRun .LOGGER .info (f"Removing partitions from device: { device .path } "
256257 f"({ device .get_device_id ()} )." )
257- wipefs (device )
258- Udev .trigger ()
258+ # We can't use wipefs here. wipefs only erases magic bytes, not the partition
259+ # table itself, so the kernel may still see stale partitions after partprobe.
260+ # parted mklabel replaces the entire partition table and triggers kernel re-read.
261+ # The label type choice does not really matter, so we just pick gpt.
262+ TestRun .executor .run_expect_success (f"parted --script { device .path } mklabel gpt" )
259263 Udev .settle ()
260264 output = TestRun .executor .run (f"ls { device .path } * -1" )
261265 if len (output .stdout .split ('\n ' )) > 1 :
You can’t perform that action at this time.
0 commit comments