From nobody Wed Nov 19 00:18:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.173 as permitted sender) client-ip=209.85.208.173; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-lj1-f173.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.173 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1613328226; cv=none; d=zohomail.com; s=zohoarc; b=DusLo+bdeokC6IbC4ElOtmwwN12bNuOLq/iZ6Q+b6EJidYA6P3KnO+C6zPz06ldUH3j1Lh5RdA3+2DiboUXCXIMulzn+UljHXI36sDUY/1QNJypHjJLfMCOCww9oYPsZNU7v0rAXwxJnVesAzGhVFi4aiqmTFAfaAsA8J8SWEnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613328226; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gZSzBZ5cwzLEMl1m4ueqOFOq71K8++arIDvi8B+RYEY=; b=Pl7KL6DTPv0Qm/dqnJVMEu2lvZmR66VEeGcMOzMbGz2TojxoMicXWByFDKoD/cVy6Zj++BViIpI2JRYo83j2yXZ+TNXzYlVaVz8DtkOFs1uq5BYbyuL68MYV4p1Hsj5cz66r2fqcLfStGBj/Ij2JxF6iBTL4JDAT+MNhs6cC8KI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.173 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by mx.zohomail.com with SMTPS id 1613328226534150.43292373146016; Sun, 14 Feb 2021 10:43:46 -0800 (PST) Received: by mail-lj1-f173.google.com with SMTP id e17so5216423ljl.8 for ; Sun, 14 Feb 2021 10:43:43 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id x18sm8701695wrs.16.2021.02.14.10.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 10:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gZSzBZ5cwzLEMl1m4ueqOFOq71K8++arIDvi8B+RYEY=; b=ZJmI9sTO3d9Js+k0LaDPnWAlUubc7e4so0JyvQgsOxqnyDlcm/O/BqNAdy5G3maddK d74hzd6EMrVyrClBRKwEjCgtQsFbNguvDoJqMZGgRYaedWzrGWpfioej3s1L7a1ZKOuX vp3E6HaIZTYkWyNvofEU8xxPnUpFb/5BsMCiBjCg91LzvD+CZWWQlyLzLGMOmo2J/Kgj PnGN07o/uUjq0qAblADcwrg4PF3i1SBlqxXFKB7q/14WSpoyjUtquqYhtG/aK/WhaaxM EB5xuvzDeWNb1GGLXI0+vWOGxiv2Qo2l5ET2XH66JGuVAXfKy9xfCbUDkA5Ee7dIGzit PjeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gZSzBZ5cwzLEMl1m4ueqOFOq71K8++arIDvi8B+RYEY=; b=aeaZenwMePh4YsXAfOGQ6Lv8TeNrDc06+a9XwDzdQKb8tSf9o8U8bSZST2dbSZugxb 7iSKqjPf9jTLKvIBpFuhLrmARYzjksTE3ypHhNMlmtGqHy62KJucQLX0nir2DywRG3TI V+/Hmi/06kjTztpqxgwuXCRL0dK/n9wPRYu41gZ8lM2pQJEFFgxfRfmu+ITGTXaKRz1E IqSfp+/BLVqwUkKMtinGrQMa7tqq7es9Gn4c5uDL0T9TAPjNEKy17ZSp8TdrhW/VwXNA kiKoGXtjocOo/rdcvS/5zXmF+170P+YqOqoApdkVorb6HexDtzAHpKm9RbO5TsJsnzd+ y5Gw== X-Gm-Message-State: AOAM530uUR9aBjqstQuS1WyJKvpujBswmBYcP+CyYRVqpEMf4TgWUuFB Gw/6Kv0PGULs6EDgEqgxuH/VOa9464s= X-Google-Smtp-Source: ABdhPJxGGozT7vVqFV87EM4Q6sd89GQ48EFSrEmraPjq4VV4K0SdCNJoTC2ZI1/Hj7qd9j+GycaIfA== X-Received: by 2002:a5d:5910:: with SMTP id v16mr4258464wrd.304.1613325760376; Sun, 14 Feb 2021 10:02:40 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fredrik Noring , Laurent Vivier , Jiaxun Yang , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Maciej W. Rozycki" , Thomas Huth , Aurelien Jarno , Richard Henderson , Aleksandar Rikalo , Cleber Rosa , Wainer dos Santos Moschetta Subject: [RFC PATCH 41/42] tests/acceptance: Test R5900 CPU with BusyBox from Sony PS2 Date: Sun, 14 Feb 2021 18:59:11 +0100 Message-Id: <20210214175912.732946-42-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210214175912.732946-1-f4bug@amsat.org> References: <20210214175912.732946-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Test BusyBox on the R5900 CPU with 2 different binaries: - o32 32-bit (statically linked) - o32 64-bit (dynamically linked, uses multimedia instructions) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 1 + tests/acceptance/mips_r5900_ps2.py | 69 ++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 tests/acceptance/mips_r5900_ps2.py diff --git a/MAINTAINERS b/MAINTAINERS index de5fe1c65f5..1a23f471b0e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -242,6 +242,7 @@ F: include/hw/mips/ F: include/hw/misc/mips_* F: include/hw/timer/mips_gictimer.h F: tests/tcg/mips/ +F: tests/acceptance/mips_r5900_ps2.py K: ^Subject:.*(?i)mips =20 MIPS TCG CPUs (nanoMIPS ISA) diff --git a/tests/acceptance/mips_r5900_ps2.py b/tests/acceptance/mips_r59= 00_ps2.py new file mode 100644 index 00000000000..ff73f994e59 --- /dev/null +++ b/tests/acceptance/mips_r5900_ps2.py @@ -0,0 +1,69 @@ +# Test the MIPS R5900 CPU +# +# Copyright (C) 2021 Philippe Mathieu-Daud=C3=A9 +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +import lzma +import shutil + +from avocado import skipUnless + +from avocado.utils import archive +from avocado_qemu import QemuUserTest + +class R5900(QemuUserTest): + + @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + def test_gentoo_busybox_32bit(self): + """ + :avocado: tags=3Darch:r5900o32el + :avocado: tags=3Dlinux_user + :avocado: tags=3Dquick + """ + busybox_url =3D ('https://raw.githubusercontent.com/philmd' + '/qemu-testing-blob/bf6a300cf0bc56e4a2c5b' + '/mips/ps2/busybox-gentoo-v1.32.0.xz') + busybox_hash =3D 'd2a0abc2c7c3adb6b2fdd63356be78bc5e99f324' + busybox_path_xz =3D self.fetch_asset(busybox_url, asset_hash=3Dbus= ybox_hash) + + busybox_path =3D os.path.join(self.workdir, "busybox") + with lzma.open(busybox_path_xz, 'rb') as f_in: + with open(busybox_path, 'wb') as f_out: + shutil.copyfileobj(f_in, f_out) + os.chmod(busybox_path, 0o755) + + res =3D self.run(busybox_path) + ver =3D 'BusyBox v1.32.0 (2021-02-09 15:13:23 -00) multi-call bina= ry' + self.assertIn(ver, res.stdout_text) + + res =3D self.run(busybox_path, ['uname', '-a']) + unm =3D 'mips64 mips64 mips64 GNU/Linux' + self.assertIn(unm, res.stdout_text) + + @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + def test_ps2_busybox_64bit(self): + """ + :avocado: tags=3Darch:r5900o32el + :avocado: tags=3Dlinux_user + :avocado: tags=3Dquick + """ + rootfs_url =3D ('https://raw.githubusercontent.com/philmd' + '/qemu-testing-blob/bf6a300cf0bc56e4a2c5b/mips' + '/ps2/ps2linux_live_v5_pal_netsurf_usb_busybox.tar.= gz') + rootfs_hash =3D '9aa8fdd974cd3332c7167bceb6dd7137853d3a10' + rootfs_path_tgz =3D self.fetch_asset(rootfs_url, asset_hash=3Droot= fs_hash) + + archive.extract(rootfs_path_tgz, self.workdir) + busybox_path =3D self.workdir + "/bin/busybox" + + self.add_ldpath(self.workdir) + + res =3D self.run(busybox_path) + ver =3D 'BusyBox v0.60.5 (2010.06.06-16:16+0000) multi-call binary' + self.assertIn(ver, res.stderr_text) + + res =3D self.run(busybox_path, ['uname', '-a']) + unm =3D 'mips64 unknown' + self.assertIn(unm, res.stdout_text) --=20 2.26.2