Skip to content

Commit

Permalink
client: Conditionally remove workaround for UDisks2 #1206
Browse files Browse the repository at this point in the history
It's fixed in 2.11, but that isn't released yet.

And fix the test to use two PVs. Cockpit will not show how a logical
volume is stored when there is only one PV.
  • Loading branch information
mvollmer committed Feb 17, 2025
1 parent cf3f3f2 commit 51530f1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
10 changes: 7 additions & 3 deletions pkg/storaged/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,12 +588,12 @@ function update_indices() {
const struct = client.lvols[path].Structure;
const lvol = client.lvols[path];

// HACK - UDisks2 can't find the PVs of a segment when they
// are on a device mapper device.
// HACK - UDisks2 befopre 2.11 can't find the PVs of a segment
// when they are on a device mapper device.
//
// https://github.com/storaged-project/udisks/pull/1206

if (vgroups_with_dm_pvs[lvol.VolumeGroup])
if (!client.at_least("2.11") && vgroups_with_dm_pvs[lvol.VolumeGroup])
continue;

let summary;
Expand Down Expand Up @@ -1070,6 +1070,10 @@ client.older_than = function older_than(version) {
return utils.compare_versions(this.manager.Version, version) < 0;
};

client.at_least = function at_least(version) {
return utils.compare_versions(this.manager.Version, version) <= 0;
};

/* Mount users
*/

Expand Down
15 changes: 9 additions & 6 deletions test/verify/check-storage-lvm2
Original file line number Diff line number Diff line change
Expand Up @@ -802,17 +802,20 @@ class TestStorageLvm2(storagelib.StorageCase):

self.login_and_go("/storage")

disk = self.add_loopback_disk()
b.wait_visible(self.card_row("Storage", name=disk))
m.execute(f"echo einszweidrei | cryptsetup luksFormat --pbkdf-memory 32768 {disk}")
m.execute(f"echo einszweidrei | cryptsetup luksOpen {disk} dm-test")
disk1 = self.add_ram_disk()
disk2 = self.add_loopback_disk()

b.wait_visible(self.card_row("Storage", name=disk2))
m.execute(f"echo einszweidrei | cryptsetup luksFormat --pbkdf-memory 32768 {disk1}")
m.execute(f"echo einszweidrei | cryptsetup luksOpen {disk1} dm-test")
self.addCleanup(m.execute, "cryptsetup close dm-test || true")
m.execute("vgcreate vgroup0 /dev/mapper/dm-test")
m.execute(f"vgcreate vgroup0 /dev/mapper/dm-test {disk2}")
self.addCleanupVG("vgroup0")
m.execute("lvcreate vgroup0 -n lvol0 -l100%FREE")

self.click_card_row("Storage", name="lvol0")
b.wait_in_text(self.card_desc("LVM2 logical volume", "Physical volumes"), bn(disk))
b.wait_in_text(self.card_desc("LVM2 logical volume", "Physical volumes"), bn(disk1))
b.wait_in_text(self.card_desc("LVM2 logical volume", "Physical volumes"), bn(disk2))


class TestStorageLvm2Destructive(storagelib.StorageCase):
Expand Down

0 comments on commit 51530f1

Please sign in to comment.