Bug 10826

Summary: issue with the telnet output ,when telnet commands are executed pexpect module
Product: Busybox Reporter: Rajesh Dasari <raajeshdasari>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: major CC: busybox-cvs
Priority: P5    
Version: 1.27.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Rajesh Dasari 2018-03-01 09:13:45 UTC
we are using busybox v1.27.2 version.

I am executing the telnet command from pexpect spawned object. 

telnet_obj=pexpect.spawn('telnet NODE')

telnet_obj.sendline("mycommand")
telnet_obj.expect('NODE#', timeout = 30)

actual command flow is like below
NODE#mycommand 

-some output-
NODE#

when i execute "mycommand" ,o/p will be printed and then NODE# will be seen after the output.

what we expect to be present in the pexpect buffers, when the command is executed is like below

-some output-
NODE#
 but what we see in the pexpect buffers is 

NODE#mycommand
-some output-
NODE#

we are noticing the prompt and "mycommand" in the pexpect output buffers, with the busybox telnet.

I tested with the telnet binary from inetutils with the same NODE and pexpect versions, this worked as expected i.e we didn't see NODE#mycommand in the buffers.

Please let me know what is the cause for this behaviour and how to fix this .
Comment 1 Denys Vlasenko 2018-03-04 22:30:30 UTC
I don't know what pexpect is.

"o/p will be printed" - what is "o/p"?

stracing both telnets will show the difference.