Hi Tim,
Following up in a slightly different style to Neil... :-)
On Tue, Jun 19, 2018 at 12:27:26PM +0000, Tim Jaacks wrote:
I have two cases in which I need to reboot my device during tests:
OK. This *can* be problematic, depending on the device - as Neil says. However, if your device and bootloader play nicely then it's perfectly possible. You can define multiple boot: and test: blocks in your test job to do this.
Reboot is active part of the test (e.g. store some persistent settings,
reboot, check if persistent settings are correctly loaded after reboot)
OK, so you'd need one deploy block, then:
boot: # first boot block do stuff test: # first test block do stuff store settings # maybe call sync, etc. - hard reboot coming
# After this test action block, LAVA will look for another block to # execute...
# At the beginning of the next boot action block, LAVA will # automatically power-cycle the board
boot: # second boot block catch the bootloader messages and boot into the system again test: # second test block check the settings were stored ok
Reboot is triggered and has to be evaluated (e.g. activate watchdog,
stop resetting it, wait, check if system reboots automatically)
This is more difficult, I'm afraid - LAVA doesn't (yet!) have support for this kind of thing. While you might *try* something like the following:
boot: # first boot block do stuff test: # first test block do stuff enable watchdog # maybe write a file as a flag for a later test block to know # we've done this? sleep N # longer than the watchdog timeout boot: # second boot block catch the bootloader messages and boot into the system again test: # second test block do stuff # maybe check for the flag file and say "watchdog test successful"?
I'm afraid at the moment this isn't going to work - at the end of the first test block, LAVA will still be waiting for the test shell prompt and won't pick up on the next boot messages. It'll time out and fail. If you try to hack around that (e.g. with a short timeout on the first test block), LAVA will then do a hard power-cycle like in your first test case - this won't be actually testing your watchdog. We're looking at adding soft reboots in between action blocks for this kind of test requirement, but it's not there yet.
Cheers,