Commit graph

6 commits

Author SHA1 Message Date
Lucas Tamborrino d65b6bc199 twister: add flash-before option
Add option to flash board before attach serial.

Current implementation performs the following sequence:

1. Open serial port to listen to board log output
2. Flash device

In case of ESP32 where it uses the same serial port
for both operations, flashing needs to come first.

This PR adds a twister option named --flash-before
which enables the process above, allowing tests to be
performed properly.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-03-25 18:37:49 -04:00
Dmitrii Golovanov f31aab58d5 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>
2023-04-08 18:37:33 +02:00
Fabio Baltieri 5c32300861 yamllint: fix all yamllint truthy errors
Fix all thruthy errors detected by yamllint:

yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
  grep '(truthy)'

This only accepts true/false for boolean properties. Seems like python
takes all sort of formats:

https://github.com/yaml/pyyaml/blob/master/lib/yaml/constructor.py#L224-L235

But the current specs only mention "true" or "false"

https://yaml.org/spec/1.2.2/#10212-boolean

Which is the standard yamllint config.

Excluding codeconv and workflow files, as some are using yes/no instead
in the respective documentation.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 01:16:45 +09:00
Enjia Mai 4966de2014 twister: add a hardware map support for using serial pty
The hardware map feature can be used with serial pty mode in
this change. And also add an runner_params option for passing
more parameters from hardware map file to west runner. Note
that you need to create this map file manually because it
cannot be scanned out correctly due to pty is not a physical
HW device existing in system.

And also update doc/develop/test/twister.rst for the usage.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-05-11 05:54:23 -04:00
Dennis Ruffer c714c78743 twister: Allow baud rates other than 115200
Fixes #38046
Document the changes in twister.rst
Add baud rate to debug message in twister
Add baud parameter to twister's add_device function
Set the twister baud rate from input parameters
Use 115200 as the default baud rate if not specified
Add baud to the hwmap-schema.yaml file
Add --device-serial-baud to twister arguments
Fix compliance issues
Fix mistake in parameter name from device-baud to device-serial-baud
Refactoring of the code in orded to simplify the logic
   and clear multiple definitions of the default baud rate.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Signed-off-by: Dennis Ruffer <daruffer@gmail.com>
2021-10-14 16:35:48 -04:00
Anas Nashif c24bf6f183 sanitycheck: move schemas to scripts/schemas
Move yaml schemas into one single location. We have quite a few schema
used across the tree, one common place will make them easier to find and
reference.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-11 14:13:02 -05:00
Renamed from scripts/sanity_chk/hwmap-schema.yaml (Browse further)