[tbot] Problem with Linux boot to prompt

Lukasz Majewski lukma at denx.de
Wed Jan 23 23:17:46 UTC 2019


Dear tbot users,

I'm trying now to boot into Linux prompt (the LinuxStandaloneMachine),
and then execute 'uname -a'

The idea is to use boot_to_shell, log in, and execute 'uname -a'
https://rahix.de/tbot/module-board.html#tbot.machine.board.LinuxStandaloneMachine.boot_to_shell

Test case:

@tbot.testcase
def linux_uname(
    lab: typing.Optional[linux.LabHost] = None,
    board_linux: typing.Optional[board.LinuxStandaloneMachine] = None,
) -> None:
    with contextlib.ExitStack() as cx:
        if board_linux is None:
            lh  = cx.enter_context(lab or tbot.acquire_lab())
            b   = cx.enter_context(tbot.acquire_board(lh))
            lnx = cx.enter_context(tbot.acquire_linux(b))
        else:
            lnx = board_linux

        lnx.boot_to_shell('root at display5:~# ')
        lnx.exec0("uname", "-a")

(For simplicity I'm using the Linux Standalone Machine).

The output of -vvv:

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

The 'root at display5:~# ' is sent to the "channel", but there is no
reaction on it (I'm using picocom -b 115200 /dev/ttyUSB0 to handle
serial console).
Do I need to use regexp here ?



A side question(s):
-------------------

1. Is it possible to return value from test case to make it fail?

For example - I do lnx.exec0() then do some work on text received and
on that basis I would like to make the test pass or fail. Similar use
case is with parsing 'dmesg' output.


2. Do we have any timeout of booting u-boot/kernel? 

A very common test case is to check if the board still boots after
update of SPL/u-boot/linux. I can hack some in-test case timeout (and
pass with -p the value), but maybe there is a better way?

(If anybody has such functionality, please share :-) )

Thanks in advance for your help.

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/tbot/attachments/20190124/73c464b5/attachment.sig>


More information about the tbot mailing list