diff mbox series

[v2,4/4] oeqa/runtime/_qemutiny: rewrite test to be functional

Message ID 20231010125458.167900-4-ross.burton@arm.com
State Accepted, archived
Commit 2245b2754d6f4798127ce85a2ab7cb48f458c1f7
Headers show
Series [v2,1/4] oeqa/selftest: don't skip test_read_only_image on qemuarm64 | expand

Commit Message

Ross Burton Oct. 10, 2023, 12:54 p.m. UTC
From: Ross Burton <ross.burton@arm.com>

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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/lib/oeqa/runtime/cases/_qemutiny.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/runtime/cases/_qemutiny.py b/meta/lib/oeqa/runtime/cases/_qemutiny.py
index 14ff8b98b22..816fd4a7cb5 100644
--- a/meta/lib/oeqa/runtime/cases/_qemutiny.py
+++ b/meta/lib/oeqa/runtime/cases/_qemutiny.py
@@ -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)