Testcases Documentation

Simply a documentation for all testcases, found in src/tc/

Directory

Directory board

Directory board/bbb

board/bbb/tc_board_bbb_after_linux_booted.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_bbb_after_linux_booted.py

nowadays after booting into linux there comes the message

“random: crng init done”

This pos in, and may disturb a current running test ...

so call this testcase after logging into linux

and wait until this string is read ...

used variables

  • tb.config.bbb_check_crng_init
wait for string “crng init”
default: ‘yes’

board/bbb/tc_board_bbb_bootmode.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_bbb_bootmode.py

switch bootmode for the bbb

in the lab tbot2go.

  • power off the board
  • set bootmode
2 states:
normal: we use emmc
recovery: we boot from sd card

board/bbb/tc_board_bbb_bootmode_labdenx.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_bbb_bootmode_labdenx.py

switch bootmode for the bbb in the denx vlab

  • power off the board
  • set bootmode

2 states:

normal: we use sd card

recovery: we boot from emmc


board/bbb/tc_board_bbb_restore_uboot.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_bbb_restore_uboot.py

we boot from emmc, if it is broken, we boot

from sdcard and restore a known working uboot on

the emmc.

To switch between botmodes we can use the PIN P8_43

attached to GND -> boot from sd, floating -> boot

from emmc.


board/bbb/tc_board_deploy_beagleboneblack.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_deploy_beagleboneblack.py

Copy the binaries from the compile PC

to the tftp directory on the lab PC


board/bbb/tc_board_deploy_lx_beagleboneblack.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_deploy_lx_beagleboneblack.py

Copy the linux binaries from the compile PC

to the tftp directory on the lab PC


board/bbb/tc_board_yocto_boot_nfs.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_yocto_boot_nfs.py

used variables

  • tb.config.linux_user_nfsrootfs
nfs rootfs username
default: ‘’
  • tb.config.linux_prompt_default_nfsrootfs
default prompt from nfs rootfs
default: ‘’

board/bbb/tc_board_yocto_boot_sdcard.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_yocto_boot_sdcard.py

  • set jumper to normal
  • boot sd card image

used variables

  • tb.config.linux_user_yoctorootfs
yocto rootfs username
default: ‘’

board/bbb/tc_board_yocto_boot_sdcard_recovery.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_yocto_boot_sdcard_recovery.py

  • set recovery mode
  • boot with linux from tftp
  • boot sd card image

board/bbb/tc_board_yocto_get_and_bake.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_yocto_get_and_bake.py

  • go to compile PC
  • goto lab source dir
  • get yocto sources with tc_workfd_get_yocto_source_py
  • bitbake it
  • check if files we expect exist
  • check tar content
  • deploy files (copy to lab PC)
  • get rootfs version

board/bbb/tc_board_yocto_install_nfs.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_yocto_install_nfs.py

copy sd card image into nfs

  • restore old workfd

used variables

  • tb.config.rootfs_sdcard_file
if != ‘none’ copy tb.config.rootfs_sdcard_file file
from tb.config.yocto_results_dir_lab_ to nfs directory
tb.config.nfs_subdir + ‘/boot’
default: ‘none’

board/bbb/tc_board_yocto_install_sdcard.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/bbb/tc_board_yocto_install_sdcard.py

install sd card image from

/boot/ + tb.config.rootfs_sdcard_file into

of=/dev/mmcblk + devnr

devnr gets detected with ‘dmesg | grep mmc | grep SD’


board/tc_board_aristainetos2_linux.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_aristainetos2_linux.py

start all linux testcases for the aristainetos2 board


board/tc_board_aristainetos2_linux_bisect.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_aristainetos2_linux_bisect.py

start a git bisect for the aristainetos2 board


board/tc_board_aristainetos2_linux_tests.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_aristainetos2_linux_tests.py

start all linux testcases for the aristainetos2 board


board/tc_board_ccu1_tests.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_ccu1_tests.py

start all testcases for the ccu1 board


board/tc_board_corvus.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_corvus.py

start all testcases for the corvus board


board/tc_board_dxr2.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_dxr2.py

start all testcases for the dxr2 board


board/tc_board_dxr2_linux.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_dxr2_linux.py

start all linux testcases for the dxr2 board


board/tc_board_dxr2_lx_ubi_tests.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_dxr2_lx_ubi_tests.py

more dxr2 specific ubi tests, maybe make them common


board/tc_board_dxr2_ub.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_dxr2_ub.py

start all u-boot testcases for the dxr2 board


board/tc_board_dxr2_ub_ubi.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_dxr2_ub_ubi.py

start all ubi testcases for the dxr2 board


board/tc_board_dxr2_uboot_patchwork.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_dxr2_uboot_patchwork.py

dxr2 check all patches with patchworknumber > default_nr

in patchwork, if it is checkpatch clean and applies to

current mainline without errors


board/tc_board_fipad.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_fipad.py

start all U-Boot/linux testcases for the fipad board


board/tc_board_fipad_linux.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_fipad_linux.py

start all linux testcases for the fipad board


board/tc_board_fipad_ub_tests.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_fipad_ub_tests.py

start all U-Boot testcases for the fipad board


board/tc_board_fipad_ub_usb.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_fipad_ub_usb.py

do some simple usb test

  • usb start
  • usb info (check some output)
  • list root dir on the stick

(ext2 formatted stick)

  • load test.bin from this partition with ext2load
  • check if test.bin has the crc32 sum 0x2144df1c

used variables

  • tb.config.tc_board_fipad_uboot_ext2load_files
list of files which get load and crc32 tested
default: ‘[]’

board/tc_board_fipad_upd_ub.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_fipad_upd_ub.py

update SPL and u-boot.img on the SPI NOR or the MMC0

card, and boot it ...


board/tc_board_fipad_upd_ub_mmc.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_fipad_upd_ub_mmc.py

update SPL and u-boot.img on the MMC0


board/tc_board_fipad_upd_ub_spi.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_fipad_upd_ub_spi.py

update SPL and u-boot.img on the SPI NOR


board/tc_board_flea3.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_flea3.py

start all testcases for the flea3 board

currently only test the nor unprotect with linux


board/tc_board_mcx.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_mcx.py

start all testcases for the mcx board linux stable and linux-ml


board/tc_board_mcx_tests.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_mcx_tests.py

start all testcases for the mcx board


board/tc_board_shc.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_shc.py

start all testcases for the shc board linux and linux-stable


board/tc_board_shc_compile_ml.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_shc_compile_ml.py

compile ML linux kernel for the shc board


board/tc_board_shc_tests.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_shc_tests.py

start all testcases for the shc board


board/tc_board_shc_ub_create_regdump.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_shc_ub_create_regdump.py

create a uboot regdump for all interesting registers

on the shc board


board/tc_board_shc_ub_tests.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_shc_ub_tests.py

start all U-Boot testcases for the shc board


board/tc_board_shc_upd_ub.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_shc_upd_ub.py

update MLO and u-boot.img on the SD card or the eMMC

card, and boot it ...


board/tc_board_sigmatek-nand.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_sigmatek-nand.py

On the sigmatek-nand board we have problems with a crash in U-boot

We do:

  • wait until linux state is reached
  • wait random seconds (3 -10)
  • power off the board
  • wait 3 seconds for powering really of the board
  • loop this 50 times

board/tc_board_sirius_dds.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_sirius_dds.py

On the sirius board we have problems with ubifs

on nand flash and power cuts. So this is a special

testcase for this board. We do:

  • go into statte u-boot
  • start linux with ubifs as rootfs
  • wait until Userspace APP SiriusApplicat is started
  • wait random seconds (3 -10)
  • power off the board
  • wait 3 seconds for powering really of the board
  • loop this 50 times

if we have an ubifs error, testcase ends with error


board/tc_board_smartweb.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_smartweb.py

remove, clone current mainline U-Boot, then

start tc_board_smartweb_test_ub_py


board/tc_board_smartweb_test_ub.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_smartweb_test_ub.py

start all ub testcases for the smartweb board


board/tc_board_taurus.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_taurus.py

start all testcases for the taurus board


board/tc_board_thuban_test_uboot.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_thuban_test_uboot.py

trigger a bug in old U-Boot ubi implementation

and test, if with current U-Boot this bug does

not appear anymore.

boot into linux and install a buggy nand image

go into u-boot and start an old u-boot binary,

which has the bug, which leads into a reset

After the reset, the new U-Boot is booted.

run ‘ubi part rootfs 2048’ which repairs the buggy

nand and no U-Boot reset should ocur.

after the new U-Boot has repaired the nand, the old

U-Boot should also work again.

call testcase tc_demo_uboot_tests_py for doing

U-Boot standard tests.


board/tc_board_tqm5200s_try_cur_ub.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_tqm5200s_try_cur_ub.py

remove current u-boot code on the lab PC

then call tc tc_board_tqm5200s_ub_comp_install_py


board/tc_board_tqm5200s_ub_comp_install.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_board_tqm5200s_ub_comp_install.py

compile and install U-Boot for the tqm5200s board

install U-Boot with BDI


board/tc_linux_create_reg_file_am335x.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_linux_create_reg_file_am335x.py

create a regfile for am335x SoC registers


board/tc_linux_create_reg_file_imx6qdl.py

https://github.com/hsdenx/tbot/blob/master/src/tc/board/tc_linux_create_reg_file_imx6qdl.py

create a regfile for imx6qdl SoC registers


Directory debugger

Directory debugger/bdi

debugger/bdi/tc_lab_bdi_connect.py

https://github.com/hsdenx/tbot/blob/master/src/tc/debugger/bdi/tc_lab_bdi_connect.py

connect to the BDI if tb.config.board_has_debugger == ‘yes’

used variables

  • tb.config.lab_bdi_upd_uboot_bdi_cmd
command for connecting to BDI
default: ‘telnet bdi6’
  • tb.config.lab_bdi_upd_uboot_bdi_prompt
BDI prompt string
default: ‘BDI>’

debugger/bdi/tc_lab_bdi_create_dump.py

https://github.com/hsdenx/tbot/blob/master/src/tc/debugger/bdi/tc_lab_bdi_create_dump.py

check if we are on the BDI already, if not switch to it

with tc_lab_bdi_connect_py

to tb.config.tc_lab_bdi_create_dump_stop with mask

tb.config.tc_lab_bdi_create_dump_mask and stepsize

tb.config.tc_lab_bdi_create_dump_type into the file

tb.config.tc_lab_bdi_create_dump_filename

used variables

  • tb.config.tc_lab_bdi_create_dump_filename
filename, to witch registers get dumped
default: ‘’
  • tb.config.tc_lab_bdi_create_dump_start
register start address from which dump gets created
default: ‘’
  • tb.config.tc_lab_bdi_create_dump_stop
register stop address to which dump gets created
default: ‘’
  • tb.config.tc_lab_bdi_create_dump_mask
default mask, which get added
default: ‘’
  • tb.config.tc_lab_bdi_create_dump_type
type with which registers get read
default: ‘’

debugger/bdi/tc_lab_bdi_disconnect.py

https://github.com/hsdenx/tbot/blob/master/src/tc/debugger/bdi/tc_lab_bdi_disconnect.py

disconnect from the BDI


debugger/bdi/tc_lab_bdi_run.py

https://github.com/hsdenx/tbot/blob/master/src/tc/debugger/bdi/tc_lab_bdi_run.py

BDI run

used variables

  • tb.config.lab_bdi_upd_uboot_bdi_run
command for resetting U-Boot
default: “[{‘cmd’:’res run’, ‘val’:’resetting target passed’}]”

debugger/bdi/tc_lab_bdi_upd_uboot.py

https://github.com/hsdenx/tbot/blob/master/src/tc/debugger/bdi/tc_lab_bdi_upd_uboot.py

update u-boot with BDI

  • send BDI cmd: “res halt”
  • send BDI cmd: “era”
  • send BDI cmd:

tb.config.lab_bdi_upd_uboot_bdi_prog + ‘ ‘ + tb.config.lab_bdi_upd_uboot_bdi_file + ‘ BIN’

used variables

  • tb.config.lab_bdi_upd_uboot_bdi_era
command for erasing
default: ‘era’
  • tb.config.lab_bdi_upd_uboot_bdi_prog
command for programming
default: ‘prog 0xfc000000’
  • tb.config.lab_bdi_upd_uboot_bdi_file
filename, which get programmed
default: ‘/tftpboot/tqm5200s/tbot/u-boot.bin’

Directory default

default/tc_def_lx.py

https://github.com/hsdenx/tbot/blob/master/src/tc/default/tc_def_lx.py

simple set default values for linux testcases

used variables

  • tb.config.i2c_pre
string added before ‘i2cget’ command
default: ‘’
  • tb.config.tc_lx_mount_dir
path where testcase tc_lx_mount_py mounts
default: ‘/home/hs/mnt’
  • tb.config.uboot_get_parameter_file_list
list of files, where TC searches for the define
default: ‘’
  • tb.config.uboot_config_option
config option which get searched
default: ‘’
  • tb.config.tc_workfd_lx_get_bc_file
path with filename to bootcounter file
default: ‘/sys/devices/soc0/soc/2100000.aips-bus/21a0000.i2c/i2c-0/0-0008/bootcount’

default/tc_def_tbot.py

https://github.com/hsdenx/tbot/blob/master/src/tc/default/tc_def_tbot.py

simple set default values for tbot

used variables

  • tb.config.ip
ip of the lab PC
default: ‘’
  • tb.config.user
username for loggin into lab PC
default: ‘’
  • tb.config.boardname
boardname: name of the board.
default: ‘’
  • tb.config.uboot_strings
Strings found when U-Boot is booting
default: “[‘Autobooting in’, ‘noautoboot’, ‘autoboot’, ‘EOF’, ‘RomBOOT’]”
  • tb.config.tc_lab_source_dir
tbot source directory on lab PC
default: ‘/work/hs/tbot’
  • tb.config.tc_workfd_work_dir
tbots workdirectory on labor PC
  • tb.config.tc_workfd_tbotfiles_dir
place for tbot to store tempfiles on labor PC
default: tb.config.tc_workfd_work_dir + ‘/tmpfiles’
  • tb.config.board_has_debugger
if ‘yes’ board has a debugger
default: ‘no’
  • tb.config.lab_tmp_dir
directory on lab PC, where tbot stores temporary files.
default: ‘/var/tmp’
  • tb.config.compile_pc_workdir
tbots workdirectory on compile PC
  • tb.config.debug
If ‘True’ enable debugprint() output
default: ‘False’
  • tb.config.debugstatus
If ‘True’ enable statusprintf() output
default: ‘False’
  • tb.config.state_uboot_timeout
u-boot read timeout in seconds (float)
default: ‘1’
  • tb.config.uboot_autoboot_key
U-Boots autoboot key, send if autoboot is read, and != ‘none’
default: ‘none’
  • tb.config.tb_power_state
last read powerstate
default: ‘undef’
  • tb.config.term_line_length
maximal line length of terminal
default: ‘200’
  • tb.config.wdt_timeout
wdt timeout in seconds
default: ‘120’
  • tb.config.state_linux_timeout
linux timeout in seconds when reading from channel
default: ‘4’
  • tb.config.labsshprompt
prompt after login into lab with ssh
default: ‘$ ‘
  • tb.config.tc_return
used as return value from testcases
default: ‘True’
  • tb.config.ub_boot_linux_cmd
bootcommand for booting linux
default: ‘run tbot_boot_linux’
  • tb.config.do_connect_to_board
connect to boards console on tbot start
default: ‘True’
  • tb.config.tftpboardname
tftp subdir name for board
  • tb.config.boardlabname
