Testlab Wiki

Login

TC Presentation

Here are aspects of the TC presentation:

Show as Slide Show

Outline [edit section]

  • Introducing Target Control
  • What is Target Control?
    • What does it do?
    • How do you use it?
    • Architecture for automated testing?
  • Tips and tricks learned over the years

Introducing Target Control [edit section]

  • What is it?
    • A program that helps you build and install kernels on a target board, then install and run programs on the board
  • Where did it come from?
    • "tc" was originally written for the CELF test lab
    • Intent was to support remote development and test operations
    • Test lab didn't work out (although CELF might revive it)
    • tc is now in active use inside Sony
  • It is now released to the public, and I expect to maintain it going forward

Tc Purpose (1) [edit section]

  • Allows you to develop and test a kernel on different boards, using the same commands
  • Primary goal is to preserve my own sanity
    • I get lots of different boards, with different attributes:
      • architectures (arm, mips, powerpc, x86, etc.)
      • toolchains (version, endian-ness, etc.)
      • bootloaders (u-boot, blob, pmon, custom)
      • network address
      • serial port
      • install procedures (tftp, serial upload, re-flash)
      • remote execution programs (telnet, ssh)
    • I am usually working on at least 2 boards at a time, and sometimes on 5 or 6 at a time (for testing)
  • Boards are in a remote lab, and are shared

Tc Purpose (2) [edit section]

  • Allows developers to share boards
    • Boards on a single host are remotely accessible
  • Allows for test automation
    • Same commands can be used to perform the same test on different target boards
    • Can perform same steps manually, or write a program to perform the steps

How does it work? [edit section]

  • Tc provides an abstraction layer to shield the developer from details of board configuration and control.
  • Basic 'tc' operation:
    • reads a configuration file
    • sets up environment
    • runs command(s) appropriate for the specified target
  • Tc is command-line oriented
    • It works over an network login (e.g. ssh'ed to a remote host)
    • It can automated from any language (sh, python, etc.)

Development architecture [edit section]

  • tc is on a host machine
    • host machine has toolchain, kernel sources, patches, etc.
  • target is connected to host via network, serial
  • Host has ability to control power to target (or some method to reset the target)
  • My preferences:
    • bootloader that can automatically download and boot kernel
    • download kernel via tftp
    • mount root file system over NFS
    • console over serial port
    • ssh for remote login and remote execution

Host/Target requirements [edit section]

  • REQUIREMENT: Any operation required to install a kernel or file system on the target must be able to be executed non-interactively from the command line
    • Some bootloaders and board configs require the use of expect scripts
      • I tend to use python expect (pexpect.py)
    • Some targets can only be re-flashed using a windows utility (Ugh!)
      • There must be a way to automate this - have fun!

TC config file [edit section]

  • tc is a pretty thin layer - most logic is in the config file
    • global conf file = /etc/tc.conf
    • local conf file = specified by LOCAL_TARGET_CONF
  • list of targets, with attributes for each one
    • attributes are: name=<value>
    • attributes with a '_cmd' ending are executed
      • example: target=tx49 ARCH=mips kimage=uimage kbuild_cmd=make ARCH=$ARCH $kimage
      • command: tc tx49 kbuild

TC config file (cont.) [edit section]

  • Advanced stuff:
    • inheritance:
      • target=bar
      • inherit_from=foo
    • macros
      • foo=bar
      • baz=<font color=red>&lt;missing data value for key "foo"&gt</font>
    • convenience/temporary environments
      • tc tx49 setenv
      • tc tx49 setenv -o foo ; source foo

TC commands [edit section]

TC sample session [edit section]

Supporting programs [edit section]

  • <xxx>-reset
  • <xxx>-reboot
  • switch-target-fs
    • used with 'tc reserve'
  • get-kernel
    • can be used with 'tc get_kernel'
  • telnet_exec/ssh_exec
    • used for 'tc run'
  • minicom (or other terminal emulator)
    • used for 'tc console'
  • telnet/ssh
    • used for 'tc login'

To-Do list for tc presentation [edit section]

  • write presentation
    • see FIXTHIS sections
    • finish section on automated test flow design
  • update Target Control Usage Guide
  • upload tc package
  • create tc package support site
    • create online repository??
      • create repository for otl-tools
        • dust off testlab repository on sourceforge??
        • create git repository on mirror?
          • set up gitweb for http access??
    • gather utilities and support libraries for package
      • pexpect.py
      • serial.py
    • make an installer??
      • see if pexpect.py is already present
      • see if serial.py is already present
    • finish tc-autoconf??

Wiki engine (tbiki) by Tim Bird