summaryrefslogtreecommitdiff
path: root/tests/uitests
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2022-02-27 12:08:30 -0500
committerCole Robinson <crobinso@redhat.com>2022-02-27 13:44:26 -0500
commit365d1f5d563b5bab2d5d831a0fe3cf9e3ef62b41 (patch)
tree48643bd154b11a0dbe076c568b243a7512580197 /tests/uitests
parent59595aebb7863bb8ae495fc927e70d97398234c0 (diff)
downloadvirt-manager-365d1f5d563b5bab2d5d831a0fe3cf9e3ef62b41.tar.gz
diskbackend: Set relative path for media change
Via the virt-manager UI we aren't converting relative path to absolute path, even though we do it internally when needed. We were benefiting from this in the test suite in some ways, so we need to adjust tests to strip out the dev dir on XML comparison Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'tests/uitests')
-rw-r--r--tests/uitests/test_mediachange.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/uitests/test_mediachange.py b/tests/uitests/test_mediachange.py
index f20a7cd1..917dfad3 100644
--- a/tests/uitests/test_mediachange.py
+++ b/tests/uitests/test_mediachange.py
@@ -1,6 +1,9 @@
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
+import os
+
+import tests
from . import lib
@@ -10,6 +13,7 @@ from . import lib
def testMediaChange(app):
vmname = "test-many-devices"
+ app.uri = tests.utils.URIs.test_remote
app.open(show_console=vmname)
win = app.find_details_window(vmname,
click_details=True, shutdown=True)
@@ -39,7 +43,7 @@ def testMediaChange(app):
entry.text == "Floppy_install_label (/dev/fdb)")
# Specify manual path
- path = "/tmp/aaaaaaaaaaaaaaaaaaaaaaa.img"
+ path = "/pool-dir/UPPER"
entry.set_text(path)
appl.click()
lib.utils.check(lambda: not appl.sensitive)
@@ -88,10 +92,16 @@ def testMediaHotplug(app):
entry = win.find("media-entry")
appl = win.find("config-apply")
- # CDROM + physical
hw.find("IDE CDROM 1", "table cell").click()
lib.utils.check(lambda: not entry.text)
- entry.set_text("/dev/sr0")
+ # Catch path does not exist error
+ entry.set_text("/dev/sr7")
+ appl.click()
+ app.click_alert_button("non-existent path '/dev/sr7", "Close")
+
+ # Check relative path while we are at it
+ path = "virt-install"
+ entry.set_text(path)
appl.click()
app.click_alert_button("changes will take effect", "OK")
lib.utils.check(lambda: not appl.sensitive)
@@ -101,4 +111,4 @@ def testMediaHotplug(app):
win.find("Shut Down", "push button").click()
run = win.find("Run", "push button")
lib.utils.check(lambda: run.sensitive)
- lib.utils.check(lambda: entry.text == "Fedora12_media (/dev/sr0)")
+ lib.utils.check(lambda: entry.text == os.path.abspath(path))