Changelog

[Unreleased]

Fixed

  • kas_checkout runs kas-container checkout when the container is used, with the same credentials and environment as the build. Before it ran no kas checkout at all with the container, so the tbot flag kasupdate had nothing to act on and a build after a separate checkout built whatever the repos were left at. With unit tests.

Changed

  • KAS builds plain build targets that follow each other in buildtargets in one bitbake call instead of one call per target. A recipe whose task hash changes from call to call was built again in every call, so a bundle built in an earlier call carried an older copy of an image than the one deployed last. -c in a build target counts only as a word of its own, a target name like linux-cxx is no task option. With unit tests.

  • The dfu-util loader (tbot flag dfuutilloader) stops when a file of dfuutil_loader_steps does not exist on the lab host or dfu-util could not download it. Before, its return code was not looked at, so tbot went on and waited for a U-Boot that was never loaded. A return code other than 0 after “Download done.” still counts as success: the device leaves DFU mode once it starts what it got, and the status request after the download fails then. dfu-util runs under timeout, 30 s per step or the “timeout” of the step: dfu-util -w waits forever for a DFU device, also when the board is not in DFU boot mode. With unit tests.

  • generic_lnx_all returns False when one of its testcases failed, True otherwise. It still runs all of them and raises no exception, but a caller, e.g. a CI job, can now tell the result. With unit tests.

  • A boot command named in ub_env_bootcmd with an empty list selects no ub_env_<name> group. Before, [] meant the same as a boot command not named there, all groups, so a boot from the environment of the board alone could not be told apart. With unit tests.

