From nobody Sun Dec 14 12:18:12 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=nxp.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176277513508390.22614324232552; Mon, 10 Nov 2025 03:45:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vIQIL-0001VO-Ek; Mon, 10 Nov 2025 06:42:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vIPzq-0003ww-IQ for qemu-devel@nongnu.org; Mon, 10 Nov 2025 06:23:45 -0500 Received: from inva021.nxp.com ([92.121.34.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vIPzo-00069m-Ol for qemu-devel@nongnu.org; Mon, 10 Nov 2025 06:23:42 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9F745202DDF; Mon, 10 Nov 2025 12:23:38 +0100 (CET) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6A01F201524; Mon, 10 Nov 2025 12:23:38 +0100 (CET) Received: from lsv031015.swis.in-blr01.nxp.com (lsv031015.swis.in-blr01.nxp.com [10.12.177.77]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 8F80418000A4; Mon, 10 Nov 2025 19:23:37 +0800 (+08) From: Gaurav Sharma To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, peter.maydell@linaro.org, Gaurav Sharma Subject: [PATCH 13/13] hw/arm/fsl-imx8mm: Adding functional testing of iMX8MM emulation Date: Mon, 10 Nov 2025 16:52:57 +0530 Message-Id: <20251110112257.184578-14-gaurav.sharma_7@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251110112257.184578-1-gaurav.sharma_7@nxp.com> References: <20251110112257.184578-1-gaurav.sharma_7@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV using ClamSMTP Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=92.121.34.21; envelope-from=gaurav.sharma_7@nxp.com; helo=inva021.nxp.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1762775136960158500 Content-Type: text/plain; charset="utf-8" Added script that would validate the iMX8MM emulation by checking the linux console log. If it succeeds, it will return:- ok 1 test_imx8mm_evk.Imx8mmEvkMachine.test_aarch64_imx8mm_evk_usdhc Signed-off-by: Gaurav Sharma --- tests/functional/aarch64/meson.build | 2 + tests/functional/aarch64/test_imx8mm_evk.py | 67 +++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100755 tests/functional/aarch64/test_imx8mm_evk.py diff --git a/tests/functional/aarch64/meson.build b/tests/functional/aarch6= 4/meson.build index 5ad52f93e1..31ecedbf6f 100644 --- a/tests/functional/aarch64/meson.build +++ b/tests/functional/aarch64/meson.build @@ -5,6 +5,7 @@ test_aarch64_timeouts =3D { 'aspeed_ast2700fc' : 600, 'device_passthrough' : 720, 'imx8mp_evk' : 240, + 'imx8mm_evk' : 240, 'raspi4' : 480, 'reverse_debug' : 180, 'rme_virt' : 1200, @@ -28,6 +29,7 @@ tests_aarch64_system_thorough =3D [ 'device_passthrough', 'hotplug_pci', 'imx8mp_evk', + 'imx8mm_evk', 'kvm', 'multiprocess', 'raspi3', diff --git a/tests/functional/aarch64/test_imx8mm_evk.py b/tests/functional= /aarch64/test_imx8mm_evk.py new file mode 100755 index 0000000000..d5eb43afc6 --- /dev/null +++ b/tests/functional/aarch64/test_imx8mm_evk.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +# +# Functional test that boots a Linux kernel and checks the console +# +# SPDX-License-Identifier: GPL-2.0-or-later + +from qemu_test import LinuxKernelTest, Asset + +class Imx8mmEvkMachine(LinuxKernelTest): + + ASSET_IMAGE =3D Asset( + ('https://cloud.debian.org/images/cloud/bookworm/20231210-1590/' + 'debian-12-generic-arm64-20231210-1590.tar.xz'), + '7ebf1577b32d5af6204df74b54ca2e4675de9b5a9fa14f3ff70b88eeb7b3b359') + + KERNEL_OFFSET =3D 0x51000000 + KERNEL_SIZE =3D 32622528 + INITRD_OFFSET =3D 0x76000000 + INITRD_SIZE =3D 30987766 + DTB_OFFSET =3D 0x64F51000 + DTB_SIZE =3D 45 * 1024 + + def extract(self, in_path, out_path, offset, size): + try: + with open(in_path, "rb") as source: + source.seek(offset) + data =3D source.read(size) + with open(out_path, "wb") as target: + target.write(data) + except (IOError, ValueError) as e: + self.log.error(f"Failed to extract {out_path}: {e}") + raise + + def setUp(self): + super().setUp() + + self.image_path =3D self.scratch_file("disk.raw") + self.kernel_path =3D self.scratch_file("linux") + self.initrd_path =3D self.scratch_file("initrd.zstd") + self.dtb_path =3D self.scratch_file("imx8mm-evk.dtb") + + self.archive_extract(self.ASSET_IMAGE) + self.extract(self.image_path, self.kernel_path, + self.KERNEL_OFFSET, self.KERNEL_SIZE) + self.extract(self.image_path, self.initrd_path, + self.INITRD_OFFSET, self.INITRD_SIZE) + self.extract(self.image_path, self.dtb_path, + self.DTB_OFFSET, self.DTB_SIZE) + + def test_aarch64_imx8mm_evk_usdhc(self): + self.require_accelerator("tcg") + self.set_machine('imx8mm-evk') + self.vm.set_console(console_index=3D1) + self.vm.add_args('-m', '2G', + '-smp', '4', + '-kernel', self.kernel_path, + '-initrd', self.initrd_path, + '-dtb', self.dtb_path, + '-append', 'root=3D/dev/mmcblk2p1', + '-drive', f'file=3D{self.image_path},if=3Dsd,bus= =3D2,' + 'format=3Draw,id=3Dmmcblk2,snapshot=3D= on') + + self.vm.launch() + self.wait_for_console_pattern('Welcome to ') + +if __name__ =3D=3D '__main__': + LinuxKernelTest.main() --=20 2.34.1