All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Michael Goldish <mgoldish@redhat.com>
Cc: autotest@test.kernel.org, lmr@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH 7/9] KVM test: Introduce the local_login()
Date: Thu, 06 May 2010 11:07:55 +0800	[thread overview]
Message-ID: <4BE2328B.9030509@redhat.com> (raw)
In-Reply-To: <4BD823A4.8040103@redhat.com>

Michael Goldish wrote:
> On 04/26/2010 01:04 PM, Jason Wang wrote:
>   
>> This patch introduces a new method which is used to log into the guest
>> through the guest serial console. The serial_mode must be set to
>> "session" in order to make use of this patch.
>>     
>
> In what cases would we want to use this feature?  The serial console is
> not supported by all guests and I'm not sure it supports multiple
> concurrent sessions (does it?), so it's probably not possible to use it
> reliably as a replacement for the regular remote shell servers, or even
> as an alternative variant.
>
>   
We plan to push some network related tests in the next few weeks, so 
it's important to use a serial based console rather than network based 
one ( our test s may load/unload the nic driver, do the stress testing 
which may cause the session created by remote_login() not responsible)
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>> ---
>>  client/tests/kvm/kvm_vm.py |   25 +++++++++++++++++++++++++
>>  1 files changed, 25 insertions(+), 0 deletions(-)
>>
>> diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
>> index 0cdf925..a22893b 100755
>> --- a/client/tests/kvm/kvm_vm.py
>> +++ b/client/tests/kvm/kvm_vm.py
>> @@ -814,7 +814,32 @@ class VM:
>>                                                              "command", ""))
>>          return session
>>  
>> +    def local_login(self, timeout=240):
>> +        """
>> +        Log into the guest via serial console
>> +        If timeout expires while waiting for output from the guest (e.g. a
>> +        password prompt or a shell prompt) -- fail.
>> +        """
>> +
>> +        serial_mode = self.params.get("serial_mode")
>> +        username = self.params.get("username", "")
>> +        password = self.params.get("password", "")
>> +        prompt = self.params.get("shell_prompt", "[\#\$]")
>> +        linesep = eval("'%s'" % self.params.get("shell_linesep", r"\n"))
>>  
>> +        if serial_mode != "session":
>> +            logging.debug("serial_mode is not session")
>> +            return None
>> +        else:
>> +            command = "nc -U %s"  % self.serial_file_name
>> +            assist = self.params.get("prompt_assist")
>> +            session = kvm_utils.remote_login(command, password, prompt, linesep,
>> +                                             timeout, "", username)
>>     
>                                                          ^
> You probably meant to pass the prompt assist string to remote_login()
> but instead you're passing "".
>
>   
As I said, I just send a empty line in order to get the the prompt 
string, but this may be removed if I logout the console during when 
close the session.
>> +            if session:
>> +                session.set_status_test_command(self.params.get("status_test_"
>> +                                                                "command", ""))
>> +            return session
>> +            
>>      def copy_files_to(self, local_path, remote_path, nic_index=0, timeout=300):
>>          """
>>          Transfer files to the guest.
>>
>> --
>> 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
>>     
>
> --
> 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
>   


  parent reply	other threads:[~2010-05-06  3:08 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-26 10:03 [PATCH 0/9] Make use of the redirection of guest serial Jason Wang
2010-04-26 10:03 ` [PATCH 1/9] KVM test: Introduce the prompt assist Jason Wang
2010-04-28 11:28   ` Michael Goldish
2010-05-06  2:55     ` Jason Wang
2010-05-06 15:18       ` Lucas Meneghel Rodrigues
2010-04-26 10:03 ` [PATCH 2/9] KVM test: Add the ability to send the username in remote_login() Jason Wang
2010-04-28 11:32   ` Michael Goldish
2010-04-26 10:03 ` [PATCH 3/9] KVM test: Make the login re suitable for serial console Jason Wang
2010-04-28 11:18   ` Michael Goldish
2010-05-06  2:57     ` Jason Wang
2010-04-26 10:03 ` [PATCH 4/9] KVM test: Redirect the serial to the unix domain socket Jason Wang
2010-04-26 10:04 ` [PATCH 5/9] KVM test: Log the content from guest serial console Jason Wang
2010-04-28 13:26   ` Michael Goldish
2010-05-06  3:03     ` Jason Wang
2010-04-26 10:04 ` [PATCH 6/9] KVM test: Raise error when met unknown type in kvm_vm.remote_login() Jason Wang
2010-05-06 15:15   ` [Autotest] " Lucas Meneghel Rodrigues
2010-04-26 10:04 ` [PATCH 7/9] KVM test: Introduce the local_login() Jason Wang
2010-04-28 12:01   ` Michael Goldish
2010-04-28 23:44     ` Amos Kong
     [not found]     ` <20100428234409.GA2738@akong@redhat.com>
2010-05-05  9:37       ` [Autotest] " Michael Goldish
2010-05-06  3:07     ` Jason Wang [this message]
2010-04-26 10:04 ` [PATCH 8/9] KVM test: Create the background threads before calling process() Jason Wang
2010-04-28 11:55   ` Michael Goldish
2010-05-06 15:35     ` [Autotest] " Lucas Meneghel Rodrigues
2010-04-26 10:04 ` [PATCH 9/9] KVM test: Redirect the console to serial for all linux guests Jason Wang
2010-04-28 12:24   ` Michael Goldish
2010-05-06  3:08     ` Jason Wang
2010-05-06 15:43       ` Lucas Meneghel Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BE2328B.9030509@redhat.com \
    --to=jasowang@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=lmr@redhat.com \
    --cc=mgoldish@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.