boardsname in the lab
  • tb.config.boardlabpowername
boards name in the lab for power on/off
  • tb.config.tftpboardrootdir
root path for tftp directory (if needed for u-boot)
default: ‘none’
  • tb.config.tc_lab_denx_power_tc
Name of testcase, which controlls power state of the board
default: ‘tc_lab_denx_power_py
  • tb.config.tc_lab_denx_get_power_state_tc
Name of the testcase, which reads the current powerstate of the board
  • tb.config.tc_lab_denx_connect_to_board_tc
Name of the testcase, which connects to boards console
  • tb.config.tc_lab_denx_disconnect_from_board_tc
Name of the testcase, which disconnects from boards console
  • tb.config.linux_prompt_default
linux default prompt, after login into console
default: 'root@generic-armv7a-hf:~# ‘
  • tb.config.labprompt
prompt of the lab, tbot set after login
  • tb.config.linux_prompt
prompt of the lab, tbot set after login
default: ‘’
  • tb.config.linux_user
Username for linux used on the board
default: ‘root’
  • tb.config.create_dot
Call the “dot” backend after tbot finsihed
default: ‘no’
  • tb.config.create_statistic
Call the “statistic” backend after tbot finsihed
default: ‘no’
  • tb.config.create_dashboard
Call the “dashboard” backend after tbot finsihed
default: ‘no’
  • tb.config.create_webpatch
Call the “webpatch” backend after tbot finsihed
default: ‘no’
  • tb.config.create_html_log
Call the “html_log” backend after tbot finsihed
default: ‘no’
  • tb.config.create_documentation
Call the “documentation” backend after tbot finsihed
default: ‘no’
  • tb.config.event_documentation_strip_list
see documentation backend documentation
default: ‘[]’
  • tb.config.create_documentation_auto
see documentation backend documentation
default: ‘[]’
  • tb.config.create_junit
Call the “junit” backend after tbot finsihed
default: ‘no’
  • tb.config.junit_tclist
