[tbot] How to debug acquire_linux

Stefano Babic sbabic at denx.de
Fri Nov 23 09:02:05 UTC 2018


Hi Harald,

On 23/11/18 09:48, Harald Seiler wrote:
> Hi Stefano,
> 
> On Thu, 2018-11-22 at 23:47 +0100, Stefano Babic wrote:
>> Hi,
>>
>> On 22/11/18 19:24, Stefano Babic wrote:
>>> Hi,
>>>
>>> I have a board that cannot be got in linux. It looks like that
>>> tbot.acquire_linux() hangs forever (can I set a tiimeout ?)
>>>
>>> I ran a testcase that works fine for another board - I guess that the
>>> issue is due to the fact that this board has a lot of output in part
>>> caused by systemd and in part due to kernel messages that are printed to
>>> the console. When I start the testcase, tbot remains in <board>-linux. I
>>> can understand that board is up and works because software activates
>>> some relays, but it is not recognized by tbot.
>>>
>>> The weird thing is that "interactive_linux" works. How can I debug this
>>> ? Or do we have to block kernel messages to the console via kernel
>>> parameter ?
>>>
>>
>> I have some more details. The not working board has "bash" as shell and
>> TERM is set to "xterm". Running tbot with -vvv, after "root" as user,
>> the bord answers with some terminal control characters. It looks like
>> that tbot gets confused. If I replace "bash" with "busybox", it works.
> 
> Hmm, can you send me the output of -vvv? The only cases I know don't
> work is when something is sent after the password prompt or once the
> shell comes up ...
> 

Ouch..I have already done, but I see that the ML was removed in the
answer. I attach Heiko's answer, too.

The thing is:

   ├─'login: '
│   │    <> CCU-1 login: root
│   ├─'root\n\x1b7\x1b[r\x1b[999;999H\x1b[6n'
│   ├─'\x1b'
│   ├─'8'
│   ├─'root at CCU-1:~'
│   ├─'# '

So there are some control characters (I have not decoded them) just if
the target runs the bash shell. With busybox, it works and tbot completes.


> You could try defining `login_wait`[1] in your BoardLinuxMachine
> and see if that helps ...

This does not help, I have already tried.

IMHO the login should be done more resistant - I proposed to try to send
some CR in a loop to check if login was successful in my previous mail.

> 
>> The second not working case seems if the board prints some data on the
>> console after the login propt is sent. This is the case when a daemon
>> has the stdout set to the console. Also in this case, it seems that tbot
>> gets confused.
> 
> Yes, this is an open issue:
> 
> 	https://github.com/Rahix/tbot/issues/1
> 
> I don't know how we best handle this case ... Do you have any ideas?

I think there are more use cases. One is the kernel messages. Kernel
messages can be turned off at boot time with loglevel=0 (but they can be
read via dmesg). This is a suitable way.

My use case is an application (SWUpdate) in a small system (rescue
system). It makes sense to redirect application stdout to the console,
becaus a rescue does not have many options. It should at least possible
to login and to collect the output, while a testcase will push an image
from network (and then, there is no exec on the board).

Regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
-------------- next part --------------
An embedded message was scrubbed...
From: Heiko Schocher <hs at denx.de>
Subject: Re: [tbot] How to debug acquire_linux
Date: Fri, 23 Nov 2018 07:29:08 +0100
Size: 5641
URL: <http://lists.denx.de/pipermail/tbot/attachments/20181123/ade6f385/attachment-0002.eml>
-------------- next part --------------
An embedded message was scrubbed...
From: Stefano Babic <sbabic at denx.de>
Subject: Re: [tbot] How to debug acquire_linux
Date: Fri, 23 Nov 2018 09:10:35 +0100
Size: 7598
URL: <http://lists.denx.de/pipermail/tbot/attachments/20181123/ade6f385/attachment-0003.eml>


More information about the tbot mailing list