From 0f2e3d24a438c120718a845b04dd85b9d5ce1956 Mon Sep 17 00:00:00 2001 From: Christopher Clark Date: Tue, 31 Aug 2021 16:27:43 -0700 Subject: 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 Signed-off-by: Bruce Ashfield --- classes/qemuboot-testimage-network.bbclass | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 classes/qemuboot-testimage-network.bbclass (limited to 'classes') 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 @@ +# The recipe for init-ifupdown in core has a special-case for all +# the Qemu MACHINES: it removes all external network interfaces +# by default. However, eth0 is needed for testimage, so enable it here. +enable_runqemu_network() { + : # no-op for non-qemu MACHINES +} +enable_runqemu_network:qemuall() { + if ! grep -q eth0 "${IMAGE_ROOTFS}${sysconfdir}/network/interfaces" ; then + cat <>${IMAGE_ROOTFS}${sysconfdir}/network/interfaces + +# Network for testimage +auto eth0 +iface eth0 inet dhcp +EOF + fi +} +ROOTFS_POSTPROCESS_COMMAND += 'enable_runqemu_network;' -- cgit v1.2.3-54-g00ecf