diff --git a/pkg/storaged/block/format-dialog.jsx b/pkg/storaged/block/format-dialog.jsx index 2d37827dc22b..2c8303a4c427 100644 --- a/pkg/storaged/block/format-dialog.jsx +++ b/pkg/storaged/block/format-dialog.jsx @@ -290,7 +290,7 @@ function format_dialog_internal(client, path, start, size, enable_dos_extended, let [, old_dir, old_opts] = get_fstab_config(block, true, content_block?.IdType == "btrfs" ? { pathname: "/", id: 5 } - : null); + : undefined); if (old_opts == undefined) old_opts = initial_mount_options(client, block); diff --git a/test/verify/check-storage-btrfs b/test/verify/check-storage-btrfs index b2096961742e..88b5e0b24330 100755 --- a/test/verify/check-storage-btrfs +++ b/test/verify/check-storage-btrfs @@ -109,8 +109,9 @@ class TestStorageBtrfs(storagelib.StorageCase): b.wait_visible(self.card_row("Storage", name="nonfstab")) # Format the btrfs device - self.click_dropdown(self.card_row("Storage", name="sda"), "Format") - self.dialog_wait_open() + # The mount of /run/basement might take some time to be recognized by Cockpit + self.dialog_open_with_retry(lambda: self.click_dropdown(self.card_row("Storage", name="sda"), "Format"), + lambda: "/run/basement" in b.text("#dialog")) self.checkTeardownAction(1, "Device", dev_1) self.checkTeardownAction(1, "Location", "/run/basement") self.checkTeardownAction(1, "Action", "unmount, format")