Releases: Rahix/tbot
Version 0.8.0
The machine interface was completely overhauled. Please read the migration
guide for more info.
Added
@tbot.with_lab
,@tbot.with_uboot
, and@tbot.with_linux
decorators to
make writing testcase much simplerlinux.RedirStdout(f)
&linux.RedirStderr(f)
: Redirect stdout and stderr symbolsMachine.init()
hook to call custom code after the machine was initialized.
This can be used, for example, to init network manually in U-Boot.tc.shell.check_for_tool()
testcasetbot.skip()
: Skip a testcaseMachine.clone()
: Attempt creating a copy of a machine. The two copies
allow parallel interaction with the same host.
Changed
-
linux.BuildMachine
is now a mixin calledlinux.Builder
-
linux.LabHost
is now a mixin calledlinux.Lab
-
linux.LinuxMachine
should be replaced bylinux.LinuxShell
-
LabHost.new_channel()
was removed in favor ofLinuxShell.open_channel()
.
open_channel()
consumes the machine it is called on which means the
equivalent tonew_channel()
now is:with mach.clone() as cl: chan = cl.open_channel("telnet", "192.0.2.1")
Removed
exec0(stdout=f)
: Redirection should be done usingRedirStdout
.linux.Env(var)
: Environment-Variable substitution is hard to control. It
is much easier to just usemach.env(var)
.
Fixed
Path.__fspath__()
erroneously returning a result, even though the contract
that is assumed with this method cannot be upheld by tbot.
Version 0.7.1
Added
tbot.acquire_local()
: Quick access to a localhost machineLinuxMachine.home
: Path to the current user's homeLocalLabHost.tbotdir
: tbot's current working directory on the localhost (either
from where you rantbot
or the path given with-C
)tbot.tc.kconfig
: Testcases for modifying a kernel config filelogin_delay
: Time to wait before logging in on the board. This should
allow working with boards that clobber the console a lot during boot.
Changed
- Unknown parameters are now ignored if running multiple testcases so
you can specify parameters that are just relevant to a single one. SSHMachine
s now useNoneAuthenticator
by default.
Fixed
selftest
s sometimes failing if dropbear does not start fast enoughSSHMachine
s using the local user's home dir instead of the one on the
lab-host.- Local channels now correctly end the session which fixes weird bugs like
picocom not being able to reaquire the shell.
Version 0.7.0
Added
- Read commandline arguments from files: You can now specify a file using
@filename
and each line from that file will be interpreted as a commandline
argument. - A man-page:
doc/tbot.1
! tbot.named_testcase
: Define testcases with a different name in log-files
than the function name. The motivation is to reduce name ambiguity
(e.g.uboot.build
andlinux.build
would both be calledbuild
in the
log). This also affects the testcases name when calling it from the
commandline (you have to use the new name).
Changed
-
The U-Boot build testcase has been completely rewritten. You will need to
adapt you board config to work with the new version:- The build-info no longer exists, instead you define a
UBootBuilder
. Take
a look at the docs to see available options. - The build attribute of your U-Boot machine must now be an instance of
yourUBootBuilder
, not the class itself.
Example of the new config:
from tbot.machine import board from tbot.tc import uboot class MyUBootBuilder(uboot.UBootBuilder): name = "my-builder" defconfig = "my_defconfig" toolchain = "generic-armv7a-hf" class MyUBootMachine(board.UBootMachine): ... build = MyUBootBuilder()
- The build-info no longer exists, instead you define a
Fixed
boot_to_shell
is no longer a public method ofBoardLinux
machines.
Version 0.6.6
Added
- Graphviz
dot
diagram generator - New and improved documentation!
LinuxMachine.fsroot
: A little convenience helper: You can now write
mach.fsroot / "proc/version"
instead oflinux.Path(mach, "/proc/version")
Changed
- tbot no longer automatically creates a log file. If you want
the previous behavior, use--log-auto
.--log=<file>
will
still behave as before. generators/generate_htmllog.py
->generators/htmllog.py
generators/debug_messages.py
->generators/messages.py
UBootMachine.env()
now also acceptsboard.Special
s.
Fixed
- Duplication warning when star-importing another testcase-file.
Version 0.6.5
Added
-
Machine.lh
: You can access the lab-host from every machine now. The idea
behind this is to allow access to lab-specific configuration in a much
easier way. -
mach.env()
can now be used to set environment variables as well:
env("name", "value")
-
-p
for setting testcase parameters. Provided values are parsed
usingeval
, so be careful ... Example:$ tbot -p int_param=42 -p boolean=True -p string=\'str\'
Changed
- You can now use
--log=
to suppress the creation of a log file.
Fixed
selftest_path_stat
assuming the existence of/dev/sda
, which makes
it fail on systems without this block device.- tbot will now only color its output if appropriate.
It honors CLICOLOR.
Version 0.6.4
Added
-C
parameter to allow setting a different working directory${TBOTPATH}
environment variable to provide additional testcase
directories;TBOTPATH
is a:
separated list of directorieauth.NoneAuthenticator
: Authenticator without key nor password, useful
if ssh can figure authentication out by itself (eg with ssh-agent)GitRepository.apply
: Apply patches without committing the changes
Changed
linux.shell
: Shells now have ashell.command
, which allows specifying
a command to run the shell. For example, bash is run usingbash --norc
now.
Fixed
- timeout in
read_until_prompt
sometimes being negative - log missing bootlog for U-Boot if no autoboot is configured
- tbot ignored ssh host aliases (ref #8)
Version 0.6.3
Added
tbot.log.warning
: Print a warning message- If tbot fails to load a testcase source, it will now show the
traceback that caused the failure
Changed
- Show any and all output that is received on the channel with
-vvv
BoardLinuxMachine
now allows the login and password prompts to
be clobberedBoardLinuxMachine
login now waits for the shell to respond
Removed
login_wait
config parameter fromBoardLinuxMachine
. This "hack"
is superseded by the more robust login implementation now.
Fixed
importlib.util
needs to be manually imported on some python versions
Version 0.6.2
Added
Machine.env
: Easily get the value of an environment variable- Allow specifying a command when spawning a subshell.
ub.bootlog
andlnx.bootlog
to allow accessing the bootlog (ref #5)- Add
SSHMachine.ssh_config
: List of additional ssh config options
Version 0.6.1
Added
- Proper buildhost support + U-Boot build testcase
GitRepository
now fetches latest changes from remote by defaultLinuxMachine.subshell
: Spawn subshell to isolate context changes
Changed
- Allow setting
autoboot_prompt
toNone
, if the board automatically drops
into a U-Boot shell. - Testcase directories are now traversed recurively
SSHLabHost
now attempts to use values from~/.ssh/config
if available.SSHMachine
: Use labhost's username by default
Version 0.6.0
Version 0.6.0 is finally here! It is a complete rewrite so none of the old
stuff is relevant any more. The changelog below is not everything that was
changed, but the changes since the last prerelease (0.6.0-pre08
).
Added
mach.test()
to just check the return code of a commandlinux.F
,board.F
: Formatter with TBot supportmax
parameter forChannel.recv()
recv_n
method forChannel
to read exactly N bytesignore_hostkey
inSSHLabHost
console_check
hook to prevent racey board connections
from multiple developersLinuxWithUBootMachine.do_boot
for a more flexible
boot_commands
definition
Changed
- Improved testrun end handling
- Made
SSHMachine
more userfriendly; now shows ssh errors in log - Made
shell
mandatory forBoardLinux
machines
Fixed
shell.copy
sometimes not respectingignore_hostkey
flagshell.copy
relying on an ugly hack that breaks on some python versionsVerbosity
being in the wrong format in log events