Automated hardware testing support for reference platforms
cover Automated hardware testing support for reference platforms
On top of the automated hardware testing changes just sent for OE-Core, this series adds support for automatically deploying images and running tests on two of the Yocto Project reference hardware platforms (beaglebone and edgerouter).
Note that this requires the matching OE-Core patch series to be applied first.
The following changes since commit 17daa2ba6280304771c5fe52b94eb56f0c087490:
bitbake: bb.utils, bb.codeparser: Add bb.utils.contains_any (2014-04-29 23:38:54 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib paule/testimage-ref-hw
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/testimage-ref-hw
Paul Eggleton (1):
meta-yocto-bsp: oeqa/controllers: add EdgeRouterTarget
Stefan Stanacar (1):
meta-yocto-bsp: oeqa/controllers: add BeagleBoneTarget
meta-yocto-bsp/lib/oeqa/controllers/__init__.py | 0 .../lib/oeqa/controllers/beaglebonetarget.py | 94 ++++++++++++++++++++++ .../lib/oeqa/controllers/edgeroutertarget.py | 89 ++++++++++++++++++++ 3 files changed, 183 insertions(+) create mode 100644 meta-yocto-bsp/lib/oeqa/controllers/__init__.py create mode 100644 meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py create mode 100644 meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py
Signature · 1 line
1.9.0
PATCH 1/2 meta-yocto-bsp: oeqa/controllers: add BeagleBoneTarget
From: Stefan Stanacar <[email protected]>
With a serial connection and beaglebone setup correctly as per README.hardware (nand erased, default uboot config assumed, etc) and a correctly deployed core-image-testmaster, we could actually deploy and test AB built images.
In the default configuration u-boot will do the right thing and will always boot into the master image (rootfs on second fs on the card, kernel in /boot on the same partition). We just need to tell it for the test image to use the third partition and update the kernel cmdline. Pexpect is used to interact with whatever serial connection we have (which for this target is mandatory).
There is some handling for images that don't contain the kernel and dtb files as needed (such as core-image-minimal).
Implements [YOCTO #6252].
--- meta-yocto-bsp/lib/oeqa/controllers/__init__.py | 0 .../lib/oeqa/controllers/beaglebonetarget.py | 94 ++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 meta-yocto-bsp/lib/oeqa/controllers/__init__.py create mode 100644 meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py
meta-yocto-bsp/lib/oeqa/controllers/__init__.py new file +0 -0
meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py new file +94 -0
94 lines not on this page · raw message
Signature · 1 line
1.9.0
PATCH 2/2 meta-yocto-bsp: oeqa/controllers: add EdgeRouterTarget
In reply to Paul EggletonBased on BeagleBoneTarget, this provides support for deploying images and running tests on an EdgeRouter Lite (edgerouter). The device must be set up to boot into the master image already - see the instructions in the file.
Implements [YOCTO #6253].
--- .../lib/oeqa/controllers/edgeroutertarget.py | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py
meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py new file +89 -0
@@ -0,0 +1,89 @@ +# Copyright (C) 2014 Intel Corporation +# +# Released under the MIT license (see COPYING.MIT) + +# This module adds support to testimage.bbclass to deploy images and run +# tests on a Ubiquiti Networks EdgeRouter Lite. The device must be set up +# to boot into the master image already - the easiest way to do that is as +# follows: +# +# 1. Take out the internal USB drive and plug it into your PC +# 2. Repartition the USB drive so that you have three partitions in this +# order: +# 1: vfat, labelled "boot" (it will need to be formatted with mkfs.vfat +# for this to be possible, since FAT partitions formatted under +# DOS/Windows will only support uppercase labels) +# 2: ext3 (for master image) labelled "testmaster" +# 3: ext3 (for image under test) labelled "testrootfs" +# 3. Copy the kernel to be used by the master image to the FAT partition +# (it should be named "vmlinux.64" with the factory u-boot configuration) +# 4. Install the master image onto the "testmaster" ext3 partition. If +# you do this by just extracting the contents of an image onto the +# partition, you will also likely need to create the master image marker +# file /etc/masterimage within this partition so that we can tell when +# we're booted into it that it is the master image. +# 5. Put the USB drive back into the device, and ensure the console port +# and first ethernet port are connected before powering on +# +# TEST_SERIALCONTROL_CMD will need to be set in local.conf so that we can +# interact with u-boot over the serial console port. + +import os +import bb +import time +import subprocess +import sys +import pexpect + +import oeqa.utils.sshcontrol as sshcontrol +from oeqa.controllers.masterimage import MasterImageHardwareTarget + + +class EdgeRouterTarget(MasterImageHardwareTarget): + + def __init__(self, d): + super(EdgeRouterTarget, self).__init__(d) + + self.deploy_cmds = [ + 'mount -L boot /boot', + 'mkdir -p /mnt/testrootfs', + 'mount -L testrootfs /mnt/testrootfs', + 'cp ~/test-kernel /boot', + 'rm -rf /mnt/testrootfs/*', + 'tar xzvf ~/test-rootfs.tar.gz -C /mnt/testrootfs' + ] + if not self.serialcontrol_cmd: + bb.fatal("This TEST_TARGET needs a TEST_SERIALCONTROL_CMD defined in local.conf.") + + + def _deploy(self): + self.master.run("umount /mnt/testrootfs;") + self.master.ignore_status = False + self.master.copy_to(self.kernel, "~/test-kernel") + self.master.copy_to(self.rootfs, "~/test-rootfs.tar.gz") + for cmd in self.deploy_cmds: + self.master.run(cmd) + + def _start(self, params=None): + self.power_cycle(self.master) + try: + serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout) + serialconn.expect("U-Boot") + serialconn.sendline("a") + serialconn.expect("Octeon ubnt_e100#") + serialconn.sendline("fatload usb 0:1 $loadaddr test-kernel") + serialconn.expect(" bytes read") + serialconn.expect("Octeon ubnt_e100#") + serialconn.sendline("bootoctlinux $loadaddr coremask=0x3 root=/dev/sda3 rw rootwait mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@3072k(eeprom)") + serialconn.expect("login:", timeout=120) + serialconn.close() + except pexpect.ExceptionPexpect as e: + bb.fatal('Serial interaction failed: %s' % str(e)) + + def _wait_until_booted(self): + try: + serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout) + serialconn.expect("login:", timeout=120) + serialconn.close() + except pexpect.ExceptionPexpect as e: + bb.fatal('Serial interaction failed: %s' % str(e))
Signature · 1 line
1.9.0