Skip to contentSkip to conversation

genericarm64.conf: fix qemu testing with testimage.bbclass

PATCH Superseded Mikko Rapeli 2 participants 3 messages Mar 11

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 genericarm64.conf: fix qemu testing with testimage.bbclass

genericarm64 machine has supported qemu for a long time but the default build config failed with testimage.bbclass to boot and run oeqa runtime tests.

TESTIMAGEDEPENDS needs qemu utilities so that they are correctly installed to image sysroot. For qemu machines these are set in testimage.bbclass but remain unset for non-qemu machines like genericarm64.

TEST_RUNQEMUPARAMS needs snapshot since default genericarm64 image is a compressed wic.zst and nographic to run qemu without connected display which is better on headless build machines.

With these set, default genericarm64 core-image-sato boots correctly with testimage.bbclass and all oeqa runtime tests pass on an x86_64 build machine:

$ bitbake core-image-sato && bitbake -c testimage core-image-sato
...
SUMMARY:
core-image-sato () - Ran 75 tests in 229.248s
core-image-sato - OK - All required tests passed (successes=24,
skipped=51, failures=0, errors=0)
NOTE: Tasks Summary: Attempted 1558 tasks of which 1556 didn't need to
be rerun and all succeeded.

To boot qemu manually (add "slirp" if tap networking not setup):

$ runqemu nographic snapshot core-image-sato
---
 meta-yocto-bsp/conf/machine/genericarm64.conf | 4 ++++
 1 file changed, 4 insertions(+)

v2: dropper slirp from TEST_RUNQEMUPARAMS

v1: https://lists.yoctoproject.org/g/poky/message/13854

meta-yocto-bsp/conf/machine/genericarm64.conf +4 -0
index 2b1ce4bdd02b..d6839d16a515 100644
@@ -73,5 +73,9 @@ QB_TCPSERIAL_OPT ?= "-device virtio-serial-pci -chardev socket,id=virtcon,port=@
 # Virtio networking
 QB_TAP_OPT ?= "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
 
+# default to nographic to work on headless build machines using testimage.bbclass, snapshot for wic.zst image type
+TEST_RUNQEMUPARAMS ?= "nographic snapshot"
+# basic qemu testimage.bbclass support
+TESTIMAGEDEPENDS:append = " qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot"
 # If we're running testimage then we're in a qemu, so ensure u-boot is build
 TESTIMAGEDEPENDS:append = " u-boot:do_deploy"
Signature · 1 line
2.34.1
#1 lore raw
Quoted 51 lines · Mikko Rapeli via lists.yoctoproject.org

genericarm64 machine has supported qemu for a long time but the default build config failed with testimage.bbclass to boot and run oeqa runtime tests.

TESTIMAGEDEPENDS needs qemu utilities so that they are correctly installed to image sysroot. For qemu machines these are set in testimage.bbclass but remain unset for non-qemu machines like genericarm64.

TEST_RUNQEMUPARAMS needs snapshot since default genericarm64 image is a compressed wic.zst and nographic to run qemu without connected display which is better on headless build machines.

With these set, default genericarm64 core-image-sato boots correctly with testimage.bbclass and all oeqa runtime tests pass on an x86_64 build machine:

$ bitbake core-image-sato && bitbake -c testimage core-image-sato
...
SUMMARY:
core-image-sato () - Ran 75 tests in 229.248s
core-image-sato - OK - All required tests passed (successes=24,
skipped=51, failures=0, errors=0)
NOTE: Tasks Summary: Attempted 1558 tasks of which 1556 didn't need to
be rerun and all succeeded.

To boot qemu manually (add "slirp" if tap networking not setup):

$ runqemu nographic snapshot core-image-sato

---
 meta-yocto-bsp/conf/machine/genericarm64.conf | 4 ++++

 1 file changed, 4 insertions(+)

v2: dropper slirp from TEST_RUNQEMUPARAMS

v1: https://lists.yoctoproject.org/g/poky/message/13854

meta-yocto-bsp/conf/machine/genericarm64.conf +0 -0
index 2b1ce4bdd02b..d6839d16a515 100644
@@ -73,5 +73,9 @@ QB_TCPSERIAL_OPT ?= "-device virtio-serial-pci -chardev socket,id=virtcon,port=@
  # Virtio networking

 QB_TAP_OPT ?= "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"

meta-yocto-bsp/conf/machine/genericarm64.conf +4 -0
+# default to nographic to work on headless build machines using testimage.bbclass, snapshot for wic.zst image type
+TEST_RUNQEMUPARAMS ?= "nographic snapshot"
+# basic qemu testimage.bbclass support
+TESTIMAGEDEPENDS:append = " qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot"
Quoted 2 lines

 # If we're running testimage then we're in a qemu, so ensure u-boot is build TESTIMAGEDEPENDS:append = " u-boot:do_deploy"

I'll try again.

nographic does not make sense here, genericarm64 supports graphics as far as I know. The limitations of the test environment should not be hardcoded into the machine definition.

There are patches which I sent recently against master which fix that issue in a better way and will mean this is not needed. I am therefore not going to take that as it is confusing, incorrect and not actually needed.

Cheers,

Richard

#2 lore raw

Hi,

Quoted 57 lines · Richard Purdie
Quoted 51 lines · Mikko Rapeli via lists.yoctoproject.org

genericarm64 machine has supported qemu for a long time but the default build config failed with testimage.bbclass to boot and run oeqa runtime tests.

TESTIMAGEDEPENDS needs qemu utilities so that they are correctly installed to image sysroot. For qemu machines these are set in testimage.bbclass but remain unset for non-qemu machines like genericarm64.

TEST_RUNQEMUPARAMS needs snapshot since default genericarm64 image is a compressed wic.zst and nographic to run qemu without connected display which is better on headless build machines.

With these set, default genericarm64 core-image-sato boots correctly with testimage.bbclass and all oeqa runtime tests pass on an x86_64 build machine:

$ bitbake core-image-sato && bitbake -c testimage core-image-sato
...
SUMMARY:
core-image-sato () - Ran 75 tests in 229.248s
core-image-sato - OK - All required tests passed (successes=24,
skipped=51, failures=0, errors=0)
NOTE: Tasks Summary: Attempted 1558 tasks of which 1556 didn't need to
be rerun and all succeeded.

To boot qemu manually (add "slirp" if tap networking not setup):

$ runqemu nographic snapshot core-image-sato

---
�meta-yocto-bsp/conf/machine/genericarm64.conf | 4 ++++ �1 file changed, 4 insertions(+)

v2: dropper slirp from TEST_RUNQEMUPARAMS

v1: https://lists.yoctoproject.org/g/poky/message/13854

meta-yocto-bsp/conf/machine/genericarm64.conf +0 -0
index 2b1ce4bdd02b..d6839d16a515 100644
@@ -73,5 +73,9 @@ QB_TCPSERIAL_OPT ?= "-device virtio-serial-pci -chardev socket,id=virtcon,port=@

�# Virtio networking
�QB_TAP_OPT ?= "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" �

meta-yocto-bsp/conf/machine/genericarm64.conf +4 -0
+# default to nographic to work on headless build machines using testimage.bbclass, snapshot for wic.zst image type
+TEST_RUNQEMUPARAMS ?= "nographic snapshot"
+# basic qemu testimage.bbclass support
+TESTIMAGEDEPENDS:append = " qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot"
Quoted 2 lines

�# If we're running testimage then we're in a qemu, so ensure u-boot is build �TESTIMAGEDEPENDS:append = " u-boot:do_deploy"

I'll try again.

Quoted 8 lines

nographic does not make sense here, genericarm64 supports graphics as far as I know. The limitations of the test environment should not be hardcoded into the machine definition.

There are patches which I sent recently against master which fix that issue in a better way and will mean this is not needed. I am therefore not going to take that as it is confusing, incorrect and not actually needed.

Right, v3 then without nographic.

Cheers,

-Mikko