On Fri, Dec 18, 2009 at 09:25:24AM -0600, Ryan Harper wrote: > * Yolkfull Chow <yzhou@xxxxxxxxxx> [2009-12-17 22:51]: > > Signed-off-by: Yolkfull Chow <yzhou@xxxxxxxxxx> > > --- > > client/tests/kvm/tests/vnc.py | 24 ++++++++++++++++++++++++ > > client/tests/kvm/tests_base.cfg.sample | 3 +++ > > 2 files changed, 27 insertions(+), 0 deletions(-) > > create mode 100644 client/tests/kvm/tests/vnc.py > > > > diff --git a/client/tests/kvm/tests/vnc.py b/client/tests/kvm/tests/vnc.py > > new file mode 100644 > > index 0000000..0f00379 > > --- /dev/null > > +++ b/client/tests/kvm/tests/vnc.py > > @@ -0,0 +1,24 @@ > > +import logging, pexpect > > +from autotest_lib.client.common_lib import error > > +import kvm_test_utils, kvm_subprocess > > + > > +def run_vnc(test, params, env): > > + """ > > + Test whether guest could be interacted with vnc. > > + > > + @param test: kvm test object > > + @param params: Dictionary with the test parameters > > + @param env: Dictionary with test environment. > > + """ > > + vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) > > + session = kvm_test_utils.wait_for_login(vm) > > + > > + # Start vnc connection test > > + vnc_port = str(vm.vnc_port - 5900) > > + vnc_cmd = "vncviewer" + " localhost:" + vnc_port > > Can we make this configurable? vncviewer does have a few bugs that kvm > tends to expose; it'd be good to let the admin set this value. Hi Ryan, Sorry for late reply and thanks very much for these suggestions. During our testing, we found a problem for this test: the sessions autotest server gets from its client machines will not get X services and this test will always fail with following error: 12/29 17:04:44 DEBUG| vnc:0020| Try to connect to guest via vnc, vnc_port is: 1 12/29 17:04:44 DEBUG| vnc:0023| Using command to vnc connect: vncviewer localhost:1 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) VNC Viewer Free Edition 4.1.2 for X - built Jan 26 2009 11:52:08 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) Copyright (C) 2002-2005 RealVNC Ltd. 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) See http://www.realvnc.com for information on VNC. 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) vncviewer: unable to open display "" 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) (Process terminated with status 1) 12/29 17:04:44 ERROR| kvm:0063| Test failed: Vnc connect to guest failed Therefore, we need to use socket to connect to vncserver of qemu-kvm and analyse the header info readed from socket connection. I will improve this test later. Any further suggestions will be appreciated. :-) Thanks again. > > > > + logging.debug("Using command to vnc connect: %s" % vnc_cmd) > > + > > + p = kvm_subprocess.run_bg(vnc_cmd, None, logging.debug, "(vnc) ") > > + if not p.is_alive(): > > + raise error.TestFail("Vnc connect to guest failed") > > + p.close() > > diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample > > index a403399..0eaccae 100644 > > --- a/client/tests/kvm/tests_base.cfg.sample > > +++ b/client/tests/kvm/tests_base.cfg.sample > > @@ -270,6 +270,9 @@ variants: > > type = physical_resources_check > > catch_uuid_cmd = dmidecode | awk -F: '/UUID/ {print $2}' > > > > + - vnc: install setup unattended_install > > + type = vnc > > + > > # NICs > > variants: > > - @rtl8139: > > -- > > 1.6.5.5 > > > > _______________________________________________ > > Autotest mailing list > > Autotest@xxxxxxxxxxxxxxx > > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest > > -- > Ryan Harper > Software Engineer; Linux Technology Center > IBM Corp., Austin, Tx > ryanh@xxxxxxxxxx > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html