]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
selftest: runqemu: better check for ROOTFS: in the log
authorMartin Jansa <Martin.Jansa@gmail.com>
Thu, 30 Mar 2023 23:27:22 +0000 (01:27 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 1 Apr 2023 12:09:30 +0000 (13:09 +0100)
* it was searching for line like this:
  ROOTFS: [/OE/build/poky/build/build-st-2023-03-20-esdk-runqemu-patch1/runqemu.RunqemuTests.test_boot_machine_ext4/build-st/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64-20230320081121.rootfs.ext4]
  but with IMAGE_NAME_SUFFIX changed to something else than default ".rootfs"
  or with my pending changes the line looks like this:
  ROOTFS: [/OE/build/poky/build/build-st-2023-03-20-esdk-runqemu-patch2/runqemu.RunqemuTests.test_boot_machine_ext4/build-st/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.rootfs-20230320085744.ext4]
  and test was failing.

* Check for whole line starting with ROOTFS: and ending just with .ext4

[YOCTO #12937]

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/runqemu.py

index e1093c67c7a3a61aa0cb248f1b2d14ea38cb08c8..3f8760a5bacdc70a9423735ecf36d4817a871244 100644 (file)
@@ -62,7 +62,8 @@ SYSLINUX_TIMEOUT = "10"
         cmd = "%s %s ext4" % (self.cmd_common, self.machine)
         with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
             with open(qemu.qemurunnerlog) as f:
-                self.assertIn('rootfs.ext4', f.read(), "Failed: %s" % cmd)
+                regexp = r'\nROOTFS: .*\.ext4]\n'
+                self.assertRegex(f.read(), regexp, "Failed to find '%s' in '%s' after running '%s'" % (regexp, qemu.qemurunnerlog, cmd))
 
     @skipIfNotArch(['i586', 'i686', 'x86_64'])
     def test_boot_machine_iso(self):