From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucas Meneghel Rodrigues Subject: Re: [Autotest] [Autotest PATCH] KVM-test: Check if guest bootable after reseting several times Date: Fri, 29 Apr 2011 01:53:01 -0300 Message-ID: References: <20110421064749.10673.63282.stgit@t> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: autotest@test.kernel.org, kvm@vger.kernel.org To: Amos Kong Return-path: Received: from mail-ew0-f46.google.com ([209.85.215.46]:53629 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007Ab1D2ExE convert rfc822-to-8bit (ORCPT ); Fri, 29 Apr 2011 00:53:04 -0400 Received: by ewy4 with SMTP id 4so1034260ewy.19 for ; Thu, 28 Apr 2011 21:53:02 -0700 (PDT) In-Reply-To: <20110421064749.10673.63282.stgit@t> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Apr 21, 2011 at 3:47 AM, Amos Kong wrote: > This test comes from a regression bug: > Guest can not found bootable device after reseting several times by > monitor command. Can you point out the bug number? I really don't expect that we keep integrity of the disk after several resets, at least I wouldn't if it was a bare metal machine... Anyway, I've made some changes to the code, mostly removing unnecessary imports and having some messages explaining what the test is doing... I am just not convinced that this test should pass in all circumstances (I tried here and it does pass, by the way). > Signed-off-by: Amos Kong > --- > =A0client/tests/kvm/tests/system_reset_bootable.py | =A0 29 +++++++++= ++++++++++++++ > =A0client/tests/kvm/tests_base.cfg.sample =A0 =A0 =A0 =A0 =A0| =A0 =A0= 7 ++++++ > =A02 files changed, 36 insertions(+), 0 deletions(-) > =A0create mode 100755 client/tests/kvm/tests/system_reset_bootable.py > > 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..ca9fb70 > --- /dev/null > +++ b/client/tests/kvm/tests/system_reset_bootable.py > @@ -0,0 +1,29 @@ > +import logging, time > +from autotest_lib.client.common_lib import error > +import kvm_test_utils > + > + > +def run_system_reset_bootable(test, params, env): > + =A0 =A0""" > + =A0 =A0KVM reset test: > + =A0 =A01) Boot guest. > + =A0 =A02) Send some times system_reset monitor command. > + =A0 =A03) Log into the guest to verify it could normally boot. > + > + =A0 =A0@param test: kvm test object > + =A0 =A0@param params: Dictionary with the test parameters > + =A0 =A0@param env: Dictionary with test environment. > + =A0 =A0""" > + =A0 =A0vm =3D env.get_vm(params["main_vm"]) > + =A0 =A0vm.verify_alive() > + =A0 =A0timeout =3D float(params.get("login_timeout", 240)) > + =A0 =A0reset_times =3D int(params.get("reset_times",20)) > + =A0 =A0interval =3D int(params.get("reset_interval",10)) > + =A0 =A0wait_time =3D int(params.get("wait_time_for_reset",60)) > + =A0 =A0time.sleep(wait_time) > + > + =A0 =A0for i in range(reset_times): > + =A0 =A0 =A0 =A0vm.monitor.cmd("system_reset") > + =A0 =A0 =A0 =A0time.sleep(interval) > + > + =A0 =A0session =3D vm.wait_for_login(timeout=3Dtimeout) > diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kv= m/tests_base.cfg.sample > index 7333ed0..ceafebe 100644 > --- a/client/tests/kvm/tests_base.cfg.sample > +++ b/client/tests/kvm/tests_base.cfg.sample > @@ -961,6 +961,13 @@ variants: > =A0 =A0 =A0 =A0 sleep_before_reset =3D 20 > =A0 =A0 =A0 =A0 kill_vm_on_error =3D yes > > + =A0 =A0- system_reset_bootable: > + =A0 =A0 =A0 =A0type =3D system_reset_bootable > + =A0 =A0 =A0 =A0interval =3D 1 > + =A0 =A0 =A0 =A0reset_times =3D 20 > + =A0 =A0 =A0 =A0wait_time_for_reset =3D 120 > + =A0 =A0 =A0 =A0kill_vm_on_error =3D yes > + > =A0 =A0 - shutdown: =A0 =A0 install setup unattended_install.cdrom > =A0 =A0 =A0 =A0 type =3D shutdown > =A0 =A0 =A0 =A0 shutdown_method =3D shell > > _______________________________________________ > Autotest mailing list > Autotest@test.kernel.org > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest > --=20 Lucas