Closed jneuhauser closed 1 year ago
(I am aware of the CI failures, ignore them for now. I'll dig into it and let you know once I've fixed it in master
so you can rebase.)
Do you think something similar to the
copy_if_outdated()
would be useful for you or not?
We also have boards that don't have ethernet and so no ssh/scp is possible.
It could definitely be useful for my use case in the future, but currently the function shown above wouldn't do it for me since copy()
doesn't have support for serial console transfer yet.
However, I have already planned to extend copy() to support serial console transmission so that I can simplify my downstream implementation of copy_if_outdated()
.
However, I have already planned to extend copy() to support serial console transmission
Yeah, I always wanted that as well. However, I ran into so many things I want to do before that(tm) that I didn't reach it yet. So maybe I can share my thoughts here:
Of course the easiest implementation is actually quite straight forward:
content = file_src.read_bytes()
file_dest.write_bytes(content)
This implementation has a few problems, though:
base64
utility available which surprisingly isn't the case for a lot of embedded Linux systems. So I want to extend {read,write}_bytes()
to fall back to other tools when base64
is missing. I do not yet know which alternative tools would be the best options here, though.{read,write}_bytes()
don't produce completely ugly terminal output but it still isn't pleasant when you don't care about the contents. Ideally, we would hide the output from the two commands when running under copy()
. A facility for that exists now, in the form of tbot.log.with_verbosity()
. Ideally, I wanted to overhaul the entire logging first, but I think that helper is a good enough start for now.On that note, I just pushed 4d385785c249 ("log: Add only_decrease parameter to with_verbosity()") which may be useful for my point 2.
Hello @Rahix,
we have some test cases where we use
hashcmp()
excessively to ensure the device under test is in shape. Add the parameteruse_cache
, which defaults toFalse
, for optional cached results.In the same test, we use check_for_tool() to determine if some executables/scripts need to be deployed first, but since the result of
check_for_tool()
is cached, we still always getFalse
fromcheck_for_tool()
after a successful deployment. Add the parameteruse_cache
, which defaults toTrue
, to optionally disable cached results.I have implemented the default values for
use_cache
to keep the old behavior ofcheck_for_tool()
andhashcmp()
.Greets, Johann