From patchwork Fri May 6 15:04:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 762312 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p46F4Mjt010510 for ; Fri, 6 May 2011 15:04:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755445Ab1EFPET (ORCPT ); Fri, 6 May 2011 11:04:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16972 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755345Ab1EFPET (ORCPT ); Fri, 6 May 2011 11:04:19 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p46F4Iuv002371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 6 May 2011 11:04:18 -0400 Received: from localhost6.localdomain6 (vpn2-8-71.sin2.redhat.com [10.67.8.71]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p46F4DiL008150; Fri, 6 May 2011 11:04:14 -0400 Subject: [PATCH 3/3] KVM-test: Check if guest bootable after reseting several times To: autotest@test.kernel.org From: Amos Kong Cc: lmr@redhat.com, kvm@vger.kernel.org Date: Fri, 06 May 2011 23:04:09 +0800 Message-ID: <20110506150409.5847.72444.stgit@localhost6.localdomain6> In-Reply-To: References: User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 06 May 2011 15:04:22 +0000 (UTC) This test comes from a regression bug: Guest can not found bootable device after reseting several times by monitor command. https://bugzilla.redhat.com/show_bug.cgi?id=531026 Changes from v1: - add bug id to commitlog - remove unnecessary imports - add some log message Signed-off-by: Amos Kong --- client/tests/kvm/tests/system_reset_bootable.py | 31 +++++++++++++++++++++++ client/tests/kvm/tests_base.cfg.sample | 7 +++++ 2 files changed, 38 insertions(+), 0 deletions(-) create mode 100755 client/tests/kvm/tests/system_reset_bootable.py -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/client/tests/kvm/tests/system_reset_bootable.py b/client/tests/kvm/tests/system_reset_bootable.py new file mode 100755 index 0000000..54536dc --- /dev/null +++ b/client/tests/kvm/tests/system_reset_bootable.py @@ -0,0 +1,31 @@ +import logging, time +from autotest_lib.client.common_lib import error + +def run_system_reset_bootable(test, params, env): + """ + KVM reset test: + 1) Boot guest. + 2) Reset system by monitor command for several times. + 3) Log into the guest to verify it could normally boot. + + @param test: kvm test object + @param params: Dictionary with the test parameters + @param env: Dictionary with test environment. + """ + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() + timeout = float(params.get("login_timeout", 240)) + reset_times = int(params.get("reset_times",20)) + interval = int(params.get("reset_interval",10)) + wait_time = int(params.get("wait_time_for_reset",60)) + + logging.info("Wait for %d seconds before reset" % wait_time) + time.sleep(wait_time) + + for i in range(reset_times): + logging.info("Reset the system by monitor cmd") + vm.monitor.cmd("system_reset") + time.sleep(interval) + + logging.info("Try to login guest after reset") + session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample index 1e659bc..3b69b37 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -962,6 +962,13 @@ variants: sleep_before_reset = 20 kill_vm_on_error = yes + - system_reset_bootable: + type = system_reset_bootable + interval = 1 + reset_times = 20 + wait_time_for_reset = 120 + kill_vm_on_error = yes + - shutdown: install setup unattended_install.cdrom type = shutdown shutdown_method = shell