When using cdba to bisect for intermittent issues related to boot
lockups or crashes taking us to download mode it's only useful to
power-cycle on success (as a failure case shows the intermittent
problem).
Add a special version of the existing power cycle code, that stops the
power cycling loop if a timeout criteria is hit, cutting down on
unnecessary reboots of a broken kernel.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Specifying -t means that inactivity timeout should be disabled,
regardless of the value. Specifying either -t 0 or -T 0 will set timeout
to 0, which means no timeout, regardless of timeout_on_inactivity.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reverse the logic of inactivity timeout so that by default we set
inactivity timeout to 600s. Passing -T 0 disables inactivity timeout
completely.
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
In addition to have a fixed timeout (-t) introduce a new inactivity
timeout (-T) which allow us to provide a shorter timeout to quickly
abort when the kernel fails to boot but still allow us to run lengthy
test scripts without getting a timeout.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Make the exit code non-zero when the cdba for some reason failed, to
allow tools calling cdba to differentiate the various scenarios.
There is still some tuning needed here, but for now we exit with error
code 110 if we reached a timeout, 1 if there was an error and 0 if we
either exited by user request or by hitting the power-off token.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
In the event that cdba is launched from e.g. a cron job stdin won't be a
tty and as such we can't modify the termios settings.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Support specifying a timeout -t in order to limit the execution time of
stalling test runs.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Register the stdin pipe with the write fdset in order to know when it's
appropriate to send commands over the pipe.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>