* [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid file uncomplete during scp file from host to VM @ 2016-12-16 6:53 Yao Lei 2016-12-19 2:50 ` Liu, Yong 0 siblings, 1 reply; 6+ messages in thread From: Yao Lei @ 2016-12-16 6:53 UTC (permalink / raw) To: dts; +Cc: lei yao From: lei yao <lei.a.yao@intel.com> Signed-off-by: lei yao <lei.a.yao@intel.com> --- framework/ssh_pexpect.py | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py index d5b6616..09095a1 100644 --- a/framework/ssh_pexpect.py +++ b/framework/ssh_pexpect.py @@ -185,6 +185,7 @@ class SSHPexpect(object): if i == 1: time.sleep(0.5) p.sendline(password) + time.sleep(10) p.expect("100%", 60) if i == 4: self.logger.error("SCP TIMEOUT error %d" % i) -- 2.7.4 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid file uncomplete during scp file from host to VM 2016-12-16 6:53 [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid file uncomplete during scp file from host to VM Yao Lei @ 2016-12-19 2:50 ` Liu, Yong 2016-12-19 3:15 ` Yao, Lei A 0 siblings, 1 reply; 6+ messages in thread From: Liu, Yong @ 2016-12-19 2:50 UTC (permalink / raw) To: Yao, Lei A, dts; +Cc: Yao, Lei A Hi Lei, One question for why added the dealy. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yao Lei > Sent: Friday, December 16, 2016 2:54 PM > To: dts@dpdk.org > Cc: Yao, Lei A > Subject: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid file > uncomplete during scp file from host to VM > > From: lei yao <lei.a.yao@intel.com> > > Signed-off-by: lei yao <lei.a.yao@intel.com> > --- > framework/ssh_pexpect.py | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py > index d5b6616..09095a1 100644 > --- a/framework/ssh_pexpect.py > +++ b/framework/ssh_pexpect.py > @@ -185,6 +185,7 @@ class SSHPexpect(object): > if i == 1: > time.sleep(0.5) > p.sendline(password) > + time.sleep(10) > p.expect("100%", 60) Expect function has been already wait for about one minute, look like there's no need to add more time. > if i == 4: > self.logger.error("SCP TIMEOUT error %d" % i) > -- > 2.7.4 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid file uncomplete during scp file from host to VM 2016-12-19 2:50 ` Liu, Yong @ 2016-12-19 3:15 ` Yao, Lei A 2016-12-19 3:24 ` Liu, Yong 0 siblings, 1 reply; 6+ messages in thread From: Yao, Lei A @ 2016-12-19 3:15 UTC (permalink / raw) To: Liu, Yong, dts Hi, Yong See my comments. Thanks. > -----Original Message----- > From: Liu, Yong > Sent: Monday, December 19, 2016 10:50 AM > To: Yao, Lei A <lei.a.yao@intel.com>; dts@dpdk.org > Cc: Yao, Lei A <lei.a.yao@intel.com> > Subject: RE: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid > file uncomplete during scp file from host to VM > > Hi Lei, > One question for why added the dealy. > > > -----Original Message----- > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yao Lei > > Sent: Friday, December 16, 2016 2:54 PM > > To: dts@dpdk.org > > Cc: Yao, Lei A > > Subject: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid > file > > uncomplete during scp file from host to VM > > > > From: lei yao <lei.a.yao@intel.com> > > > > Signed-off-by: lei yao <lei.a.yao@intel.com> > > --- > > framework/ssh_pexpect.py | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py > > index d5b6616..09095a1 100644 > > --- a/framework/ssh_pexpect.py > > +++ b/framework/ssh_pexpect.py > > @@ -185,6 +185,7 @@ class SSHPexpect(object): > > if i == 1: > > time.sleep(0.5) > > p.sendline(password) > > + time.sleep(10) > > p.expect("100%", 60) > Expect function has been already wait for about one minute, look like there's > no need to add more time. This timeout is used before sending the ssh cmd. Not waiting time. During virtualization test, we find the file will always be corrupted when scp dpdk.tar.gz from host to vm. Wait 10s after ssh connection set up , then send scp cmd will resolve this failure. > > > if i == 4: > > self.logger.error("SCP TIMEOUT error %d" % i) > > -- > > 2.7.4 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid file uncomplete during scp file from host to VM 2016-12-19 3:15 ` Yao, Lei A @ 2016-12-19 3:24 ` Liu, Yong 2016-12-19 3:30 ` Yao, Lei A 0 siblings, 1 reply; 6+ messages in thread From: Liu, Yong @ 2016-12-19 3:24 UTC (permalink / raw) To: Yao, Lei A, dts > > > diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py > > > index d5b6616..09095a1 100644 > > > --- a/framework/ssh_pexpect.py > > > +++ b/framework/ssh_pexpect.py > > > @@ -185,6 +185,7 @@ class SSHPexpect(object): > > > if i == 1: > > > time.sleep(0.5) > > > p.sendline(password) > > > + time.sleep(10) > > > p.expect("100%", 60) > > Expect function has been already wait for about one minute, look like > there's > > no need to add more time. > This timeout is used before sending the ssh cmd. Not waiting time. During > virtualization test, we find the file will always be corrupted when scp > dpdk.tar.gz from host to vm. Wait 10s after ssh connection set up , then > send scp cmd will resolve this failure. The sleep command is after "password" message, so I think connection between VM and host machine has been created and worked. What I wonder is that why file is corrupted after "100%" hint. Either expect worked abnormally or some issues we haven't figured out. Thanks, Marvin ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid file uncomplete during scp file from host to VM 2016-12-19 3:24 ` Liu, Yong @ 2016-12-19 3:30 ` Yao, Lei A 2016-12-19 3:50 ` Liu, Yong 0 siblings, 1 reply; 6+ messages in thread From: Yao, Lei A @ 2016-12-19 3:30 UTC (permalink / raw) To: Liu, Yong, dts > -----Original Message----- > From: Liu, Yong > Sent: Monday, December 19, 2016 11:25 AM > To: Yao, Lei A <lei.a.yao@intel.com>; dts@dpdk.org > Subject: RE: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid > file uncomplete during scp file from host to VM > > > > > diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py > > > > index d5b6616..09095a1 100644 > > > > --- a/framework/ssh_pexpect.py > > > > +++ b/framework/ssh_pexpect.py > > > > @@ -185,6 +185,7 @@ class SSHPexpect(object): > > > > if i == 1: > > > > time.sleep(0.5) > > > > p.sendline(password) > > > > + time.sleep(10) > > > > p.expect("100%", 60) > > > Expect function has been already wait for about one minute, look like > > there's > > > no need to add more time. > > This timeout is used before sending the ssh cmd. Not waiting time. During > > virtualization test, we find the file will always be corrupted when scp > > dpdk.tar.gz from host to vm. Wait 10s after ssh connection set up , then > > send scp cmd will resolve this failure. > > The sleep command is after "password" message, so I think connection > between VM and host machine has been created and worked. > What I wonder is that why file is corrupted after "100%" hint. Either expect > worked abnormally or some issues we haven't figured out. > I can't find out the root cause at my side. This issue can't reproduced manually because human will always wait 2~3 seconds after ssh connection set up , then send scp cmd. Also can't reproduced by pdb. This patch is just the practice experience which can avoid this error. > > Thanks, > Marvin ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid file uncomplete during scp file from host to VM 2016-12-19 3:30 ` Yao, Lei A @ 2016-12-19 3:50 ` Liu, Yong 0 siblings, 0 replies; 6+ messages in thread From: Liu, Yong @ 2016-12-19 3:50 UTC (permalink / raw) To: Yao, Lei A, dts Lei, please try again. We need to know the difference between normal connection and vm connection. > -----Original Message----- > From: Yao, Lei A > Sent: Monday, December 19, 2016 11:30 AM > To: Liu, Yong; dts@dpdk.org > Subject: RE: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid > file uncomplete during scp file from host to VM > > > > > -----Original Message----- > > From: Liu, Yong > > Sent: Monday, December 19, 2016 11:25 AM > > To: Yao, Lei A <lei.a.yao@intel.com>; dts@dpdk.org > > Subject: RE: [dts] [PATCH V1] framework ssh_pexpect: add timeout to > avoid > > file uncomplete during scp file from host to VM > > > > > > > diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py > > > > > index d5b6616..09095a1 100644 > > > > > --- a/framework/ssh_pexpect.py > > > > > +++ b/framework/ssh_pexpect.py > > > > > @@ -185,6 +185,7 @@ class SSHPexpect(object): > > > > > if i == 1: > > > > > time.sleep(0.5) > > > > > p.sendline(password) > > > > > + time.sleep(10) > > > > > p.expect("100%", 60) > > > > Expect function has been already wait for about one minute, look > like > > > there's > > > > no need to add more time. > > > This timeout is used before sending the ssh cmd. Not waiting time. > During > > > virtualization test, we find the file will always be corrupted when > scp > > > dpdk.tar.gz from host to vm. Wait 10s after ssh connection set up , > then > > > send scp cmd will resolve this failure. > > > > The sleep command is after "password" message, so I think connection > > between VM and host machine has been created and worked. > > What I wonder is that why file is corrupted after "100%" hint. Either > expect > > worked abnormally or some issues we haven't figured out. > > > I can't find out the root cause at my side. This issue can't reproduced > manually because human will always wait 2~3 seconds after ssh connection > set up , then send scp cmd. Also can't reproduced by pdb. This patch is > just the practice experience which can avoid this error. > > You can try with pdb the function expect_loop which can find in /usr/lib/python2.7/dist-packages/pexpect/__init__.py. When "index >= 0" happened, file should transferred normally. If file not transferred as expected, we need to know why. Thanks > > Thanks, > > Marvin ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-12-19 3:50 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-12-16 6:53 [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid file uncomplete during scp file from host to VM Yao Lei 2016-12-19 2:50 ` Liu, Yong 2016-12-19 3:15 ` Yao, Lei A 2016-12-19 3:24 ` Liu, Yong 2016-12-19 3:30 ` Yao, Lei A 2016-12-19 3:50 ` Liu, Yong
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).