Added

  • tbottest.tc.buildinfo: lnx_check_buildinfo reads /etc/buildinfo of image-buildinfo on the board and compares variables and layer revisions with the values handed in, so a test can tell it runs the build it is meant to test. A layer built from a modified checkout does not match. With unit tests.

  • KAS takes site.conf in the kas dictionary: lines written to build/conf/site.conf before every kas checkout and kas build, anew each time, for values that change from build to build such as an ID of the build. auto.conf is written once and kept. Left alone with kaskeepconfig. With unit tests.

  • A step of the dfu-util loader takes the device with the optional key d, <vid>:<pid> as for dfu-util -d, so dfu-util does not try other DFU devices of the lab host, e.g. a webcam. With unit tests.

  • tbot flag kasupdate passes --update to kas checkout, kas shell and kas build. Without it kas does not fetch a repo given by a branch once that branch is checked out, so a CI build of a feature branch kept building the commit it found from an earlier build. Ignored with kaskeepconfig. With unit tests.

  • scripts/registermap/mpc855_create_registermap.py makes the registermap of the PowerPC MPC855T from its user’s manual: the registers from Table 2-1, the fields from the field and bit description tables, with the bit numbering of the manual (bit 0 the most significant) turned into the one of the registermap. Its peripheral table is relative to the IMMR ("relative_to": "IMMR"), the base comes from REGISTERMAP(..., base=...), regdump.py --base or the new board key registermap_base. mpc855_registers.json is made that way, with 20 blocks, 161 registers and 677 fields.

  • generic_ub_dump_register dumps the registers of the key regdump in U-Boot with md.l, with the register map of the SoC the new board key socname names, into generic_registerdump_uboot.txt. U-Boot has no /proc/device-tree, and fdt addr would overwrite the variable fdtaddr, so without socname it is skipped. socname also takes the place of the detection in generic_lx_dump_register. Both share dump_registers().

  • generic_get_socname() recognises the AM335x by ti,am33xx in the compatible of the root of the device tree, as it has no /proc/device-tree/soc@0/compatible, so generic_lx_dump_register takes am335x_registers.json there.

  • scripts/registermap/am335x_create_registermap.py makes the registermap of the TI AM335x from its Technical Reference Manual (SPRUH73), as TI publishes no SVD file for it, and am335x_registers.json is made that way from SPRUH73L, with 63 instances of 40 modules, 1411 registers and 6518 fields, every register with page and chapter. The subsystems CPSW, USB and PRU-ICSS are not in it yet.

  • stm32_svd_create_registermap.py --rm takes page, chapter and the field descriptions from the reference manual (PDF, with stm32_rm_descriptions.py). The register is looked up in the table of contents of the PDF, by its name or by a name with an index letter (GPIOx_MODER for GPIOA_MODER), and the fields are taken from the “Bit n NAME: …” lines of its section. Headers and footers an older extraction left in descriptions taken over with -m are dropped. stm32mp157_registers.json is made with RM0436 now, with 15634 of the 17044 fields described and 3466 of the 3724 registers with a page.

  • scripts/registermap/stm32_svd_create_registermap.py makes the registermap of an STM32MP1 from the SVD file of ST and takes the bus of every peripheral and the descriptions and pages of an existing registermap of the reference manual over, register by register at the same address. stm32mp157_registers.json is made that way now, with 123 peripherals and 3724 registers instead of 9 registermaps, 514 of the registers with the texts of the reference manual. The register names are the ones of the SVD (CR1 of USART1, not USART_CR1), which matters for --regsfile of regdump.py. With unit tests.

  • The quick start recommends the JSON configuration (create_setup.sh --json) for a new setup.

  • An entry of lnx_commands may leave out "val" and only run its command, and may have "mode": "exec", then its return code does not matter, as for linux_init (lnx_check_cmd()). So commands that prepare the checks, such as stopping a service, fit in the same list.

  • board_lnx_cangen sends with cansequence of canutils when the sending machine has no cangen, e.g. a board with canutils of Pengutronix, so the direction board2lab of generic_lnx_test_cangen works there. Its frames have the fixed CAN ID 2 and one data byte, counted up, and there is no gap; check_cangen_log() takes the CAN ID as canid.

  • create_setup.sh writes a .gitignore into the setup directory if there is none, from the template tbottest/tbotconfig/gitignore. It keeps tbot/, tbottest/, log/, *.pyc and *.swp out of a git repository of the setup.

  • An entry of ub_env or of a group ub_env_<name> may have "append" or "remove" instead of "val", words added to or taken out of the value the U-Boot variable has on the board (ub_env_apply(), ub_env_edit()). Together with "flag", several flags can each add a word to the same variable, e.g. to optargs, what needed set_ub_board_specific() in boardspecific.py before.

  • Unit tests for the generic testcases of tc/generic_board.py, for the configuration a testcase reads, the calls it makes with it, the skip without its key and the counts of generic_lnx_all. The kas testcases are not covered yet.

  • generic_lnx_test_cangen, run by generic_lnx_all, runs board_lnx_cangen for every entry of the board configuration key cangen, from the lab host to the board and from the board to the lab host (cangen_config_calls()). An entry names the CAN interfaces of board and lab host (boarddev, labdev) and may restrict the directions.

  • generic_lnx_test_rs485, run by generic_lnx_all, runs board_lnx_rs485 once for every entry of the board configuration key rs485, whose keys are its parameters (rs485_config_kwargs()).

  • linux_safe_init_prompt in the board configuration, True by default, sets tbot’s safe_init_prompt, so the prompt is read with read_until_prompt_safe() while tbot sets up the linux shell.

  • Section TC_BOARDNAME.TESTCASENAME of the board configuration. While a testcase decorated with tc_config() or require_cfg() runs, a key is searched there first, then in TC_BOARDNAME and TC. There is deliberately no section TC_TESTCASENAME for all boards.

  • get_config_literal() reads a key as Python literal.

  • Configuration as JSON. tbot.json and BOARDNAME.json replace tbot.ini, BOARDNAME.ini and boardspecific.py when the flags inifile: and boardfile: name .json files. Values that depend on a run are expressions (${env:NAME}, ${flag:NAME}, ${lab:key}, ${tbot:SECTION:key}), which also work in ini files. An ub_env entry with "flag" is set only with that flag. generic_config_to_json writes a configuration as JSON, create_setup.sh --json sets one up.

  • Groups of the U-Boot environment (ub_env_<group>), selected with the flag ub_env: or by the boot command.

  • cmd_versions presets cmd_get_version() of tbot for the lab host, the build hosts and the board. The testcase generic_cmd_versions finds the versions out and installs missing packages with cmd_versions_install.

  • testdir, a directory for testcases on the build host, the lab host and the board.

  • Power control with a shell script, a GPIO, Tinkerforge, a Shelly device (ShellyControl), a tbox SYSTEM Controller Modul (TboxCtrlControl), a tbox lab host through hwdamon-dut-power (TboxHwdaemonControl) and the DH electronics TM-021 relay module. Console and power connector are detected from the configuration.

  • Console access with a script of your own (ScriptConnector) and with telnet (TelnetConnector). Picocom sends slowly with slow_send_delay and slow_send_chunksize, the kermit options are configurable.

  • Loading after power on with dfu-util and over the serial line (sb), and the Abatron BDI2000, which runs poweron_cmds after power on and selects its configuration file with configname:. tc/bdi2000.py opens a telnet session to the BDI2000.

  • More than one lab host (LABHOST_<name>, flag labname:), password login and a configurable ssh authenticator, board locking, the boot mode switched with sd-mux or a shell command, and a local build host (flag buildername:local). The lab init runs once per boot of the lab host, the ethernet setup once per board.

  • U-Boot without return codes (uboot_has_retcode), boards that log in automatically, linux_plain_prompt, and linux_netcmd to choose ip or ifconfig.

  • Testcases for process measurement with top and ps (with gnuplot), register dumps with register maps of NXP i.MX and STM32MP157 (and the standalone regdump tool), the generic linux tests with generic_lnx_all, iperf and ping, the unit tests of U-Boot, U-Boot builds with buildman, a boot counter, swupdate over the embedded web server, the watchdog, lnx_mtd_dump and the hello world build of a Yocto SDK. exec_check() and exec0_check() abort early on death strings.

  • kas with an interactive shell, --runtime-args, .netrc, auto.conf, bitbake targets, kas_build_dir, kas_mounts, a configurable deploy path and the flag kaskeepconfig.

  • create_setup.sh asks for console and power control with --inter, writes a setup.sh with aliases, copies the CI testcases only with --ci, checks out tbottest with -b or -c, takes tbot from the branch v0.10.10-emb of github.com/EmbLux-Kft/tbot and updates existing clones. completions.sh completes the testcases and the aliases.

  • newtbot_starter.py takes the paths from TBOTCONFIGPATH and TBOTTESTPATH and sets TBOT_STARTTIME for the argument files. generators/console.py shows a JSON log as tbot showed it on the console.

  • Documentation of every tbot flag, the Tips section, testcase parameters, the generic testcases and how to start them, and the pages CHANGELOG, CONTRIBUTING and LICENSE.

  • A pytest unit test suite with its own CI workflow, and pyproject.toml.

