Enabling Automation Test in Poky

From Yocto Project
Revision as of 07:11, 12 November 2010 by Sgarman (talk | contribs) (Added some important details to sanity test automation regarding VNC setup)
Jump to navigationJump to search

Enable Automation Test in Poky

Currently we have implemented two automated sanity test cases in Poky. User can follow below steps to enable the automation test:

  • Make sure your working tree has latest test code. The first sanity test implementation is checked in poky master tree as commit, fd1d661b391dfad1edaac937a17c1165f635031a.
  • Make sure your machine has package "expect" installed. The package is necessary for testing. We will add a recipe for it later. Currently, you need install it by yourself. On Ubuntu host, you can use apt-get to install expect:
$ apt-get install expect
  • Edit /etc/sudoers to allow the user run sudo without prompted for a password. For example, you can do like following for user "tester":
$ cat /etc/sudoers
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
....
....
....

%tester ALL=(ALL) NOPASSWD: NOPASSWD: ALL
  • Instead of requiring sudo access, you can run the poky-gen-tapdevs script from a build of meta-ide-support or a Poky toolchain install in /opt/poky. The script will create and set up networking for one or more tap devices that will be used automatically by the poky-qemu script if detected.
  • Typically, you need a X environment to start QEMU. You can use your desktop's DISPLAY. Or, alternatively, you can install vncserver, and startup a X environment in localhost:x.0. (x can be 1, 2, 3.....n)
  • For the VNC setup, the following xstartup script is known to work for an openSUSE 11.2 host:
#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
xhost +
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
  • For the VNC setup, you will also want to put the following in ~/.twmrc, which allows windows to be placed automatically.
RandomPlacement
  • You need set "IMAGETEST" to "qemu" in build/conf/local.conf
$ cat local.conf
.....
# Set IMAGETEST to qemu if you want to build testcases and start
# testing in qemu after do_rootfs.
IMAGETEST = "qemu"
.....
  • Then you can run "bitbake poky-image-xxx" (xxx can be minimal, sato, sdk). After the kernel/image are generated, you need run "bitbake poky-image-xxx -c qemuimagetest". It will trigger automation test and you will get the result after a while. :)