From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Goldish Subject: Re: [AUTOTEST] print login command and change some timeout values Date: Fri, 24 Jul 2009 12:03:13 -0400 (EDT) Message-ID: <1952871865.974061248451393009.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> References: <1629700637.973841248451192277.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm-devel , Lucas Meneghel Rodrigues , Autotest mailing list To: sudhir kumar Return-path: Received: from mx1.redhat.com ([66.187.233.31]:44867 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752554AbZGXQDS convert rfc822-to-8bit (ORCPT ); Fri, 24 Jul 2009 12:03:18 -0400 In-Reply-To: <1629700637.973841248451192277.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: ----- "sudhir kumar" wrote: > On Fri, Jul 24, 2009 at 5:54 PM, Michael Goldish > wrote: > > > > ----- "sudhir kumar" wrote: > > > >> This patch does two small things. > >> 1. Prints the guest login command to debug messages. > > > > Why do we want to do that? > I do not see any harm in that. We are logging "trying to login". If > sometimes login fail we can check by manually typing the same command > and see what went wrong. That print statement has helped me in past > quite a number of times. OK, no problem. What do you think about printing the login command and the "trying to login" message on the same line, like: Trying to login: ssh root@localhost 5000 or Trying to login with command: ssh root@localhost 5000 or Trying to login (ssh root@localhost 5000) or something like that. If you don't like any of these options, the patch is OK as it is. I just thought it would be a good idea to keep the output short, because "Trying to login" is displayed repeatedly during boot so it can produce a lot of (not so interesting) output. > >> 2. Changes the guest login timeout to 240 seconds. I see the > timeout > >> for > >> *.wait_for() functions in boot test is 240 seconds, while in reboo= t > is > >> 120 > >> seconds which causes the test to fail. We might have missed it by > >> mistake. > >> 240 seconds is a reasonable timeout duration. This patch fixes > that. > > > > Using the same timeout value everywhere makes sense, but it > surprises me > > that tests are failing because 120 isn't enough. It sounds like the > host > > has to be heavily loaded for the boot to take longer than 2 minutes= =2E > But > > if it happened to you then let's increase the timeout. >=20 > Yes please, > the test failed very near to the sshd daemon was about to run. So > that > shows 120 seconds is not sufficient. The host was not at all loaded > and is a pretty high end machine. > Thanks. OK, I agree. I guess I run fast guests most of the time, and some guest= s can take much longer to boot. > >> Signed-off-by: Sudhir Kumar > >> > >> Index: autotest/client/tests/kvm/kvm_utils.py > >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >> --- autotest.orig/client/tests/kvm/kvm_utils.py > >> +++ autotest/client/tests/kvm/kvm_utils.py > >> @@ -637,6 +637,7 @@ def remote_login(command, password, prom > >> =C2=A0 =C2=A0 =C2=A0password_prompt_count =3D 0 > >> > >> =C2=A0 =C2=A0 =C2=A0logging.debug("Trying to login...") > >> + =C2=A0 =C2=A0logging.debug("Guest login Command: %s" % command) > >> > >> =C2=A0 =C2=A0 =C2=A0while True: > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(match, text) =3D sub.read_until= _last_line_matches( > >> Index: autotest/client/tests/kvm/kvm_tests.py > >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >> --- autotest.orig/client/tests/kvm/kvm_tests.py > >> +++ autotest/client/tests/kvm/kvm_tests.py > >> @@ -48,7 +48,7 @@ def run_boot(test, params, env): > >> > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0logging.info("Guest is down; wai= ting for it to go up > >> again...") > >> > >> - =C2=A0 =C2=A0 =C2=A0 =C2=A0session =3D kvm_utils.wait_for(vm.ssh= _login, 120, 0, 2) > >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0session =3D kvm_utils.wait_for(vm.ssh= _login, 240, 0, 2) > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if not session: > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0raise error.TestFa= il("Could not log into guest after > >> reboot") > >> > >> @@ -88,7 +88,7 @@ def run_shutdown(test, params, env): > >> > >> =C2=A0 =C2=A0 =C2=A0logging.info("Shutdown command sent; waiting f= or guest to go > >> down...") > >> > >> - =C2=A0 =C2=A0if not kvm_utils.wait_for(vm.is_dead, 120, 0, 1): > >> + =C2=A0 =C2=A0if not kvm_utils.wait_for(vm.is_dead, 240, 0, 1): > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0raise error.TestFail("Guest refu= ses to go down") > >> > >> =C2=A0 =C2=A0 =C2=A0logging.info("Guest is down") > >> @@ -445,7 +445,7 @@ def run_yum_update(test, params, env): > >> > >> =C2=A0 =C2=A0 =C2=A0logging.info("Logging into guest...") > >> > >> - =C2=A0 =C2=A0session =3D kvm_utils.wait_for(vm.ssh_login, 120, 0= , 2) > >> + =C2=A0 =C2=A0session =3D kvm_utils.wait_for(vm.ssh_login, 240, 0= , 2) > >> =C2=A0 =C2=A0 =C2=A0if not session: > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0message =3D "Could not log into = guest" > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0logging.error(message) > >> > >> > >> > >> -- > >> Sudhir Kumar > > >=20 >=20 >=20 > --=20 > Sudhir Kumar