Changed

  • REGISTERMAP (registermap.py) takes the format of a registermap from its file instead of from the name of the SoC, so am335x_registers.json works without a code path of its own; a SoC name it did not know raised an error before.

  • check_yocto_build_install_sdk() starts the SDK installer as linux.Path instead of a path built as string.

  • lnx_create_random() takes a linux.Path as well as a string, and the RS485 test passes its paths as linux.Path instead of _local_str().

  • lnx_can_write_dump_compare() has no parameters lab and lnx any more. lab only decided whether to use sudo, lnx was not used.

  • board_setup_can() runs ip with lnx_sudo(), so with sudo unless the machine is logged in as root. Its parameter usesudo and sudo_exec0() of tc/can.py are gone, and lnx_can_write_dump_compare() no longer guesses from lab == lnxsend whether sudo is needed.

  • board_lnx_cangen checks the candump log itself, with the new check_cangen_log(), on the output of cat on the board. Nothing is copied to the lab host any more, so the parameters lab and labtbottestcasepath and tc/files/check_cangen_output.py are gone. It checks the number of frames, interface, CAN ID, data length and data, reports every difference and raises instead of stopping in an interactive shell. The transfer rate comes from the candump timestamps.

  • The generic testcases read their keys when they run, with the get_config*() methods of cfggeneric, so they find their own section. require_cfg() takes the name of the key. cfggeneric.kas_config(lab, bh) and cfggeneric.get_lnx_dump_files() replace cfg.kas and cfg.lnx_dump_files.

  • tbot is v0.10.10.

  • tbot.ini and the board configuration are read through the helpers of tbottest.initconfig, the board name comes from the flag boardname:, and boardspecific.py sits next to tbot.ini.

  • Configuration values are read with ast.literal_eval() instead of eval().

  • Commands that need root rights run without sudo when tbot is logged in as root.

  • GenericUBoot.exec() reads back the echo of the command line like tbot.

