Skip to contentSkip to conversation

oeqa/selftest: don't skip test_read_only_image on qemuarm64

PATCH Superseded [email protected] 3 participants 7 messages Oct 10, 2023 – Oct 30, 2023 RISC-V

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 oeqa/selftest: don't skip test_read_only_image on qemuarm64

From: Ross Burton <[email protected]>

There's no need to skip this test anymore, as skipping on qemuarm64 was a proxy for "uses SERIAL_CONSOLES_CHECK" which no longer exists.

[ YOCTO #14962 ]

---
 meta/lib/oeqa/selftest/cases/buildoptions.py | 2 --
 1 file changed, 2 deletions(-)
meta/lib/oeqa/selftest/cases/buildoptions.py +0 -2
index 01ea4dce395..104448442ad 100644
@@ -50,8 +50,6 @@ class ImageOptionsTests(OESelftestTestCase):
             loglines = "".join(f.readlines())
         self.assertIn("ccache", loglines, msg="No match for ccache in %s log.do_compile. For further details: %s" % (recipe , log_compile))
 
-    # https://bugzilla.yoctoproject.org/show_bug.cgi?id=14962
-    @skipIfMachine("qemuarm64", "fails on qemuarm64 (uses SERIAL_CONSOLES_CHECK)")
     def test_read_only_image(self):
         distro_features = get_bb_var('DISTRO_FEATURES')
         if not ('x11' in distro_features and 'opengl' in distro_features):
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/5 meta/conf/machine: remove SERIAL_CONSOLES_CHECK

From: Ross Burton <[email protected]>

There's no need for this variable anymore, as all consoles listed in SERIAL_CONSOLES are checked for their existence before a getty is started.

---
 meta/conf/machine/include/riscv/qemuriscv.inc | 1 -
 meta/conf/machine/qemuarm.conf                | 1 -
 meta/conf/machine/qemuarm64.conf              | 1 -
 3 files changed, 3 deletions(-)
meta/conf/machine/include/riscv/qemuriscv.inc +0 -1
index 8da5b0b0c88..46ae66b9e50 100644
@@ -10,7 +10,6 @@ KERNEL_IMAGETYPES += "uImage"
 KEEPUIMAGE = "no"
 
 SERIAL_CONSOLES ?= "115200;ttyS0 115200;hvc0"
-SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
 
 IMAGE_FSTYPES += "ext4 wic.qcow2"
 
meta/conf/machine/qemuarm.conf +0 -1
index 9f07664bef0..943ce7c16a2 100644
@@ -10,7 +10,6 @@ KERNEL_IMAGETYPE = "zImage"
 UBOOT_MACHINE ?= "qemu_arm_defconfig"
 
 SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0"
-SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
 
 # For runqemu
 QB_SYSTEM_NAME = "qemu-system-arm"
meta/conf/machine/qemuarm64.conf +0 -1
index 51600d40a4a..a096d964db5 100644
@@ -10,7 +10,6 @@ KERNEL_IMAGETYPE = "Image"
 UBOOT_MACHINE ?= "qemu_arm64_defconfig"
 
 SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0"
-SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
 
 # For runqemu
 QB_SYSTEM_NAME = "qemu-system-aarch64"
Signature · 1 line
2.34.1
#2 lore raw

PATCH 3/5 meta-yocto-bsp/conf/machine: remove SERIAL_CONSOLES_CHECK

In reply to [email protected]

From: Ross Burton <[email protected]>

There's no need for this variable anymore, as all consoles listed in SERIAL_CONSOLES are checked for their existence before a getty is started.

---
 meta-yocto-bsp/conf/machine/beaglebone-yocto.conf | 1 -
 meta-yocto-bsp/conf/machine/genericx86-64.conf    | 1 -
 2 files changed, 2 deletions(-)
meta-yocto-bsp/conf/machine/beaglebone-yocto.conf +0 -1
index 8b67cefef70..9f389711b3b 100644
@@ -18,7 +18,6 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-image kernel-devicetree"
 do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot virtual/bootloader:do_deploy"
 
 SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyO0 115200;ttyAMA0"
-SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
 PREFERRED_VERSION_linux-yocto ?= "6.1%"
meta-yocto-bsp/conf/machine/genericx86-64.conf +0 -1
index 14913ea1f15..f19a1c1527c 100644
@@ -6,6 +6,5 @@ DEFAULTTUNE ?= "core2-64"
 require conf/machine/include/x86/tune-core2.inc
 require conf/machine/include/genericx86-common.inc
 
-SERIAL_CONSOLES_CHECK = "ttyS0"
 #For runqemu
 QB_SYSTEM_NAME = "qemu-system-x86_64"
Signature · 1 line
2.34.1
#3 lore raw

Re: [OE-core] [PATCH 3/5] meta-yocto-bsp/conf/machine: remove SERIAL_CONSOLES_CHECK

Greetings,

Quoted 27 lines · Ross Burton

From: Ross Burton <[email protected]>

There's no need for this variable anymore, as all consoles listed in SERIAL_CONSOLES are checked for their existence before a getty is started.

---
  meta-yocto-bsp/conf/machine/beaglebone-yocto.conf | 1 -
  meta-yocto-bsp/conf/machine/genericx86-64.conf    | 1 -
  2 files changed, 2 deletions(-)
meta-yocto-bsp/conf/machine/beaglebone-yocto.conf +0 -1
index 8b67cefef70..9f389711b3b 100644
@@ -18,7 +18,6 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-image kernel-devicetree"
  do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot virtual/bootloader:do_deploy"
 
  SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyO0 115200;ttyAMA0"
-SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
 
  PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
  PREFERRED_VERSION_linux-yocto ?= "6.1%"
meta-yocto-bsp/conf/machine/genericx86-64.conf +0 -0
index 14913ea1f15..f19a1c1527c 100644

meta-yocto-bsp/conf/machine/genericx86-64.conf DEFAULTTUNE ?= "core2-64" · line 10

Quoted 6 lines
meta-yocto-bsp/conf/machine/genericx86-64.conf +0 -1
@@ -6,6 +6,5 @@ DEFAULTTUNE ?= "core2-64"
  require conf/machine/include/x86/tune-core2.inc
  require conf/machine/include/genericx86-common.inc
 
-SERIAL_CONSOLES_CHECK = "ttyS0"
  #For runqemu
  QB_SYSTEM_NAME = "qemu-system-x86_64"

Oops, this patch hasn't been taken yet in poky-contrib. Any reason why?
Getting rid of SERIAL_CONSOLES_CHECK for good would allow me to remove it from the documentation.

Cheers
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

Re: [OE-core] [PATCH 3/5] meta-yocto-bsp/conf/machine: remove SERIAL_CONSOLES_CHECK

In reply to [email protected]

Hi Ross,

Quoted 7 lines · Ross Burton

From: Ross Burton <[email protected]>

There's no need for this variable anymore, as all consoles listed in SERIAL_CONSOLES are checked for their existence before a getty is started.
---

Your Signed-off-by tag is missing.

#5 lore raw

PATCH 4/5 busybox-inittab: fix console handling

In reply to [email protected]

From: Ross Burton <[email protected]>

A testing failure meant that the inittab changes made in 6c65544 didn't actually work.

A copy-paste problems meant that start_getty was being invoked instead of getty, but start_getty is sysvinit-inittab-specific. Revert this inittab to calling getty directly.

Remove the terminal type, this wasn't specified in the original inittab.

Busybox's init has non-standard behaviour for the inittab's ID field. With SysV this is a four-character identifier and nothing more, but with busybox init this is the controlling terminal (minus /dev). If the terminal doesn't exist then busybox doesn't gracefully handle the failure but instead repeatedly fails to spawn.

As getty will immediately issue a setsid() this isn't needed for getty entries, so the ID can be empty and ttyrun does the terminal detection.

---
 meta/recipes-core/busybox/busybox-inittab_1.36.1.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/busybox/busybox-inittab_1.36.1.bb +1 -1
index 462c9bb9c5f..8ee88b6aeff 100644
@@ -23,7 +23,7 @@ do_install() {
         device=$(echo $s | cut -d\; -f 2)
         label=$(echo $device | sed -e 's/tty//' | tail --bytes=5)
 
-        echo "$label::respawn:${sbindir}/ttyrun $device ${base_bindir}/start_getty $speed $device vt102" >> ${D}${sysconfdir}/inittab
+        echo "::respawn:${sbindir}/ttyrun $device ${base_sbindir}/getty $speed $device" >> ${D}${sysconfdir}/inittab
     done
 
 	if [ "${USE_VT}" = "1" ]; then
Signature · 1 line
2.34.1
#6 lore raw

PATCH 5/5 oeqa/runtime/_qemutiny: rewrite test to be functional

In reply to [email protected]

From: Ross Burton <[email protected]>

The _qemutiny is a small test case that was explicitly designed to do a minimal level of testing for poky-tiny images. These typically don't have SSH servers so we need to assume that qemu is being used and access the serial console directly.

---
 meta/lib/oeqa/runtime/cases/_qemutiny.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
meta/lib/oeqa/runtime/cases/_qemutiny.py +8 -3
index 14ff8b98b22..816fd4a7cb5 100644
@@ -5,10 +5,15 @@
 #
 
 from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.target.qemu import OEQemuTarget
 
 class QemuTinyTest(OERuntimeTestCase):
 
     def test_boot_tiny(self):
-        status, output = self.target.run_serial('uname -a')
-        msg = "Cannot detect poky tiny boot!"
-        self.assertTrue("yocto-tiny" in output, msg)
+        # Until the target has explicit run_serial support, check that the
+        # target is the qemu runner
+        if isinstance(self.target, OEQemuTarget):
+            status, output = self.target.runner.run_serial('uname -a')
+            self.assertIn("Linux", output)
+        else:
+            self.skipTest("Target %s is not OEQemuTarget" % self.target)
Signature · 1 line
2.34.1