]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional/arm: Add helper to generate OTP images
authorKane-Chen-AS <kane_chen@aspeedtech.com>
Wed, 17 Sep 2025 03:59:15 +0000 (11:59 +0800)
committerCédric Le Goater <clg@redhat.com>
Mon, 29 Sep 2025 16:00:20 +0000 (18:00 +0200)
Add a small helper that generates OTP images at test time. This lets
multiple test cases create default OTP contents without shipping prebuilt
fixtures and keeps the tests self-contained.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250917035917.4141723-2-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
tests/functional/aspeed.py

index b131703c5283aa2ea004d7e38817d7c25bda986a..47e84e035bd0a76dbb907e6d6be28d2d40530336 100644 (file)
@@ -61,3 +61,11 @@ class AspeedTest(LinuxKernelTest):
         self.wait_for_console_pattern('U-Boot 2019.04')
         self.wait_for_console_pattern('## Loading kernel from FIT Image')
         self.wait_for_console_pattern('Starting kernel ...')
+
+    def generate_otpmem_image(self):
+        path = self.scratch_file("otpmem.img")
+        pattern = b'\x00\x00\x00\x00\xff\xff\xff\xff' * (16 * 1024 // 8)
+        with open(path, "wb") as f:
+            f.write(pattern)
+        return path
+