Changelog
[Unreleased]
Fixed
kas_checkoutrunskas-container checkoutwhen 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 flagkasupdatehad 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
buildtargetsin 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.-cin a build target counts only as a word of its own, a target name likelinux-cxxis no task option. With unit tests.The dfu-util loader (tbot flag
dfuutilloader) stops when a file ofdfuutil_loader_stepsdoes 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 undertimeout, 30 s per step or the “timeout” of the step:dfu-util -wwaits forever for a DFU device, also when the board is not in DFU boot mode. With unit tests.generic_lnx_allreturns 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_bootcmdwith an empty list selects noub_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_buildinforeads/etc/buildinfoof 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.confin the kas dictionary: lines written tobuild/conf/site.confbefore 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.confis written once and kept. Left alone withkaskeepconfig. With unit tests.A step of the dfu-util loader takes the device with the optional key
d,<vid>:<pid>as fordfu-util -d, so dfu-util does not try other DFU devices of the lab host, e.g. a webcam. With unit tests.tbot flag
kasupdatepasses--updateto 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 withkaskeepconfig. With unit tests.scripts/registermap/mpc855_create_registermap.pymakes 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 fromREGISTERMAP(..., base=...),regdump.py --baseor the new board keyregistermap_base.mpc855_registers.jsonis made that way, with 20 blocks, 161 registers and 677 fields.generic_ub_dump_registerdumps the registers of the keyregdumpin U-Boot withmd.l, with the register map of the SoC the new board keysocnamenames, intogeneric_registerdump_uboot.txt. U-Boot has no/proc/device-tree, andfdt addrwould overwrite the variablefdtaddr, so withoutsocnameit is skipped.socnamealso takes the place of the detection ingeneric_lx_dump_register. Both sharedump_registers().generic_get_socname()recognises the AM335x byti,am33xxin the compatible of the root of the device tree, as it has no/proc/device-tree/soc@0/compatible, sogeneric_lx_dump_registertakesam335x_registers.jsonthere.scripts/registermap/am335x_create_registermap.pymakes the registermap of the TI AM335x from its Technical Reference Manual (SPRUH73), as TI publishes no SVD file for it, andam335x_registers.jsonis 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 --rmtakes page, chapter and the field descriptions from the reference manual (PDF, withstm32_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_MODERforGPIOA_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-mare dropped.stm32mp157_registers.jsonis 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.pymakes 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.jsonis 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 (CR1of USART1, notUSART_CR1), which matters for--regsfileof regdump.py. With unit tests.The quick start recommends the JSON configuration (
create_setup.sh --json) for a new setup.An entry of
lnx_commandsmay leave out"val"and only run its command, and may have"mode": "exec", then its return code does not matter, as forlinux_init(lnx_check_cmd()). So commands that prepare the checks, such as stopping a service, fit in the same list.board_lnx_cangensends withcansequenceof canutils when the sending machine has no cangen, e.g. a board with canutils of Pengutronix, so the direction board2lab ofgeneric_lnx_test_cangenworks 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 ascanid.create_setup.sh writes a
.gitignoreinto the setup directory if there is none, from the templatetbottest/tbotconfig/gitignore. It keeps tbot/, tbottest/, log/,*.pycand*.swpout of a git repository of the setup.An entry of
ub_envor of a groupub_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. tooptargs, what neededset_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 ofgeneric_lnx_all. The kas testcases are not covered yet.generic_lnx_test_cangen, run bygeneric_lnx_all, runsboard_lnx_cangenfor every entry of the board configuration keycangen, 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 thedirections.generic_lnx_test_rs485, run bygeneric_lnx_all, runsboard_lnx_rs485once for every entry of the board configuration keyrs485, whose keys are its parameters (rs485_config_kwargs()).linux_safe_init_promptin the board configuration, True by default, sets tbot’ssafe_init_prompt, so the prompt is read withread_until_prompt_safe()while tbot sets up the linux shell.Section
TC_BOARDNAME.TESTCASENAMEof the board configuration. While a testcase decorated withtc_config()orrequire_cfg()runs, a key is searched there first, then inTC_BOARDNAMEandTC. There is deliberately no sectionTC_TESTCASENAMEfor all boards.get_config_literal()reads a key as Python literal.Configuration as JSON.
tbot.jsonandBOARDNAME.jsonreplacetbot.ini,BOARDNAME.iniandboardspecific.pywhen the flagsinifile:andboardfile:name.jsonfiles. Values that depend on a run are expressions (${env:NAME},${flag:NAME},${lab:key},${tbot:SECTION:key}), which also work in ini files. Anub_enventry with"flag"is set only with that flag.generic_config_to_jsonwrites a configuration as JSON,create_setup.sh --jsonsets one up.Groups of the U-Boot environment (
ub_env_<group>), selected with the flagub_env:or by the boot command.cmd_versionspresetscmd_get_version()of tbot for the lab host, the build hosts and the board. The testcasegeneric_cmd_versionsfinds the versions out and installs missing packages withcmd_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 withslow_send_delayandslow_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_cmdsafter power on and selects its configuration file withconfigname:.tc/bdi2000.pyopens a telnet session to the BDI2000.More than one lab host (
LABHOST_<name>, flaglabname:), 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 (flagbuildername: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, andlinux_netcmdto chooseiporifconfig.Testcases for process measurement with top and ps (with gnuplot), register dumps with register maps of NXP i.MX and STM32MP157 (and the standalone
regdumptool), the generic linux tests withgeneric_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_dumpand the hello world build of a Yocto SDK.exec_check()andexec0_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 flagkaskeepconfig.create_setup.shasks for console and power control with--inter, writes asetup.shwith aliases, copies the CI testcases only with--ci, checks out tbottest with-bor-c, takes tbot from the branchv0.10.10-embof github.com/EmbLux-Kft/tbot and updates existing clones.completions.shcompletes the testcases and the aliases.newtbot_starter.pytakes the paths fromTBOTCONFIGPATHandTBOTTESTPATHand setsTBOT_STARTTIMEfor the argument files.generators/console.pyshows 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, soam335x_registers.jsonworks 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 parameterslabandlnxany more.labonly decided whether to use sudo,lnxwas not used.board_setup_can()runsipwithlnx_sudo(), so with sudo unless the machine is logged in as root. Its parameterusesudoandsudo_exec0()oftc/can.pyare gone, andlnx_can_write_dump_compare()no longer guesses fromlab == lnxsendwhether sudo is needed.board_lnx_cangenchecks the candump log itself, with the newcheck_cangen_log(), on the output ofcaton the board. Nothing is copied to the lab host any more, so the parameterslabandlabtbottestcasepathandtc/files/check_cangen_output.pyare 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 ofcfggeneric, so they find their own section.require_cfg()takes the name of the key.cfggeneric.kas_config(lab, bh)andcfggeneric.get_lnx_dump_files()replacecfg.kasandcfg.lnx_dump_files.tbot is v0.10.10.
tbot.iniand the board configuration are read through the helpers oftbottest.initconfig, the board name comes from the flagboardname:, andboardspecific.pysits next totbot.ini.Configuration values are read with
ast.literal_eval()instead ofeval().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 changedkaslayerbranchwas ignored, and a branch the remote does not have did not stop the build. It fetcheskaslayerbranchnow and checks it out, and fails if the fetch does. With unit tests.scripts/registermap/regdump.pydid not run without tbot, as importingtbottest.tc.registermaprantbottest/__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__.pyof the packages. With unit tests.create_setup.shkept an existingsetup.shwithout 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 asetup.shfor 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, whichnewtbot_starter.pyinstalls into tbot, looks it up through sys.path as an import does.completions.shcompletes a variable name such as$tbtcwithout the space bash-completion adds, so the module path can follow.board_lnx_cangenhung 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-Leither: tbot’scmd_get_version()reports it ascanutils(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 inTBOTTEST_COMMANDSnow, with the Debian package can-utils forcmd_versions_install.The check of
board_lnx_cangendid not let the data counter wrap, so it failed after 256 frames withdllength=1; it compared the log with the board path on the lab host and copied it from a fixed IP address.The default
testdirof the lab host and of[SSHMACHINE],<workdir>/tbottests, got a double slash whenworkdirended in one.A relative
workdirortestdirof 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 moduletbot.machine.linux.pathinstead oflinux.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 oftbot_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,rs485boarddevandrs485lengthsin the documentation of the board configuration. No code reads them; the values are entries of the keyrs485ofgeneric_lnx_test_rs485, or parameters ofboard_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
GenericBoardConfigfor the keys of the board configuration (cfg.dmesg,cfg.kas, …). It keeps what belongs to the board (tmpdir,shelltype, …).setup.py,pyproject.tomlreplaces it.tftp_subdirin the board configuration,tftpsubdirof the lab section replaces it.