From: Ryan Harper Subject: Re: [Autotest] [Autotest PATCH] KVM test: Add a subtest vnc via which interacts with guest Date: Fri, 18 Dec 2009 09:25:24 -0600 Message-ID: <20091218152524.GH25491@us.ibm.com> References: <1261111846-4564-1-git-send-email-yzhou@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: autotest@test.kernel.org, kvm@vger.kernel.org To: Yolkfull Chow Return-path: Received: from e37.co.us.ibm.com ([32.97.110.158]:58729 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753903AbZLRPZu (ORCPT ); Fri, 18 Dec 2009 10:25:50 -0500 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e37.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id nBIFOUxS025001 for ; Fri, 18 Dec 2009 08:24:30 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nBIFPXT7129798 for ; Fri, 18 Dec 2009 08:25:42 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nBIFPSGO005397 for ; Fri, 18 Dec 2009 08:25:29 -0700 Content-Disposition: inline In-Reply-To: <1261111846-4564-1-git-send-email-yzhou@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: * Yolkfull Chow [2009-12-17 22:51]: > Signed-off-by: Yolkfull Chow > --- > 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. > + 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@test.kernel.org > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx ryanh@us.ibm.com