mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
tests: Add some virt-install autoconsole tests
This commit is contained in:
parent
59edd87e9f
commit
0e8d4007cf
@ -793,6 +793,10 @@ c.add_valid("--file %(EXISTIMG1)s") # Existing file, no opts
|
||||
c.add_valid("--file %(EXISTIMG1)s --file %(EXISTIMG1)s") # Multiple existing files
|
||||
c.add_valid("--file %(NEWIMG1)s --file-size .00001 --nonsparse") # Nonexistent file
|
||||
|
||||
c = vinst.add_category("console-tests", "--pxe --nodisks")
|
||||
c.add_valid("--nographics") # mock virsh console waiting
|
||||
c.add_valid("--graphics vnc --noreboot") # mock virt-viewer waiting, with noreboot magic
|
||||
c.add_valid("--nographics --wait 1")
|
||||
|
||||
|
||||
|
||||
|
@ -410,8 +410,14 @@ def validate_disk(dev, warn_overwrite=False):
|
||||
check_path_search(dev)
|
||||
|
||||
|
||||
def _run_console(args):
|
||||
def _run_console(guest, args):
|
||||
logging.debug("Running: %s", " ".join(args))
|
||||
if "VIRTINST_TEST_SUITE" in os.environ:
|
||||
# Add this destroy() in here to trigger more virt-install code
|
||||
# for the test suite
|
||||
guest.domain.destroy()
|
||||
return None
|
||||
|
||||
child = os.fork()
|
||||
if child:
|
||||
return child
|
||||
@ -432,7 +438,7 @@ def _gfx_console(guest):
|
||||
|
||||
logging.debug("Launching virt-viewer for graphics type '%s'",
|
||||
guest.get_devices("graphics")[0].type)
|
||||
return _run_console(args)
|
||||
return _run_console(guest, args)
|
||||
|
||||
|
||||
def _txt_console(guest):
|
||||
@ -441,7 +447,7 @@ def _txt_console(guest):
|
||||
"console", guest.name]
|
||||
|
||||
logging.debug("Connecting to text console")
|
||||
return _run_console(args)
|
||||
return _run_console(guest, args)
|
||||
|
||||
|
||||
def connect_console(guest, consolecb, wait):
|
||||
|
Loading…
Reference in New Issue
Block a user