Skip to content

Releases: Rahix/tbot

Version 0.8.0

20 Nov 10:52
v0.8.0
c3e0a01
Compare
Choose a tag to compare

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 simpler
  • linux.RedirStdout(f) & linux.RedirStderr(f): Redirect stdout and stderr symbols
  • Machine.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() testcase
  • tbot.skip(): Skip a testcase
  • Machine.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 called linux.Builder

  • linux.LabHost is now a mixin called linux.Lab

  • linux.LinuxMachine should be replaced by linux.LinuxShell

  • LabHost.new_channel() was removed in favor of LinuxShell.open_channel().
    open_channel() consumes the machine it is called on which means the
    equivalent to new_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 using RedirStdout.
  • linux.Env(var): Environment-Variable substitution is hard to control. It
    is much easier to just use mach.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

14 Mar 11:58
v0.7.1
cb0af55
Compare
Choose a tag to compare

Added

  • tbot.acquire_local(): Quick access to a localhost machine
  • LinuxMachine.home: Path to the current user's home
  • LocalLabHost.tbotdir: tbot's current working directory on the localhost (either
    from where you ran tbot or the path given with -C)
  • tbot.tc.kconfig: Testcases for modifying a kernel config file
  • login_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.
  • SSHMachines now use NoneAuthenticator by default.

Fixed

  • selftests sometimes failing if dropbear does not start fast enough
  • SSHMachines 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

08 Feb 12:01
v0.7.0
04c95de
Compare
Choose a tag to compare

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 and linux.build would both be called build 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
      your UBootBuilder, 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()

Fixed

  • boot_to_shell is no longer a public method of BoardLinux machines.

Version 0.6.6

18 Jan 09:51
v0.6.6
8e6a299
Compare
Choose a tag to compare

Added

  • Graphviz dot diagram generator
  • New and improved documentation!
  • LinuxMachine.fsroot: A little convenience helper: You can now write
    mach.fsroot / "proc/version" instead of linux.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 accepts board.Specials.

Fixed

  • Duplication warning when star-importing another testcase-file.

Version 0.6.5

20 Dec 10:31
v0.6.5
5f74540
Compare
Choose a tag to compare

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
    using eval, 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

05 Dec 08:41
v0.6.4
981af89
Compare
Choose a tag to compare

Added

  • -C parameter to allow setting a different working directory
  • ${TBOTPATH} environment variable to provide additional testcase
    directories; TBOTPATH is a : separated list of directorie
  • auth.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 a shell.command, which allows specifying
    a command to run the shell. For example, bash is run using bash --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

28 Nov 07:46
v0.6.3
2f0c003
Compare
Choose a tag to compare

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 clobbered
  • BoardLinuxMachine login now waits for the shell to respond

Removed

  • login_wait config parameter from BoardLinuxMachine. 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

22 Nov 12:03
v0.6.2
465a4e6
Compare
Choose a tag to compare

Added

  • Machine.env: Easily get the value of an environment variable
  • Allow specifying a command when spawning a subshell.
  • ub.bootlog and lnx.bootlog to allow accessing the bootlog (ref #5)
  • Add SSHMachine.ssh_config: List of additional ssh config options

Version 0.6.1

16 Nov 10:26
v0.6.1
14873e3
Compare
Choose a tag to compare

Added

  • Proper buildhost support + U-Boot build testcase
  • GitRepository now fetches latest changes from remote by default
  • LinuxMachine.subshell: Spawn subshell to isolate context changes

Changed

  • Allow setting autoboot_prompt to None, 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

16 Nov 10:25
v0.6.0
60f2699
Compare
Choose a tag to compare

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 command
  • linux.F, board.F: Formatter with TBot support
  • max parameter for Channel.recv()
  • recv_n method for Channel to read exactly N bytes
  • ignore_hostkey in SSHLabHost
  • console_check hook to prevent racey board connections
    from multiple developers
  • LinuxWithUBootMachine.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 for BoardLinux machines

Fixed

  • shell.copy sometimes not respecting ignore_hostkey flag
  • shell.copy relying on an ugly hack that breaks on some python versions
  • Verbosity being in the wrong format in log events