The OpenEmbedded build system can run tests on real hardware, and for certain devices it can also deploy the image to be tested onto the device beforehand.
For automated deployment, a "master image" is installed onto the hardware once as part of setup. Then, each time tests are to be run, the following occurs:
The master image is booted into and used to write the image to be tested to a second partition.
The device is then rebooted using an external script that you need to provide.
The device boots into the image to be tested.
When running tests (independent of whether the image has been deployed automatically or not), the device is expected to be connected to a network on a pre-determined IP address. You can either use static IP addresses written into the image, or set the image to use DHCP and have your DHCP server on the test network assign a known IP address based on the MAC address of the device.
In order to run tests on hardware, you need to set
TEST_TARGET
to an appropriate value.
For QEMU, you do not have to change anything, the default
value is "QemuTarget".
For running tests on hardware, the following options exist:
"SimpleRemoteTarget": Choose "SimpleRemoteTarget" if you are going to run tests on a target system that is already running the image to be tested and is available on the network. You can use "SimpleRemoteTarget" in conjunction with either real hardware or an image running within a separately started QEMU or any other virtual machine manager.
"SystemdbootTarget":
Choose "SystemdbootTarget" if your hardware is
an EFI-based machine with
systemd-boot
as bootloader and
core-image-testmaster
(or something similar) is installed.
Also, your hardware under test must be in a
DHCP-enabled network that gives it the same IP
address for each reboot.
If you choose "SystemdbootTarget", there are additional requirements and considerations. See the "Selecting SystemdbootTarget" section, which follows, for more information.
"BeagleBoneTarget":
Choose "BeagleBoneTarget" if you are deploying
images and running tests on the BeagleBone
"Black" or original "White" hardware.
For information on how to use these tests, see the
comments at the top of the BeagleBoneTarget
meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py
file.
"EdgeRouterTarget":
Choose "EdgeRouterTarget" is you are deploying
images and running tests on the Ubiquiti Networks
EdgeRouter Lite.
For information on how to use these tests, see the
comments at the top of the EdgeRouterTarget
meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py
file.
"GrubTarget":
Choose the "supports deploying images and running
tests on any generic PC that boots using GRUB.
For information on how to use these tests, see the
comments at the top of the GrubTarget
meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py
file.
"your-target
":
Create your own custom target if you want to run
tests when you are deploying images and running
tests on a custom machine within your BSP layer.
To do this, you need to add a Python unit that
defines the target class under
lib/oeqa/controllers/
within
your layer.
You must also provide an empty
__init__.py
.
For examples, see files in
meta-yocto-bsp/lib/oeqa/controllers/
.