twister: Add configurable flashing timeout

Use explicit flash command execution timeout at DeviceHandler
instead of the hardcoded value of 60 sec.

When a HW platform executes test cases right after the flash command,
the test case remaining timeout is affected by how much time the flash
operation consumes. Some simulation platforms need to spend significant
amount of time on each 'flash' cycle, usually adding the same delay on
each test case.

This improvement adds two new command line options and device map fields:

  --device-flash-timeout - for the flash operation timeout
  ('flash-timeout' device map field).

  --device-flash-with-test - to indicate that the platform flash
  command also runs a test case, so the overall timeout should be
  calculated as a sum of the flash timeout and the current test case
  timeout to receive all console output from the platform
  ('flash-with-test' device map field).

The device map field values override command line values for the
particular platform where configured.

Default behavior is backward compatible: flash operation fixed timeout
is 60 sec. not including the test case timeout.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
This commit is contained in:
Dmitrii Golovanov 2023-04-03 10:24:46 +02:00 committed by Carles Cufí
commit f31aab58d5
5 changed files with 62 additions and 11 deletions

View file

@ -55,3 +55,9 @@ sequence:
required: false
sequence:
- type: str
"flash_timeout":
type: int
required: false
"flash_with_test":
type: bool
required: false