@@ -6,7 +6,7 @@
#
from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import bitbake, runqemu
+from oeqa.utils.commands import bitbake, runqemu, get_bb_var
from oeqa.core.decorator.data import skipIfNotArch
from oeqa.core.decorator import OETestTag
@@ -34,7 +34,8 @@ QEMU_USE_KVM = "False"
bitbake("virtual/bootloader core-image-minimal")
- with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic',
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic %s' % (runqemu_params),
boot_patterns=barebox_boot_patterns) as qemu:
# test if barebox console works
@@ -147,10 +147,12 @@ CORE_IMAGE_EXTRA_INSTALL += "elfutils xz"
""")
bitbake("core-image-minimal elfutils-native:do_addto_recipe_sysroot xz:do_localpkgfeed")
+ runqemu_params = get_bb_var("TEST_RUNQEMUPARAMS", "core-image-minimal") or ""
+
try:
self.start_debuginfod(get_bb_var("LOCALPKGFEED_DIR", "xz"))
- with runqemu("core-image-minimal", runqemuparams="nographic") as qemu:
+ with runqemu("core-image-minimal", runqemuparams="nographic %s" % runqemu_params) as qemu:
cmd = "DEBUGINFOD_URLS=http://%s:%d/ debuginfod-find debuginfo /usr/bin/xz" % (qemu.server_ip, self.port)
self.logger.info(f"Starting client {cmd}")
status, output = qemu.run_serial(cmd)
@@ -1836,8 +1836,9 @@ class DevtoolDeployTargetTests(DevtoolBase):
# First try a dry-run of deploy-target
result = runCmd('devtool deploy-target -n %s root@localhost' % testrecipe)
self.assertIn(' %s' % testfile, result.output)
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', testimage) or ""
# Boot the image
- with runqemu(testimage) as qemu:
+ with runqemu(testimage, runqemuparams=runqemu_params) as qemu:
# Now really test deploy-target
result = runCmd('devtool deploy-target -c %s root@%s' % (testrecipe, qemu.ip))
# Run a test command to see if it was installed properly
@@ -2810,7 +2811,8 @@ class DevtoolIdeSdkTests(DevtoolBase):
# Verify deployment to Qemu (system mode) works
bitbake(testimage)
- with runqemu(testimage, runqemuparams="nographic") as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu(testimage, runqemuparams="nographic %s" % runqemu_params) as qemu:
# cmake-example recipe
recipe_name = "cmake-example"
example_exe = "cmake-example"
@@ -30,5 +30,6 @@ IMAGE_INSTALL:append = " grub-efi kernel-image-bzimage"
% (image))
bitbake(image + " ovmf")
- with runqemu(image, ssh=False, launch_cmd=cmd) as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', image) or ""
+ with runqemu(image, ssh=False, launch_cmd=cmd, runqemuparams=runqemu_params) as qemu:
self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
@@ -79,7 +79,8 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
bitbake("core-image-minimal")
# wrap the execution with a qemu instance
- with runqemu("core-image-minimal", runqemuparams = "nographic") as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu("core-image-minimal", runqemuparams = "nographic %s" % runqemu_params) as qemu:
# validate that SSH is working
status, _ = qemu.run("uname")
self.assertEqual(status, 0)
@@ -42,7 +42,8 @@ CORE_IMAGE_EXTRA_INSTALL = "gdbserver"
filename = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s.tar.bz2" % bb_vars['IMAGE_LINK_NAME'])
shutil.unpack_archive(filename, debugfs)
- with runqemu("core-image-minimal", runqemuparams="nographic") as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu("core-image-minimal", runqemuparams="nographic %s" % runqemu_params) as qemu:
status, output = qemu.run_serial("kmod --help")
self.assertIn("modprobe", output)
@@ -70,7 +70,8 @@ class GlibcSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
bitbake("core-image-minimal")
# start runqemu
- qemu = s.enter_context(runqemu("core-image-minimal", runqemuparams = "nographic", qemuparams = "-m 1024"))
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ qemu = s.enter_context(runqemu("core-image-minimal", runqemuparams = "nographic %s" % runqemu_params, qemuparams = "-m 1024"))
# validate that SSH is working
status, _ = qemu.run("uname")
@@ -36,7 +36,8 @@ class ImageFeatures(OESelftestTestCase):
# Build a core-image-minimal
bitbake('core-image-minimal')
- with runqemu("core-image-minimal") as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu("core-image-minimal", runqemuparams=runqemu_params) as qemu:
# Attempt to ssh with each user into qemu with empty password
for user in [self.root_user, self.test_user]:
ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user=user)
@@ -4,7 +4,7 @@
from oeqa.selftest.case import OESelftestTestCase
from oeqa.core.decorator import OETestTag
-from oeqa.utils.commands import bitbake, runqemu
+from oeqa.utils.commands import bitbake, runqemu, get_bb_var
class LocalesTest(OESelftestTestCase):
@@ -25,7 +25,8 @@ class LocalesTest(OESelftestTestCase):
# Build a core-image-minimal
bitbake('core-image-minimal')
- with runqemu("core-image-minimal", ssh=False, runqemuparams='nographic') as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu("core-image-minimal", ssh=False, runqemuparams='nographic %s' % runqemu_params) as qemu:
cmd = "locale -a"
status, output = qemu.run_serial(cmd)
# output must includes fr_FR or fr_FR.UTF-8
@@ -5,7 +5,7 @@
#
from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import bitbake, runqemu, get_bb_vars
+from oeqa.utils.commands import bitbake, runqemu, get_bb_var, get_bb_vars
from oeqa.core.decorator import OETestTag
from oeqa.core.decorator.data import skipIfNotMachine
@@ -181,7 +181,8 @@ EOT
bitbake('core-image-minimal')
- with runqemu('core-image-minimal') as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu('core-image-minimal', runqemuparams=runqemu_params) as qemu:
# Check that application service started
status, output = qemu.run_serial("systemctl status my-application")
self.assertTrue("active (exited)" in output, msg=output)
@@ -360,7 +361,8 @@ OVERLAYFS_ROOTFS_TYPE = "ext4"
bitbake('core-image-minimal')
- with runqemu('core-image-minimal', image_fstype='wic') as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu('core-image-minimal', runqemuparams=runqemu_params, image_fstype='wic') as qemu:
status, output = qemu.run_serial("/bin/mount")
line = getline_qemu(output, "upperdir=/data/overlay-etc/upper")
@@ -399,7 +401,8 @@ OVERLAYFS_ROOTFS_TYPE = "ext4"
bitbake('core-image-minimal')
testFile = "/etc/my-test-data"
- with runqemu('core-image-minimal', image_fstype='wic', discard_writes=False) as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu('core-image-minimal', runqemuparams=runqemu_params, image_fstype='wic', discard_writes=False) as qemu:
status, output = qemu.run_serial("/bin/mount")
line = getline_qemu(output, "/dev/sda3")
@@ -420,7 +423,7 @@ OVERLAYFS_ROOTFS_TYPE = "ext4"
self.assertTrue(line and line.startswith(testFile), msg=output)
# Check that file exists in /etc after reboot
- with runqemu('core-image-minimal', image_fstype='wic') as qemu:
+ with runqemu('core-image-minimal', runqemuparams=runqemu_params, image_fstype='wic') as qemu:
status, output = qemu.run_serial("ls -1 " + testFile)
line = getline_qemu(output, testFile)
self.assertTrue(line and line.startswith(testFile), msg=output)
@@ -454,7 +457,8 @@ IMAGE_INSTALL:append = " overlayfs-user"
self.append_config(configLower)
bitbake('core-image-minimal')
- with runqemu('core-image-minimal', image_fstype='wic') as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu('core-image-minimal', runqemuparams=runqemu_params, image_fstype='wic') as qemu:
status, output = qemu.run_serial("echo \"Modified in upper\" > /etc/" + testFile)
status, output = qemu.run_serial("diff /etc/" + testFile + " /data/overlay-etc/lower/" + testFile)
line = getline_qemu(output, "Modified in upper")
@@ -500,7 +504,8 @@ IMAGE_INSTALL:append = " overlayfs-user"
res = bitbake('core-image-minimal')
- with runqemu('core-image-minimal', image_fstype='wic') as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu('core-image-minimal', runqemuparams=runqemu_params, image_fstype='wic') as qemu:
for filename in ("rootfs", "delayed-a", "delayed-b"):
status, output = qemu.run_serial("test -f %s && echo found" % os.path.join(targettestdir, filename))
self.assertIn("found", output, "%s was not present on boot" % filename)
@@ -177,7 +177,8 @@ class PackageTests(OESelftestTestCase):
self.logger.error("GDB result:\n%d: %s", status, output)
return False
- with runqemu('core-image-minimal') as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu('core-image-minimal', runqemuparams=runqemu_params) as qemu:
for binary in ['/usr/bin/hello1',
'/usr/bin/hello2',
'/usr/libexec/hello3',
@@ -202,7 +203,8 @@ class PackageTests(OESelftestTestCase):
self.fail("Cannot parse output: " + output)
sysconfdir = get_bb_var('sysconfdir', 'selftest-chown')
- with runqemu('core-image-minimal') as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu('core-image-minimal', runqemuparams=runqemu_params) as qemu:
for path in [ sysconfdir + "/selftest-chown/file",
sysconfdir + "/selftest-chown/dir",
sysconfdir + "/selftest-chown/symlink",
@@ -42,7 +42,8 @@ class TestExport(OESelftestTestCase):
isdir = os.path.isdir(testexport_dir)
self.assertEqual(True, isdir, 'Failed to create testexport dir: %s' % testexport_dir)
- with runqemu('core-image-minimal') as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu('core-image-minimal', runqemuparams=runqemu_params) as qemu:
# Attempt to run runexported.py to perform ping test
test_path = os.path.join(testexport_dir, "oe-test")
data_file = os.path.join(testexport_dir, 'data', 'testdata.json')
@@ -320,7 +321,8 @@ class Postinst(OESelftestTestCase):
self.assertTrue(os.path.isfile(os.path.join(hosttestdir, "rootfs")),
"rootfs state file was not created")
- with runqemu('core-image-minimal') as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu('core-image-minimal', runqemuparams=runqemu_params) as qemu:
# Make the test echo a string and search for that as
# run_serial()'s status code is useless.'
for filename in ("rootfs", "delayed-a", "delayed-b"):
@@ -99,7 +99,8 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
# wrap the execution with a qemu instance.
# Tests are run with 512 tasks in parallel to execute all tests very quickly
- with runqemu("core-image-minimal", runqemuparams = "nographic", qemuparams = "-m 512") as qemu:
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu("core-image-minimal", runqemuparams = "nographic %s" % runqemu_params, qemuparams = "-m 512") as qemu:
# Copy remote-test-server to image through scp
host_sys = get_bb_var("RUST_BUILD_SYS", "rust")
ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root")
@@ -6,7 +6,7 @@
#
from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import bitbake, runqemu
+from oeqa.utils.commands import bitbake, runqemu, get_bb_var
from oeqa.core.decorator.data import skipIfNotArch
from oeqa.core.decorator import OETestTag
@@ -33,7 +33,8 @@ QEMU_USE_KVM = "False"
""")
bitbake("virtual/bootloader core-image-minimal")
- with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic',
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', "core-image-minimal") or ""
+ with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic %s' % runqemu_params,
boot_patterns=uboot_boot_patterns) as qemu:
# test if u-boot console works
To support "slirp" userspace networking which works more easily on various build machines, also without root and sudo rights to setup loop interfaces. Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> --- meta/lib/oeqa/selftest/cases/barebox.py | 5 +++-- meta/lib/oeqa/selftest/cases/debuginfod.py | 4 +++- meta/lib/oeqa/selftest/cases/devtool.py | 6 ++++-- .../oeqa/selftest/cases/efibootpartition.py | 3 ++- meta/lib/oeqa/selftest/cases/gcc.py | 3 ++- meta/lib/oeqa/selftest/cases/gdbserver.py | 3 ++- meta/lib/oeqa/selftest/cases/glibc.py | 3 ++- meta/lib/oeqa/selftest/cases/imagefeatures.py | 3 ++- meta/lib/oeqa/selftest/cases/locales.py | 5 +++-- meta/lib/oeqa/selftest/cases/overlayfs.py | 19 ++++++++++++------- meta/lib/oeqa/selftest/cases/package.py | 6 ++++-- meta/lib/oeqa/selftest/cases/runtime_test.py | 6 ++++-- meta/lib/oeqa/selftest/cases/rust.py | 3 ++- meta/lib/oeqa/selftest/cases/uboot.py | 5 +++-- 14 files changed, 48 insertions(+), 26 deletions(-) v2: added missing get_bb_var import to u-boot.py v1: https://lists.openembedded.org/g/openembedded-core/message/215225