From patchwork Fri Dec 18 04:50:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yolkfull Chow X-Patchwork-Id: 68586 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBI4ouB3013113 for ; Fri, 18 Dec 2009 04:50:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750753AbZLREuy (ORCPT ); Thu, 17 Dec 2009 23:50:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750752AbZLREuy (ORCPT ); Thu, 17 Dec 2009 23:50:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26338 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750711AbZLREuw (ORCPT ); Thu, 17 Dec 2009 23:50:52 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBI4oofi023224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 17 Dec 2009 23:50:51 -0500 Received: from localhost.localdomain (dhcp-65-181.nay.redhat.com [10.66.65.181]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBI4omwF028390; Thu, 17 Dec 2009 23:50:49 -0500 From: Yolkfull Chow To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Yolkfull Chow Subject: [Autotest PATCH] KVM test: Add a subtest vnc via which interacts with guest Date: Fri, 18 Dec 2009 12:50:46 +0800 Message-Id: <1261111846-4564-1-git-send-email-yzhou@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 + 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: