From: Michael Goldish Subject: Re: [AUTOTEST]telnet login fails in win2k8 DC 64. here are debug and other info Date: Tue, 4 Aug 2009 07:31:56 -0400 (EDT) Message-ID: <1926117875.1425631249385516954.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> References: <1176266579.1425541249385385191.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: Lucas Meneghel Rodrigues , Ryan Harper , kvm-devel To: sudhir kumar Return-path: Received: from mx1.redhat.com ([66.187.233.31]:41480 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753802AbZHDLcH convert rfc822-to-8bit (ORCPT ); Tue, 4 Aug 2009 07:32:07 -0400 In-Reply-To: <1176266579.1425541249385385191.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Maybe the problem is related to how you implemented TAP support in your tree. You're obviously not using user mode networking because the guest's IP address is 10.0.99.100. I'm not sure exactly what the problem is, so can you print the connection command in remote_login()? Add something like 'print "COMMAND: " + command' at the top of the function, and that might help us figure out what's wrong. ----- Original Message ----- =46rom: "sudhir kumar" To: "Michael Goldish" Cc: "Lucas Meneghel Rodrigues" , "Ryan Harper" , "kvm-devel" Sent: Tuesday, August 4, 2009 9:43:42 AM (GMT+0200) Auto-Detected Subject: Re: [AUTOTEST]telnet login fails in win2k8 DC 64. here are deb= ug and other info =46or making it more clear here are the timoeout debug prints 14:31:04 INFO | ('DEBUG: timeout in read_until_output_matches =3D%d', 3= 0) 14:31:04 INFO | ('DEBUG: internal_timeout in read_until_output_matches =3D%d', 3.5) {sorry with little syntax typo :( } On Tue, Aug 4, 2009 at 12:12 PM, sudhir kumar wrot= e: > On Tue, Aug 4, 2009 at 11:23 AM, Michael Goldish= wrote: >> Looks like there really are only 3 lines to read. >> Telnet is printing those lines, not windows. It's just indicating >> that it successfully connected. Windows is saying nothing. >> >> This is a little weird, because: >> - It can happen when the telnet server isn't running at all, >> =C2=A0but it seemed to be running fine when you connected manually. >> - It can happen when trying to connect to the wrong port, but I >> =C2=A0see you set the port to 23. >> >> It can also happen due to the short default timeout of 10 seconds. >> Windows can take longer than that to send something. > My manual observation also says that it does not take that much. >> Are you sure you increased the timeout? You only sent a log of 4 > I increased the timeout and did not send the complete log. here are > the start and end of the complete log > > 12:26:44 INFO | Waiting for guest to be up... > 12:26:44 INFO | DEBUG: in ssh_login ssh_prompt =3D C:\Users\Administr= ator> > 12:26:44 INFO | DEBUG: in ssh_login timeout =3D 20 > 12:26:47 INFO | DEBUG: Printing data read by read_nonblocking from ou= tput: > 12:26:47 INFO | DEBUG: data read from output is Trying 10.0.99.100... > 12:26:47 INFO | telnet: connect to address 10.0.99.100: No route to h= ost > 12:26:47 INFO | telnet: Unable to connect to remote host: No route to= host > > > > 12:30:48 INFO | DEBUG: Printing accumulated data read from output don= e. > 12:30:48 INFO | DEBUG: Printing data after filter: > 12:30:48 INFO | DEBUG: filtered data is Escape character is '^]'. > 12:30:48 INFO | DEBUG: Printing data after filter done: > 12:30:50 ERROR| Test failed: Could not log into guest > > >> seconds (starting at 12:27:25). How long does >> read_until_output_matches() wait before it gives up? > > Here is the complete code flow with parameters. > in kvm_tests.py > =C2=A0 =C2=A0session =3D kvm_utils.wait_for(vm.ssh_login, 240, 0, 2) > which calls in kvm_utils.py > =C2=A0 =C2=A0 =C2=A0 =C2=A0output =3D func() > This calls ssh_login() in kvm_vm.py with default parameters and the > default def is changed to have timeout 20 second instead of 10 > seconds. > =C2=A0 =C2=A0def ssh_login(self, timeout=3D20): > This calls the telnet which calls remote_login() in kvm_utils.py > =C2=A0 =C2=A0 =C2=A0 =C2=A0if use_telnet: > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0session =3D kvm_utils.telnet= (address, port, username, password, > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 prompt,= timeout) > So timeout is 20 now. This calls remote_login > =C2=A0 =C2=A0return remote_login(command, password, prompt, "\r\n", t= imeout) > PS: A dumb Question: Does "\r\n" have to do something with the failur= e ? > So timeout is still 20. The next call is > =C2=A0 =C2=A0while True: > =C2=A0 =C2=A0 =C2=A0 =C2=A0(match, text) =3D sub.read_until_last_line= _matches( > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[r"[Aa]re you = sure", r"[Pp]assword:\s*$", r"^\s*[Ll]ogin:\s*$", > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 r"[Cc]onnecti= on.*closed", r"[Cc]onnection.*refused", prompt], > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 timeout=3Dtim= eout, internal_timeout=3D3.5) > which calls to > =C2=A0 =C2=A0 =C2=A0 =C2=A0return self.read_until_output_matches(patt= erns, self.get_last_line, > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0timeout, internal_timeout, > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0print_func) > > Hence this function waits for 20 seconds in each try. i think that is > good enough. > > In my manual observation there is no delay between the above all the > lines printed. So this should not be an issue. I can bet that there i= s > not even a delay of 2 secs between these two lines: > =C2=A0Escape character is '^]'. > =C2=A0Welcome to Microsoft Telnet Service > > But yes there is a very small delay(looks < 1 second), which should b= e > taken care by increased internal_timeout which i have increased to > around 3 seconds. > >> >> ----- Original Message ----- >> From: "sudhir kumar" >> To: "kvm-devel" >> Cc: "Lucas Meneghel Rodrigues" , "Michael Goldi= sh" , "Ryan Harper" >> Sent: Tuesday, August 4, 2009 8:06:32 AM (GMT+0200) Auto-Detected >> Subject: [AUTOTEST]telnet login fails in win2k8 DC 64. here are debu= g and =C2=A0other info >> >> Hi, >> I am seeing a telnet failure in autotest to a win2k8 DC 64 bit guest= =2E >> I have tried some debugging and came to a conclusion that >> read_nonblocking() is reading only 3 lines. let me first print the >> output of manual login >> >> =C2=A0# telnet -l Administrator 10.0.99.100 23 >> Trying 10.0.99.100... >> Connected to ichigo-dom100.linuxperf9025.net (10.0.99.100). >> Escape character is '^]'. >> Welcome to Microsoft Telnet Service >> >> password: >> >> *=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 >> Microsoft Telnet Server. >> *=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 >> C:\Users\Administrator> >> >> Now autotest only reads the first 3 lines(upto Escape.....). It seem= s >> windows is doing something nasty here. I have put some debug prints = in >> the code and here is the output. let me first put the code snippet >> from kvm_utils.py with added debug prints. >> >> =C2=A0 =C2=A0def read_until_output_matches(self, patterns, filter=3D= lambda(x):x, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0timeout=3D30.0, intern= al_timeout=3D3.0, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print_func=3DNone): >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0end_time =3D time.time() + timeout >> =C2=A0 =C2=A0 =C2=A0 =C2=A0while time.time() < end_time: >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Read data from child >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0newdata =3D self.read_nonbl= ocking(internal_timeout) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print("DEBUG: Printing data= read by read_nonblocking from output:") >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print("DEBUG: data read fro= m output is %s" % newdata) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print("DEBUG: Printing data= read by read_nonblocking from >> output done.") >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Print it if necessary >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if print_func and newdata: >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0map(print_fun= c, newdata.splitlines()) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0data +=3D newdata >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print("DEBUG: Printing accu= mulated data read from output:") >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print("DEBUG: accumulated d= ata read from output is %s" % data) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print("DEBUG: Printing accu= mulated data read from output done.") >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0done =3D False >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Look for patterns >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print("DEBUG: Printing data= after filter:") >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print("DEBUG: filtered data= is %s" % filter(data)) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print("DEBUG: Printing data= after filter done:") >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match =3D self.match_patter= ns(filter(data), patterns) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if match !=3D None: >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0done =3D True >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Check if child has died >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if self.poll() !=3D None: >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0logging.debug= ("Process terminated with status %d", self.poll()) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0done =3D True >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Are we done? >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if done: break >> >> >> Here is the output once the guest comes up. >> >> 12:27:25 INFO | DEBUG: Printing data read by read_nonblocking from o= utput: >> 12:27:25 INFO | DEBUG: data read from output is Trying 10.0.99.100..= =2E >> 12:27:25 INFO | Connected to ichigo-dom100.linuxperf9025.net (10.0.9= 9.100). >> 12:27:25 INFO | Escape character is '^]'. >> 12:27:25 INFO | >> 12:27:25 INFO | DEBUG: Printing data read by read_nonblocking from o= utput done. >> 12:27:25 INFO | DEBUG: Printing accumulated data read from output: >> 12:27:25 INFO | DEBUG: accumulated data read from output is Trying >> 10.0.99.100... >> 12:27:25 INFO | Connected to ichigo-dom100.linuxperf9025.net (10.0.9= 9.100). >> 12:27:25 INFO | Escape character is '^]'. >> 12:27:25 INFO | >> 12:27:25 INFO | DEBUG: Printing accumulated data read from output do= ne. >> 12:27:25 INFO | DEBUG: Printing data after filter: >> 12:27:25 INFO | DEBUG: filtered data is Escape character is '^]'. >> 12:27:25 INFO | DEBUG: Printing data after filter done: >> 12:27:29 INFO | DEBUG: Printing data read by read_nonblocking from o= utput: >> 12:27:29 INFO | DEBUG: data read from output is >> 12:27:29 INFO | DEBUG: Printing data read by read_nonblocking from o= utput done. >> 12:27:29 INFO | DEBUG: Printing accumulated data read from output: >> 12:27:29 INFO | DEBUG: accumulated data read from output is Trying >> 10.0.99.100... >> 12:27:29 INFO | Connected to ichigo-dom100.linuxperf9025.net (10.0.9= 9.100). >> 12:27:29 INFO | Escape character is '^]'. >> 12:27:29 INFO | >> 12:27:29 INFO | DEBUG: Printing accumulated data read from output do= ne. >> 12:27:29 INFO | DEBUG: Printing data after filter: >> 12:27:29 INFO | DEBUG: filtered data is Escape character is '^]'. >> 12:27:29 INFO | DEBUG: Printing data after filter done: >> >> and so on... timeout elapses and test fails. >> >> I am not able to find out why read_nonblocking() is reading only 3 >> lines. I have tried increasing the timeouts and internal_timeouts as >> well. But no luck. >> >> Here is how my kvm_tests.cfg looks like. >> # colorful prompt, so migration_test_command will fail, try with tel= net >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ssh_prompt =3D= "C:\Users\Administrator>" >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ssh_port =3D = 23 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0use_telnet =3D= yes >> Any clues ? >> >> -- >> Sudhir Kumar >> > > > > -- > Sudhir Kumar > --=20 Sudhir Kumar