mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-09 09:57:40 +03:00
The copyright headers in every file were chjanged in this previous commit commit b6dcee8eb7ec4de999058c187162fe4aedef36b4 Author: Cole Robinson <crobinso@redhat.com> Date: Tue Mar 20 15:00:02 2018 -0400 Use consistent and minimal license header for every file Where before this they said " "either version 2 of the License, or (at your option) any later version." Now they just say "GNU GPLv2" This fixes it to say "GNU GPLv2 or later" again. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
89 lines
3.1 KiB
Python
89 lines
3.1 KiB
Python
# This work is licensed under the GNU GPLv2 or later.
|
|
# See the COPYING file in the top-level directory.
|
|
|
|
from tests.uitests import utils as uiutils
|
|
|
|
|
|
class VMMCLI(uiutils.UITestCase):
|
|
"""
|
|
UI tests for virt-manager's command line --show options
|
|
"""
|
|
|
|
##############
|
|
# Test cases #
|
|
##############
|
|
|
|
def testShowNewVM(self):
|
|
self.app.open(extra_opts=["--show-domain-creator"])
|
|
self.assertEqual(self.app.topwin.name, "New VM")
|
|
|
|
def testShowHost(self):
|
|
self.app.open(extra_opts=["--show-host-summary"])
|
|
|
|
self.assertEqual(self.app.topwin.name,
|
|
"test testdriver.xml Connection Details")
|
|
self.assertEqual(
|
|
self.app.topwin.find_fuzzy("Name:", "text").text,
|
|
"test testdriver.xml")
|
|
|
|
def testShowDetails(self):
|
|
self.app.open(extra_opts=["--show-domain-editor", "test-clone-simple"])
|
|
|
|
self.assertTrue("test-clone-simple on" in self.app.topwin.name)
|
|
self.assertFalse(
|
|
self.app.topwin.find_fuzzy(
|
|
"Guest is not running", "label").showing)
|
|
self.assertTrue(
|
|
self.app.topwin.find_fuzzy(
|
|
"add-hardware", "button").showing)
|
|
|
|
def testShowPerformance(self):
|
|
self.app.open(extra_opts=["--show-domain-performance",
|
|
"test-clone-simple"])
|
|
|
|
self.assertTrue("test-clone-simple on" in self.app.topwin.name)
|
|
self.assertFalse(
|
|
self.app.topwin.find_fuzzy(
|
|
"Guest is not running", "label").showing)
|
|
self.assertTrue(
|
|
self.app.topwin.find_fuzzy("CPU usage", "label").showing)
|
|
|
|
def testShowConsole(self):
|
|
self.app.open(extra_opts=["--show-domain-console", "test-clone-simple"])
|
|
|
|
self.assertTrue("test-clone-simple on" in self.app.topwin.name)
|
|
self.assertTrue(
|
|
self.app.topwin.find_fuzzy(
|
|
"Guest is not running", "label").showing)
|
|
self.assertFalse(
|
|
self.app.topwin.find_fuzzy(
|
|
"add-hardware", "button").showing)
|
|
|
|
def testShowRemoteConnect(self):
|
|
"""
|
|
Test the remote app dbus connection
|
|
"""
|
|
self.app.open()
|
|
newapp = uiutils.VMMDogtailApp("test:///default")
|
|
newapp.open()
|
|
uiutils.check_in_loop(lambda: not newapp.is_running())
|
|
import dogtail.tree
|
|
vapps = [a for a in dogtail.tree.root.applications() if
|
|
a.name == "virt-manager"]
|
|
self.assertEqual(len(vapps), 1)
|
|
|
|
self.app.topwin.find("test default", "table cell")
|
|
|
|
def testShowCLIError(self):
|
|
self.app.open(extra_opts=["--idontexist"])
|
|
alert = self.app.root.find("vmm dialog")
|
|
alert.find_fuzzy("Unhandled command line")
|
|
|
|
def testShowConnectBadURI(self):
|
|
baduri = "fribfrobfroo"
|
|
self.app = uiutils.VMMDogtailApp(baduri)
|
|
alert = self.app.root.find("vmm dialog")
|
|
alert.find_fuzzy(baduri)
|
|
alert.find_fuzzy("Close", "push button").click()
|
|
uiutils.check_in_loop(lambda: not self.app.is_running())
|