ubootdriver: optionally strip timestamps #1816
Open
+11
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some U-Boot configurations may prepend timestamps to the beginning of every line during early boot, and at the prompt, e.g.:
|[ 2.397] Failed to get fastboot key config: -19
|[ 2.402] sdh@d4280000: 74 clk wait timeout(100)
|[ 2.405] MMC: no card present
|[ 2.408] mmc_init: -123, time 7
|[ 2.412] Net: RGMII interface
|[ 2.414] eth0: ethernet@cac80000
|[ 2.420] Autoboot in 5 seconds
|=>
|=> [ 4.878]
|=> [ 5.920]
|=> [ 503.743] d
|=> [ 505.712]
Unfortunately, this means that strategies may not behave as expected when trying to run commands, as labgrid's console.expect() function will always find the timestamp in addition to the check strings it sends. Handle this by adding the
strip_timestampsboolean option for UBootDriver, which (if enabled) strips any timestamps found prepended to output lines.Test results with tox:
================================================================================================== 363 passed, 41 skipped, 231 warnings in 195.01s (0:03:15) ==================================================================================================
py39: SKIP (0.17 seconds)
py310: SKIP (0.01 seconds)
py311: SKIP (0.01 seconds)
py312: SKIP (0.01 seconds)
py313: SKIP (0.36 seconds)
py314: OK (211.12=setup[15.06]+cmd[196.06] seconds)
congratulations :) (211.71 seconds)
Checklist