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")