list of testcasenames, for which the logfile get delivered to jenkins
default: “[‘tc_lab_get_uboot_source_py‘,
  • tb.config.junit_ignlist
list of testcasesnames, which get not passed to jenkins
default: “[‘tc_workfd_check_cmd_success_py‘,
tc_dummy_py‘]”
  • tb.config.tb_set_after_linux
testcase called after logging into linux on board.
default: ‘none’

default/tc_def_ub.py

https://github.com/hsdenx/tbot/blob/master/src/tc/default/tc_def_ub.py

simple set default values for U-Boot testcases

used variables

  • tb.config.tc_ub_tftp_file_addr
ram address to which the file gets loaded
  • tb.config.tc_ub_tftp_file_name
file name for the tftp command
default: ‘’
  • tb.config.ub_load_board_env_subdir
subdirectory, where tbot finds boards u-boot env
default: ‘tbot’
  • tb.config.tc_ub_tftp_path
tftp boot directory path for tftp U-Boot command

Directory demo

Directory demo/linux

demo/linux/tc_demo_compilepc_linux_compile.py

https://github.com/hsdenx/tbot/blob/master/src/tc/demo/linux/tc_demo_compilepc_linux_compile.py

!! changes tb.workfd !!


demo/linux/tc_demo_compilepc_linux_test.py

https://github.com/hsdenx/tbot/blob/master/src/tc/demo/linux/tc_demo_compilepc_linux_test.py

start with


demo/linux/tc_demo_linux_compile.py

https://github.com/hsdenx/tbot/blob/master/src/tc/demo/linux/tc_demo_linux_compile.py

call boardspecific testcase for deploying linux sources.
else copy files from “$TBOT_BASEDIR_LINUX/arch/arm/boot/”

used variables

  • tb.config.tc_demo_linux_test_deploy
contains the testcasename which get called for deploying linux
default: ‘none’

demo/linux/tc_demo_linux_testcases.py

https://github.com/hsdenx/tbot/blob/master/src/tc/demo/linux/tc_demo_linux_testcases.py

tb.config.tc_board_bootmode_tc

is set to ‘yes’

  • get booted linux version
  • grep through dmesg and check if strings in

tb.config.tc_demo_linux_test_dmesg exist

  • check with devmem2 if the register values defined

in the register files tb.config.tc_demo_linux_test_reg_files

are identical with the values defined in the files

and check the returning strings.

used variables

  • tb.config.tc_demo_linux_tc_boot_lx
if == ‘yes’ boot a linux kernel
default: ‘yes’
  • tb.config.tc_demo_linux_test_dmesg
list of strings, which must be in dmesg
default: ‘none’
  • tb.config.tc_demo_linux_test_reg_files
list of register filenames, which get
checked with testcase tc_lx_check_reg_file_py
default: ‘none’
  • tb.config.tc_demo_linux_test_basic_cmd
list of dictionary with key = ‘cmd’ and value = ‘val’
command in ‘cmd gets executed and checked if string in ‘val’
is found. if ‘val’ == ‘undef’, no check, only command is
executed.
default: ‘none’
  • tb.config.tc_demo_linux_tc_list
list of testcasenames, which get called
default: ‘none’

Directory demo/u-boot

demo/u-boot/tc_demo_compile_install_test.py

https://github.com/hsdenx/tbot/blob/master/src/tc/demo/u-boot/tc_demo_compile_install_test.py

(set bootmode for the board)
which should contain a testcase, which tests the new
installed u-boot
power off board at the end.

used variables:

  • tb.config.tc_demo_compile_install_test_ub_vers_file
if != ‘none’ contains the filename, in which testcase
tc_ub_get_version_py find the U-Boot version
default: ‘none’
  • tb.config.tc_demo_compile_install_test_spl_vers_file
if != ‘none’ contains the filename, in which testcase
tc_ub_get_version_py find the U-Boot SPL version
default: ‘none’
  • tb.config.tc_demo_uboot_test_deploy
if != ‘none’ call testcase with name tb.config.tc_demo_uboot_test_deploy
for installing U-Boot
default: ‘none’
  • tb.config.tc_board_bootmode_tc
if != ‘none’ call testcase with name tb.config.tc_board_bootmode_tc
for switching bootmode of the board
default: ‘none’
  • tb.config.tc_demo_compile_install_test_poweroff
if ‘yes, switch off board power after successful test
default: ‘yes’
  • tb.config.tc_demo_compile_install_test_name
if != ‘none’ call testcase with name tb.config.tc_demo_compile_install_test_name
to test the new installed u-boot
default: ‘none’
  • tb.config.tc_demo_compile_install_test_files
list of files which get copied into tftpdirectory
default: ‘none’
  • tb.config.tc_demo_uboot_test_update
if != ‘none’ testcasename which gets called for updating U-Boot
default: ‘none’

demo/u-boot/tc_demo_compilepc_uboot_test.py

https://github.com/hsdenx/tbot/blob/master/src/tc/demo/u-boot/tc_demo_compilepc_uboot_test.py

!! changes tb.workfd !!


demo/u-boot/tc_demo_get_ub_code.py

https://github.com/hsdenx/tbot/blob/master/src/tc/demo/u-boot/tc_demo_get_ub_code.py


demo/u-boot/tc_demo_uboot_tests.py

https://github.com/hsdenx/tbot/blob/master/src/tc/demo/u-boot/tc_demo_uboot_tests.py

start all “standard” u-boot testcases

a list of files, check for each file with testcase

tc_ub_check_reg_file_py if the registersettings are

correct.

and check the returning strings.

tb.config.tc_demo_uboot_tc_list

used variables:

  • tb.config.tc_demo_uboot_test_reg_files
list of register files, which contain registerdumps
used for testcase
default: ‘none’
  • tb.config.tc_demo_uboot_test_basic_cmd
list of dictionary, which contains key = ‘cmd’ and
value = ‘val’ entries
default: ‘none’
example: [
{“cmd”:”help”, “val”:”i2c”},
{“cmd”:”md”, “val”:”undef”},
]

If “val” = ‘undef’ only command gets executed, no check
  • tb.config.tc_demo_uboot_tc_list
list of testcasesnames, which get called
default: ‘none’

demo/tc_demo_can_part1.py

https://github.com/hsdenx/tbot/blob/master/src/tc/demo/tc_demo_can_part1.py

starts a can demo

For this demo the fipad board in the denx lab is used.

To test the CAN bus we have in the DENX lab installed a PC, called

CANPC to which a PEAK CAN adapter is attached, which then is connected

to the CAN bus the fipad board is also connected.

We use tc_workfd_can_py for testing

We open a new connection to the LabPC, called canm and then we ssh

to the CANPC, from where we then start candump, while on the console

connection a cansend was started. So we can read from the canm

connection, the bytes we send with cansend on the console connection.

If we got the same bytes as we send -> TC True

else the TC returns False

Only one cansend call is tested ... room for more.


Directory lab

Directory lab/denx

lab/denx/tc_lab_denx_connect_to_board.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/denx/tc_lab_denx_connect_to_board.py

connect to board tb.config.boardlabname with

connect script


lab/denx/tc_lab_denx_disconnect_from_board.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/denx/tc_lab_denx_disconnect_from_board.py

disconnect from board tb.config.boardlabname

in denx vlab


lab/denx/tc_lab_denx_get_power_state.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/denx/tc_lab_denx_get_power_state.py

get the power state of the board tb.config.boardlabpowername,_

and save it in tb.power_state


lab/denx/tc_lab_interactive_get_power_state.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/denx/tc_lab_interactive_get_power_state.py

get the power state of the board through user input,

and save it in tb.power_state

Currently nothing done.


lab/denx/tc_lab_interactive_power.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/denx/tc_lab_interactive_power.py

power on/off the board tb.config.boardlabpowername_ manually

You will see a countdown from 3 to 1

Than you have to power on or off the board manually


lab/tc_lab_power_onoff_gpio.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/tc_lab_power_onoff_gpio.py

Switch on/off boardpower through a GPIO pin

from the lab PC

define the gpio for powering on/off in your board config

file with for example:

gpio_power_on = gpo(21) # gpio number of gpio used to controll power of board

used variables

  • tb.config.gpio_power_on
gpio pin used for powering on / off the board
default: ‘’

lab/tc_lab_prepare.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/tc_lab_prepare.py

when logging into a lab, do some basic setup

testcase which name is defined in tb.config.tc_lab_prepare_tc_name

In this testcase, you can do lab specific setup you need

and set the variable tb.config.tc_lab_prepare_tc_name

with the name you give your testcase for lab specific setup.

used variables

  • tb.config.tc_lab_prepare_tc_name
call testcase with this name for settings up lab specific
tasks.
default: ‘none’

lab/tc_lab_prepare_laptop_hs.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/tc_lab_prepare_laptop_hs.py

do setup needed for the laptop from hs, when used as

lapPC


lab/tc_lab_prepare_tbot2go.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/tc_lab_prepare_tbot2go.py

do setup needed for the pi in tbot2go mode, when used as

lapPC


lab/tc_lab_sispmctl_get_power_state.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/tc_lab_sispmctl_get_power_state.py

get the power state of the board through sispmctl

and save it in tb.power_state

find more information for the Gembird Silver Shield PM power controller:

http://sispmctl.sourceforge.net/

use testcase tc_lab_sispmctl_get_variables_py for setting

the serial and the index you need for the specific board.

This file is an example for a setup, you need to adapt

this to your needs.


lab/tc_lab_sispmctl_get_variables.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/tc_lab_sispmctl_get_variables.py

get serial and index for tb.config.boardlabpowername_ for

controlling the Gembird Silver Shield PM power controller

and save it in tb.config.gembird_serial and tb.config.gembird_index

used variables

  • tb.config.gembird_serial
setup at runtime of testcase tc_lab_sispmctl_get_variables_py
contains the serial number of the gembird controller
to which the tb.config.boardlabpowername_ is connected
  • tb.config.gembird_index
setup at runtime of testcase tc_lab_sispmctl_get_variables_py
contains the device index of the gembird controller
to which the tb.config.boardlabpowername_ is connected

lab/tc_lab_sispmctl_set_power_state.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/tc_lab_sispmctl_set_power_state.py

power on/off the board with Gembird Silver Shiels

get the power state of the board through sispmctl tool

and save it in tb.power_state

find more information for the Gembird Silver Shield PM power controller:

http://sispmctl.sourceforge.net/

use testcase tc_lab_sispmctl_get_variables_py for setting

the tb.config.gembird_serial and tb.config.gembird_index

you need for the specific board.


lab/tc_lab_usb_relay_power.py

https://github.com/hsdenx/tbot/blob/master/src/tc/lab/tc_lab_usb_relay_power.py

power on / off the board tb.config.boardlabpowername_

with testcase tc_linux_relay_simple_set_py

simple util must be installed, source see

src/files/relay/simple.c

adapt dependend on tb.config.boardlabpowername_

which port you use..

If you have more than one USB relay from sainsmart

adapt simple.c to work with the serial ID, and adapt

also tb.config.tc_linux_relay_simple_set_cmd


Directory linux

Directory linux/relay

linux/relay/tc_linux_relay_get_config.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/relay/tc_linux_relay_get_config.py

get relay tbot configuration

used variables

  • tb.config.tc_linux_relay_simple_set_cmd
command string for simple command
default: ‘/home/hs/Software/usbrelais/src/simple ‘
  • tb.config.tc_linux_relay_simple_set_sudo
with sudo
default: ‘yes’
  • tb.config.tc_linux_relay_set_tc
testcase which get called for setting the relay

linux/relay/tc_linux_relay_pyrelayctl_get.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/relay/tc_linux_relay_pyrelayctl_get.py

get state of relay port

tb.config.tc_linux_relay_pyrelayctl_device_

tb.config.tc_linux_relay_pyrelayctl_port_

with the pyrelayctl cmd

and set state in

tb.config.tc_linux_relay_pyrelayctl_get_state

“on”, “off” or “undef”

find the c source code for the pyrelayctl cmd here:

git clone https://github.com/xypron/pyrelayctl.git

install python3-usb

apt-get install python3-usb

python3 setup_py_ build

sudo python3 setup_py_ install

add file /lib/udev/rules.d/60-relayctl.rules

SUBSYSTEM==”usb”, ATTR{idVendor}==”0403”, ATTR{idProduct}==”6001”, GROUP=”relayctl”, MODE=”660”, ENV{MODALIAS}=”ignore”

(execute udevadm control –reload-rules)


linux/relay/tc_linux_relay_pyrelayctl_get_power.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/relay/tc_linux_relay_pyrelayctl_get_power.py

get tb.power_state of the relay port with the testcases

tc_linux_relay_pyrelayctl_get_py

used variables:

  • tb.config.tc_linux_relay_pyrelayctl_getconfig

testcase name which gets called for getting pyrelayctl

configuration

  • tb.config.tc_linux_relay_pyrelayctl_get_state

contains current state of the relay


linux/relay/tc_linux_relay_pyrelayctl_getcfg.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/relay/tc_linux_relay_pyrelayctl_getcfg.py

set tb.config.tc_linux_relay_pyrelayctl_device_ and

tb.config.tc_linux_relay_pyrelayctl_port_ dependend

on tb.config.boardlabpowername_

for usage with testcase

tc_linux_relay_pyrelayctl_set_power_py and

tc_linux_relay_pyrelayctl_get_power_py

used variables:

  • tb.config.boardlabpowername

boards name in the lab.

returns:

  • tb.config.tc_linux_relay_pyrelayctl_device

device used with pyrelayctl command.

  • tb.config.tc_linux_relay_pyrelayctl_port

port used with pyrealyctl command.


linux/relay/tc_linux_relay_pyrelayctl_set.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/relay/tc_linux_relay_pyrelayctl_set.py

set relay port with the pyrelayctl cmd to state

find the c source code for the pyrelayctl cmd here:

git clone https://github.com/xypron/pyrelayctl.git

install python3-usb

apt-get install python3-usb

python3 setup_py_ build

sudo python3 setup_py_ install

add file /lib/udev/rules.d/60-relayctl.rules

SUBSYSTEM==”usb”, ATTR{idVendor}==”0403”, ATTR{idProduct}==”6001”, GROUP=”relayctl”, MODE=”660”, ENV{MODALIAS}=”ignore”

(execute udevadm control –reload-rules)

used variables:

  • tb.config.tc_linux_relay_pyrelayctl_state

state which get set

  • tb.config.tc_linux_relay_pyrelayctl_device

device on which state get set

  • tb.config.tc_linux_relay_pyrelayctl_port

port on the device for which the state get set


linux/relay/tc_linux_relay_pyrelayctl_set_power.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/relay/tc_linux_relay_pyrelayctl_set_power.py

set relay port with the pyrelayctl cmd to state

tb.power_state with testcase

tc_linux_relay_pyrelayctl_set_py

relay info set from testcase

tb.config.tc_linux_relay_pyrelayctl_getconfig_

used variables:

  • tb.config.tc_linux_relay_pyrelayctl_getconfig

used testcase name for getting pyrelayctl configuration

  • tb.config.tc_linux_relay_pyrelayctl_state

current state for the relay on device and port


linux/relay/tc_linux_relay_set.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/relay/tc_linux_relay_set.py

set relay port tb.config.tc_linux_relay_set_port_ to state

tb.config.tc_linux_relay_set_state._

you need to adapt tc_linux_relay_get_config_py, which does

the mapping from port/state to your specific lab settings.

used variables


linux/relay/tc_linux_relay_simple_set.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/relay/tc_linux_relay_simple_set.py

set relay port with the simple cmd to state

find the c source code for the simple cmd in src/files/relay/simple.c

tb.config.tc_linux_relay_simple_set_sudo if ‘yes’ “sudo” is prwpended to

tb.config.tc_linux_relay_simple_set_cmd and if password is needed, password

is searched in password_py_ with board = tb.config.ip and user = tb.config.user + ‘_sudo’


Directory linux/ubi

linux/ubi/tc_lx_ubi_def.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/ubi/tc_lx_ubi_def.py

simply set defaults for linux ubi tests

used variables

  • tb.config.tc_ubi_cmd_path
path to ubi commands (in mtd-utils package)
default: ‘/work/tbot/mtd-utils’
  • tb.config.tc_ubi_mtd_dev
mtd device used
default: ‘/dev/mtd4’
  • tb.config.tc_ubi_ubi_dev
ubi device used
default: ‘/dev/ubi0’
  • tb.config.tc_ubi_min_io_size
ubi minimum io size
may you detect them with testcase tc_lx_get_ubi_parameters_py
default: ‘1024’
  • tb.config.tc_ubi_max_leb_cnt
used leb number
may you detect them with testcase tc_lx_get_ubi_parameters_py
default: ‘100’
  • tb.config.tc_ubi_leb_size
  • tb.config.tc_ubi_vid_hdr_offset
  • tb.config.tc_lx_ubi_format_filename
filename for ubiformat
default: ‘/home/hs/ccu1/ecl-image-usbc.ubi’

linux/ubi/tc_lx_ubi_tests.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/ubi/tc_lx_ubi_tests.py


Directory linux/xenomai

linux/xenomai/tc_xenomai_common.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/xenomai/tc_xenomai_common.py

basic xenomai tests

  • simply call “cat /proc/xenomai/*”

ToDo: call xeno-test


linux/xenomai/tc_xenomai_latency.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/xenomai/tc_xenomai_latency.py

start latency command tb.config.tc_xenomai_latency_lcmd from the xenomai

tools. Use paramter -g for creating histogram to file

tb.config.tc_xenomai_latency_tmpfile in gnuplot format.

Save this file into tb.config.tc_xenomai_latency_datfile2

on the lab PC.

While latency test is running, extract the content of the

line starting with “RTD” into the file

tb.config.tc_xenomai_latency_datfile

This testcase runs the latency tool until tb.config.tc_xenomai_latency_count

lines are read. While running it checks if the value

of the column “lat max” is lower than tb.config.tc_xenomai_latency_max

Than this testcase ends with True, else Testcase ends with False.

If the value from column ‘overrun’ != 0 Testcase fails.

At the end of this tetscase, it creates the png images

of the files tb.config.tc_xenomai_latency_datfile

and tb.config.tc_xenomai_latency_datfile2 on the host PC

using gnuplot tool.

Therefore the files

src/files/balkenplot_lat_tbot.sem

src/files/balkenplot_latency.sem

are used.

used variables

  • tb.config.tc_xenomai_latency_lcmd
latency command
default: ‘/usr/xenomai/bin/latency’
  • tb.config.tc_xenomai_latency_tmpfile
if != ‘none’ add paramter “-g” to latency command
default: ‘/tmp/latency.dat’
  • tb.config.tc_xenomai_latency_datfile
name of latency results file on lab PC
default: ‘lat_tbot.dat’
  • tb.config.tc_xenomai_latency_datfile2
name of latency results file on Host PC
default: ‘latency_tbot.dat’
  • tb.config.tc_xenomai_latency_count
number of lines containing ‘RTD’ read, before
Testcase ends latency command.
default: ‘100’
  • tb.config.tc_xenomai_latency_max
maximum value which is allowed in latency output column
‘max’. If a value > tb.config.tc_xenomai_latency_max
Testcase fails with error.
default: ‘42’
  • tb.config.tc_xenomai_latency_opt
latency options added to tb.config.tc_xenomai_latency_lcmd
default: ‘none’

linux/tb_workfd_check_if_process_run.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tb_workfd_check_if_process_run.py

check if proces with name

tb.config.tc_workfd_check_if_process_run_name

runs

used variables

  • tb.config.tc_workfd_check_if_process_run_name
runs.
default: ‘none’

linux/tc_connect_to_compilepc.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_connect_to_compilepc.py

This testcase creates a third connection handle to the lab and uses

ssh to create a connection to a compile pc.

The third connection can then be used with tb.workfd and tb.c_cpc

to outsource resource hungry tasks like compiling.

! workfd is set after calling this testcase to the new connection !

The vars tb.config.compile_pc_ip,_ tb.config.compile_pc_user

tb.config.connect_to_compilepc_ssh_opt,_ tb.config.connect_to_compilepc_ssh_cmd_prompt

could also be a list of strings.

used variables

  • tb.config.compile_pc_ip
ip address to the compile PC
default: ‘’
  • tb.config.compile_pc_user
login user name of compile PC
default:
  • tb.config.connect_to_compilepc_ssh_opt
ssh options for the ssh command for logging into compile PC
default:
  • tb.config.connect_to_compilepc_ssh_cmd_prompt
prompt of the compile PC, after login
default:

linux/tc_git_get_branch_commit.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_git_get_branch_commit.py

get current branch, commit from git tree in directory

tb.config.tc_git_get_branch_commit_tree

save values in

tb.config.tc_git_get_branch_commit_dirty

tb.config.tc_git_get_branch_commit_branch

tb.config.tc_git_get_branch_commit_commit

used variables

  • tb.config.tc_git_get_branch_commit_tree
path to the git tree, for which infos get collected
default: ‘’
  • tb.config.tc_git_get_branch_commit_dirty
default: no default, get set on runtime of tc_git_get_branch_commit_py
  • tb.config.tc_git_get_branch_commit_branch
default: no default, get set on runtime of tc_git_get_branch_commit_py
  • tb.config.tc_git_get_branch_commit_commit
default: no default, get set on runtime of tc_git_get_branch_commit_py

linux/tc_linux_imx_usb_loader_boot_uboot.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_linux_imx_usb_loader_boot_uboot.py

install SPL and u-boot image with imx_usb_installer

which is installed in tb.config.tc_linux_imx_usb_loader_install_path

first check if tb.config.tc_linux_imx_usb_loader_install_path

is defined, if not, try to get it with testcase

tc_linux_imx_usb_loader_install_py

if we find a imx usb loader installation, try to

load files in tb.config.tc_linux_imx_usb_loader_boot_uboot_files

from tb.config.tftpdir_ + tb.config.boardname

and get into state “u-boot” after all files loaded

succesfully.

used variables:

  • tb.config.tc_linux_imx_usb_loader_install_path
path to imx_usb_loader utility.
default: If not set, try to install imx_usb_loader
  • tb.config.tc_linux_imx_usb_loader_boot_uboot_files
list of files, which get loaded with imx_usb_loader
default:
[
‘SPL’,
‘u-boot-fit.img’
]

linux/tc_linux_imx_usb_loader_install.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_linux_imx_usb_loader_install.py

checks if tb.config.tc_linux_imx_usb_loader_install_path is already

set. If so, we have a correct installation of imx_usb_loader

and path to imx_usb is stored in tb.config.tc_linux_imx_usb_loader_install_path

If tb.config.tc_linux_imx_usb_loader_install_path is not set,

set tb.config.tc_linux_imx_usb_loader_install_path to

tb.config.tc_linux_imx_usb_loader_install_path = tb.config.tbot_src_path + ‘imx_usb_loader/’

and check if directory exists. If True, we assume that there is

a correct imx_usb installation and return

If tb.config.tc_linux_imx_usb_loader_install_path

does not exist, try to clone imx_usb_loader from

https://github.com/boundarydevices/imx_usb_loader

and set it up for our needs, and compile it.

We use for vid:pid the setting in

tb.config.tc_linux_imx_usb_loader_install_vid_pid_

be sure, libusb is installed on your system.

used variables:

  • tb.config.tbot_src_dirname
path, where tbot installs programs used from tbot
on the lab pc
default = ‘src/’
  • tb.config.tbot_src_path
full path to src directory

linux/tc_linux_top.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_linux_top.py

This testcase starts the linux “top” command

with the top cmdline arguments tb.config.tc_linux_top_count

and tb.config.tc_linux_top_sec

and analyses the output and write them into the file

tb.config.tc_linux_top_filename in a gnuplot format.

create the images with gnuplot:

gnuplot src/files/top_plot_mem.sem

result image

top-mem-output.jpg

gnuplot src/files/top_plot_cpu.sem

result image

top-cpu-output.jpg

gnuplot src/files/top_plot_load.sem

result image

top-load-output.jpg

!! may you need to adapt path in src/files/top_plot*.sem files

ToDo: pass paramter workdir to gnuplot

While at it, include a demo for adding it to the dashboard

backend and create a demo documentation.

If you use this testcase in conjunction with other testcases

you should remove the line

tb.config.create_documentation_auto = ‘linux_top’

used variables

  • tb.config.tc_linux_top_count
top count argument
default: ‘10’
  • tb.config.tc_linux_top_sec
top seconds argument
default: ‘2’
  • tb.config.tc_linux_top_filename
filename where the results are stored
default: ‘top-stat.dat’

linux/tc_lx_bonnie.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_bonnie.py

run a bonnie test, if timer tc_workfd_check_tc_time_py timed out

  • if bonnie is not installed, try to install bonnie with

used variables

  • tb.config.tc_lx_bonnie_dev
device used for bonnie
default: ‘/dev/sda1’
  • tb.config.tc_lx_bonnie_sz
bonnie size
default: ‘968’

linux/tc_lx_bonnie_install.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_bonnie_install.py

get bonnie source and install it

go into tbot workdir with tc_workfd_goto_tbot_workdir_py

check, if bonnie++ is installed.

if not, try to download and install it.


linux/tc_lx_check_i2c_reg_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_check_i2c_reg_file.py

checks if the default values in reg file tb.config.tc_lx_create_i2c_reg_file_name_

on the tbot host in tb.workdir have the same values, as the

the values on the board.

bus and addr of the i2c device comes from the register

file.

you should create the register file with testcase

tc_lx_create_i2c_reg_file_py

used variables:

  • tb.config.i2c_pre
string added before ‘i2cget’ command
default: ‘’
  • tb.config.tc_lx_create_i2c_reg_file_name
register dump file name

linux/tc_lx_check_reg_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_check_reg_file.py

checks if the default values in reg file tb.config.tc_lx_create_reg_file_name

on the tbot host in tb.workdir have the same values, as the

registers on the board. Needs devmem2 installed.

format of the regfile:

regaddr mask type defval

If you have to call devmem2 with a “header”

set it through tb.config.devmem2_pre

so on the bbb with original rootfs -> no devmem2 installed

so to use tc which use devmem2 you have to copy devmem2

bin to the rootfs, and start it with ‘sudo ...’

ToDo: use the file from the lab host, not the tbot host

used variables

  • tb.config.devmem2_pre
path to devmem2 command
default: ‘’

linux/tc_lx_check_usb_authorized.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_check_usb_authorized.py

check if usb device tb.config.tc_lx_check_usb_authorized needs authorizing

used variables

  • tb.config.tc_lx_check_usb_authorized
usb device string
default: ‘usb 1-1’

linux/tc_lx_cmd_and_grep.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_cmd_and_grep.py

loop over the list of strings in the tb.config.tc_lx_cmd_and_grep

“cmds” key.

for each command save the output in a temporary file, and

search that all strings in key=”cmd” are in the temporary file.

used variables

  • tb.config.tc_lx_cmd_and_grep
dictionary with key=”cmds” value is a list of commands.
Each command get exectuted and in the command output
the list of strings stored in the dictionary with the
key=command get searched.

tc_lx_cmd_and_grep = {“cmds” : [“cat /proc/partitions”,
“cat /proc/mounts”],
“cat /proc/partitions” :
[
“mmcblk0p1”,
“mmcblk0p2”,
]
,
“cat /proc/mounts” : [
“/ squashfs ro,noatime 0 0”,
“tmp /tmp tmpfs rw,relatime 0 0”,
]}

This will do:
- “cat /proc/partitions > gnlmpf”
- search if gnlmpf contains the strings “mmcblk0p1” and “mmcblk0p2”
- “cat /proc/mounts > gnlmpf”
- search if gnlmpf contains the strings
“/ squashfs ro,noatime 0 0”
“tmp /tmp tmpfs rw,relatime 0 0”


linux/tc_lx_cpufreq.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_cpufreq.py

check if frequencies in tb.config.tc_lx_cpufreq_frequences

are possible to set with cpufreq-info

used variables

  • tb.config.tc_lx_cpufreq_frequences
list of frequencies
default: “[‘294’]”

linux/tc_lx_create_dummy_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_create_dummy_file.py

create a random dummy file tb.tc_lx_dummy_file_tempfile in tb.config.lab_tmp_dir

on tb.c_con with bs = tb.tc_lx_dummy_file_bs and

count = tb.tc_lx_dummy_file_count

used variables

  • tb.config.tc_lx_dummy_file_tempfile
name of the created dummy file
testcase tc_lx_create_dummy_file_py adds fullpath
default: ‘’
  • tb.config.tc_lx_dummy_file_bs
dd bs paramter
default: ‘’
  • tb.config.tc_lx_dummy_file_count
dd count paramter
default: ‘’

linux/tc_lx_create_i2c_reg_dump_pfuze_3000.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_create_i2c_reg_dump_pfuze_3000.py

create with i2cget tool a register dump of

pfuze3000 on bus

tb.config.tc_lx_create_i2c_reg_dump_pfuze_3000_bus

used variables:

  • tb.config.tc_lx_create_i2c_reg_dump_pfuze_3000_bus
i2c bus number on which the pfuze3000 is connected to.
default: ‘0x0’

linux/tc_lx_create_i2c_reg_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_create_i2c_reg_file.py

create with i2cget tool a register dump of

i2c device on bus tb.config.tc_lx_create_i2c_reg_file_bus

with addr tb.config.tc_lx_create_i2c_reg_file_bus

dump registers from tb.config.tc_lx_create_i2c_reg_file_start

until tb.config.tc_lx_create_i2c_reg_file_stop

with accessmode tb.config.tc_lx_i2c_readreg_type

into file with name

tb.config.tc_lx_create_i2c_reg_file_name_

used variables

  • tb.config.tc_lx_create_i2c_reg_file_name
filename to which registerdump get written
default: ‘i2c_dump.txt’
  • tb.config.tc_lx_create_i2c_reg_file_start
start offset from which get read
default: ‘0x0’
  • tb.config.tc_lx_create_i2c_reg_file_stop
stop offset until to which get read
default: ‘0x10’
  • tb.config.tc_lx_create_i2c_reg_file_bus
i2c bus number from which get read
default: ‘0x0’
  • tb.config.tc_lx_create_i2c_reg_file_addr
i2c address from which get read
default: ‘0x8’
  • tb.config.tc_lx_i2c_readreg_mask
mask which get written into dump file
default: ‘’
  • tb.config.tc_lx_i2c_readreg_type
read type (types from i2c_get util)
default: ‘b’

linux/tc_lx_create_reg_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_create_reg_file.py

creates a reg file tb.config.tc_lx_create_reg_file_name on the tbot host

in tb.workdir

read from tb.config.tc_lx_create_reg_file_start to tb.config.tc_lx_create_reg_file_stop

and writes the results in the regfile

format of the regfile:

regaddr mask type defval

This reg file can be used as a default file, how the

registers must be setup, check it with testcase

tc_lx_check_reg_file_py

If you have to call devmem2 with a “header”

set it through tb.config.devmem2_pre

so on the bbb with original rootfs -> no devmem2 installed

so to use tc which use devmem2 you have to copy devmem2

bin to the rootfs, and start it with ‘sudo ...’

ToDo: use the file from the lab host, not the tbot host

used variables

  • tb.config.tc_lx_create_reg_file_name
name of the register file
default: ‘pinmux.reg’
  • tb.config.tc_lx_create_reg_file_start
start address of registerdump
default: ‘0x44e10800’
  • tb.config.tc_lx_create_reg_file_stop
end address for register dump
default: ‘0x44e10a34’
  • tb.config.tc_lx_readreg_mask
used mask
default: ‘0xffffffff’
  • tb.config.tc_lx_readreg_type
devmem2 type for reading register
default: ‘w’

linux/tc_lx_devmem2_install.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_devmem2_install.py

get devmem2 source from www.lartmaker.nl/lartware/port/devmem2.c

and install it


linux/tc_lx_dmesg_grep.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_dmesg_grep.py

check if string tb.config.tc_lx_dmesg_grep_name is in dmesg output.

make the grep options configurable through tb.config.tc_lx_dmesg_grep_options

used variables

  • tb.config.tc_lx_dmesg_grep_name
string which must be in dmesg output
default: ‘’
  • tb.config.tc_lx_dmesg_grep_options

default: ‘–color=never’

linux/tc_lx_eeprom.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_eeprom.py

Test an eeprom:

with “cat” into tmpfile

if WP pin works

  • generate random file with tb.config.tc_lx_eeprom_wp_sz size
  • write it into eeprom
  • reread it
  • compare it with original
  • restore original eeprom content at end

used variables

  • tb.config.tc_lx_eeprom_file
linux path to eeprom
default: ‘/sys/class/i2c-dev/i2c-0/device/0-0050/eeprom’
  • tb.config.tc_lx_eeprom_tmp_dir
temp directory, where eeprom content get stored
  • tb.config.tc_lx_eeprom_wp_gpio
if ‘none’ check only if eeprom is readable
else check also if wp pin tb.config.tc_lx_eeprom_wp_gpio works
default: ‘none’
  • tb.config.tc_lx_eeprom_wp_val
gpio protected state ‘0’ or ‘1’
default: ‘0’
  • tb.config.tc_lx_eeprom_wp_sz
size of eeprom test
default: ‘4096’
  • tb.config.tc_lx_eeprom_wp_obs
dd obs size for writting into eeprom
default: ‘32’
  • tb.config.tc_lx_eeprom_wp_wc
dd count size for writting into eeprom
default: ‘128’

linux/tc_lx_get_version.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_get_version.py

get the linux version and create event LINUX_VERSION

save the linux version in tb.config.tc_return


linux/tc_lx_gpio.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_gpio.py

set in linux gpio tb.config.tc_lx_gpio_nr to direction tb.config.tc_lx_gpio_dir

and value tb.config.tc_lx_gpio_val

used variables

  • tb.config.tc_lx_gpio_nr
gpio number
default: ‘69’
  • tb.config.tc_lx_gpio_dir
direction to witch gpio get set ‘in’ or ‘out’
default: ‘out’
  • tb.config.tc_lx_gpio_val
state of gpio ‘0’ or ‘1’
default: ‘1’

linux/tc_lx_mount.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_mount.py

mount device tb.config.tc_lx_mount_dev with fs type tb.config.tc_lx_mount_fs_type

to tb.config.tc_lx_mount_dir

used variables

  • tb.config.tc_lx_mount_dev
device which get mounted
default: ‘/dev/sda1’
  • tb.config.tc_lx_mount_fs_type
fs type for mount command
default: ‘ext4’

linux/tc_lx_mtdutils_install.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_mtdutils_install.py

check if mtdutils are installed. If not, clone the code with

git clone git://git.infradead.org/mtd-utils.git mtd-utils

and install it into tb.config.tc_workfd_work_dir


linux/tc_lx_partition_check.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_partition_check.py

cp a dummy file into a partiton umount/mount it and

compare it.


linux/tc_lx_partitions_grep.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_partitions_grep.py

check, if all strings in tb.config.tc_lx_ps_partitions are

in “cat /proc/partitions” output.

used variables

  • tb.config.tc_lx_ps_partitions
list of strings, which must be in ps output
default: ‘[]’

linux/tc_lx_printenv.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_printenv.py

simple printenv linux command


linux/tc_lx_ps_grep.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_ps_grep.py

check, if all strings in tb.config.tc_lx_ps_grep are

in ps output.

used variables

  • tb.config.tc_lx_ps_grep
list of strings, which must be in ps output
default: ‘[]’

linux/tc_lx_regulator.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_regulator.py

check if regulators in tb.config.tc_lx_regulator_nrs exist, and have

the correct microvolts settings.

used variables

  • tb.config.tc_lx_regulator_nrs
list of regulator strings. one string has 3 values
seperated by a space:
regulator_number name microvoltsvalue
default:

linux/tc_lx_trigger_wdt.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_trigger_wdt.py

simple trigger wdt with command tb.config.tc_lx_trigger_wdt_cmd

used variables

  • tb.config.tc_lx_trigger_wdt_cmd
command with which wdt gets triggered.
default: ‘/home/hs/wdt &’

linux/tc_lx_uname.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_lx_uname.py

simple linux “uname -a” command


linux/tc_workfd_apply_local_patches.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_apply_local_patches.py

apply patches from directory tb.config.tc_workfd_apply_local_patches_dir

with ‘git am -3’ to the source in current directory.

if tb.config.tc_workfd_apply_local_patches_dir == ‘none’

do nothing.

if tb.config.tc_workfd_apply_local_patches_checkpatch_cmd != ‘none’

check the patches with the checkpatch cmd tb.config.tc_workfd_apply_local_patches_checkpatch_cmd

before applying.

used variables

  • tb.config.tc_workfd_apply_local_patches_dir
path to patches which testcase should apply with “git am -3”
default: ‘none’
  • tb.config.tc_workfd_apply_local_patches_checkpatch_cmd
if != ‘none’ contains command for checking patch
for styling errors (normaly with checkpatch)
default: ‘none’
  • tb.config.tc_workfd_apply_local_patches_checkpatch_cmd_strict
if ‘yes’ return testcase with failure if checkpatch finds
errors.
default: ‘no’

linux/tc_workfd_apply_patchwork_patches.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_apply_patchwork_patches.py

apply patchworkpatches from list:

tb.config.tc_workfd_apply_patchwork_patches_list:_

to source in current directory.

creates event:

  • PW_NR: which patchwork number used
  • PW_CLEAN: is it checkpatch clean
  • PW_AA: already applied
  • PW_APPLY: apply it clean to source

used variables

  • tb.config.tc_workfd_apply_patchwork_patches_list
list of patchwork numbers, which should be used with
default: ‘[]’
  • tb.config.tc_workfd_apply_patchwork_patches_checkpatch_cmd
command with which the patches get checked
default: ‘none’
  • tb.config.tc_workfd_apply_patchwork_patches_eof
if ‘yes’ end testcase with failure, if applying fails.
default: ‘yes’

linux/tc_workfd_can.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_can.py

minimal can test:

starts a new connection named tb_canm. This connection runs

on board/PC which has a can conncetion to the board tbot

tests, named CAN PC.

If necessary (tb.config.tc_workfd_can_ssh != ‘no’), tc connects first

to ssh (if the CAN PC is not the lab PC). Also if necessary

(tb.config.tc_workfd_can_su != ‘no’, switch to superuser on the CAN PC.

Set on the CAN PC, with the “ip” command the bitrate

tb.config.tc_workfd_can_bitrate for the can device tb.config.tc_workfd_can_dev

and activate the interface.

Now on the board, go into tb.config.tc_workfd_can_iproute_dir

(which contains the “ip” command ...

Set the bitrate with it and activate the can interface.

Goto into tb.config.tc_workfd_can_util_dir which contains canutils

Send ‘123#DEADBEEF’ with cansend

check if the CAN PC gets this string.

End True if this is the case, False else

ToDo:

(add the commands to rootfs ...)

  • support different can devices on the CAN PC and board

used variables

  • tb.config.tc_workfd_can_ssh
if != ‘no’ first ssh to PC on which we have can adapter
default: ‘no’
  • tb.config.tc_workfd_can_ssh_prompt
default login prompt after login
default: ‘$’
  • tb.config.tc_workfd_can_su
do we nned sudo for can utilities
default: ‘no’
  • tb.config.tc_workfd_can_iproute_dir
path to iproute2 utilities
default: ‘/home/hs/iproute2’
  • tb.config.tc_workfd_can_util_dir
path to can utilities
default: ‘/home/hs/can-utils’
  • tb.config.tc_workfd_can_dev
can device used
default: ‘can0’
  • tb.config.tc_workfd_can_bitrate
can bitrate used for test
default: ‘500000’

linux/tc_workfd_cd_to_dir.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_cd_to_dir.py

simple cd into directory tb.config.tc_workfd_cd_name

used variables

  • tb.config.tc_workfd_cd_name
name of path
default: ‘none’

linux/tc_workfd_check_cmd_success.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_check_cmd_success.py

simple check if previous shell command was succesful


linux/tc_workfd_check_if_cmd_exist.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_check_if_cmd_exist.py

check if a command tb.config.tc_workfd_check_if_cmd_exist_cmdname

exists

used variables

  • tb.config.tc_workfd_check_if_cmd_exist_cmdname
command name which gets checked
default: ‘none’

linux/tc_workfd_check_if_device_exist.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_check_if_device_exist.py

check if a device tb.config.tc_workfd_check_if_device_exists_name exist

this tc returns always true, but sets

tb.config.tc_return True or False, because we may not

want to end testcase failed, if device not exists.

used variables

  • tb.config.tc_workfd_check_if_device_exists_name
device name
default: ‘’

linux/tc_workfd_check_if_dir_exist.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_check_if_dir_exist.py

check if a dir in tbot workdir exist

this tc returns always true, but sets

tb.config.tc_return True or False, because we may not

want to end testcase failed, if dir not exists.

if tb.config.tc_workfd_check_if_dir_exists_create != ‘no’

create the directory.

used variables

  • tb.config.tc_workfd_check_if_dir_exists_name
name of directory
default: ‘mtd-utils’
  • tb.config.tc_workfd_check_if_dir_exists_create
if ‘yes’ create directory if it does not exist
default: ‘no’

linux/tc_workfd_check_if_file_exist.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_check_if_file_exist.py

check if a file in tbot workdir exist

used variables

  • tb.config.tc_workfd_check_if_file_exists_name
filename
default: ‘bonnie++-1.03e.tgz’

linux/tc_workfd_check_tar_content.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_check_tar_content.py

check if the strings in the tb.config.tc_workfd_check_tar_content_elements

list are in the tar file tb.config.tc_workfd_check_tar_content_path

tb.config.tc_workfd_check_tar_content_path path and file name

tb.config.tc_workfd_check_tar_content_elements list of elements in the tar file

tb.config.tc_workfd_check_tar_content_endtc_onerror end TC when element is not found

used variables

  • tb.config.tc_workfd_check_tar_content_path
tar file with full path
default: ‘’
  • tb.config.tc_workfd_check_tar_content_elements
list of elements which must be in tar file
default: ‘’
  • tb.config.tc_workfd_check_tar_content_endtc_onerror
if ‘yes’ end testcase with failure
default: ‘yes’

linux/tc_workfd_check_tc_time.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_check_tc_time.py

check if time for a special testcase is expired.

some testcases (like writting in a flash) are not good for

execute them every day, so give them a timeout. This testcase

checks, if the testcases is ready for a new run.

False means time is not expired

True means time is expired

used variables

  • tb.config.tc_workfd_check_tc_time_tcname
tc name
default: ‘’
  • tb.config.tc_workfd_check_tc_time_timeout
timeout in seconds
default: ‘2592000’ which is 30 days

linux/tc_workfd_compile_linux.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_compile_linux.py

compile linux:

call “make mrproper”

add LOAD_ADDR=tb.config.tc_workfd_compile_linux_load_addr_ to make

compile modules

compile DTB from list tb.config.tc_workfd_compile_linux_dt_name

create FIT image

mkimage path: tb.config.tc_workfd_compile_linux_mkimage

fit description file: tb.config.tc_workfd_compile_linux_fit_its_file

tb.config.tc_workfd_compile_linux_fit_file

append dtb to kernel image

tb.config.tc_workfd_compile_linux_boardname _defconfig

used variables

  • tb.config.tc_workfd_compile_linux_clean
if ‘yes’ call ‘make mrproper’
default: ‘yes’
  • tb.config.tc_workfd_compile_linux_load_addr
if != ‘no’ add LOADADDR= before make
default: ‘no’
  • tb.config.tc_workfd_compile_linux_makeoptions
string of makeoptions
default: ‘none’
  • tb.config.tc_workfd_compile_linux_make_target
make target normally zImage or uImage
default: ‘uImage’
  • tb.config.tc_workfd_compile_linux_fit_its_file
if != ‘no’ create fit image
default: ‘no’
  • tb.config.tc_workfd_compile_linux_fit_file
output file name if creating fit image
default: ‘no’
  • tb.config.tc_workfd_compile_linux_boardname
name for the used defconfig (without ‘_defconfig’)
  • tb.config.tc_workfd_compile_linux_modules
if != ‘none’ build modules
default: ‘none’
  • tb.config.tc_workfd_compile_linux_modules_path
if != ‘none’ contains modules path for ‘make modules_install’ step
INSTALL_MOD_PATH=tb.config.tc_workfd_compile_linux_modules_path_
default: ‘none’
  • tb.config.tc_workfd_compile_linux_dt_name
contains a string or a list of strings of
dtb targets
default: ‘none’
  • tb.config.tc_workfd_compile_linux_append_dt
default: ‘no’
  • tb.config.tc_workfd_compile_linux_mkimage
path to mkimage tool (incl. mkimage)
default: ‘/home/hs/i2c/u-boot/tools/mkimage’

linux/tc_workfd_connect_with_conmux.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_connect_with_conmux.py

connect to console with conmux

Never tested !!!


linux/tc_workfd_connect_with_kermit.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_connect_with_kermit.py

connect with kermit to serials board console

connect first with ssh to another PC (where kermit is started)

set line tb.config.kermit_line and speed tb.config.kermit_speed and

kermit parameter list tb.config.tc_workfd_connect_with_kermit_settings

than connect to serial line.

else

connect with command in tb.config.tc_workfd_connect_with_kermit_rlogin

and a sudo is preceded to kermit.

the sudo password is searched with

user: tb.config.user + ‘_kermit’

board: tb.config.boardname

used variables

  • tb.config.kermit_line
used serial linux device
default: ‘/dev/ttyUSB0’
  • tb.config.kermit_speed
serial line speed
default: ‘115200’
  • tb.config.tc_workfd_connect_with_kermit_ssh
  • tb.config.tc_workfd_connect_with_kermit_sudo
use sudo for kermit
default: ‘none’
  • tb.config.tc_workfd_connect_with_kermit_rlogin
rlogin string for kermit. If != ‘none’
do not ‘set line’, ‘set speed’ and ‘connect’
default: ‘none’
  • tb.config.tc_workfd_connect_with_kermit_settings
list of additionally kermit parameter, which get
set after ‘set line’ and ‘set speed’
default: ‘[“set carrier-watch off”,
“set handshake none”,
“set flow-control none”,
“robust”,
“set file type bin”,
“set file name lit”,
“set rec pack 1000”,
“set send pack 1000”,
“set window 5”,
]’

linux/tc_workfd_connect_with_ssh.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_connect_with_ssh.py

connect wit ssh to board, and use it as console

used variables

  • tb.config.connect_with_ssh_user
username for connecting to boards “console”
default: ‘root’
  • tb.config.connect_with_ssh_ip
ip to connect with
default: ‘192.168.3.23’

linux/tc_workfd_cp_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_cp_file.py

simple copy file from tb.config.tc_workfd_cp_file_from to tb.config.tc_workfd_cp_file_to

used variables

  • tb.config.tc_workfd_cp_file_from
source path + filename
default: ‘’
  • tb.config.tc_workfd_cp_file_to
target path + filename
default: ‘’

linux/tc_workfd_create_ubi_rootfs.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_create_ubi_rootfs.py

create a ubifs rootfs

ubi rootfs path: tb.config.tc_workfd_create_ubi_rootfs_path

ubi parameters:

tb.config.tc_ubi_min_io_size tb.config.tc_ubi_leb_size tb.config.tc_ubi_max_leb_cnt

output path: tb.config.tc_workfd_create_ubi_rootfs_target

used variables

  • tb.config.tc_workfd_create_ubi_rootfs_path
path into which the ubifs image with name
default: ‘/opt/eldk-5.4/armv7a-hf/rootfs-minimal-mtdutils’
  • tb.config.tc_workfd_create_ubi_rootfs_target
name of the ubi image which get created
default: ‘/tftpboot/dxr2/tbot/rootfs-minimal.ubifs’

linux/tc_workfd_date.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_date.py

just as a demo for the tbot workshop

simply show, how to send a cmd (in our case “date”) to the

linux console on the DUT

(2 different possibilities)

Then send again “date” and search for the string

“Mon” in the output of the date command, and end Testcase

with True, if found, else end TC with False.

This testcase is a good starting point for writting

own testcases.

You also can use this testcase for a fast tbot

test after tbot is installed.

See config/tbot_test_py_ for more info

don;t forget to describe here variables you use in

your testcase. Format

some text, which describes the function of the variable
default: and of course, say what is the default value

linux/tc_workfd_disconnect_with_kermit.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_disconnect_with_kermit.py

disconnect from a kermit connection

and set linux prompt.


linux/tc_workfd_generate_random_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_generate_random_file.py

simple create a random file tb.tc_workfd_generate_random_file_name

with tb.tc_workfd_generate_random_file_length length.

used variables

  • tb.config.tc_workfd_generate_random_file_name
name of random file which get created
default: ‘’
  • tb.config.tc_workfd_generate_random_file_length
lenght in bytes which get created
default: ‘’

linux/tc_workfd_get_linux_source.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_get_linux_source.py

get Linux source tb.config.tc_lab_get_linux_source_git_repo with “git clone”

and go into the source tree.

check out branch tc_lab_get_linux_source_git_branch if tc_lab_get_linux_source_git_commit_id == ‘none’

else checkout commit tc_lab_get_linux_source_git_commit_id

Apply patches if needed with:

tc_lab_apply_patches_py and tc_workfd_apply_local_patches_py

used variables

  • tb.config.tc_lab_get_linux_source_git_repo
git repo to checkout
default: ‘/home/git/linux.git’
  • tb.config.tc_lab_get_linux_source_git_branch
branch which get checkout
default: ‘master’
  • tb.config.tc_lab_get_linux_source_git_reference
if != ‘none’ add –reference option to git clone
default: ‘none’
  • tb.config.tc_lab_get_linux_source_git_commit_id
if != ‘none’ checkout commit id instead branch
default: ‘none’
  • tb.config.tc_lab_get_linux_source_git_repo_user
if a username is needed for cloning
password comes from password_py_
default: ‘none’

linux/tc_workfd_get_list_of_files_in_dir.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_get_list_of_files_in_dir.py

get a list of files from directory tb.config.tc_workfd_get_list_of_files_dir

tb.config.tc_workfd_get_list_of_files_mask

used variables

  • tb.config.tc_workfd_get_list_of_files_dir
directory in which files get searched
default: ‘’
  • tb.config.tc_workfd_get_list_of_files_mask
find expression
default: ‘*’

linux/tc_workfd_get_patchwork_number_list.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_get_patchwork_number_list.py

get a list of patchworknumbers

which are delegated to specific user

tb.config.workfd_get_patchwork_number_user

currently, this testcase reads “http://patchwork.ozlabs.org/project/uboot/list/

and filters out the patches, which are for

tb.config.workfd_get_patchwork_number_user

It would be better to login and look for the users

ToDo list, but I did not find out, how to login ...

ignore patches on blacklist:

tb.config.tc_workfd_apply_patchwork_patches_blacklist

also you can set the patch order with:

tb.config.tc_workfd_get_patchwork_number_list_order

used variables

  • tb.config.workfd_get_patchwork_number_user
patchwork username
default: ‘hs’
  • tb.config.tc_workfd_apply_patchwork_patches_blacklist
patchwork numbers, which get ignored
default: ‘[]’
  • tb.config.tc_workfd_get_patchwork_number_list_order
?order= parameter for request patchwork page
default: ‘-delegate’

linux/tc_workfd_get_uboot_config_hex.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_get_uboot_config_hex.py

get a hex parameter from U-Boot configuration

return value:

TC ends True, if hex value found, else False

tb.config_result: founded hex value, else ‘undef’


linux/tc_workfd_get_uboot_config_string.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_get_uboot_config_string.py

start with

get a string parameter from U-Boot configuration

return value:

TC ends True, if string value found, else False

tb.config_result: founded string value, else ‘undef’


linux/tc_workfd_get_uboot_config_vars.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_get_uboot_config_vars.py

start with

python2.7 src/common/tbot.py -s labconfigname -c boardconfigname -t tc_workfd_get_uboot_config_vars.py

try to get some configuration variables from the U-Boot

source code, and save them in config variables.

‘CONFIG_SYS_SDRAM_BASE’ saved in tb.config.tc_ub_memory_ram_ws_base

tb.config.tc_ub_memory_ram_ws_base_alt = tc_ub_memory_ram_ws_base + 0x100000

tb.config.tc_ub_memory_ram_big depended on CONFIG_SYS_ARCH

if CONFIG_SYS_ARCH == powerpc than yes else no

used variables

  • tb.config.tc_ub_memory_ram_ws_base
base address for memory tests in RAM
if ‘undef’ testcase tc_workfd_get_uboot_config_vars_py
try to detect a good value from U-Boot config
default: ‘undef’
  • tb.config.tc_ub_memory_ram_ws_base_alt
alternate address in RAM for memory tests
if ‘undef’ testcase tc_workfd_get_uboot_config_vars_py
try to detect a good value from U-Boot config
default: ‘undef’
  • tb.config.tc_ub_memory_ram_big
big or little endian
if ‘undef’ testcase tc_workfd_get_uboot_config_vars_py
try to detect a good value from U-Boot config
default: ‘undef’
  • tb.config.tc_ub_memory_base
only output the content of the ‘help base’ and
‘base’ and ‘md tb.config.tc_ub_memory_ram_ws_base 0xc’
command.
default: ‘yes’

linux/tc_workfd_git_rebase.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_git_rebase.py

go into git source tree tb.config.tc_workfd_git_rebase_git_src_path

checkout branch tb.config.tc_workfd_git_rebase_git_base_branch

call “git fetch” and “git pull”

checkout branch tb.config.tc_workfd_git_rebase_git_work_branch

and rebase tb.config.tc_workfd_git_rebase_git_work_branch with

tb.config.tc_workfd_git_rebase_git_base_branch

used variables

  • tb.config.tc_workfd_git_rebase_git_src_path
path to source tree
default: ‘’
  • tb.config.tc_workfd_git_rebase_git_base_branch
branch name, which get rebased against tb.config.tc_workfd_git_rebase_git_work_branch
default: ‘’
  • tb.config.tc_workfd_git_rebase_git_work_branch
branch name with which tb.config.tc_workfd_git_rebase_git_base_branch gets rebased
default: ‘’

linux/tc_workfd_goto_lab_source_dir.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_goto_lab_source_dir.py

switch into lab PC source directory tb.config.tc_lab_source_dir

set TBOT_BASEDIR to tb.config.tc_lab_source_dir

if workfd == ‘tb_cpc’ go into workdirectory

on compile PC, and set there TBOT_BASEDIR to tb.config.compile_pc_workdir


linux/tc_workfd_goto_linux_code.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_goto_linux_code.py

switch into linux source tb.config.tc_lab_source_dir + “/linux-” + tb.config.boardlabname

set tb.config.linux_name to “linux-” + tb.config.boardlabname

and tb.config.linux_fulldir_name_ to tb.config.tc_lab_source_dir + “/” + tb.config.linux_name

and set $TBOT_BASEDIR_LINUX to tb.config.linux_fulldir_name_

used variables

  • tb.config.linux_name
“linux-” + tb.config.boardlabname
directory in lab source dir
default: get set from tc_workfd_goto_linux_code_py

linux/tc_workfd_goto_tbot_workdir.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_goto_tbot_workdir.py

go into the tbot work dir tb.config.tc_workfd_work_dir

if not exist, create it


linux/tc_workfd_goto_uboot_code.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_goto_uboot_code.py

switch into U-Boot source tb.config.tc_lab_source_dir + “/u-boot-” + tb.config.boardlabname

set tb.config.uboot_name to “u-boot-” + tb.config.boardlabname

and tb.config.uboot_fulldir_name to tb.config.tc_lab_source_dir + “/” + tb.config.uboot_name

and set $TBOT_BASEDIR_UBOOT to tb.config.uboot_fulldir_name

used variables

  • tb.config.uboot_name
“u-boot-” + tb.config.boardlabname
default: set from testcase tc_workfd_goto_uboot_code_py
  • tb.config.uboot_fulldir_name
“$TBOT_BASEDIR/” + tb.config.uboot_name
default: set from testcase tc_workfd_goto_uboot_code_py

linux/tc_workfd_grep.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_grep.py

search string tb.config.tc_workfd_grep_string in file tb.config.tc_workfd_grep_file

grep options configurable through tb.config.tc_workfd_grep_option

default ‘–color=never’

used variables

  • tb.config.tc_workfd_grep_file
file in which we grep
default: ‘’
  • tb.config.tc_workfd_grep_string
string we search in file
default: ‘’
  • tb.config.tc_workfd_grep_option
grep options
default: ‘–color=never’

linux/tc_workfd_hdparm.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_hdparm.py

make a minimal hdparm check

call hdparm -t tb.config.tc_workfd_hdparm_dev

and check if read speed is greater than tb.config.tc_workfd_hdparm_min

It is possible to add a PATH tb.config.tc_workfd_hdparm_path

where hdparm is installed

Testcase fails if readen speed is <= tb.config.tc_workfd_hdparm_min

used variables

  • tb.config.tc_workfd_hdparm_path
path to hdparm utility
default: ‘/home/hs/shc/hdparm-9.50/’
  • tb.config.tc_workfd_hdparm_dev
hdparm device “-t tb.config.tc_workfd_hdparm_dev”_
default: ‘/dev/mmcblk1’
  • tb.config.tc_workfd_hdparm_min
Testcase fails if readen speed is <= tb.config.tc_workfd_hdparm_min
default: ‘12.0’

linux/tc_workfd_insmod.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_insmod.py

insmod module tb.config.tc_workfd_insmod_module with

module path tb.config.tc_workfd_insmod_mpath and

tb.config.tc_workfd_insmod_module_path

check if the strings in list tb.config.tc_workfd_insmod_module_checks

come back when inserting the module.

used variables

  • tb.config.tc_workfd_insmod_module
module name without ‘.ko’
default: ‘’
  • tb.config.tc_workfd_insmod_mpath
path to modules
default: ‘’
  • tb.config.tc_workfd_insmod_module_path
path to module
default: ‘’
  • tb.config.tc_workfd_insmod_module_checks
list of strings which must be found when loading module
default: ‘’

linux/tc_workfd_iperf.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_iperf.py

make a minimal iperf check

starts an iperf server on tb.tc_workfd_c_sr connection

with ip addr tb.tc_workfd_iperf_sip

starts an iperf “slave” on tb.tc_workfd_c_sl

waiting for the first result of iperf measure and

check if the resulting speed is bigger then

tb.config.tc_workfd_iperf_minval

if you have not the iperf cmd instead iperf 3, you can

set

tb.config.tc_workfd_c_sr_vers or tb.config.tc_workfd_c_sl_vers

to ‘3’

used variables

  • tb.config.tc_workfd_c_sr
tbot connection where iperf server is started
default: ‘’
  • tb.config.tc_workfd_c_sl
tbot connection where iperf slave is started
default: ‘’
default: ‘’
  • tb.config.tc_workfd_iperf_sip
iperf server ip used for iperf slave
default: ‘’
  • tb.config.tc_workfd_iperf_minval
if iperf result is greater than tb.config.tc_workfd_iperf_minval
testcase tc_workfd_iperf_py returns True
default: ‘’
  • tb.config.tc_workfd_c_sr_vers
iperf version
default: ‘’
  • tb.config.tc_workfd_c_sl_vers
iperf version
default: ‘’

linux/tc_workfd_linux_get_ifconfig.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_linux_get_ifconfig.py

read from tb.config.linux_get_ifconfig_dev the current

ip addr and save it in tb.config.linux_get_ifconfig_ip

broadcast and save it in tb.config.linux_get_ifconfig_broadcast

mask and save it in tb.config.linux_get_ifconfig_mask

used variables

  • tb.config.linux_get_ifconfig_dev
network device, for which ip, mask and broadcast address get detected.
default: ‘’
  • tb.config.linux_get_ifconfig_ip
contains current ip address from tb.config.linux_get_ifconfig_dev
default:
  • tb.config.linux_get_ifconfig_broadcast
contains current broadcast address from tb.config.linux_get_ifconfig_dev
default:
  • tb.config.linux_get_ifconfig_mask
contains current mask from tb.config.linux_get_ifconfig_dev
default:

linux/tc_workfd_linux_get_uboot_env.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_linux_get_uboot_env.py

read U-Boot Environment variable from tb.config.linux_get_uboot_env_name

from linux with fw_printenv, and save the value in tb.config.linux_get_uboot_env_value

used variables

  • tb.config.linux_get_uboot_env_name
U-Boot Envvariable, which get read
default: ‘’
  • tb.config.linux_get_uboot_env_value
get set from testcase tc_workfd_linux_get_uboot_env_py
default:

linux/tc_workfd_linux_mkdir.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_linux_mkdir.py

check if the directory tb.config.tc_workfd_linux_mkdir_dir exists.

if not, create it

used variables

  • tb.config.tc_workfd_linux_mkdir_dir
directory which get created
default:

linux/tc_workfd_lx_get_bc.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_lx_get_bc.py

get in linux bootcount value

through file tb.config.tc_workfd_lx_get_bc_file

if not found testcases end with failure

value returned in var tb.lx_bc


linux/tc_workfd_lx_set_bc.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_lx_set_bc.py

set in linux bootcount value tb.lx_bc

through file tb.config.tc_workfd_lx_get_bc_file


linux/tc_workfd_md5sum.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_md5sum.py

calculate md5sum of file tb.config.tc_workfd_md5sum_name , and store it in

tb.tc_workfd_md5sum_sum

used variables

  • tb.config.tc_workfd_md5sum_name
path with filename, for which md5sum gets calculated
default:

linux/tc_workfd_rm_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_rm_file.py

simple rm file tb.config.tc_workfd_rm_file_name on the lab

used variables tc_workfd_rm_file_name

  • tb.config.tc_workfd_rm_file_name
filenam which get removed (call rm tb.config.tc_workfd_rm_file_name)_
default: ‘none’

linux/tc_workfd_scp.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_scp.py

start an scp transfer

tb.config.tc_workfd_scp_opt:_ scp options

tb.config.tc_workfd_scp_from:_ from where

tb.config.tc_workfd_scp_to:_ to where

If the scp command asks for “password” the testcase extracts

the user and ip from scp output “user@ip's password:”

and writes the password it find in password_py_ with

tb.write_stream_passwd(tb.workfd, user, ip)

to the scp command ... if no user and or ip

is found ... scp command fails and so the testcase.

An errorneous scp command exits with an error code.

check this error code when scp command finished,

and return True, if no error, else False.

used variables

  • tb.config.tc_workfd_scp_opt
if != ‘none’ contains scp option string
default: ‘none’
  • tb.config.tc_workfd_scp_from
string from where scp copy
default: ‘’
  • tb.config.tc_workfd_scp_to
string to where scp copy
default: ‘’

linux/tc_workfd_set_gpio.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_set_gpio.py

Sets a GPIO through sysfs gpio high/low

Call like this:

tb.eof_call_tc(“tc_workfd_set_gpio_py”, highlow=’high’, gpio=gpioname)


linux/tc_workfd_ssh.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_ssh.py

login with ssh to tb.config.workfd_ssh_cmd and ssh options

tb.config.workfd_ssh_opt._

This testcases expects

tb.config.workfd_ssh_cmd_prompt

as the prompt it get, after a succefull log in.

When logged in call

if tb.config.workfd_ssh_do_first == ‘yes’:

tb.do_first_settings_after_login(c)

used variables

  • tb.config.workfd_ssh_cmd
ssh command string
default:
  • tb.config.workfd_ssh_cmd_prompt
prompt after successful ssh
default: ‘$’
  • tb.config.workfd_ssh_opt
option string for ssh
default: ‘none’
  • tb.config.workfd_ssh_do_first
if == ‘yes’, call
tb.do_first_settings_after_login(c)
after successful login.
default: ‘yes’

linux/tc_workfd_switch_su.py

https://github.com/hsdenx/tbot/blob/master/src/tc/linux/tc_workfd_switch_su.py

switch to superuser with user ‘root’ and password

tb.config.switch_su_board

used variables

  • tb.config.switch_su_board
boardname with which password get searched in password file.
default: ‘lab’

Directory uboot

Directory uboot/duts

uboot/duts/tc_ub_duts_hush.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/duts/tc_ub_duts_hush.py

create the logfiles needed for the U-Boot documentation

used in src/documentation/u-boot-script.rst

based on the DULG chapter:

http://www.denx.de/wiki/view/DULG/CommandLineParsing


uboot/duts/tc_ub_duts_version.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/duts/tc_ub_duts_version.py

execute U-Boots “version” cmd, and create event


uboot/duts/tc_ub_i2c_help.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/duts/tc_ub_i2c_help.py

simple prints “help i2c” cmd

used variables

  • tb.config.tc_ub_i2c_help_with_bus
if ‘yes’ i2c help output with “i2c bus”
default: ‘no’

uboot/duts/tc_ub_start_all_duts.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/duts/tc_ub_start_all_duts.py

start all DUTS tests

only start the DUTS testcases, if tb.config.tc_ub_start_all_duts_start

is set to True (default)

used variables

  • tb.config.tc_ub_start_all_duts_start
if ‘yes’ start all duts testcases
default: ‘yes’

uboot/tc_ub_aristainetos2_ubi.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_aristainetos2_ubi.py

ubi testcases for the aristainetos2 board


uboot/tc_ub_check_reg_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_check_reg_file.py

checks if the default values in reg file tb.config.tc_ub_create_reg_file_name

on the tbot host in tb.workdir have the same values, as the

registers on the board

format of the regfile:

regaddr mask type defval

ToDo: use the file from the lab host, not the tbot host


uboot/tc_ub_check_version.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_check_version.py

check if the current running U-Boot vers == tb.uboot_vers

and SPL vers == tb.spl_vers


uboot/tc_ub_cmp.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_cmp.py

compare the contents of tb.config.tc_ub_cmp_addr1 with

tb.config.tc_ub_cmp_addr2 of tb.config.tc_ub_cmp_len

bytes length

used variables

  • tb.config.tc_ub_cmp_addr1
address one
default: ‘’
  • tb.config.tc_ub_cmp_addr2
address one
default: ‘’
  • tb.config.tc_ub_cmp_len
length of bytes which get compared
default: ‘’

uboot/tc_ub_create_am335x_reg_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_create_am335x_reg_file.py

creates U-Boot register dump files for an am335x based board.

using testcase tc_ub_create_reg_file_py

dumps:

  • pinmux 44e10000 - 44e10004
  • pinmux 44e10010 - 44e10010
  • pinmux 44e10040 - 44e10040
  • pinmux 44e10110 - 44e10110
  • pinmux 44e10428 - 44e11440
  • cm per 44e00000 - 44e00150
  • cm wkup 44e00400 - 44e004d0
  • cm dpll 44e00500 - 44e0053c
  • cm mpu 44e00600 - 44e00604
  • cm device 44e00700 - 44e00700
  • emif 4c000000 - 4c000120
  • ddr 44e12000 - 44e121dc

into files found in src/files/

create for your board a subdir in the directory,

and move the new created files into it, so you have

them as a base for comparing further.


uboot/tc_ub_create_imx28_reg_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_create_imx28_reg_file.py

creates U-Boot register dump files for an imx28 based board.

using testcase tc_ub_create_reg_file_py

dumps:

  • pinmux 80018000 - 80018b40
  • clkctrl 80044000 - 80044170
  • emi 800e0000 - 800e02ec
  • gpmi 8000c000 - 8000c0d4
  • enet 0 800f0000 - 800f0684
  • enet 1 800f4000 - 800f4684

into files found in src/files/

create for your board a subdir in the directory,

and move the new created files into it, so you have

them as a base for comparing further use.


uboot/tc_ub_create_imx6_reg_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_create_imx6_reg_file.py

creates U-Boot register dump files for an imx6 based board.

using testcase tc_ub_create_reg_file_py

dumps:

  • pinmux 20e0000 - 20e0950

into files found in src/files/

create for your board a subdir in the directory,

and move the new created files into it, so you have

them as a base for comparing further use.


uboot/tc_ub_create_reg_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_create_reg_file.py

creates a reg file tb.config.tc_ub_create_reg_file_name on the tbot host

in tb.workdir

read from tb.config.tc_ub_create_reg_file_start to tb.config.tc_ub_create_reg_file_stop

and writes the results in the regfile tb.config.tc_ub_create_reg_file_name

format of the regfile:

regaddr mask type defval

This reg file can be used as a default file, how the

registers must be setup, check it with testcase

tc_ub_check_reg_file_py

ToDo: use the file from the lab host, not the tbot host

used variables

  • tb.config.tc_ub_create_reg_file_name
filename of regfile which gets created
complete path: tb.workdir + “/” + tb.config.tc_ub_create_reg_file_name
default: ‘’
  • tb.config.tc_ub_create_reg_file_start
start addresse from which a register dump gets created
default: ‘’
  • tb.config.tc_ub_create_reg_file_stop
stop addresse to which a register dump gets created
default: ‘’
  • tb.config.tc_ub_readreg_mask
mask which gets written as default into register dump file
default:
  • tb.config.tc_ub_readreg_type
u-boot types of md command
‘l’, ‘w’ or ‘b’
default: ‘’
  • tb.config.tc_ub_create_reg_file_mode
filemode, for file which gets created
default:
  • tb.config.tc_ub_create_reg_file_comment
if != ‘none’ add a comment line with content of this variable
preceeded by a ‘#’
default: ‘none’

uboot/tc_ub_dfu.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_dfu.py

test dfu

tb.config.tc_ub_dfu_dfu_util_downloadfile

  • download it back to the board
  • upload it again
  • and compare the two files

used variables

  • tb.config.tc_ub_dfu_dfu_util_path
path to dfu-util program
default: ‘/home/hs/zug/dfu-util’
  • tb.config.tc_ub_dfu_dfu_util_alt_setting
alt setting for dfu command
default: ‘Linux’
  • tb.config.tc_ub_dfu_dfu_util_downloadfile
file with full path which is used as temporary file
in this testcase.
default: ‘’

uboot/tc_ub_dfu_random.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_dfu_random.py

test a U-Boot dfu alt setting tb.config.tc_ub_dfu_dfu_util_alt_setting

Therefore write a random file with size tb.config.tc_ub_dfu_rand_size

to it, reread it and compare it. TC fails if files differ

(If readen file is longer, this is no error!)

random file is created in tb.config.lab_tmp_dir

If dfu-util is not installed on the lab PC, set

tb.config.tc_ub_dfu_dfu_util_ssh for connecting with ssh to a PC

which have it installed, and a USB cable connected to the board.

Set tb.config.tc_ub_dfu_dfu_util_path to the path of dfu-util, if

you have a self compiled version of it.

Set tb.config.tc_ub_dfu_rand_ubcmd for the executed command on

U-Boot shell for getting into DFU mode

used variables

  • tb.config.tc_ub_dfu_dfu_util_ssh
if != ‘none’ connect with ssh to a PC, where
dfu-util is installed.
default: ‘none’
  • tb.config.tc_ub_dfu_rand_size
size in bytes of created random file
default: ‘’
  • tb.config.tc_ub_dfu_rand_ubcmd
U-Boot command for starting dfu
default: ‘’

uboot/tc_ub_dfu_random_default.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_dfu_random_default.py

test a U-Boot dfu alt setting tb.config.tc_ub_dfu_dfu_util_alt_setting

with reading / writing different sizes

and calling testcase tc_ub_dfu_random_py

used variables

  • tb.config.dfu_test_sizes_default
default: [
64 - 1,
64,
64 + 1,
128 - 1,
128,
128 + 1,
960 - 1,
960,
960 + 1,
4096 - 1,
4096,
4096 + 1,
1024 * 1024 - 1,
1024 * 1024,
8 * 1024 * 1024,
]

uboot/tc_ub_get_bc.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_get_bc.py

get in uboot bootcount value

if not found testcases end with failure

value returned in var tb.ub_bc


uboot/tc_ub_get_filesize.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_get_filesize.py

simple get the content of U-Boot env variable filesize

and store it in tb.ub_filesize


uboot/tc_ub_get_version.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_get_version.py

search in tb.config.tc_ub_get_version_file the string

tb.config.tc_ub_get_version_string

and save the value in tb.config.tc_return and create

event ID UBOOT_VERSION.

used variables

  • tb.config.tc_ub_get_version_file
file in which string gets searched
default: ‘’
  • tb.config.tc_ub_get_version_string
string which get searched in file
default: ‘’

uboot/tc_ub_help.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_help.py

test U-Boots help cmd

may we add a list as parameter, so we can adapt it board

specific.


uboot/tc_ub_load_board_env.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_load_board_env.py

task: load U-Boot Environment env.txt file with tftp for the

board tb.config.tftpboardname to the addr tb.config.ub_load_board_env_addr

from subdir tb.config.ub_load_board_env_subdir_

and imports the the textfile with ‘env import’

options:

if tb.config.tc_ub_boot_linux_load_env == ‘no’ than TC does nothing

if tb.config.tc_ub_boot_linux_load_env == ‘set’ or == ‘setend’

than TC executes the cmds in list tb.config.ub_load_board_env_set

if tb.config.tc_ub_boot_linux_load_env == ‘setend’ TC returns

after executing the commands with True

else TC executes the steps described in ‘task’

tb.config.ub_load_board_env_testcase != ‘none’

call a board specific testcase, whichs name is defined in

tb.config.ub_load_board_env_testcase for setting U-Boot

Env. If this testcase succeeds, end True.

used variables

  • tb.config.ub_load_board_env_testcase
if != ‘none’ call testcase with this name for
for setting U-Boot Environment
default: ‘none’
  • tb.config.ub_load_board_env_addr
ram address to which the env.txt file gets loaded
default: ‘0x81000000’
  • tb.config.ub_load_board_env_subdir
subdir name in which env.txt file is found
default: ‘tbot’
  • tb.config.tc_ub_boot_linux_load_env
value
‘no’ no Environment gets loaded
‘set’ load Environment from tb.config.ub_load_board_env_set
‘setend’ same as ‘set’ just end testcase after
Environment is set from tb.config.ub_load_board_env_set
‘load’ tftp a ‘env.txt’ file and import it with
‘env import -t’
default: ‘load’
  • tb.config.ub_load_board_env_set
list of Environment settings
default: ‘[]’

uboot/tc_ub_reset.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_reset.py

simply call U-Boots reset command

This testcase works only on the console connection c_con


uboot/tc_ub_setenv.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_setenv.py

set U-Boot Environmentvariable tb.config.setenv_name with value

tb.config.setenv_value

used variables:

  • tb.config.setenv_name
name of the U-Boot Environment variable
default: ‘tralala’
  • tb.config.setenv_value
value of the U-Boot Environment variable
defalt: ‘hulalahups’

uboot/tc_ub_setenv_fkt.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_setenv_fkt.py

set U-Boot Environmentvariable tb.config.setenv_name with value

tb.config.setenv_value

This is for demonstration how to use functions in tbot only.

So, this testcase sets 3 times the U-Boot Envvariable:

  • The new way with importing the functions from testcase

src/tc/uboot/tc_ub_testfkt_py

with tb.eof_call_tc()

with tb.call_tc() and getting the return value.


uboot/tc_ub_test_py.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_test_py.py

call test/py from u-boot source

  • power off the board
  • disconnect console
  • goto u-boot code with testcase tc_workfd_goto_uboot_code_py
  • call test/py
  • power off the board
  • connect back to console

test/py hookscript directory:

tb.config.tc_ub_test_py_hook_script_path

you can disable this testcase with tb.config.tc_ub_test_py_start = ‘no’

may a configure file is needed, so create it with

tb.config.tc_ub_test_py_configfile._ This variable contains

the config file, which gets created.

at the end create event with ID UBOOT_TEST_PY

used variables

  • tb.config.tc_ub_test_py_hook_script_path
full path to hook scripts for test/py
default: ‘$HOME/testframework/hook-scripts’
  • tb.config.tc_ub_test_py_configfile
list of strings with configsettings for test/py
default: ‘[]’
  • tb.config.tc_ub_test_py_start
if ‘no’ do not start test/py
default: ‘yes’

uboot/tc_ub_testfkt.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_testfkt.py

This testcase is for demonstration of using functions in

testcases, and use them from other testcases.

testcase which calls this function for demo:

src/tc/uboot/tc_ub_setenv_fkt_py

defines 2 functions:

  • ub_setenv(tb, c, name, val)

set Environment variable name with value val

  • ub_checkenv(tb, c, name, val)

checks, if U-Boot Environmentvariable name

has the value val.

there are 2 ways from calling this testcase directly

from the cmdline:

  • with arguments:

tbot.py -s lab_denx -c beagleboneblack -t tc_ub_testfkt.py -a “Heiko Schochernew”

name = tb.arguments.split()[0]

val = tb.arguments.split()[1]

  • without arguments:

tbot.py -s lab_denx -c beagleboneblack -t tc_ub_testfkt.py

in this case

name = tb.config.setenv_name

val = tb.config.setenv_value


uboot/tc_ub_ubi_check_volume.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_ubi_check_volume.py

checks if ubi volume tb.config.tc_ub_ubi_load_name exists

used variables

  • tb.config.tc_ub_ubi_load_name
volume name
default: ‘kernel’

uboot/tc_ub_ubi_create_volume.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_ubi_create_volume.py

create ubi volume tb.config.tc_ub_ubi_create_vol_name with size

tb.config.tc_ub_ubi_create_vol_sz

used variables

  • tb.config.tc_ub_ubi_create_vol_name
volume name, which get created
  • tb.config.tc_ub_ubi_create_vol_sz
size of volume which get created
default: ‘600000’

uboot/tc_ub_ubi_erase.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_ubi_erase.py

erase an ubi device

execute U-Boot Env tbot_ubi_erase


uboot/tc_ub_ubi_prepare.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_ubi_prepare.py

preparation for ubi tests

load U-Boot Env with tc_ub_load_board_env_py

check if an ubi partition is attached, if so detach it

execute “ubi part” with tb.config.tc_ub_ubi_prep_partname

if tb.config.tc_ub_ubi_prep_offset != ‘none’

with offset tb.config.tc_ub_ubi_prep_offset

and detach it

used variables:

  • tb.config.tc_ub_ubi_prep_partname
mtd partition name, which is used for ubi
default: ‘ubi’
  • tb.config.tc_ub_ubi_prep_offset
ubi pyhsical VID header offset for ‘ubi part’ command
default: ‘none’

uboot/tc_ub_ubi_read.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_ubi_read.py

read ubi volume tb.config.tc_ub_ubi_prep_offset to tb.config.tc_ub_ubi_read_addr

with len tb.config.tc_ub_ubi_read_len

used variables

  • tb.config.tc_ub_ubi_read_addr
ram address for ‘ubi read’
default: ‘’
  • tb.config.tc_ub_ubi_read_vol_name
ubi volume name, which get read into ram
default: ‘’
  • tb.config.tc_ub_ubi_read_len
length in bytes for ‘ubi read’
default: ‘’

uboot/tc_ub_ubi_write.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_ubi_write.py

write image @ tb.config.tc_ub_ubi_write_addr to ubi volume

tb.config.tc_ub_ubi_write_vol_name with len tb.config.tc_ub_ubi_write_len

used variables

  • tb.config.tc_ub_ubi_write_addr
RAM address of image, which gets written into ubi volume
default: ‘14000000’
  • tb.config.tc_ub_ubi_write_vol_name
ubi volume name in which the image gets written
  • tb.config.tc_ub_ubi_write_len
length in bytes which gets written into ubi volume
default: ‘0xc00000’

uboot/tc_ub_ubifs_ls.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_ubifs_ls.py

ls ubifs tb.config.tc_ub_ubifs_ls_dir

used variables

  • tb.config.tc_ub_ubifs_ls_dir
directory path which gets listed with ‘ubifsls’
default: ‘/’

uboot/tc_ub_ubifs_mount.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_ubifs_mount.py

mount ubifs tb.config.tc_ub_ubifs_volume_name

used variables

  • tb.config.tc_ub_ubifs_volume_name
ubifs volume name which gets mounted with ‘ubifsmount’
default: ‘ubi:rootfs’

uboot/tc_ub_upd_spl.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_upd_spl.py

update new spl to board if tb.config.tc_ub_upd_spl_withspl == ‘yes’

steps:

  • execute “run tbot_upd_spl”
  • execute “run tbot_cmp_spl”
  • reset board
  • get u-boot

used variables

  • tb.config.tc_ub_upd_spl_ubvars
additionaly printed U-Boot Environmnet variables, if != ‘none’
default: ‘none’
  • tb.config.tc_ub_upd_spl_withspl
if != ‘yes’ do nothing, return True
default: ‘yes’
  • tb.config.tc_ub_upd_spl_latest
if == ‘no’ load U-Boot Environment with testcase
default: ‘no’

uboot/tc_ub_upd_uboot.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_ub_upd_uboot.py

update new uboot to board

steps:

  • load tbot u-boot env vars if tb.config.tc_ub_upd_uboot_latest == ‘no’
  • execute “run tbot_upd_uboot”
  • execute “run tbot_cmp_uboot”
  • reset board
  • get u-boot

used variables

  • tb.config.tc_ub_upd_uboot_ubvars
additionaly printed U-Boot Environmnet variables, if != ‘none’
default: ‘none’
  • tb.config.tc_ub_upd_uboot_latest
if == ‘no’ load U-Boot Environment with testcase
default: ‘no’

uboot/tc_uboot_check_kconfig.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_uboot_check_kconfig.py

check for all boards, if a patch changes the u-boot binary

If U-boot binary changed by the patch this testcase fails.

use this testcase, if you for example move a config option

into Kconfig. As we need reproducable builds, we need to

patch U-Boot with tb.config.tc_uboot_check_kconfig_preparepatch

find this patch here: src/files/ub-patches/0001-U-Boot-version-fix.patch

copy it to the lab pc and adapt tb.config.tc_uboot_check_kconfig_preparepatch

Steps from this testcase:

get rid of local version ToDo: find a way to disable CONFIG_LOCALVERSION_AUTO

so this patch is not longer needed.

read a list of boards and md5sums from the file in

tb.config.tc_uboot_check_kconfig_read_sumfile

else

  • create a list of boards (all defconfigs)
  • do for all boards:
  • get architecture and set toolchain
  • compile U-Boot and calculate md5sum

with tc_workfd_compile_uboot_py and tc_workfd_md5sum_py

save the board md5sum lists in the file

tb.config.tc_uboot_check_kconfig_create_sumfile

you can use this now as a reference, so no need

to calculate always for all boards the md5sums

-> saves a lot of time!

  • apply patch(es) with tc_workfd_apply_patches_py
  • do for all boards:
  • compile U-Boot again (patched version)
  • calculate md5sum again
  • calculate md5sums
  • check if they are the same

used variables:

  • tb.config.tc_uboot_check_kconfig_preparepatch
full path to directory, which contains patch
to patch U-Boot to produce reproducible builds
default: ‘’
  • tb.config.tc_uboot_check_kconfig_read_sumfile
fix value ‘none’
  • tb.config.tc_uboot_check_kconfig_create_sumfile
fix value ‘md5sum.txt’

uboot/tc_uboot_ext2load.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_uboot_ext2load.py

load a file from ext2 into ram with ext2ls cmd.

check if the file has crc32 checksum 0x2144df1c

How to create such a file, which has crc32 checksum of 0x2144df1c ?

$ dd if=/dev/urandom of=test.bin bs=1M count=1

$ crc32 test.bin

4f3fef33

$ perl -e ‘print pack “H*”, “33ef3f4f”’ >> test.bin

$ crc32 test.bin

2144df1c

https://stackoverflow.com/questions/28591991/crc32-of-already-crc32-treated-data-with-the-crc-data-appended

!! Don;t forget Big into little endian conversion

used variables

  • tb.config.tc_uboot_ext2load_check
if == ‘no’ do not check crc
default: ‘no’
  • tb.config.tc_uboot_ext2load_file
name of file, which gets loaded
default: ‘/test.bin’
  • tb.config.tc_uboot_ext2load_addr
RAM address to which the file get loaded
default: ‘10000000’
  • tb.config.tc_uboot_ext2load_dev
device from which the file get loaded
default: ‘0:1’
  • tb.config.tc_uboot_ext2load_interface
device from which the file get loaded
default: ‘usb’

uboot/tc_uboot_ext2ls.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_uboot_ext2ls.py

simply call ext2ls U-Boot command and check if

all strings in tb.config.tc_uboot_ext2ls_expect

come back from the command.

used variables

  • tb.config.tc_uboot_ext2ls_expect
list of strings, which should come back from
command ‘ext2ls’
default: “[‘lost+found’]”
  • tb.config.tc_uboot_ext2ls_interface
used interface for ext2ls command
default: ‘usb’
  • tb.config.tc_uboot_ext2ls_dev
device used for ext2ls command
default: ‘0:1’
  • tb.config.tc_uboot_ext2ls_dir
directory, which gets dumped
default: ‘/’

uboot/tc_uboot_get_arch.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_uboot_get_arch.py

get architecture from u-boot config


uboot/tc_uboot_load_bin_with_kermit.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_uboot_load_bin_with_kermit.py

load binary into ram with loadb

if tb.config.tc_uboot_load_bin_with_kermit_possible != ‘yes’

do nothing return True

default: ‘yes’

precondition:

kermit must be used

steps:

protocol: kermit_protocol=’kermit’

wait for “C-Kermit>”

connect

you must get back something like this:

## Total Size = 0x00050bc0 = 330688 Bytes

## Start Addr = 0x81000000

used variables

  • tb.config.tc_uboot_load_bin_with_kermit_possible
if != ‘yes’ return True, do nothing
default: ‘yes’
  • tb.config.tc_uboot_load_bin_ram_addr
RAM address to which file get loaded
default: ‘81000000’
  • tb.config.tc_uboot_load_bin_file
filename which get loaded with kermit
default: ‘/home/alka/tbot/nero-images/u-boot.img’
  • tb.config.tc_uboot_load_bin_with_kermit_kermit_settings
kermit settings, known to work good
default:
[
“set carrier-watch off”,
“set handshake none”,
“set flow-control none”,
“robust”,
“set file type bin”,
“set file name lit”,
“set rec pack 100”,
“set send pack 100”,
“set window 5”,
]’

uboot/tc_uboot_usb_info.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_uboot_usb_info.py

call “usb info” command

used variables:

  • tb.config.tc_uboot_usb_info_expect
strings which must come from “usb info” command
default: “[‘Hub, USB Revision 2.0’, ‘Mass Storage, USB Revision 2.0’]”

uboot/tc_uboot_usb_start.py

https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_uboot_usb_start.py

call “usb start” command

used variable

strings which must come back from “usb start” command
default: ‘Storage Device(s) found’

Directory yocto

yocto/tc_workfd_bitbake.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_workfd_bitbake.py

simple call bitbake with tb.config.tc_workfd_bitbake_args

if tb.config.tc_workfd_bitbake_machine is != ‘none’, also cat

the content of the newest file in tmp/log/cooker/” + tb.config.tc_workfd_bitbake_machine + “/*

used variables:

  • tb.config.tc_workfd_bitbake_machine
if != ‘none’ add “MACHINE=tb.config.tc_workfd_bitbake_machine_ ” bofore
bitbake command.
default: ‘none’
  • tb.config.tc_workfd_bitbake_args
arguments for bitbake command
default: ‘’

yocto/tc_workfd_check_repo_cmd.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_workfd_check_repo_cmd.py

check if repo cmd exists, if not try to set

PATH variable stored in tb.config.tc_workfd_repo_path_

used variable:

PATH to repo command. If ‘repo’ command is not found
add this path to PATH Environment variable.
default: ‘none’

yocto/tc_workfd_get_with_repo.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_workfd_get_with_repo.py

get yocto code with repo tool and configure sources

  • check if repo command exists

if not try to set path to it, if tb.config.tc_workfd_repo_path_

is set, else failure

if dir $TBOT_BASEDIR_REPO does not exist create it

  • call “repo init” with variables

tb.config.tc_workfd_get_with_repo_u

tb.config.tc_workfd_get_with_repo_m

tb.config.tc_workfd_get_with_repo_b

  • get newest sources with “repo sync”
  • setup environment with samples from meta-

tb.config.tc_workfd_get_with_repo_metaname

exists, if not create it and set DL_DIR and SSTATE_DIR in local.conf

with the values from tb.config.tc_workfd_get_yocto_source_conf_dl_dir

and tb.config.tc_workfd_get_yocto_source_conf_sstate_dir

and setup site.conf with specific settings

used variables:

  • tb.config.tc_workfd_get_with_repo_metaname
name for meta layer, from which samples get used for
setting up bitbake with ‘TEMPLATECONF=meta-‘ + tb.config.tc_workfd_get_with_repo_metaname
default: ‘beld’
  • tb.config.builddir
bitbake builddir. If it exists, only dump site.conf
If dir not exist, setup up this directory
default: “$TBOT_BASEDIR_YOCTO/build_” + tb.config.tc_workfd_bitbake_machine + “/”
  • tb.config.tc_workfd_get_with_repo_sync
call ‘repo sync’ if yes
default: ‘yes’
  • tb.config.tc_workfd_get_with_repo_u
‘-u’ paramter for repo command
default: ‘’
  • tb.config.tc_workfd_get_with_repo_m
‘-m’ paramter for repo command
default: ‘’
  • tb.config.tc_workfd_get_with_repo_b
‘-b’ paramter for repo command
default: ‘’
  • tb.config.tc_workfd_get_with_repo_target
target directory, where source is found after “repo sync”
‘$TBOT_BASEDIR_REPO/’ + tb.config.tc_workfd_get_with_repo_target
default: ‘’

yocto/tc_workfd_get_yocto_source.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_workfd_get_yocto_source.py

get yocto source tb.config.tc_workfd_get_yocto_patches_git_repo with “git clone”

check out branch:

tb.config.tc_workfd_get_yocto_patches_git_branch

check out commit ID:

tb.config.tc_workfd_get_yocto_git_commit_id

if tb.config.tc_workfd_get_yocto_patches_git_repo != ‘none’

apply patches with “git am” from directory:

tb.config.tc_workfd_get_yocto_clone_apply_patches_git_am_dir_

additionally define a reference for cloning:

tb.config.tc_workfd_get_yocto_source_git_reference_

if a user/password for cloning is needed, define the user:

tb.config.tc_workfd_get_yocto_source_git_repo_user_

and set the password in password_py_

get other layers defined in the list:

tb.config.tc_workfd_get_yocto_source_layers

if tb.config.tc_workfd_get_yocto_source_autoconf == ‘none’

overwrite yocto configuration found in

tb.config.tc_workfd_get_yocto_source_conf_dir

else

try to autogenerate bblayers.conf and site.conf

clones into directory tb.config.yocto_name

created with tc_workfd_goto_yocto_code_py

used variables

  • tb.config.tc_workfd_get_yocto_source_autoconf
if ‘none’ copy config files from tb.config.tc_workfd_get_yocto_source_conf_dir
default: ‘none’
  • tb.config.tc_workfd_get_yocto_source_conf_dir
path, in which yocto configurations file are found
default: ‘not defined’
  • tb.config.tc_workfd_get_yocto_patches_git_repo
path to git repo with yocto patches
default: ‘’
  • tb.config.tc_workfd_get_yocto_patches_git_branch
branch which get checked out in tb.config.tc_workfd_get_yocto_patches_git_repo
default: ‘’
  • tb.config.tc_workfd_get_yocto_patches_git_repo_name
name the repo with the patches gets
default: ‘’
  • tb.config.tc_workfd_get_yocto_source_git_repo
git url, to yocto code
default: ‘git://git.yoctoproject.org/poky.git’
  • tb.config.tc_workfd_get_yocto_source_git_branch
branch which gets checked out
default: ‘pyro’
  • tb.config.tc_workfd_get_yocto_git_commit_id
if != ‘none’ commit ID to which tree gets resettet
default: ‘none’
  • tb.config.tc_workfd_get_yocto_source_layers
list of meta layers, which get checked out
one element contains the following list element:
[‘git repo’,
‘git branch’,
‘git commit id’,
‘apply_patches_dir’
‘apply_patches_git_am_dir’,
‘source_git_reference’,
‘source_git_repo_user’,
‘source_git_repo_name’
]

default: “
[
[‘git://git.openembedded.org/meta-openembedded’, ‘morty’, ‘659d9d3f52bad33d7aa1c63e25681d193416d76e’, ‘none’, ‘none’, ‘none’, ‘’, ‘meta-openembedded’],
[‘https://github.com/sbabic/meta-swupdate.git‘, ‘master’, ‘b3abfa78d04b88b88bcef6f5be9f2adff1293544’, ‘none’, ‘none’, ‘none’, ‘’, ‘meta-swupdate’],
]
  • tb.config.tc_workfd_get_yocto_source_conf_dl_dir
path to yocto download directory.
If != ‘none’ testcase checks if exists, if not
create it. Also patch local.conf
default: ‘none’
  • tb.config.tc_workfd_get_yocto_source_conf_sstate_dir
path to sstate directory.
If != ‘none’ testcase checks if exists, if not
create it. Also patch local.conf
default: ‘none’

yocto/tc_workfd_goto_repo_code.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_workfd_goto_repo_code.py

switch into yocto source directory $TBOT_BASEDIR_REPO

created with repo tool.

Which is tb.config.tc_lab_source_dir + “/repo-” + tb.config.boardlabname

set tb.config.repo_name to “repo-” + tb.config.boardlabname

and tb.config.repo_fulldir_name to tb.config.tc_lab_source_dir + “/” + tb.config.repo_name

and set $TBOT_BASEDIR_REPO to tb.config.repo_fulldir_name

used variables

  • tb.config.tc_workfd_goto_repo_code_dirext
if != ‘none’ add this string to tb.config.repo_name
default: ‘none’
  • tb.config.tc_workfd_goto_repo_code_checked
variable at runtime set, do not set it from a config file
marker, if setup for this testcase is already done.
  • tb.config.repo_name
set to to “repo-” + tb.config.boardlabname
  • tb.config.repo_fulldir_name

yocto/tc_workfd_goto_yocto_code.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_workfd_goto_yocto_code.py

switch into yocto source tb.config.tc_lab_source_dir + “/yocto-” + tb.config.boardlabname

set tb.config.yocto_name to “yocto-” + tb.config.boardlabname

and tb.config.yocto_fulldir_name to tb.config.tc_lab_source_dir + “/” + tb.config.yocto_name

and set $TBOT_BASEDIR_YOCTO to tb.config.yocto_fulldir_name

used variables

  • tb.config.tc_workfd_goto_yocto_code_dirext
if != ‘none’ add this string to tb.config.yocto_name
default: ‘none’
  • tb.workfd.tc_workfd_goto_yocto_code_path
if != ‘none’ tb.config.yocto_name = os.path.basename(tb.workfd.tc_workfd_goto_yocto_code_path)
default: ‘none’
  • tb.workfd.tc_workfd_goto_yocto_code_checked
marker, if setup for this testcase is already done.
variable at runtime set, do not set it from a config file.
  • tb.config.yocto_fulldir_name
set at runtime, full path to yocto source code
  • tb.config.yocto_name
set at runtime, name of yocto source code directory
“yocto-” + tb.config.boardlabname

yocto/tc_workfd_yocto_basic_check.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_workfd_yocto_basic_check.py

do basic yocto checks

  • check rootfs version
which is the default.
  • check dmesg output
check if strings defined in tb.config.tc_demo_yocto_test_checks
are found in dmesg output
  • check if devmem2 tool is in rootfs, if so, do register checks

used variables

  • tb.config.tc_workfd_yocto_basic_check_rootfsversion
if ‘yes’ check rootfs version with testcase
default: ‘yes’
  • tb.config.tc_workfd_yocto_basic_check_board_specific
if != ‘none, call testcase with this name
default: ‘none’
  • tb.config.tc_demo_yocto_test_checks
list of strings, which must be in ‘dmesg’ output
default: ‘[]’
  • tb.config.tc_workfd_yocto_basic_check_regfiles
list of filenames, which contain register dumps.
This registerdumps are checked with testcase
tc_lx_check_reg_file_py if devmem2 command exists.
default: ‘[]’

yocto/tc_workfd_yocto_check_rootfs_version.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_workfd_yocto_check_rootfs_version.py

check if the current /etc/version on the target rootfs is the

same as in tb.config.tc_yocto_get_rootfs_from_tarball


yocto/tc_workfd_yocto_generate_bblayers.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_workfd_yocto_generate_bblayers.py

create bblayer.conf file

used variables

  • tb.config.tc_workfd_yocto_generate_bblayers_openembedded_layers
used meta layers from meta-openembedded
default: “[‘meta-networking’]”
  • tb.config.tc_workfd_yocto_generate_bblayers_xenomai_layers
used meta layers from meta-xenomai
default: ‘[]’

yocto/tc_workfd_yocto_patch_site.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_workfd_yocto_patch_site.py

patch / create site.conf

used variables:

  • tb.config.tc_workfd_yocto_patch_site_path_default_file
if != ‘none’ use this file as default
default: ‘none’
  • tb.config.tc_workfd_yocto_patch_site_swu_priv_key
if != ‘none’ add SWUPDATE_PRIVATE_KEY if tb.config.tc_workfd_yocto_patch_site_swu_priv_key
default: ‘none’
  • tb.config.tc_workfd_yocto_patch_site_swu_priv_passout
if != ‘none’
if != ‘none’
default: ‘none’
  • tb.config.tc_workfd_yocto_patch_site_ub_key
if != ‘none’
default: ‘none’
  • tb.config.tc_workfd_yocto_patch_site_dl_dir
if != ‘none’
default: ‘none’
  • tb.config.tc_workfd_yocto_patch_site_sstate_dir
if != ‘none’
default: ‘none’
  • tb.config.tc_workfd_yocto_patch_site_src_linux_stable
if != ‘none’
default: ‘none’
  • tb.config.tc_workfd_yocto_patch_site_premirrors
if != ‘none’
default: ‘none’

yocto/tc_yocto_get_rootfs_from_tarball.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_yocto_get_rootfs_from_tarball.py

get rootfs version from rootfs tar ball filepath and name stored in

tb.config.tc_yocto_get_rootfs_from_tarball

and store versionstring in variable:

tb.config.tc_yocto_get_rootfs_from_tarball_rootfs_version

creates event ID DUTS_YOCTO_VERSION

used variables:

  • tb.config.tc_yocto_get_rootfs_from_tarball
filename of tar.gz or tar.bz2 rootfsfile
default: ‘’
  • tb.config.tc_yocto_get_rootfs_from_tarball_rootfs_version
contains the content of ‘/etc/version’ of a yocto builded rootfs

yocto/tc_yocto_install_rootfs_as_nfs.py

https://github.com/hsdenx/tbot/blob/master/src/tc/yocto/tc_yocto_install_rootfs_as_nfs.py

install tb.config.rootfs_tar_file from path tb.config.tc_yocto_install_rootfs_as_nfs_path

into tb.config.nfs_subdir

used variables

  • tb.config.rootfs_tar_file
tar file with rootfs content
default: ‘’
  • tb.config.tc_yocto_install_rootfs_as_nfs_path
path to testcase finds file tb.config.rootfs_tar_file
default: ‘’
  • tb.config.nfs_subdir
nfs path
default: ‘’

tc_board_git_bisect.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_board_git_bisect.py

get a source code with tc tb.config.board_git_bisect_get_source_tc

and start a “git bisect” session

current commit is bad

good commit id is defined through tb.config.board_git_bisect_good_commit

tc for testing good or bad is tb.config.board_git_bisect_call_tc

if you have some local patches, which needs to be applied

each git bisect step, set tb.config.board_git_bisect_patches

if you need to restore your board after a failure, set the

variable tb.config.board_git_bisect_restore to the tc name

which restores the board after each step

used variables

  • tb.config.board_git_bisect_get_source_tc
testcase which gets called for changing into the git source
code.
  • tb.config.board_git_bisect_call_tc
testcase, which gets called for finding out, if current
checked out state of the source is good or bad
  • tb.config.board_git_bisect_good_commit
last know good commit id
default: ‘f9860cf’
  • tb.config.board_git_bisect_patches
patches, which get applied in each step fo git bisect
default: ‘none’
  • tb.config.board_git_bisect_restore
name of testcase, which gets called after each step, for
restoring your board. Used for example, if you bisect
u-boot and you break with bad source code your board.
default: ‘none’

tc_dummy.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_dummy.py

This is only a dummy testcase, with which you can start

to write a testcase.

which explains what your testcase do and how.

If it defines a new variable with tb.define_variable

add the following section, where you explain the new

variable.

used variables

  • tb.config.varname
some text, which describes the function of the variable
default: ‘default value’

tc_lab_compile_uboot.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_lab_compile_uboot.py

set workfd to c_ctrl

call tc_workfd_compile_uboot_py

restore old workfd


tc_lab_cp_file.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_lab_cp_file.py

simple copy file from arg.get(‘s’)

to arg.get(‘t’) on the channel arg.get(‘ch’)


tc_lab_get_uboot_source.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_lab_get_uboot_source.py

get U-Boot source

and go into the source tree

used variables

  • tb.config.tc_lab_get_uboot_source_git_repo
repo to clone
default: ‘/home/git/u-boot.git’
  • tb.config.tc_lab_get_uboot_source_git_branch
branch which get checked out
default: master
  • tb.config.tc_get_ub_source_reference
reference which get used when cloning
if ‘none’ no “–reference=...” option is
used for “git clone”
default: ‘none’

tc_lab_set_toolchain.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_lab_set_toolchain.py

set eldk toolchain with eldk-switch

works only on tb.c_ctrl (change this)

used variables

  • tb.config.tc_lab_toolchain_rev
toolchain revision
default: ‘5.4’
  • tb.config.tc_lab_toolchain_name
toolchain name
default: ‘armv5te’

tc_test_bootcounter.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_test_bootcounter.py

Test U-Boot / Linux bootcounter functionality

  • go into U-Boot
  • get bootcounter value
  • reset
  • get bootcounter value (must be previous + 1)
  • reset
  • get bootcounter value (must be previous + 1)
  • boot linux
  • get bootcounter value (must be the same as in U-Boot)
  • set bootcounter value in linux
  • power off the board
  • power on the board
  • go into U-Boot
  • get bootcounter value (must be +1 the value set in linux)
  • power off the board
  • power on the board
  • go into U-Boot
  • get bootcounter value (must be 1)

tc_ub_boot_linux.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_ub_boot_linux.py


tc_workfd_apply_patches.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_workfd_apply_patches.py

apply patches in tb.config.tc_lab_apply_patches_dir_

path to directory which contains the patches

default: ‘none’


tc_workfd_compile_uboot.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_workfd_compile_uboot.py

compile u-boot

used variables

  • tb.config.tc_lab_compile_uboot_export_path
if != ‘none’ add in PATH the string from this variable
default: ‘none’
  • tb.config.tc_lab_compile_uboot_boardname
Name used for defconfig
  • tb.config.tc_lab_compile_uboot_makeoptions
option string used for calling make
default: ‘-j4’

tc_workfd_git_clone_source.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_workfd_git_clone_source.py

get source from git repo tb.config.tc_lab_git_clone_source_git_repo with “git clone”

and go into the source tree.

check out branch tb.config.tc_lab_git_clone_source_git_branch

and apply patches if needed with:

tc_lab_apply_patches_py and patches from directory

tb.config.tc_lab_git_clone_apply_patches_dir

use as reference tb.config.tc_lab_git_clone_source_git_reference

if != ‘none’

You can give the repo a name with setting

tb.config.tc_lab_git_clone_source_git_repo_name

!= ‘none’

If you need a user/password for cloning, you can define

the username through:

tb.config.tc_lab_git_clone_source_git_repo_user

define the password for this in password_py_

boardname in password_py_ is used as tb.config.tc_lab_git_clone_source_git_repo

used variables

  • tb.config.tc_lab_git_clone_source_git_repo
git url
default: ‘git://git.yoctoproject.org/poky.git’
  • tb.config.tc_lab_git_clone_source_git_branch
branch which get checked out after cloning
default: ‘morty’
  • tb.config.tc_lab_git_clone_source_git_commit_id
commit id which gets checked out if value != ‘none’
default: ‘none’
  • tb.config.tc_lab_git_clone_apply_patches_dir
directory with patches for applying with
default: ‘none’
  • tb.config.tc_lab_git_clone_apply_patches_git_am_dir
directory with patches for applying with
default: ‘none’
  • tb.config.tc_lab_git_clone_source_git_reference
default: ‘none’
  • tb.config.tc_lab_git_clone_source_git_repo_user
default: ‘’
  • tb.config.tc_lab_git_clone_source_git_repo_name
default: ‘none’

tc_workfd_set_toolchain.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_workfd_set_toolchain.py

set the toolchain, dependend on the architecture setting in

tb.config.tc_workfd_set_toolchain_arch

or source script set with tb.config.tc_workfd_set_toolchain_source

if tb.config.tc_workfd_set_toolchain_source != ‘no’

supported toolchains defined in

tb.config.tc_workfd_set_toolchain_t_p and tb.config.tc_workfd_set_toolchain_cr_co

set also the ARCH environment variable with the value from

tb.config.tc_workfd_set_toolchain_arch

Add a list of also executed cmds in tb.config.tc_workfd_set_toolchain_addlist

used variables

  • tb.config.tc_workfd_set_toolchain_source
if != ‘none’ call “source tb.config.tc_workfd_set_toolchain_source”_
default: ‘none’
  • tb.config.tc_workfd_set_toolchain_arch
architecture set with “export ARCH=tb.config.tc_workfd_set_toolchain_arch”_
default: ‘not set’
  • tb.config.tc_workfd_set_toolchain_addlist
list of commands which get called additionally
default: ‘none’
  • tb.config.tc_workfd_set_toolchain_t_p
dictionary: keys = architecture names
values = path to toolchains
default: ‘’
  • tb.config.tc_workfd_set_toolchain_cr_co
dictionary: keys = architecture names
values = cross compiler prefixes
default: ‘’

tc_workfd_write_cmd_check.py

https://github.com/hsdenx/tbot/blob/master/src/tc/tc_workfd_write_cmd_check.py

Wrap a testcase around tb.write_cmd_check.

This testcase can be called via

tb.call_tc(‘tc_workfd_write_cmd_check_py‘, cmd=’foo’, string=’bar’).