diff options
| author | Kane-Chen-AS <kane_chen@aspeedtech.com> | 2025-09-17 11:59:15 +0800 |
|---|---|---|
| committer | Cédric Le Goater <clg@redhat.com> | 2025-09-29 18:00:20 +0200 |
| commit | 54623e94623cd75aec87ebd1e49b538033676c3f (patch) | |
| tree | ee07f52eefe0b09baf13be2be545a23d06df9260 | |
| parent | b28103bb52161e2d240be3e03bf0e8680cb873c9 (diff) | |
| download | focaccia-qemu-54623e94623cd75aec87ebd1e49b538033676c3f.tar.gz focaccia-qemu-54623e94623cd75aec87ebd1e49b538033676c3f.zip | |
tests/functional/arm: Add helper to generate OTP images
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>
| -rw-r--r-- | tests/functional/aspeed.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/functional/aspeed.py b/tests/functional/aspeed.py index b131703c52..47e84e035b 100644 --- a/tests/functional/aspeed.py +++ b/tests/functional/aspeed.py @@ -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 + |