Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Use wait_text to check an empty string #1195

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions test/check-machines-storage-pools
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,18 @@ class TestMachinesStoragePools(VirtualMachinesCase):
b.wait_visible(f"#pool-myPoolTwo-{connectionName}-volume-VolumeOne-usedby")
b.wait_in_text(f"#pool-myPoolTwo-{connectionName}-volume-VolumeOne-usedby", "subVmTest1")

m.execute("virsh detach-disk --config --target vdc subVmTest1")
b.wait_in_text(f"#pool-myPoolTwo-{connectionName}-volume-VolumeOne-usedby", "")
# Detach disk from VM
self.goToMainPage()
self.waitVmRow("subVmTest1")
self.goToVmPage("subVmTest1")
self.deleteDisk("vdc")
self.goToMainPage()
b.click(".pf-v5-c-card .pf-v5-c-card__header button:contains(Storage pools)")
self.togglePoolRow("myPoolTwo", connectionName)
self.gotoVolumesTab("myPoolTwo")

# Verify storage pool's "Used by [vms]" was updated
b.wait_text(f"#pool-myPoolTwo-{connectionName}-volume-VolumeOne-usedby", "")

# Transient pool
self.togglePoolRow("myPoolThree", connectionName)
Expand Down
13 changes: 13 additions & 0 deletions test/machineslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,19 @@ def run_admin(self, cmd, connectionName='system'):
else:
return m.execute(cmd)

def deleteDisk(self, target, vm_name="subVmTest1"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You just defined this function without using this anywhere. Forgot to commit something?

b = self.browser

b.wait_visible(f"#vm-{vm_name}-disks-{target}-device")
b.wait_visible(f"#vm-{vm_name}-disks-{target}-action-kebab")
b.click(f"#vm-{vm_name}-disks-{target}-action-kebab button")
b.wait_visible(f"#delete-vm-{vm_name}-disks-{target}")
b.click(f"#delete-vm-{vm_name}-disks-{target}")
b.wait_visible(".pf-v5-c-modal-box")
b.click("#delete-resource-modal-primary")
b.wait_not_present(".pf-v5-c-modal-box")
b.wait_not_present(f"#vm-{vm_name}-disks-{target}-device")

def deleteIface(self, iface, mac=None, vm_name=None):
b = self.browser

Expand Down