[tbot] Testcase example with board reboot
hs at denx.de
Thu Nov 29 05:09:42 UTC 2018
Am 28.11.2018 um 18:01 schrieb Harald Seiler:
> Hi Stefano,
> On Wed, 2018-11-28 at 17:39 +0100, Stefano Babic wrote:
>> is there an example where a testcase foresees a reboot ? Let's say, I
>> acquire the board (linux), I do something on the board (ok, I update)
>> and then I reboot again - after reboot I will check again.
>> Of course, until "reboot" is the standard way. Should I get a new context ?
>> with contextlib.ExitStack() as cx:
>> if mach is None:
>> lh = cx.enter_context(tbot.acquire_lab())
>> b = cx.enter_context(tbot.acquire_board(lh))
>> lnx = cx.enter_context(tbot.acquire_linux(b))
>> lnx = mach
>> ......doing somethin
> To reboot, you have to reenter the board context. In that case, having a `mach`
> parameter is not a good idea, because the powercontrol should happen completely
> inside your testcase.
> An example can be found here:
> Note the outer context for the lab-host, which is not restarted and the inner
> context for the board, which is destructed and rebuild again to reboot the
> board (using a powercycle).
If you are interested in the bootlog, it is saved in
> Hope this helps,
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: hs at denx.de
More information about the tbot