Fixed

  • KAS.kas_checkout() left an existing clone of the kas layer on the branch it was cloned with and only pulled it, so a changed kaslayerbranch was ignored, and a branch the remote does not have did not stop the build. It fetches kaslayerbranch now and checks it out, and fails if the fetch does. With unit tests.

  • scripts/registermap/regdump.py did not run without tbot, as importing tbottest.tc.registermap ran tbottest/__init__.py, which imports tbot, and it found tbottest only in a directory named tbottest. It takes the repository it is in now and loads the modules without the __init__.py of the packages. With unit tests.

  • create_setup.sh kept an existing setup.sh without a word when it had no aliases for the board just set up, e.g. one from an earlier run for another board, and printed aliases that did not exist. It still keeps it, but warns and prints the commands that write a setup.sh for the board.

  • Command line completion of tbottest testcases, e.g. $tbtc.generic_board.gen<TAB>, found nothing, because tbot looks a module up below the working directory, and in a setup made by create_setup.sh the package is tbottest/tbottest there. newtbot_completion.py, which newtbot_starter.py installs into tbot, looks it up through sys.path as an import does. completions.sh completes a variable name such as $tbtc without the space bash-completion adds, so the module path can follow.

  • board_lnx_cangen hung after cangen on a board with candump of canutils (Pengutronix), which ends on SIGTERM only when the next frame arrives; stop_candump() kills it after 2 seconds. Such a candump has no -L either: tbot’s cmd_get_version() reports it as canutils (candump_is_canutils()), and its log is checked without interface and without transfer rate, it has no timestamps. A sender without cangen (canutils has none) stops with an error naming the machine. candump and cangen are in TBOTTEST_COMMANDS now, with the Debian package can-utils for cmd_versions_install.

  • The check of board_lnx_cangen did not let the data counter wrap, so it failed after 256 frames with dllength=1; it compared the log with the board path on the lab host and copied it from a fixed IP address.

  • The default testdir of the lab host and of [SSHMACHINE], <workdir>/tbottests, got a double slash when workdir ended in one.

  • A relative workdir or testdir of a build host reached over ssh was taken from the directory tbot runs in on the local machine. It is taken from the home directory of the build host now; [BUILDHOST_local] keeps the directory tbot runs in, where its shell starts.

  • KAS.kas_copy() was annotated with the module tbot.machine.linux.path instead of linux.Path, so the documentation showed the module.

  • A race in lab_get_lock() of the board locking.

  • Unescaped values in shell command strings of testcases.

  • Retry loops in board_wait_for_device(), lnx_wait_for_ip() and the check of tbot_start_thread().

  • ps_parse_top() dropped the last loop, the IPv6 regex of _lnx_get_ipaddr() did not match, TM021Control.poweroff() and the CAN testcases failed with an AttributeError.

  • Copies of the ini files were left behind.

Removed

  • The rows of the board keys rs485labdev, rs485baud, rs485boarddev and rs485lengths in the documentation of the board configuration. No code reads them; the values are entries of the key rs485 of generic_lnx_test_rs485, or parameters of board_lnx_rs485.

  • The bootlin and linaro toolchains of the lab host. The classes are gone from tbot, the lab host raises like the build hosts do.

  • The attributes of GenericBoardConfig for the keys of the board configuration (cfg.dmesg, cfg.kas, …). It keeps what belongs to the board (tmpdir, shelltype, …).

  • setup.py, pyproject.toml replaces it.

  • tftp_subdir in the board configuration, tftpsubdir of the lab section replaces it.