Skip to content

Commit

Permalink
WIP - tests tests tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mvollmer committed Nov 13, 2023
1 parent bb93b5d commit 7c67fc4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion test/verify/check-storage-hidden
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class TestStorageHiddenLuks(storagelib.StorageCase):
self.assert_in_lvol_child_configuration("lvol", "crypttab", "options", "my-crypto-tag")
self.assert_in_lvol_child_configuration("lvol", "fstab", "dir", mount_point_1)
b.click(self.card_parent_link())
b.wait_text(self.card_row_col("LVM2 logical volumes", 1, 2), "Filesystem")
b.wait_text(self.card_row_col("LVM2 logical volumes", 1, 2), "Filesystem (encrypted)")

# Now the filesystem is hidden because the LUKS device is
# locked. Doubly hide it by deactivating /dev/TEST/lvol
Expand Down
2 changes: 1 addition & 1 deletion test/verify/check-storage-luks
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class TestStorageLuks(storagelib.StorageCase):
b.assert_pixels("#dialog", "format")
self.dialog_apply()
self.dialog_wait_close()
b.wait_text(self.card_row_col("Partitions", 1, 2), "ext4 filesystem")
b.wait_text(self.card_row_col("Partitions", 1, 2), "ext4 filesystem (encrypted)")
b.wait_text(self.card_row_col("Partitions", 1, 3), mount_point_secret)

dev = b.text(self.card_row_col("Partitions", 1, 1))
Expand Down
2 changes: 1 addition & 1 deletion test/verify/check-storage-lvm2
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ class TestStorageLvm2(storagelib.StorageCase):

b.click(self.card_parent_link())
b.wait_in_text(".pf-v5-c-alert", "This volume group is missing some physical volumes.")
b.wait_visible(self.card_desc("LVM2 volume group", "Name") + " button:disabled")
b.wait_visible(self.card_desc_action("LVM2 volume group", "Name") + ":disabled")
b.wait_visible(self.card_row("LVM2 logical volumes", name="lvol0") + ' .ct-icon-exclamation-triangle')

# Repair with fourth
Expand Down
18 changes: 9 additions & 9 deletions test/verify/check-storage-mounting
Original file line number Diff line number Diff line change
Expand Up @@ -424,23 +424,23 @@ class TestStorageMountingLUKS(storagelib.StorageCase):
b.wait_visible(self.card_row("Storage", name=disk))
m.execute(f"vgcreate test {disk}; lvcreate test -n one -L 20M; lvcreate test -n two -L 20M")
b.click(self.card_row("Storage", name="test"))
b.wait_text(self.card_row_col("Logical volumes", 1, 1), "one")
b.wait_text(self.card_row_col("Logical volumes", 2, 1), "two")
b.wait_text(self.card_row_col("LVM2 Logical volumes", 1, 1), "one")
b.wait_text(self.card_row_col("LVM2 Logical volumes", 2, 1), "two")

# Encrypt and format the first and give it /run/data as the mount point
b.click(self.card_row("Logical volumes", 1))
b.click(self.card_row("LVM2 Logical volumes", 1))
b.click(self.card_button("Unformatted data", "Format"))
self.dialog({"type": "ext4",
"crypto": self.default_crypto_type,
"passphrase": "vainu-reku-toma-rolle-kaja",
"passphrase2": "vainu-reku-toma-rolle-kaja",
"mount_point": "/run/data"})
b.click(self.card_desc_action("ext4 filesystem", "Stored on"))
b.wait_text(self.card_row_col("Logical volumes", 1, 2), "ext4 filesystem")
b.wait_text(self.card_row_col("Logical volumes", 1, 3), "/run/data")
b.wait_text(self.card_row_col("LVM2 Logical volumes", 1, 2), "ext4 filesystem")
b.wait_text(self.card_row_col("LVM2 Logical volumes", 1, 3), "/run/data")

# Format the second and also try to use /run/data as the mount point
b.click(self.card_row("Logical volumes", 2))
b.click(self.card_row("LVM2 Logical volumes", 2))
b.click(self.card_button("Unformatted data", "Format"))
self.dialog_wait_open()
self.dialog_set_val("type", "ext4")
Expand All @@ -456,13 +456,13 @@ class TestStorageMountingLUKS(storagelib.StorageCase):

# Format the first and re-use /run/data as the mount point.
# This should be allowed.
b.click(self.card_row("Logical volumes", 1))
b.click(self.card_row("LVM2 Logical volumes", 1))
b.click(self.card_button("ext4 filesystem", "Format"))
self.dialog({"type": "ext4",
"mount_point": "/run/data"})
b.click(self.card_desc_action("ext4 filesystem", "Stored on"))
b.wait_text(self.card_row_col("Logical volumes", 1, 2), "ext4 filesystem")
b.wait_text(self.card_row_col("Logical volumes", 1, 3), "/run/data")
b.wait_text(self.card_row_col("LVM2 Logical volumes", 1, 2), "ext4 filesystem")
b.wait_text(self.card_row_col("LVM2 Logical volumes", 1, 3), "/run/data")

def testNeverAuto(self):
m = self.machine
Expand Down
7 changes: 5 additions & 2 deletions test/verify/check-storage-resize
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class TestStorageResize(storagelib.StorageCase):

need_passphrase = crypto and self.default_crypto_type == "luks2"
filesystem_desc = f"{fsys} filesystem"
filesystem_desc_enc = filesystem_desc
if crypto:
filesystem_desc_enc = filesystem_desc + " (encrypted)"

self.login_and_go("/storage")
disk = m.add_disk("500M", serial="DISK1")
Expand Down Expand Up @@ -65,7 +68,7 @@ class TestStorageResize(storagelib.StorageCase):
with b.wait_timeout(60):
self.dialog_wait_close()

b.wait_text(self.card_row_col("LVM2 logical volumes", 1, 2), filesystem_desc)
b.wait_text(self.card_row_col("LVM2 logical volumes", 1, 2), filesystem_desc_enc)
b.wait_text(self.card_row_col("LVM2 logical volumes", 1, 3), "/run/foo")

if can_grow:
Expand Down Expand Up @@ -228,7 +231,7 @@ class TestStorageResize(storagelib.StorageCase):
self.dialog_set_val("mount_point", mountpoint)
self.dialog_apply()
self.dialog_wait_close()
b.wait_text(self.card_row_col("LVM2 logical volumes", 1, 2), "ext4 filesystem")
b.wait_text(self.card_row_col("LVM2 logical volumes", 1, 2), "ext4 filesystem (encrypted)")
b.wait_text(self.card_row_col("LVM2 logical volumes", 1, 3), mountpoint)

# Grow the logical volume and let Cockpit grow the LUKS container and the filesystem
Expand Down

0 comments on commit 7c67fc4

Please sign in to comment.