Re: [Autotest] [KVM-AUTOTEST PATCH 1/6] KVM test: kvm_subprocess: use read_nonblocking(0) instead of read_nonblocking (0.1)

2009-10-05 Thread Lucas Meneghel Rodrigues
Patchset applied!

On Tue, Sep 29, 2009 at 5:04 PM, Michael Goldish  wrote:
> In get_command_status_output() and is_responsive() use read_nonblocking(0) to
> read the unread output before sending input (e.g. a command).
> The timeout is currently 0.1 because theoretically it should help if the guest
> still produces output when the function is called, but in practice there's no
> guarantee that a value of 0.1 will suffice.  Therefore, it is be the user's
> responsibility to make sure the guest stopped producing output before
> get_command_status_output() is called.  This can be guaranteed (in most cases)
> by using get_command_status_output() and friends instead of sendline() to send
> commands (because the former waits for the prompt to return, whereas the 
> latter
> returns immediately).
>
> Signed-off-by: Michael Goldish 
> ---
>  client/tests/kvm/kvm_subprocess.py |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/client/tests/kvm/kvm_subprocess.py 
> b/client/tests/kvm/kvm_subprocess.py
> index 424c801..730f20e 100755
> --- a/client/tests/kvm/kvm_subprocess.py
> +++ b/client/tests/kvm/kvm_subprocess.py
> @@ -1028,7 +1028,7 @@ class kvm_shell_session(kvm_expect):
>         """
>         # Read all output that's waiting to be read, to make sure the output
>         # we read next is in response to the newline sent
> -        self.read_nonblocking(timeout=0.1)
> +        self.read_nonblocking(timeout=0)
>         # Send a newline
>         self.sendline()
>         # Wait up to timeout seconds for some output from the child
> @@ -1095,7 +1095,7 @@ class kvm_shell_session(kvm_expect):
>         logging.debug("Sending command: %s" % command)
>
>         # Read everything that's waiting to be read
> -        self.read_nonblocking(0.1)
> +        self.read_nonblocking(timeout=0)
>
>         # Send the command and get its output
>         self.sendline(command)
> --
> 1.5.4.1
>
> ___
> Autotest mailing list
> autot...@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>



-- 
Lucas
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[KVM-AUTOTEST PATCH 1/6] KVM test: kvm_subprocess: use read_nonblocking(0) instead of read_nonblocking (0.1)

2009-09-29 Thread Michael Goldish
In get_command_status_output() and is_responsive() use read_nonblocking(0) to
read the unread output before sending input (e.g. a command).
The timeout is currently 0.1 because theoretically it should help if the guest
still produces output when the function is called, but in practice there's no
guarantee that a value of 0.1 will suffice.  Therefore, it is be the user's
responsibility to make sure the guest stopped producing output before
get_command_status_output() is called.  This can be guaranteed (in most cases)
by using get_command_status_output() and friends instead of sendline() to send
commands (because the former waits for the prompt to return, whereas the latter
returns immediately).

Signed-off-by: Michael Goldish 
---
 client/tests/kvm/kvm_subprocess.py |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/tests/kvm/kvm_subprocess.py 
b/client/tests/kvm/kvm_subprocess.py
index 424c801..730f20e 100755
--- a/client/tests/kvm/kvm_subprocess.py
+++ b/client/tests/kvm/kvm_subprocess.py
@@ -1028,7 +1028,7 @@ class kvm_shell_session(kvm_expect):
 """
 # Read all output that's waiting to be read, to make sure the output
 # we read next is in response to the newline sent
-self.read_nonblocking(timeout=0.1)
+self.read_nonblocking(timeout=0)
 # Send a newline
 self.sendline()
 # Wait up to timeout seconds for some output from the child
@@ -1095,7 +1095,7 @@ class kvm_shell_session(kvm_expect):
 logging.debug("Sending command: %s" % command)
 
 # Read everything that's waiting to be read
-self.read_nonblocking(0.1)
+self.read_nonblocking(timeout=0)
 
 # Send the command and get its output
 self.sendline(command)
-- 
1.5.4.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html