Skip to contentSkip to conversation

oeqa/selftest: don't skip test_read_only_image on qemuarm64

PATCH New [email protected] 1 participant 4 messages Oct 10, 2023 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 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 v2 2/4 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 v2 3/4 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
#3 lore raw

PATCH v2 4/4 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