]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
runtime_test: Add debug statements to rust in kernel selftest deepesh/rust-kernel-debug
authorHarish Sadineni <Harish.Sadineni@windriver.com>
Mon, 2 Mar 2026 08:38:06 +0000 (00:38 -0800)
committerDeepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Tue, 3 Mar 2026 13:56:20 +0000 (05:56 -0800)
Adding debug statements to figure out why intermittent failure is hapenning
in autobuilder.

Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
meta/lib/oeqa/selftest/cases/runtime_test.py

index 1b18cf2e5e49bfd8e564a2015afc9a34f01a4801..34b4c9a776ed6409bcdaadfd1fdfcac5e1e079ae 100644 (file)
@@ -501,16 +501,23 @@ class RustKernel(OESelftestTestCase):
             bitbake(self.image)
 
             with runqemu(self.image, runqemuparams = "nographic") as qemu:
+
                 qemu.run_serial("dmesg -c > /dev/null")
-                status, _ = qemu.run_serial("modprobe rust_minimal")
-                self.assertEqual(status, 1, "Loading rust_minimal module failed!")
+                status, output = qemu.run_serial("modprobe rust_minimal")
+                self.logger.info("modprobe rust_minimal -> status=%s, output=\n%s", status, output.strip())
                 _, output = qemu.run_serial("dmesg")
                 self.logger.debug(f"rust_minimal dmesg output:\n" + textwrap.indent(output, "  "))
-                self.assertIn("Rust minimal sample", output, "Kernel Rust sample expected output not found in dmesg")
+                if not output.strip():
+                    self.fail("Module not loaded: dmesg output is empty")
+                else:
+                    self.assertIn("Rust minimal sample", output, "Kernel Rust sample expected output not found in dmesg")
 
                 qemu.run_serial("dmesg -c > /dev/null")
-                status, _ = qemu.run_serial("modprobe rust_out_of_tree")
-                self.assertEqual(status, 1, "Loading rust_out_of_tree module failed!")
+                status, output = qemu.run_serial("modprobe rust_out_of_tree")
+                self.logger.info("modprobe rust_out_of_tree -> status=%s, output=\n%s", status, output.strip())
                 _, output = qemu.run_serial("dmesg")
                 self.logger.debug(f"rust_out_of_tree dmesg output:\n" + textwrap.indent(output, "  "))
-                self.assertIn("Rust out-of-tree sample", output, "Out-of-tree Rust sample expected output not found in dmesg")
+                if not output.strip():
+                    self.fail("Module not loaded: dmesg output is empty")
+                else:
+                    self.assertIn("Rust out-of-tree sample", output, "Out-of-tree Rust sample expected output not found in dmesg")