diff options
author | Christopher Clark <christopher.w.clark@gmail.com> | 2021-08-31 16:27:43 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-09-02 16:36:23 -0400 |
commit | 0f2e3d24a438c120718a845b04dd85b9d5ce1956 (patch) | |
tree | 3031ceaf6cc2dda051d86a625cea857185fa0b60 /classes/qemuboot-testimage-network.bbclass | |
parent | 12fb6aaffe7ef95e2ed7162059c1e72c7bf5931d (diff) | |
download | meta-virtualization-0f2e3d24a438c120718a845b04dd85b9d5ce1956.tar.gz |
xtf: add testimage integration to run XTF test cases in OEQA
Add a new minimal OEQA test case to run the Xen Test Framework
test runner in the standard testimage step. Tested with qemux86-64
and designed for compatibility with Arm when XTF supports it.
To enable, append to local.conf:
INHERIT += "testimage"
QEMU_USE_SLIRP = "1"
TEST_SERVER_IP = "127.0.0.1"
To run: bitbake -c testimage xtf-image
For inspection while it runs, at another shell prompt:
* Observe the image booting:
tail -f ${TMPDIR}/work/qemux86_64-*/xtf-image/*/testimage/qemu_boot_log.*
* Observe the tests running once boot has completed:
tail -f ${TMPDIR}/work/qemux86_64-*/xtf-image/*/temp/log.do_testimage
The XTF test sequence by default is a single XTF test case with minimal
hardware dependency to ensure that Xen is running, the Xen toolstack is
functional and XTF works. Additional XTF test cases for an image can be
configured via variables that are documented in the OEQA test case:
* XTF_TEST_CASES_POPULATE
* XTF_TEST_CASES_SKIP
* XTF_TEST_CASES_REQUIRE
Since testimage requires a functioning network to perform the tests on
the image and the qemu MACHINES do not have networking enabled
this commit provides a new qemuboot-testimage-network bbclass to add an
image postprocess command to enable a functional eth0 for qemu MACHINES.
Signed-off-by: Christopher Clark <christopher.clark@starlab.io>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'classes/qemuboot-testimage-network.bbclass')
-rw-r--r-- | classes/qemuboot-testimage-network.bbclass | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/classes/qemuboot-testimage-network.bbclass b/classes/qemuboot-testimage-network.bbclass new file mode 100644 index 00000000..18af1eea --- /dev/null +++ b/classes/qemuboot-testimage-network.bbclass | |||
@@ -0,0 +1,17 @@ | |||
1 | # The recipe for init-ifupdown in core has a special-case for all | ||
2 | # the Qemu MACHINES: it removes all external network interfaces | ||
3 | # by default. However, eth0 is needed for testimage, so enable it here. | ||
4 | enable_runqemu_network() { | ||
5 | : # no-op for non-qemu MACHINES | ||
6 | } | ||
7 | enable_runqemu_network:qemuall() { | ||
8 | if ! grep -q eth0 "${IMAGE_ROOTFS}${sysconfdir}/network/interfaces" ; then | ||
9 | cat <<EOF >>${IMAGE_ROOTFS}${sysconfdir}/network/interfaces | ||
10 | |||
11 | # Network for testimage | ||
12 | auto eth0 | ||
13 | iface eth0 inet dhcp | ||
14 | EOF | ||
15 | fi | ||
16 | } | ||
17 | ROOTFS_POSTPROCESS_COMMAND += 'enable_runqemu_network;' | ||