public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py
@ 2010-10-20  6:55 Feng Yang
  2010-10-20  9:11 ` Michael Goldish
  2010-10-27 20:26 ` Lucas Meneghel Rodrigues
  0 siblings, 2 replies; 7+ messages in thread
From: Feng Yang @ 2010-10-20  6:55 UTC (permalink / raw)
  To: autotest; +Cc: kvm

If a connection and stdin are idle for more than timeout seconds,
then the connection is silently closed. withou this paramter,
nc will listen forever for a connection. This may cause our test
hang. redmine issue:
http://redmine.englab.nay.redhat.com/issues/show/6947
Add -w parameter should fix this issue.

Signed-off-by: Feng Yang <fyang@redhat.com>
---
 client/tests/kvm/kvm_utils.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index a51c857..526d38d 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -733,7 +733,7 @@ def remote_login(client, host, port, username, password, prompt, linesep="\n",
     elif client == "telnet":
         cmd = "telnet -l %s %s %s" % (username, host, port)
     elif client == "nc":
-        cmd = "nc %s %s" % (host, port)
+        cmd = "nc %s %s -w %s" % (host, port, timeout)
     else:
         logging.error("Unknown remote shell client: %s" % client)
         return
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py
  2010-10-20  6:55 Feng Yang
@ 2010-10-20  9:11 ` Michael Goldish
  2010-10-27 20:26 ` Lucas Meneghel Rodrigues
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Goldish @ 2010-10-20  9:11 UTC (permalink / raw)
  To: Feng Yang; +Cc: autotest, kvm

On 10/20/2010 08:55 AM, Feng Yang wrote:
> If a connection and stdin are idle for more than timeout seconds,
> then the connection is silently closed. withou this paramter,
> nc will listen forever for a connection. This may cause our test
> hang. redmine issue:
> http://redmine.englab.nay.redhat.com/issues/show/6947
> Add -w parameter should fix this issue.
> 
> Signed-off-by: Feng Yang <fyang@redhat.com>
> ---
>  client/tests/kvm/kvm_utils.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
> index a51c857..526d38d 100644
> --- a/client/tests/kvm/kvm_utils.py
> +++ b/client/tests/kvm/kvm_utils.py
> @@ -733,7 +733,7 @@ def remote_login(client, host, port, username, password, prompt, linesep="\n",
>      elif client == "telnet":
>          cmd = "telnet -l %s %s %s" % (username, host, port)
>      elif client == "nc":
> -        cmd = "nc %s %s" % (host, port)
> +        cmd = "nc %s %s -w %s" % (host, port, timeout)
>      else:
>          logging.error("Unknown remote shell client: %s" % client)
>          return

I don't understand how remote_login() can stall here.
kvm_utils._remote_login() doesn't rely on nc's self-termination.  If no
shell prompt is available after 10 seconds, nc is forcefully terminated
and _remote_login() fails.  If it somehow stalls this might indicate a
bug somewhere.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py
       [not found] <692004637.996981287569640055.JavaMail.root@zmail04.collab.prod.int.phx2.redhat.com>
@ 2010-10-20 10:18 ` Feng Yang
  2010-10-20 10:48   ` Michael Goldish
  0 siblings, 1 reply; 7+ messages in thread
From: Feng Yang @ 2010-10-20 10:18 UTC (permalink / raw)
  To: Michael Goldish; +Cc: autotest, kvm


----- "Michael Goldish" <mgoldish@redhat.com> wrote:

> From: "Michael Goldish" <mgoldish@redhat.com>
> To: "Feng Yang" <fyang@redhat.com>
> Cc: autotest@test.kernel.org, kvm@vger.kernel.org
> Sent: Wednesday, October 20, 2010 5:11:32 PM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi
> Subject: Re: [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py
>
> On 10/20/2010 08:55 AM, Feng Yang wrote:
> > If a connection and stdin are idle for more than timeout seconds,
> > then the connection is silently closed. withou this paramter,
> > nc will listen forever for a connection. This may cause our test
> > hang. redmine issue:
> > http://redmine.englab.nay.redhat.com/issues/show/6947
> > Add -w parameter should fix this issue.
> > 
> > Signed-off-by: Feng Yang <fyang@redhat.com>
> > ---
> >  client/tests/kvm/kvm_utils.py |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/client/tests/kvm/kvm_utils.py
> b/client/tests/kvm/kvm_utils.py
> > index a51c857..526d38d 100644
> > --- a/client/tests/kvm/kvm_utils.py
> > +++ b/client/tests/kvm/kvm_utils.py
> > @@ -733,7 +733,7 @@ def remote_login(client, host, port, username,
> password, prompt, linesep="\n",
> >      elif client == "telnet":
> >          cmd = "telnet -l %s %s %s" % (username, host, port)
> >      elif client == "nc":
> > -        cmd = "nc %s %s" % (host, port)
> > +        cmd = "nc %s %s -w %s" % (host, port, timeout)
> >      else:
> >          logging.error("Unknown remote shell client: %s" % client)
> >          return
> 
> I don't understand how remote_login() can stall here.
> kvm_utils._remote_login() doesn't rely on nc's self-termination.  If
> no
> shell prompt is available after 10 seconds, nc is forcefully
> terminated
> and _remote_login() fails.  If it somehow stalls this might indicate
> a
> bug somewhere.
It is really rarely reproduce. Only meet this issue when guest panic or core dump.
nc stall. Do not know why it is not terminated after 10s.

I think -w parameter is helpful in this situation.
If it does not cause other issue,  we'd better add -w in nc command.

Thanks for your command. What do you think?

Feng Yang

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py
  2010-10-20 10:18 ` Feng Yang
@ 2010-10-20 10:48   ` Michael Goldish
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Goldish @ 2010-10-20 10:48 UTC (permalink / raw)
  To: Feng Yang; +Cc: autotest, kvm

On 10/20/2010 12:18 PM, Feng Yang wrote:
> 
> ----- "Michael Goldish" <mgoldish@redhat.com> wrote:
> 
>> From: "Michael Goldish" <mgoldish@redhat.com>
>> To: "Feng Yang" <fyang@redhat.com>
>> Cc: autotest@test.kernel.org, kvm@vger.kernel.org
>> Sent: Wednesday, October 20, 2010 5:11:32 PM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi
>> Subject: Re: [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py
>>
>> On 10/20/2010 08:55 AM, Feng Yang wrote:
>>> If a connection and stdin are idle for more than timeout seconds,
>>> then the connection is silently closed. withou this paramter,
>>> nc will listen forever for a connection. This may cause our test
>>> hang. redmine issue:
>>> http://redmine.englab.nay.redhat.com/issues/show/6947
>>> Add -w parameter should fix this issue.
>>>
>>> Signed-off-by: Feng Yang <fyang@redhat.com>
>>> ---
>>>  client/tests/kvm/kvm_utils.py |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/client/tests/kvm/kvm_utils.py
>> b/client/tests/kvm/kvm_utils.py
>>> index a51c857..526d38d 100644
>>> --- a/client/tests/kvm/kvm_utils.py
>>> +++ b/client/tests/kvm/kvm_utils.py
>>> @@ -733,7 +733,7 @@ def remote_login(client, host, port, username,
>> password, prompt, linesep="\n",
>>>      elif client == "telnet":
>>>          cmd = "telnet -l %s %s %s" % (username, host, port)
>>>      elif client == "nc":
>>> -        cmd = "nc %s %s" % (host, port)
>>> +        cmd = "nc %s %s -w %s" % (host, port, timeout)
>>>      else:
>>>          logging.error("Unknown remote shell client: %s" % client)
>>>          return
>>
>> I don't understand how remote_login() can stall here.
>> kvm_utils._remote_login() doesn't rely on nc's self-termination.  If
>> no
>> shell prompt is available after 10 seconds, nc is forcefully
>> terminated
>> and _remote_login() fails.  If it somehow stalls this might indicate
>> a
>> bug somewhere.
> It is really rarely reproduce. Only meet this issue when guest panic or core dump.
> nc stall. Do not know why it is not terminated after 10s.
> 
> I think -w parameter is helpful in this situation.
> If it does not cause other issue,  we'd better add -w in nc command.
> 
> Thanks for your command. What do you think?
> 
> Feng Yang

Adding -w 10 may cause trouble.  If a good functional session is idle
for more than 10 seconds during a test, it will be closed.  For example,
if you run a command that takes more than 10 seconds to complete, and
produces no output while it runs, the session will be closed.

Also, I doubt it'll solve the problem you've experienced.  As it is, the
code should (and usually does) properly handle the case of nc not
terminating.

If you manage to reproduce this again please save the log so I can have
a look at it.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py
       [not found] <816063419.1092631287625722129.JavaMail.root@zmail04.collab.prod.int.phx2.redhat.com>
@ 2010-10-21  1:57 ` Feng Yang
  2010-10-21  7:38   ` Michael Goldish
  0 siblings, 1 reply; 7+ messages in thread
From: Feng Yang @ 2010-10-21  1:57 UTC (permalink / raw)
  To: Michael Goldish; +Cc: autotest, kvm


----- "Michael Goldish" <mgoldish@redhat.com> wrote:

> From: "Michael Goldish" <mgoldish@redhat.com>
> To: "Feng Yang" <fyang@redhat.com>
> Cc: autotest@test.kernel.org, kvm@vger.kernel.org
> Sent: Wednesday, October 20, 2010 6:48:42 PM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi
> Subject: Re: [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py
>
> On 10/20/2010 12:18 PM, Feng Yang wrote:
> > 
> > ----- "Michael Goldish" <mgoldish@redhat.com> wrote:
> > 
> >> From: "Michael Goldish" <mgoldish@redhat.com>
> >> To: "Feng Yang" <fyang@redhat.com>
> >> Cc: autotest@test.kernel.org, kvm@vger.kernel.org
> >> Sent: Wednesday, October 20, 2010 5:11:32 PM GMT +08:00 Beijing /
> Chongqing / Hong Kong / Urumqi
> >> Subject: Re: [PATCH] KVM Test: add -w parameter in nc command in
> kvm_utils.py
> >>
> >> On 10/20/2010 08:55 AM, Feng Yang wrote:
> >>> If a connection and stdin are idle for more than timeout seconds,
> >>> then the connection is silently closed. withou this paramter,
> >>> nc will listen forever for a connection. This may cause our test
> >>> hang. redmine issue:
> >>> http://redmine.englab.nay.redhat.com/issues/show/6947
> >>> Add -w parameter should fix this issue.
> >>>
> >>> Signed-off-by: Feng Yang <fyang@redhat.com>
> >>> ---
> >>>  client/tests/kvm/kvm_utils.py |    2 +-
> >>>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>>
> >>> diff --git a/client/tests/kvm/kvm_utils.py
> >> b/client/tests/kvm/kvm_utils.py
> >>> index a51c857..526d38d 100644
> >>> --- a/client/tests/kvm/kvm_utils.py
> >>> +++ b/client/tests/kvm/kvm_utils.py
> >>> @@ -733,7 +733,7 @@ def remote_login(client, host, port,
> username,
> >> password, prompt, linesep="\n",
> >>>      elif client == "telnet":
> >>>          cmd = "telnet -l %s %s %s" % (username, host, port)
> >>>      elif client == "nc":
> >>> -        cmd = "nc %s %s" % (host, port)
> >>> +        cmd = "nc %s %s -w %s" % (host, port, timeout)
> >>>      else:
> >>>          logging.error("Unknown remote shell client: %s" %
> client)
> >>>          return
> >>
> >> I don't understand how remote_login() can stall here.
> >> kvm_utils._remote_login() doesn't rely on nc's self-termination. 
> If
> >> no
> >> shell prompt is available after 10 seconds, nc is forcefully
> >> terminated
> >> and _remote_login() fails.  If it somehow stalls this might
> indicate
> >> a
> >> bug somewhere.
> > It is really rarely reproduce. Only meet this issue when guest panic
> or core dump.
> > nc stall. Do not know why it is not terminated after 10s.
> > 
> > I think -w parameter is helpful in this situation.
> > If it does not cause other issue,  we'd better add -w in nc
> command.
> > 
> > Thanks for your command. What do you think?
> > 
> > Feng Yang
> 
> Adding -w 10 may cause trouble.  If a good functional session is idle
> for more than 10 seconds during a test, it will be closed.  For
> example,
> if you run a command that takes more than 10 seconds to complete, and
> produces no output while it runs, the session will be closed.
Seems the session also will be closed in our current code in this situation.
If no output for 10s, _remote_login() will return False. Then session will be closed in remote_login().

I have run some cases, it works well.  But I think we'd better first post this code, in case it really cause trouble.

I will do more test on it.

> 
> Also, I doubt it'll solve the problem you've experienced.  As it is,
> the
> code should (and usually does) properly handle the case of nc not
> terminating.
> 
> If you manage to reproduce this again please save the log so I can
> have
> a look at it.

When meet this issue again, I will send log to you. Thanks for your help!

Feng Yang



> --
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py
  2010-10-21  1:57 ` [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py Feng Yang
@ 2010-10-21  7:38   ` Michael Goldish
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Goldish @ 2010-10-21  7:38 UTC (permalink / raw)
  To: Feng Yang; +Cc: autotest, kvm

On 10/21/2010 03:57 AM, Feng Yang wrote:
> 
> ----- "Michael Goldish" <mgoldish@redhat.com> wrote:
> 
>> From: "Michael Goldish" <mgoldish@redhat.com>
>> To: "Feng Yang" <fyang@redhat.com>
>> Cc: autotest@test.kernel.org, kvm@vger.kernel.org
>> Sent: Wednesday, October 20, 2010 6:48:42 PM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi
>> Subject: Re: [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py
>>
>> On 10/20/2010 12:18 PM, Feng Yang wrote:
>>>
>>> ----- "Michael Goldish" <mgoldish@redhat.com> wrote:
>>>
>>>> From: "Michael Goldish" <mgoldish@redhat.com>
>>>> To: "Feng Yang" <fyang@redhat.com>
>>>> Cc: autotest@test.kernel.org, kvm@vger.kernel.org
>>>> Sent: Wednesday, October 20, 2010 5:11:32 PM GMT +08:00 Beijing /
>> Chongqing / Hong Kong / Urumqi
>>>> Subject: Re: [PATCH] KVM Test: add -w parameter in nc command in
>> kvm_utils.py
>>>>
>>>> On 10/20/2010 08:55 AM, Feng Yang wrote:
>>>>> If a connection and stdin are idle for more than timeout seconds,
>>>>> then the connection is silently closed. withou this paramter,
>>>>> nc will listen forever for a connection. This may cause our test
>>>>> hang. redmine issue:
>>>>> http://redmine.englab.nay.redhat.com/issues/show/6947
>>>>> Add -w parameter should fix this issue.
>>>>>
>>>>> Signed-off-by: Feng Yang <fyang@redhat.com>
>>>>> ---
>>>>>  client/tests/kvm/kvm_utils.py |    2 +-
>>>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>>>
>>>>> diff --git a/client/tests/kvm/kvm_utils.py
>>>> b/client/tests/kvm/kvm_utils.py
>>>>> index a51c857..526d38d 100644
>>>>> --- a/client/tests/kvm/kvm_utils.py
>>>>> +++ b/client/tests/kvm/kvm_utils.py
>>>>> @@ -733,7 +733,7 @@ def remote_login(client, host, port,
>> username,
>>>> password, prompt, linesep="\n",
>>>>>      elif client == "telnet":
>>>>>          cmd = "telnet -l %s %s %s" % (username, host, port)
>>>>>      elif client == "nc":
>>>>> -        cmd = "nc %s %s" % (host, port)
>>>>> +        cmd = "nc %s %s -w %s" % (host, port, timeout)
>>>>>      else:
>>>>>          logging.error("Unknown remote shell client: %s" %
>> client)
>>>>>          return
>>>>
>>>> I don't understand how remote_login() can stall here.
>>>> kvm_utils._remote_login() doesn't rely on nc's self-termination. 
>> If
>>>> no
>>>> shell prompt is available after 10 seconds, nc is forcefully
>>>> terminated
>>>> and _remote_login() fails.  If it somehow stalls this might
>> indicate
>>>> a
>>>> bug somewhere.
>>> It is really rarely reproduce. Only meet this issue when guest panic
>> or core dump.
>>> nc stall. Do not know why it is not terminated after 10s.
>>>
>>> I think -w parameter is helpful in this situation.
>>> If it does not cause other issue,  we'd better add -w in nc
>> command.
>>>
>>> Thanks for your command. What do you think?
>>>
>>> Feng Yang
>>
>> Adding -w 10 may cause trouble.  If a good functional session is idle
>> for more than 10 seconds during a test, it will be closed.  For
>> example,
>> if you run a command that takes more than 10 seconds to complete, and
>> produces no output while it runs, the session will be closed.
> Seems the session also will be closed in our current code in this situation.
> If no output for 10s, _remote_login() will return False. Then session will be closed in remote_login().

If the login process takes more than 10s, yes, the session will be
closed.  However, if we use -w 10, the session will be closed whenever
it becomes idle, not just during login.  So if we login successfully and
then run a test (e.g. an autoit script), after 10s of no output the test
will be terminated.

> I have run some cases, it works well.  But I think we'd better first post this code, in case it really cause trouble.
> 
> I will do more test on it.
> 
>>
>> Also, I doubt it'll solve the problem you've experienced.  As it is,
>> the
>> code should (and usually does) properly handle the case of nc not
>> terminating.
>>
>> If you manage to reproduce this again please save the log so I can
>> have
>> a look at it.
> 
> When meet this issue again, I will send log to you. Thanks for your help!
> 
> Feng Yang
> 
> 
> 
>> --
>> 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py
  2010-10-20  6:55 Feng Yang
  2010-10-20  9:11 ` Michael Goldish
@ 2010-10-27 20:26 ` Lucas Meneghel Rodrigues
  1 sibling, 0 replies; 7+ messages in thread
From: Lucas Meneghel Rodrigues @ 2010-10-27 20:26 UTC (permalink / raw)
  To: Feng Yang; +Cc: autotest, kvm

On Wed, 2010-10-20 at 14:55 +0800, Feng Yang wrote:
> If a connection and stdin are idle for more than timeout seconds,
> then the connection is silently closed. withou this paramter,
> nc will listen forever for a connection. This may cause our test
> hang. redmine issue:
> http://redmine.englab.nay.redhat.com/issues/show/6947
> Add -w parameter should fix this issue.

Feng, for reasons already explained by Michael, I'll drop this patch
from the queue and not apply it, OK?

Thanks!

> Signed-off-by: Feng Yang <fyang@redhat.com>
> ---
>  client/tests/kvm/kvm_utils.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
> index a51c857..526d38d 100644
> --- a/client/tests/kvm/kvm_utils.py
> +++ b/client/tests/kvm/kvm_utils.py
> @@ -733,7 +733,7 @@ def remote_login(client, host, port, username, password, prompt, linesep="\n",
>      elif client == "telnet":
>          cmd = "telnet -l %s %s %s" % (username, host, port)
>      elif client == "nc":
> -        cmd = "nc %s %s" % (host, port)
> +        cmd = "nc %s %s -w %s" % (host, port, timeout)
>      else:
>          logging.error("Unknown remote shell client: %s" % client)
>          return

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-10-27 20:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <816063419.1092631287625722129.JavaMail.root@zmail04.collab.prod.int.phx2.redhat.com>
2010-10-21  1:57 ` [PATCH] KVM Test: add -w parameter in nc command in kvm_utils.py Feng Yang
2010-10-21  7:38   ` Michael Goldish
     [not found] <692004637.996981287569640055.JavaMail.root@zmail04.collab.prod.int.phx2.redhat.com>
2010-10-20 10:18 ` Feng Yang
2010-10-20 10:48   ` Michael Goldish
2010-10-20  6:55 Feng Yang
2010-10-20  9:11 ` Michael Goldish
2010-10-27 20:26 ` Lucas Meneghel Rodrigues

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox