Skip to content

Commit

Permalink
test: Avoid scsi-debug drives for partitions
Browse files Browse the repository at this point in the history
Something is causing partitions on drives backed by scsi-debug to be
permanently busy with kernel 6.9.0-64 in Testing Farm runs. Let's just
avoid them.
  • Loading branch information
mvollmer committed May 28, 2024
1 parent dd6808e commit 10ac8fa
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 36 deletions.
6 changes: 3 additions & 3 deletions test/verify/check-storage-anaconda
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ class TestStorageAnaconda(storagelib.StorageCase):
def testBiosboot(self):
b = self.browser

disk = self.add_ram_disk()
disk = self.add_loopback_disk()

anaconda_config = {
"mount_point_prefix": "/sysroot",
Expand Down Expand Up @@ -375,7 +375,7 @@ class TestStorageAnaconda(storagelib.StorageCase):
def testEfiSystemPartition(self):
b = self.browser

disk = self.add_ram_disk()
disk = self.add_loopback_disk()

anaconda_config = {
"mount_point_prefix": "/sysroot",
Expand Down Expand Up @@ -413,7 +413,7 @@ class TestStorageAnaconda(storagelib.StorageCase):
m = self.machine
b = self.browser

disk = self.add_ram_disk()
disk = self.add_loopback_disk()

anaconda_config = {
"mount_point_prefix": "/sysroot",
Expand Down
10 changes: 5 additions & 5 deletions test/verify/check-storage-basic
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ class TestStorageBasic(storagelib.StorageCase):
b.wait_visible(create_dropdown)

# Add a disk, partition it, format it, and finally remove it.
disk = self.add_ram_disk()
disk = self.add_loopback_disk()

self.click_card_row("Storage", name=disk)
b.wait_visible(self.card("Solid State Drive"))
b.wait_visible(self.card("Block device"))

b.wait_text(self.card_desc("Solid State Drive", "Model"), "scsi_debug")
b.wait_in_text(self.card_desc("Solid State Drive", "Capacity"), "50 MiB")
b.wait_text(self.card_desc("Block device", "Model"), "scsi_debug")
b.wait_in_text(self.card_desc("Block device", "Capacity"), "50 MiB")

self.assertEqual(self.inode(b.text(self.card_desc("Solid State Drive", "Device file"))), self.inode(disk))
self.assertEqual(self.inode(b.text(self.card_desc("Block device", "Device file"))), self.inode(disk))

m.execute(f'parted -s {disk} mktable gpt')
m.execute(f'parted -s {disk} mkpart primary ext2 1M 8M')
Expand Down
8 changes: 4 additions & 4 deletions test/verify/check-storage-luks
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ class TestStorageLuks(storagelib.StorageCase):
self.login_and_go("/storage")

# Add a disk and partition it
disk = self.add_ram_disk(100)
disk = self.add_loopback_disk(100)
self.click_card_row("Storage", name=disk)
self.click_card_dropdown("Solid State Drive", "Create partition table")
self.click_card_dropdown("Block device", "Create partition table")
self.dialog({"type": "gpt"})
b.wait_text(self.card_row_col("GPT partitions", 1, 1), "Free space")

Expand Down Expand Up @@ -255,7 +255,7 @@ class TestStorageLuks(storagelib.StorageCase):
self.login_and_go("/storage")

# Add a disk and format it with luks, but without filesystem
disk = self.add_ram_disk()
disk = self.add_loopback_disk()
self.click_card_row("Storage", name=disk)

self.click_card_dropdown("Unformatted data", "Format")
Expand Down Expand Up @@ -291,7 +291,7 @@ class TestStorageLuks(storagelib.StorageCase):
self.assertEqual(m.execute(f"lsblk -no RO {cleartext_dev}").strip(), "1")

# Now create a empty, encrypted partition
self.click_card_dropdown("Solid State Drive", "Create partition table")
self.click_card_dropdown("Block device", "Create partition table")
self.dialog({"type": "gpt"})
b.wait_text(self.card_row_col("GPT partitions", 1, 1), "Free space")
self.click_dropdown(self.card_row("GPT partitions", 1), "Create partition")
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 @@ -293,7 +293,7 @@ class TestStorageLvm2(storagelib.StorageCase):

self.login_and_go("/storage")

disk1 = self.add_ram_disk()
disk1 = self.add_loopback_disk()
disk2 = self.add_loopback_disk()
b.wait_visible(self.card_row("Storage", name=disk1))
b.wait_visible(self.card_row("Storage", name=disk2))
Expand Down
6 changes: 3 additions & 3 deletions test/verify/check-storage-mounting
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,10 @@ class TestStorageMountingLUKS(storagelib.StorageCase):
# Add a disk and make two partitions on it, one on /run/foo
# and one on /run/foo/bar

disk = self.add_ram_disk(100)
disk = self.add_loopback_disk(100)
self.click_card_row("Storage", name=disk)

self.click_card_dropdown("Solid State Drive", "Create partition table")
self.click_card_dropdown("Block device", "Create partition table")
self.dialog({"type": "gpt"})
b.wait_text(self.card_row_col("GPT partitions", 1, 1), "Free space")

Expand Down Expand Up @@ -694,7 +694,7 @@ class TestStorageMountingLUKS(storagelib.StorageCase):
b.wait_text("#dialog tbody:nth-of-type(1) td[data-label=Location]", "/run/foo/bar")
b.wait_text("#dialog tbody:nth-of-type(2) td[data-label=Location]", "/run/foo")

self.dialog_with_error_retry(trigger=lambda: self.click_card_dropdown("Solid State Drive",
self.dialog_with_error_retry(trigger=lambda: self.click_card_dropdown("Block device",
"Create partition table"),
first_setup=first_setup,
errors=["Timed out waiting for object"])
Expand Down
4 changes: 2 additions & 2 deletions test/verify/check-storage-msdos
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class TestStorageMsDOS(storagelib.StorageCase):
self.login_and_go("/storage")

# Add a disk
disk = self.add_ram_disk()
disk = self.add_loopback_disk()
self.click_card_row("Storage", name=disk)

# Format it with a DOS partition table
self.click_card_dropdown("Solid State Drive", "Create partition table")
self.click_card_dropdown("Block device", "Create partition table")
self.dialog({"type": "dos"})
b.wait_text(self.card_row_col("DOS partitions", 1, 1), "Free space")

Expand Down
14 changes: 7 additions & 7 deletions test/verify/check-storage-partitions
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ class TestStoragePartitions(storagelib.StorageCase):

self.login_and_go("/storage")

disk = self.add_ram_disk()
disk = self.add_loopback_disk()
self.click_card_row("Storage", name=disk)

self.click_card_dropdown("Solid State Drive", "Create partition table")
self.click_card_dropdown("Block device", "Create partition table")
self.dialog({"type": "gpt"})
b.wait_text(self.card_row_col("GPT partitions", 1, 1), "Free space")

Expand Down Expand Up @@ -110,10 +110,10 @@ class TestStoragePartitions(storagelib.StorageCase):

self.login_and_go("/storage")

disk = self.add_ram_disk(100)
disk = self.add_loopback_disk(100)
self.click_card_row("Storage", name=disk)

self.click_card_dropdown("Solid State Drive", "Create partition table")
self.click_card_dropdown("Block device", "Create partition table")
self.dialog({"type": "gpt"})
b.wait_text(self.card_row_col("GPT partitions", 1, 1), "Free space")

Expand Down Expand Up @@ -169,12 +169,12 @@ class TestStoragePartitions(storagelib.StorageCase):

self.login_and_go("/storage")

disk = self.add_ram_disk(100)
disk = self.add_loopback_disk(100)
self.click_card_row("Storage", name=disk)

# GPT

self.click_card_dropdown("Solid State Drive", "Create partition table")
self.click_card_dropdown("Block device", "Create partition table")
self.dialog({"type": "gpt"})
b.wait_text(self.card_row_col("GPT partitions", 1, 1), "Free space")

Expand Down Expand Up @@ -203,7 +203,7 @@ class TestStoragePartitions(storagelib.StorageCase):
# DOS

b.click(self.card_parent_link())
self.click_card_dropdown("Solid State Drive", "Create partition table")
self.click_card_dropdown("Block device", "Create partition table")
self.dialog({"type": "dos"})
b.wait_text(self.card_row_col("DOS partitions", 1, 1), "Free space")

Expand Down
16 changes: 8 additions & 8 deletions test/verify/check-storage-swap
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ class TestStorageswap(storagelib.StorageCase):
b = self.browser
m = self.machine

disk = self.add_ram_disk()
disk = self.add_loopback_disk()
self.addCleanup(m.execute, f"swapoff {disk} || true; swapoff {disk}1 || true")

self.login_and_go("/storage")

# Create a swap partition on GPT
self.click_card_row("Storage", name=disk)
self.click_card_dropdown("Solid State Drive", "Create partition table")
self.click_card_dropdown("Block device", "Create partition table")
self.confirm()
b.wait_text(self.card_row_col("GPT partitions", 1, 1), "Free space")
self.click_dropdown(self.card_row("GPT partitions", 1), "Create partition")
Expand All @@ -45,17 +45,17 @@ class TestStorageswap(storagelib.StorageCase):
# It should have been started and have a fstab entry
self.click_card_row("GPT partitions", 1)
b.wait_text(self.card_desc("Swap", "Used"), "0 B")
self.assertIn("defaults", m.execute(f"findmnt --fstab -n -o OPTIONS {disk}1"))
self.assertIn("defaults", m.execute(f"findmnt --fstab -n -o OPTIONS {disk}p1"))

# Stopping should set it to noauto
b.click(self.card_button("Swap", "Stop"))
b.wait_text(self.card_desc("Swap", "Used"), "-")
self.assertIn("noauto", m.execute(f"findmnt --fstab -n -o OPTIONS {disk}1"))
self.assertIn("noauto", m.execute(f"findmnt --fstab -n -o OPTIONS {disk}p1"))

# Start it again to test teardown below
b.click(self.card_button("Swap", "Start"))
b.wait_text(self.card_desc("Swap", "Used"), "0 B")
self.assertIn("defaults", m.execute(f"findmnt --fstab -n -o OPTIONS {disk}1"))
self.assertIn("defaults", m.execute(f"findmnt --fstab -n -o OPTIONS {disk}p1"))

# It should have the right partition type
b.wait_visible(self.card("Swap"))
Expand All @@ -70,7 +70,7 @@ class TestStorageswap(storagelib.StorageCase):
self.click_card_dropdown("Swap", "Format")
self.dialog_wait_open()
self.dialog_set_val("type", "swap")
b.wait_in_text("#dialog .modal-footer-teardown", f"{disk}1")
b.wait_in_text("#dialog .modal-footer-teardown", f"{disk}p1")
b.wait_in_text("#dialog .modal-footer-teardown", "stop, format")
self.dialog_apply_secondary()
self.dialog_wait_close()
Expand All @@ -79,8 +79,8 @@ class TestStorageswap(storagelib.StorageCase):
# Delete the partition, the fstab entry should disappear
self.click_card_dropdown("Partition", "Delete")
self.confirm()
b.wait_visible(self.card("Solid State Drive"))
m.execute(f"! findmnt --fstab -n -o OPTIONS {disk}1")
b.wait_visible(self.card("Block device"))
m.execute(f"! findmnt --fstab -n -o OPTIONS {disk}p1")

# Format as swap on the command line, starting it should add
# fstab entry
Expand Down
6 changes: 3 additions & 3 deletions test/verify/check-storage-used
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TestStorageUsed(storagelib.StorageCase):

self.login_and_go("/storage")

disk = self.add_ram_disk()
disk = self.add_loopback_disk()
b.wait_visible(self.card_row("Storage", name=disk))
m.execute(f"parted -s {disk} mktable msdos")
m.execute(f"parted -s {disk} mkpart primary ext2 1M 25")
Expand Down Expand Up @@ -60,7 +60,7 @@ ExecStart=/usr/bin/sleep infinity
# should be 'in use' but Cockpit can clean them all up anyway.

self.click_card_row("Storage", name=disk)
b.wait_visible(self.card("Solid State Drive"))
b.wait_visible(self.card("Block device"))

self.click_card_row("DOS partitions", 1)
self.click_card_dropdown("ext2 filesystem", "Format")
Expand Down Expand Up @@ -101,7 +101,7 @@ ExecStart=/usr/bin/sleep infinity
def retry_setup():
self.dialog_set_val("type", "empty")

self.dialog_with_error_retry(trigger=lambda: self.click_card_dropdown("Solid State Drive",
self.dialog_with_error_retry(trigger=lambda: self.click_card_dropdown("Block device",
"Create partition table"),
first_setup=first_setup,
retry_setup=retry_setup,
Expand Down

0 comments on commit 10ac8fa

Please sign in to comment.