From nobody Thu Apr 3 11:52:28 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1740652826; cv=none; d=zohomail.com; s=zohoarc; b=dSMQvhSTcNpOzqxkfLU+VQNjmxeGlyVDqhVRbEH6M8xjFyQyTHKbNY6sgdXNAbEamoRD+NfPbfS4G+46UGX9tf9ajqHApUah+iqf3tQxrTMT6KdpV8VxcGWhAHjE/RkL+3hq6tHzcXwHljgrlLk+HeKavGpw3c+2uIKLR8E2y4s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1740652826; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GWBy97K/W0cA9vpV4/TYPcmJHBMA6YOQWarCsegSOPc=; b=CMAjw7ORSTV63CrpAePtQ7covBmnfBZxPLPtsoMeiFIrzlWrRG8uNuKPewhQSOOK4Vp5C8N+uUFDKfcIR5nbrnx7v3MdU/CJDmCUeSGrGX9L5JRrJdkKvW9nxXOld5c6AUR41Z7ExtV1chVYRyu0DlcI9/BLYvyYtI0W7Ew3PR4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1740652826107986.1759920650603; Thu, 27 Feb 2025 02:40:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tnbIo-0007Ux-6R; Thu, 27 Feb 2025 05:39:38 -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 1tnbIk-0007Tx-Kp for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:39:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tnbIi-0003BX-Mg for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:39:34 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-448-jQNcx4wJMrCyKIxRKon40A-1; Thu, 27 Feb 2025 05:39:28 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DB1EB180087A; Thu, 27 Feb 2025 10:39:26 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.33.184]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F1CBB300018D; Thu, 27 Feb 2025 10:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740652772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GWBy97K/W0cA9vpV4/TYPcmJHBMA6YOQWarCsegSOPc=; b=ZXMZlKC9ODSjjBexbHHLc1007idOsDjcXemrHVFaIkP94J2Ul9Ymv5FHal7Q0pi8UAmtp5 /dn51HJAGZTcBcRCxGl6T9E2GSgpEL6ACuGmPFBRo5T2Ze0sT4mBG7R6dyZzZxHe3OQJS9 Tl5v9L7p0PNb/Mw2xXE32MNHte8u2KE= X-MC-Unique: jQNcx4wJMrCyKIxRKon40A-1 X-Mimecast-MFC-AGG-ID: jQNcx4wJMrCyKIxRKon40A_1740652767 From: Thomas Huth To: qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 1/6] tests/functional: Move the code for testing HTTP downloads to a common function Date: Thu, 27 Feb 2025 11:39:10 +0100 Message-ID: <20250227103915.19795-2-thuth@redhat.com> In-Reply-To: <20250227103915.19795-1-thuth@redhat.com> References: <20250227103915.19795-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.44, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1740652827471019100 Content-Type: text/plain; charset="utf-8" We are going to use this code in other tests, too, so let's move it to the qemu_test module to be able to re-use it more easily. Signed-off-by: Thomas Huth --- tests/functional/qemu_test/linuxkernel.py | 26 ++++++++++++++++++++++- tests/functional/test_intel_iommu.py | 22 +------------------ 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/tests/functional/qemu_test/linuxkernel.py b/tests/functional/q= emu_test/linuxkernel.py index 2c9598102d0..2aca0ee3cd0 100644 --- a/tests/functional/qemu_test/linuxkernel.py +++ b/tests/functional/qemu_test/linuxkernel.py @@ -3,8 +3,12 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 +import hashlib +import urllib.request + +from .cmd import wait_for_console_pattern, exec_command_and_wait_for_patte= rn from .testcase import QemuSystemTest -from .cmd import wait_for_console_pattern +from .utils import get_usernet_hostfwd_port =20 =20 class LinuxKernelTest(QemuSystemTest): @@ -26,3 +30,23 @@ def launch_kernel(self, kernel, initrd=3DNone, dtb=3DNon= e, console_index=3D0, self.vm.launch() if wait_for: self.wait_for_console_pattern(wait_for) + + def check_http_download(self, filename, hashsum, guestport=3D8080, + pythoncmd=3D'python3 -m http.server'): + exec_command_and_wait_for_pattern(self, + f'{pythoncmd} {guestport} & sleep 1', + f'Serving HTTP on 0.0.0.0 port {guestport}') + hl =3D hashlib.sha256() + hostport =3D get_usernet_hostfwd_port(self.vm) + url =3D f'http://localhost:{hostport}{filename}' + self.log.info(f'Downloading {url} ...') + with urllib.request.urlopen(url) as response: + while True: + chunk =3D response.read(1 << 20) + if not chunk: + break + hl.update(chunk) + + digest =3D hl.hexdigest() + self.log.info(f'sha256sum of download is {digest}.') + self.assertEqual(digest, hashsum) diff --git a/tests/functional/test_intel_iommu.py b/tests/functional/test_i= ntel_iommu.py index a9e8f82ab59..62268d6f278 100755 --- a/tests/functional/test_intel_iommu.py +++ b/tests/functional/test_intel_iommu.py @@ -10,11 +10,7 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -import hashlib -import urllib.request - from qemu_test import LinuxKernelTest, Asset, exec_command_and_wait_for_pa= ttern -from qemu_test.utils import get_usernet_hostfwd_port =20 =20 class IntelIOMMU(LinuxKernelTest): @@ -125,23 +121,7 @@ def run_and_check(self): =20 # Check virtio-net via HTTP: exec_command_and_wait_for_pattern(self, 'dhclient eth0', prompt) - exec_command_and_wait_for_pattern(self, - f'python3 -m http.server {self.GUEST_PORT} & sleep= 1', - f'Serving HTTP on 0.0.0.0 port {self.GUEST_PORT}') - hl =3D hashlib.sha256() - hostport =3D get_usernet_hostfwd_port(self.vm) - url =3D f'http://localhost:{hostport}{filename}' - self.log.info(f'Downloading {url} ...') - with urllib.request.urlopen(url) as response: - while True: - chunk =3D response.read(1 << 20) - if not chunk: - break - hl.update(chunk) - - digest =3D hl.hexdigest() - self.log.info(f'sha256sum of download is {digest}.') - self.assertEqual(digest, hashsum) + self.check_http_download(filename, hashsum, self.GUEST_PORT) =20 def test_intel_iommu(self): self.common_vm_setup() --=20 2.48.1 From nobody Thu Apr 3 11:52:28 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1740652805; cv=none; d=zohomail.com; s=zohoarc; b=LMxd2mqqbbH4VXkavxDjmZ8O+09MopIk+l2yuDHsLKcYqbxzRkycqROBswQTh2tsIEz63VjVnB6ycamO7+LrYpFEIYhrG6+FhRs66bIMZ6aehmtEZESNDH2gH9fElso05h244Bf9lXQO4ZyWzZn+kXkoMbz25mNW7xJkrCdJWTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1740652805; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jzuaNwODF1DK/Qm246vnVnxoJib6aVgbvc3Wt9wkKRM=; b=IAzcXrB5gtMSeqIKN9YMZxTAc/l8bWmhgXHvktuNaiRjTpRxB1PYeUlE4Jo5r5o2u4d97drGMAJy5RJOpLYCNIETt7FKTxKErSI57park8HowsJ4yB1KgwXcLhEgKDDRmt9T13E0uiJkVQgQp/goT4OduF4D30VlW4J4wG90Pzo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1740652805350330.98258859565124; Thu, 27 Feb 2025 02:40:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tnbIw-0007gL-NJ; Thu, 27 Feb 2025 05:39:46 -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 1tnbIr-0007bk-RR for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:39:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tnbIq-0003C3-4n for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:39:41 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-29-2wZxDIwmOGKuooz9N0h78Q-1; Thu, 27 Feb 2025 05:39:32 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D640F1800874; Thu, 27 Feb 2025 10:39:31 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.33.184]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D2CB3300018D; Thu, 27 Feb 2025 10:39:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740652778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jzuaNwODF1DK/Qm246vnVnxoJib6aVgbvc3Wt9wkKRM=; b=Ufir6tRNZ/Mcd2Q2+fp5jV9ZNswk0z2nx6+Hs9jK66biLOqsw8P6nQbFnqNnw+Hp5liUcu M3pC/kzQWG/ObdXrg6Xy/97FIWslyHdUuk1sQA1B4ihwxTXkl4VDaQrEBPkfTMd/XFZXVE 1HtfWFCawOLIxqgptZPqDpqdEkYKsjU= X-MC-Unique: 2wZxDIwmOGKuooz9N0h78Q-1 X-Mimecast-MFC-AGG-ID: 2wZxDIwmOGKuooz9N0h78Q_1740652772 From: Thomas Huth To: qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 2/6] tests/functional/test_mips_malta: Add a network test via the pcnet NIC Date: Thu, 27 Feb 2025 11:39:11 +0100 Message-ID: <20250227103915.19795-3-thuth@redhat.com> In-Reply-To: <20250227103915.19795-1-thuth@redhat.com> References: <20250227103915.19795-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.44, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1740652806076019000 Content-Type: text/plain; charset="utf-8" The kernel has a driver for the pcnet NIC included, and the initrd has a "tftp" command, so we can test a simple network transfer here, too. Signed-off-by: Thomas Huth --- tests/functional/test_mips_malta.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/functional/test_mips_malta.py b/tests/functional/test_mi= ps_malta.py index eaf372255ba..9697c7d63f8 100755 --- a/tests/functional/test_mips_malta.py +++ b/tests/functional/test_mips_malta.py @@ -45,12 +45,15 @@ def test_mips_malta(self): 'dcfe3a7fe3200da3a00d176b95caaa086495eb158f2bff64afc67d7e1eb2cddc') =20 def test_mips_malta_cpio(self): + self.require_netdev('user') + self.set_machine('malta') + self.require_device('pcnet') + kernel_path =3D self.archive_extract( self.ASSET_KERNEL_4_5_0, member=3D'boot/vmlinux-4.5.0-2-4kc-malta') initrd_path =3D self.uncompress(self.ASSET_INITRD) =20 - self.set_machine('malta') self.vm.set_console() kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + 'console=3DttyS0 console=3Dtty ' @@ -58,6 +61,8 @@ def test_mips_malta_cpio(self): self.vm.add_args('-kernel', kernel_path, '-initrd', initrd_path, '-append', kernel_command_line, + '-netdev', 'user,id=3Dn1,tftp=3D' + self.scratch_= file('boot'), + '-device', 'pcnet,netdev=3Dn1', '-no-reboot') self.vm.launch() self.wait_for_console_pattern('Boot successful.') @@ -66,6 +71,19 @@ def test_mips_malta_cpio(self): 'BogoMIPS') exec_command_and_wait_for_pattern(self, 'uname -a', 'Debian') + + exec_command_and_wait_for_pattern(self, 'ip link set eth0 up', + 'eth0: link up') + exec_command_and_wait_for_pattern(self, + 'ip addr add 10.0.2.15 dev eth0', + '#') + exec_command_and_wait_for_pattern(self, 'route add default eth0', = '#') + exec_command_and_wait_for_pattern(self, + 'tftp -g -r vmlinux-4.5.0-2-4kc-malta 10.0.2.2', = '#') + exec_command_and_wait_for_pattern(self, + 'md5sum vmlinux-4.5.0-2-4kc-malt= a', + 'a98218a7efbdefb2dfdf9ecd08c9831= 8') + exec_command_and_wait_for_pattern(self, 'reboot', 'reboot: Restarting system= ') # Wait for VM to shut down gracefully --=20 2.48.1 From nobody Thu Apr 3 11:52:28 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1740652860; cv=none; d=zohomail.com; s=zohoarc; b=SsBriV4Eq3+RcvBnKWz7e50tG965hxatigsVsLGtxkIK1CpOQjs8PGsqe89PwztMnyMs9AaP2SEqazo6HJeV9T436BfcFiVVXDfE/ASqsouZ95mkTdZGdOUm37quD7RVpK7Mo7uqw4ytbtXUgy2JUS0GZFP94t3eN3sbj5TglRQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1740652860; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Mr5F9uNh0RUX8h4wclwrek8nY4YzqtePKxhzWjLtpUA=; b=HRkKXFc0ZdT8WNiltxDjkQAtd6aHjuVTLCdyrAiTlRJAqE6JEjvgr2uRcskKGP1FTyUC1yiGAvagRu+feXiuf+f5pIpX2eVh9WunZufCnC1uVh9jwv+jxRHQNb2dQglsfu40gYvb19+c6OwRLr5QfCxT0by8n44rhVyNB6Xp8AA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1740652860946929.4896033905803; Thu, 27 Feb 2025 02:41:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tnbJ3-0007jw-C4; Thu, 27 Feb 2025 05:39:53 -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 1tnbIw-0007ge-9L for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:39:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tnbIu-0003Ck-4b for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:39:45 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-554-OHCuIKqKMGOqwLQdFrGvHQ-1; Thu, 27 Feb 2025 05:39:39 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DADEF18004A7; Thu, 27 Feb 2025 10:39:37 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.33.184]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 756BB300018D; Thu, 27 Feb 2025 10:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740652783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mr5F9uNh0RUX8h4wclwrek8nY4YzqtePKxhzWjLtpUA=; b=fCePpZqizrAjewaYURA9iaBfcm1UPCtijNb6zUAqCgAArPCI0/EEDN8dAYM4y3wNNkZgPb OJ6Bosz3myKryaBURl33goMbSbZvN2ED39gwjnVkB8/Z8pnk8wj184eJZBPwa1+pSufrua 9HnSZghoZ1FtdqskyYhS/T0DFzDx8lI= X-MC-Unique: OHCuIKqKMGOqwLQdFrGvHQ-1 X-Mimecast-MFC-AGG-ID: OHCuIKqKMGOqwLQdFrGvHQ_1740652778 From: Thomas Huth To: qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 3/6] tests/functional: Convert the 32-bit big endian Wheezy mips test Date: Thu, 27 Feb 2025 11:39:12 +0100 Message-ID: <20250227103915.19795-4-thuth@redhat.com> In-Reply-To: <20250227103915.19795-1-thuth@redhat.com> References: <20250227103915.19795-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.44, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1740652863513019100 Content-Type: text/plain; charset="utf-8" The test checks some entries in /proc and the output of some commands ... we put these checks into exportable functions now so that they can be re-used more easily. Additionally the linux_ssh_mips_malta.py uses SSH to test the networking of the guest. Since we don't have a SSH module in the functional framework yet, let's use the check_http_download() function here instead. And while we're at it, also switch the NIC to e1000 now to get some more test coverage, since the "pcnet" device is already tested in the test test_mips_malta_cpio. Signed-off-by: Thomas Huth --- tests/avocado/linux_ssh_mips_malta.py | 8 -- tests/functional/meson.build | 2 +- tests/functional/test_mips_malta.py | 108 +++++++++++++++++++++++++- 3 files changed, 107 insertions(+), 11 deletions(-) diff --git a/tests/avocado/linux_ssh_mips_malta.py b/tests/avocado/linux_ss= h_mips_malta.py index d9bb525ad9c..73d294ad5cf 100644 --- a/tests/avocado/linux_ssh_mips_malta.py +++ b/tests/avocado/linux_ssh_mips_malta.py @@ -172,14 +172,6 @@ def check_mips_malta(self, uname_m, endianess): # Wait for VM to shut down gracefully self.vm.wait() =20 - def test_mips_malta32eb_kernel3_2_0(self): - """ - :avocado: tags=3Darch:mips - :avocado: tags=3Dendian:big - :avocado: tags=3Ddevice:pcnet32 - """ - self.check_mips_malta('mips', 'be') - def test_mips_malta32el_kernel3_2_0(self): """ :avocado: tags=3Darch:mipsel diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 75f7c0f2bae..6127020654c 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -35,7 +35,7 @@ test_timeouts =3D { 'arm_tuxrun' : 240, 'arm_sx1' : 360, 'intel_iommu': 300, - 'mips_malta' : 120, + 'mips_malta' : 480, 'mipsel_replay' : 480, 'netdev_ethtool' : 180, 'ppc_40p' : 240, diff --git a/tests/functional/test_mips_malta.py b/tests/functional/test_mi= ps_malta.py index 9697c7d63f8..89b9556f30d 100755 --- a/tests/functional/test_mips_malta.py +++ b/tests/functional/test_mips_malta.py @@ -6,10 +6,93 @@ # # SPDX-License-Identifier: GPL-2.0-or-later =20 -from qemu_test import LinuxKernelTest, Asset +import os + +from qemu_test import LinuxKernelTest, Asset, wait_for_console_pattern from qemu_test import exec_command_and_wait_for_pattern =20 =20 +def mips_run_common_commands(test, prompt=3D'#'): + exec_command_and_wait_for_pattern(test, + 'uname -m', + 'mips') + exec_command_and_wait_for_pattern(test, + 'grep XT-PIC /proc/interrupts', + 'timer') + wait_for_console_pattern(test, prompt) + exec_command_and_wait_for_pattern(test, + 'grep XT-PIC /proc/interrupts', + 'serial') + wait_for_console_pattern(test, prompt) + exec_command_and_wait_for_pattern(test, + 'grep XT-PIC /proc/interrupts', + 'ata_piix') + wait_for_console_pattern(test, prompt) + exec_command_and_wait_for_pattern(test, + 'grep XT-PIC /proc/interrupts', + 'rtc') + wait_for_console_pattern(test, prompt) + exec_command_and_wait_for_pattern(test, + 'cat /proc/devices', + 'input') + wait_for_console_pattern(test, prompt) + exec_command_and_wait_for_pattern(test, + 'cat /proc/devices', + 'fb') + wait_for_console_pattern(test, prompt) + exec_command_and_wait_for_pattern(test, + 'cat /proc/ioports', + ' : serial') + wait_for_console_pattern(test, prompt) + exec_command_and_wait_for_pattern(test, + 'cat /proc/ioports', + ' : ata_piix') + wait_for_console_pattern(test, prompt) + +def mips_check_wheezy(test, kernel_path, image_path, kernel_command_line, + dl_file, hsum, nic=3D'pcnet', cpuinfo=3D'MIPS 24Kc'): + test.require_netdev('user') + test.require_device(nic) + test.set_machine('malta') + + port=3D8080 + test.vm.add_args('-kernel', kernel_path, + '-append', kernel_command_line, + '-drive', 'file=3D%s,snapshot=3Don' % image_path, + '-netdev', 'user,id=3Dn1' + + ',tftp=3D' + os.path.basename(kernel_path)= + + ',hostfwd=3Dtcp:127.0.0.1:0-:%d' % port, + '-device', f'{nic},netdev=3Dn1', + '-no-reboot') + test.vm.set_console() + test.vm.launch() + + wait_for_console_pattern(test, 'login: ', 'Oops') + exec_command_and_wait_for_pattern(test, 'root', 'Password:') + exec_command_and_wait_for_pattern(test, 'root', ':~# ') + mips_run_common_commands(test) + + exec_command_and_wait_for_pattern(test, 'cd /', '# ') + test.check_http_download(dl_file, hsum, port, + pythoncmd=3D'python -m SimpleHTTPServer') + + exec_command_and_wait_for_pattern(test, 'cat /proc/cpuinfo', cpuinfo) + exec_command_and_wait_for_pattern(test, 'cat /proc/devices', 'usb') + exec_command_and_wait_for_pattern(test, 'cat /proc/ioports', + ' : piix4_smbus') + # lspci for the host bridge does not work on big endian targets: + # https://gitlab.com/qemu-project/qemu/-/issues/2826 + # exec_command_and_wait_for_pattern(test, 'lspci -d 11ab:4620', + # 'GT-64120') + exec_command_and_wait_for_pattern(test, + 'cat /sys/bus/i2c/devices/i2c-0/name= ', + 'SMBus PIIX4 adapter') + exec_command_and_wait_for_pattern(test, 'cat /proc/mtd', 'YAMON') + # Empty 'Board Config' (64KB) + exec_command_and_wait_for_pattern(test, 'md5sum /dev/mtd2ro', + '0dfbe8aa4c20b52e1b8bf3cb6cbdf193') + + class MaltaMachineConsole(LinuxKernelTest): =20 ASSET_KERNEL_2_63_2 =3D Asset( @@ -70,7 +153,8 @@ def test_mips_malta_cpio(self): exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', 'BogoMIPS') exec_command_and_wait_for_pattern(self, 'uname -a', - 'Debian') + '4.5.0-2-4kc-malta #1 Debi= an') + mips_run_common_commands(self) =20 exec_command_and_wait_for_pattern(self, 'ip link set eth0 up', 'eth0: link up') @@ -89,6 +173,26 @@ def test_mips_malta_cpio(self): # Wait for VM to shut down gracefully self.vm.wait() =20 + ASSET_WHEEZY_KERNEL =3D Asset( + ('https://people.debian.org/~aurel32/qemu/mips/' + 'vmlinux-3.2.0-4-4kc-malta'), + '0377fcda31299213c10b8e5babe7260ef99188b3ae1aca6f56594abb71e7f67e') + + ASSET_WHEEZY_DISK =3D Asset( + ('https://people.debian.org/~aurel32/qemu/mips/' + 'debian_wheezy_mips_standard.qcow2'), + 'de03599285b8382ad309309a6c4869f6c6c42a5cfc983342bab9ec0dfa7849a2') + + def test_wheezy(self): + kernel_path =3D self.ASSET_WHEEZY_KERNEL.fetch() + image_path =3D self.ASSET_WHEEZY_DISK.fetch() + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0 root=3D/dev/sda1') + mips_check_wheezy(self, + kernel_path, image_path, kernel_command_line, nic=3D'e1000', + dl_file=3D'/boot/initrd.img-3.2.0-4-4kc-malta', + hsum=3D'ff0c0369143d9bbb9a6e6bc79322a2be535619df639e84103237f4= 06e87493dc') + =20 if __name__ =3D=3D '__main__': LinuxKernelTest.main() --=20 2.48.1 From nobody Thu Apr 3 11:52:28 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1740652863; cv=none; d=zohomail.com; s=zohoarc; b=cfEnld98VMreahssrGyuoUZNl8LVjzuy2DVcc/wTRNwE0HsBhqNhZC8EGRtXRoCmxMn346WIObtiiV1tuIHTjjvb5qneJze9Q/ZX1WQJ9SK3TVxv+TpB8rpUOWBq2zkZHU/DKhAM+H/jVp8hW02QBHqVD1zNfurQFoQnR3Vv2Ms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1740652863; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EYT0EPeyKajYJcM6FBu9bja5Ou0diuSkNLgylr2H8mI=; b=C9SipCkrIKReGqEkyalt36h2oYrLNBwKvKmlS6pofBROl50kdyGhpg82RDuDi7d0WKgSOiCS2WYyXWpik1oTlscRC/G9kzCMgk9rTNj702JvYM1kGeuwypvsHuPwRgqtMsEevgygJZG6NNKEBcix1a7ScQC7P7hGQa99tQLv4eI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1740652863916240.86070689675523; Thu, 27 Feb 2025 02:41:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tnbJ6-0007pC-AR; Thu, 27 Feb 2025 05:39:56 -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 1tnbJ1-0007ju-1D for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:39:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tnbIy-0003H9-R8 for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:39:50 -0500 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-pMdkQKLYMtuletwFrT5laA-1; Thu, 27 Feb 2025 05:39:44 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4DD161954B20; Thu, 27 Feb 2025 10:39:43 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.33.184]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A8974300018D; Thu, 27 Feb 2025 10:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740652788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EYT0EPeyKajYJcM6FBu9bja5Ou0diuSkNLgylr2H8mI=; b=hruq5YH2PSzYhDYQumzaolocdSx0DhY+e4Dgbi1EcfAEslrojV8vS3enkIOdlhPrsG/v7Y tCDe8Uc5dbSmw1pv9z6Wi+/Nhp3uWC/uLEuWj5kVZMGVHYTU9csj11jYH1NgL2R5bAkFab DotWbVjKWM5Famm3rH8PvU+oN8kLBMw= X-MC-Unique: pMdkQKLYMtuletwFrT5laA-1 X-Mimecast-MFC-AGG-ID: pMdkQKLYMtuletwFrT5laA_1740652783 From: Thomas Huth To: qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 4/6] tests/functional: Convert the 32-bit little endian Wheezy mips test Date: Thu, 27 Feb 2025 11:39:13 +0100 Message-ID: <20250227103915.19795-5-thuth@redhat.com> In-Reply-To: <20250227103915.19795-1-thuth@redhat.com> References: <20250227103915.19795-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.44, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1740652865432019100 Content-Type: text/plain; charset="utf-8" Re-use the test function from the big endian test to easily convert the 32-bit little endian Wheezy mips test. Signed-off-by: Thomas Huth --- tests/avocado/linux_ssh_mips_malta.py | 8 -------- tests/functional/meson.build | 1 + tests/functional/test_mipsel_malta.py | 22 ++++++++++++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/tests/avocado/linux_ssh_mips_malta.py b/tests/avocado/linux_ss= h_mips_malta.py index 73d294ad5cf..c1300aec961 100644 --- a/tests/avocado/linux_ssh_mips_malta.py +++ b/tests/avocado/linux_ssh_mips_malta.py @@ -172,14 +172,6 @@ def check_mips_malta(self, uname_m, endianess): # Wait for VM to shut down gracefully self.vm.wait() =20 - def test_mips_malta32el_kernel3_2_0(self): - """ - :avocado: tags=3Darch:mipsel - :avocado: tags=3Dendian:little - :avocado: tags=3Ddevice:pcnet32 - """ - self.check_mips_malta('mips', 'le') - def test_mips_malta64eb_kernel3_2_0(self): """ :avocado: tags=3Darch:mips64 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 6127020654c..3b61f02ce18 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -36,6 +36,7 @@ test_timeouts =3D { 'arm_sx1' : 360, 'intel_iommu': 300, 'mips_malta' : 480, + 'mipsel_malta' : 420, 'mipsel_replay' : 480, 'netdev_ethtool' : 180, 'ppc_40p' : 240, diff --git a/tests/functional/test_mipsel_malta.py b/tests/functional/test_= mipsel_malta.py index fe9c3a172e6..9ee2884da8e 100755 --- a/tests/functional/test_mipsel_malta.py +++ b/tests/functional/test_mipsel_malta.py @@ -13,6 +13,8 @@ from qemu_test import interrupt_interactive_console_until_pattern from qemu_test import wait_for_console_pattern =20 +from test_mips_malta import mips_check_wheezy + =20 class MaltaMachineConsole(LinuxKernelTest): =20 @@ -57,6 +59,26 @@ def test_mips_malta32el_nanomips_16k_up(self): def test_mips_malta32el_nanomips_64k_dbg(self): self.do_test_mips_malta32el_nanomips(self.ASSET_KERNEL_64K) =20 + ASSET_WHEEZY_KERNEL =3D Asset( + ('https://people.debian.org/~aurel32/qemu/mipsel/' + 'vmlinux-3.2.0-4-4kc-malta'), + 'dc8a3648305b0201ca7a5cd135fe2890067a65d93c38728022bb0e656ad2bf9a') + + ASSET_WHEEZY_DISK =3D Asset( + ('https://people.debian.org/~aurel32/qemu/mipsel/' + 'debian_wheezy_mipsel_standard.qcow2'), + '454f09ae39f7e6461c84727b927100d2c7813841f2a0a5dce328114887ecf914') + + def test_wheezy(self): + kernel_path =3D self.ASSET_WHEEZY_KERNEL.fetch() + image_path =3D self.ASSET_WHEEZY_DISK.fetch() + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0 root=3D/dev/sda1') + mips_check_wheezy(self, + kernel_path, image_path, kernel_command_line, + dl_file=3D'/boot/initrd.img-3.2.0-4-4kc-malta', + hsum=3D'9fc9f250ed56a74e35e704ddfd5a1c5a5625adefc5c9da91f64928= 8d3ca000f0') + =20 class MaltaMachineYAMON(QemuSystemTest): =20 --=20 2.48.1 From nobody Thu Apr 3 11:52:28 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1740652862; cv=none; d=zohomail.com; s=zohoarc; b=D++rkrB5tNR0aXDWJ/ZfGjDOmiTjkGWF8THAEoWrctZm4Upw0qPCKa9NK5kBlH/Qngz6/m+0qmZbyWQx7AgURig7cckheksYn5EWVZ2qohSA4dW6AiRrV0e00AmGYRTV1Vmt6Ur4R6YXehYPFVkt3Nowhb1UISrsAjj0+ODLK5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1740652862; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PmvfoAZ3ytPhu9/JmbPIS1dt+nDZQdVXojMRIjDOjEo=; b=KdMpuprMPKBKZ9/pFF0DWfjJ7NC/g6F1EGgkUBwITJApgcIZqlpPH9n5tcBocWot8dPQmd0uIEsOSGJaVt+BkvEoPhFbKh3Spej2o0wFqdBLQ+8W1ylCTvbRX9b9MsGreFLuH2Z9gzPYX0d2SbxrV545kVEXZIdDGjeE++z+su4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1740652862264696.6471872115864; Thu, 27 Feb 2025 02:41:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tnbJ7-0007r4-Bp; Thu, 27 Feb 2025 05:39:57 -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 1tnbJ5-0007nv-4W for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:39:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tnbJ3-0003JL-B7 for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:39:54 -0500 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-568-Fg5o3_dMOV2930onx9-ECQ-1; Thu, 27 Feb 2025 05:39:48 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1EA5F1954126; Thu, 27 Feb 2025 10:39:47 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.33.184]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 002FF300018D; Thu, 27 Feb 2025 10:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740652792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PmvfoAZ3ytPhu9/JmbPIS1dt+nDZQdVXojMRIjDOjEo=; b=NNeZI9p89vFaDqcCBvL9V4ub8BsN3Q7fOiyZ2X/MdZQlU5+4NuycZkHxVhcWI+oWgcGive sSiiU4A3oIcOCFt8qlVh4U+CaqAaOL14CX5hr5ARle9zQuzwnP7nMZJGlfLpujQCEFTqrQ GQ7XzNyTB1+fUbkupui2s/NECDIS8R8= X-MC-Unique: Fg5o3_dMOV2930onx9-ECQ-1 X-Mimecast-MFC-AGG-ID: Fg5o3_dMOV2930onx9-ECQ_1740652787 From: Thomas Huth To: qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 5/6] tests/functional: Convert the 64-bit little endian Wheezy mips test Date: Thu, 27 Feb 2025 11:39:14 +0100 Message-ID: <20250227103915.19795-6-thuth@redhat.com> In-Reply-To: <20250227103915.19795-1-thuth@redhat.com> References: <20250227103915.19795-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.44, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1740652863420019100 Content-Type: text/plain; charset="utf-8" Re-use the test function from the 32-bit big endian test to easily convert the 64-bit little endian Wheezy mips test. Signed-off-by: Thomas Huth --- tests/avocado/linux_ssh_mips_malta.py | 8 -------- tests/functional/meson.build | 1 + tests/functional/test_mips64el_malta.py | 22 ++++++++++++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/tests/avocado/linux_ssh_mips_malta.py b/tests/avocado/linux_ss= h_mips_malta.py index c1300aec961..2fa5cf9a6c1 100644 --- a/tests/avocado/linux_ssh_mips_malta.py +++ b/tests/avocado/linux_ssh_mips_malta.py @@ -179,11 +179,3 @@ def test_mips_malta64eb_kernel3_2_0(self): :avocado: tags=3Ddevice:pcnet32 """ self.check_mips_malta('mips64', 'be') - - def test_mips_malta64el_kernel3_2_0(self): - """ - :avocado: tags=3Darch:mips64el - :avocado: tags=3Dendian:little - :avocado: tags=3Ddevice:pcnet32 - """ - self.check_mips_malta('mips64', 'le') diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 3b61f02ce18..95cdca8320e 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -38,6 +38,7 @@ test_timeouts =3D { 'mips_malta' : 480, 'mipsel_malta' : 420, 'mipsel_replay' : 480, + 'mips64el_malta' : 420, 'netdev_ethtool' : 180, 'ppc_40p' : 240, 'ppc64_hv' : 1000, diff --git a/tests/functional/test_mips64el_malta.py b/tests/functional/tes= t_mips64el_malta.py index a8da15a26b3..dd37212f9df 100755 --- a/tests/functional/test_mips64el_malta.py +++ b/tests/functional/test_mips64el_malta.py @@ -16,6 +16,8 @@ from qemu_test import exec_command_and_wait_for_pattern from qemu_test import skipIfMissingImports, skipFlakyTest, skipUntrustedTe= st =20 +from test_mips_malta import mips_check_wheezy + =20 class MaltaMachineConsole(LinuxKernelTest): =20 @@ -90,6 +92,26 @@ def test_mips64el_malta_5KEc_cpio(self): # Wait for VM to shut down gracefully self.vm.wait() =20 + ASSET_WHEEZY_KERNEL =3D Asset( + ('https://people.debian.org/~aurel32/qemu/mipsel/' + 'vmlinux-3.2.0-4-5kc-malta'), + '5e8b725244c59745bb8b64f5d8f49f25fecfa549f3395fb6d19a3b9e5065b85b') + + ASSET_WHEEZY_DISK =3D Asset( + ('https://people.debian.org/~aurel32/qemu/mipsel/' + 'debian_wheezy_mipsel_standard.qcow2'), + '454f09ae39f7e6461c84727b927100d2c7813841f2a0a5dce328114887ecf914') + + def test_wheezy(self): + kernel_path =3D self.ASSET_WHEEZY_KERNEL.fetch() + image_path =3D self.ASSET_WHEEZY_DISK.fetch() + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0 root=3D/dev/sda1') + mips_check_wheezy(self, + kernel_path, image_path, kernel_command_line, cpuinfo=3D'MIPS = 20Kc', + dl_file=3D'/boot/initrd.img-3.2.0-4-5kc-malta', + hsum=3D'7579f8b56c1187c7c04d0dc3c0c56c7a6314c5ddd3a9bf8803ecc7= cf8a3be9f8') + =20 @skipIfMissingImports('numpy', 'cv2') class MaltaMachineFramebuffer(LinuxKernelTest): --=20 2.48.1 From nobody Thu Apr 3 11:52:28 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1740652865; cv=none; d=zohomail.com; s=zohoarc; b=NQGH9R3rndieapogo/LJBAYnVqMeKhPUW5TqVWt7lO6wQpNag5wCRdk/2/grWL+Cgl02usYdtvAK/+pJ7SZ/WFuOP/lrkrSuUNOR5/lmFdGxOS2t2SZHQjSbg7phU8nWt7oj1BU8wJFrOcNZ1USVDX5ktZRlB11Tv0QFb/nvPbI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1740652865; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1pp2bYp6rKYUhjxT3dWH6oFIydPYJSoefFJSI4DLg9A=; b=IgXkm1TpkB0k0CEU/Ilx0A0Ix2aMMgGvwU28RsYOUL9omc8eDmrCrscljT61m5Exo4GWx9xZQ1Up6GlaLWAhBr3QAA1gD9NZvZTfKuwcKDAj5SpD1/SiST2OZHuPQvQ2cH8oY9BpdUFVxa/v/OGM3Lh0V7p3zUgNme6vjo6PPgk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1740652865977494.5892892172211; Thu, 27 Feb 2025 02:41:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tnbJH-0008IY-25; Thu, 27 Feb 2025 05:40:09 -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 1tnbJD-00086H-4W for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:40:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tnbJA-0003Ou-Na for qemu-devel@nongnu.org; Thu, 27 Feb 2025 05:40:02 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-511-jZ0xRU6aO5GN32waKelvPQ-1; Thu, 27 Feb 2025 05:39:57 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 38B2B18004A7; Thu, 27 Feb 2025 10:39:56 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.33.184]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 582D0300018D; Thu, 27 Feb 2025 10:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740652800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1pp2bYp6rKYUhjxT3dWH6oFIydPYJSoefFJSI4DLg9A=; b=cBDaQWmDOrvzED0WyUEa71QVpRuSNkHaWYTzg/vPg0We23sZ9hWNTJ5KgXlJ+efeDUibl2 205DaZH8fu4rPGxOuL8DaGBr6d/iW/jVGoePzmpHwxREW2Xrh/1xVCAB68dKmM+eScfHWG WG0YQbBAgHCD+6hkj0m6kIwU7yFZKUY= X-MC-Unique: jZ0xRU6aO5GN32waKelvPQ-1 X-Mimecast-MFC-AGG-ID: jZ0xRU6aO5GN32waKelvPQ_1740652796 From: Thomas Huth To: qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 6/6] tests/functional: Convert the 64-bit big endian Wheezy mips test Date: Thu, 27 Feb 2025 11:39:15 +0100 Message-ID: <20250227103915.19795-7-thuth@redhat.com> In-Reply-To: <20250227103915.19795-1-thuth@redhat.com> References: <20250227103915.19795-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.44, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1740652867603019100 Re-use the test function from the 32-bit big endian test to easily convert the 64-bit big endian Wheezy mips test. Since this was the last test in tests/avocado/linux_ssh_mips_malta.py, we can remove this avocado file now, too. Signed-off-by: Thomas Huth --- MAINTAINERS | 1 - tests/avocado/linux_ssh_mips_malta.py | 181 -------------------------- tests/functional/meson.build | 2 + tests/functional/test_mips64_malta.py | 35 +++++ 4 files changed, 37 insertions(+), 182 deletions(-) delete mode 100644 tests/avocado/linux_ssh_mips_malta.py create mode 100755 tests/functional/test_mips64_malta.py diff --git a/MAINTAINERS b/MAINTAINERS index 098daea6f24..79fb44c698e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1340,7 +1340,6 @@ F: hw/acpi/piix4.c F: hw/mips/malta.c F: hw/pci-host/gt64120.c F: include/hw/southbridge/piix.h -F: tests/avocado/linux_ssh_mips_malta.py F: tests/functional/test_mips*_malta.py F: tests/functional/test_mips*_tuxrun.py =20 diff --git a/tests/avocado/linux_ssh_mips_malta.py b/tests/avocado/linux_ss= h_mips_malta.py deleted file mode 100644 index 2fa5cf9a6c1..00000000000 --- a/tests/avocado/linux_ssh_mips_malta.py +++ /dev/null @@ -1,181 +0,0 @@ -# Functional test that boots a VM and run commands via a SSH session -# -# Copyright (c) Philippe Mathieu-Daud=C3=A9 -# -# This work is licensed under the terms of the GNU GPL, version 2 or -# later. See the COPYING file in the top-level directory. - -import os -import re -import base64 -import logging -import time - -from avocado import skipUnless -from avocado_qemu import LinuxSSHMixIn -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern -from avocado.utils import process -from avocado.utils import archive -from avocado.utils import ssh - - -@skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') -@skipUnless(ssh.SSH_CLIENT_BINARY, 'No SSH client available') -class LinuxSSH(QemuSystemTest, LinuxSSHMixIn): - """ - :avocado: tags=3Daccel:tcg - """ - - timeout =3D 150 # Not for 'configure --enable-debug --enable-debug-tcg' - - KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' - VM_IP =3D '127.0.0.1' - - BASE_URL =3D 'https://people.debian.org/~aurel32/qemu/' - IMAGE_INFO =3D { - 'be': {'base_url': 'mips', - 'image_name': 'debian_wheezy_mips_standard.qcow2', - 'image_hash': '8987a63270df67345b2135a6b7a4885a35e392d5', - 'kernel_hash': { - 32: '592e384a4edc16dade52a6cd5c785c637bcbc9ad', - 64: 'db6eea7de35d36c77d8c165b6bcb222e16eb91db'} - }, - 'le': {'base_url': 'mipsel', - 'image_name': 'debian_wheezy_mipsel_standard.qcow2', - 'image_hash': '7866764d9de3ef536ffca24c9fb9f04ffdb45802', - 'kernel_hash': { - 32: 'a66bea5a8adaa2cb3d36a1d4e0ccdb01be8f6c2a', - 64: '6a7f77245acf231415a0e8b725d91ed2f3487794'} - } - } - CPU_INFO =3D { - 32: {'cpu': 'MIPS 24Kc', 'kernel_release': '3.2.0-4-4kc-malta'}, - 64: {'cpu': 'MIPS 20Kc', 'kernel_release': '3.2.0-4-5kc-malta'} - } - - def get_url(self, endianess, path=3D''): - qkey =3D {'le': 'el', 'be': ''} - return '%s/mips%s/%s' % (self.BASE_URL, qkey[endianess], path) - - def get_image_info(self, endianess): - dinfo =3D self.IMAGE_INFO[endianess] - image_url =3D self.get_url(endianess, dinfo['image_name']) - image_hash =3D dinfo['image_hash'] - return (image_url, image_hash) - - def get_kernel_info(self, endianess, wordsize): - minfo =3D self.CPU_INFO[wordsize] - kernel_url =3D self.get_url(endianess, - 'vmlinux-%s' % minfo['kernel_release']) - kernel_hash =3D self.IMAGE_INFO[endianess]['kernel_hash'][wordsize] - return kernel_url, kernel_hash - - def ssh_disconnect_vm(self): - self.ssh_session.quit() - - def boot_debian_wheezy_image_and_ssh_login(self, endianess, kernel_pat= h): - image_url, image_hash =3D self.get_image_info(endianess) - image_path =3D self.fetch_asset(image_url, asset_hash=3Dimage_hash) - - self.vm.set_console() - kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE - + 'console=3DttyS0 root=3D/dev/sda1') - self.vm.add_args('-no-reboot', - '-kernel', kernel_path, - '-append', kernel_command_line, - '-drive', 'file=3D%s,snapshot=3Don' % image_path, - '-netdev', 'user,id=3Dvnet,hostfwd=3D:127.0.0.1:0= -:22', - '-device', 'pcnet,netdev=3Dvnet') - self.vm.launch() - - self.log.info('VM launched, waiting for sshd') - console_pattern =3D 'Starting OpenBSD Secure Shell server: sshd' - wait_for_console_pattern(self, console_pattern, 'Oops') - self.log.info('sshd ready') - - self.ssh_connect('root', 'root', False) - - def shutdown_via_ssh(self): - self.ssh_command('poweroff') - self.ssh_disconnect_vm() - wait_for_console_pattern(self, 'Power down', 'Oops') - - def run_common_commands(self, wordsize): - self.ssh_command_output_contains( - 'cat /proc/cpuinfo', - self.CPU_INFO[wordsize]['cpu']) - self.ssh_command_output_contains( - 'uname -m', - 'mips') - self.ssh_command_output_contains( - 'uname -r', - self.CPU_INFO[wordsize]['kernel_release']) - self.ssh_command_output_contains( - 'cat /proc/interrupts', - 'XT-PIC timer') - self.ssh_command_output_contains( - 'cat /proc/interrupts', - 'XT-PIC i8042') - self.ssh_command_output_contains( - 'cat /proc/interrupts', - 'XT-PIC serial') - self.ssh_command_output_contains( - 'cat /proc/interrupts', - 'XT-PIC ata_piix') - self.ssh_command_output_contains( - 'cat /proc/interrupts', - 'XT-PIC eth0') - self.ssh_command_output_contains( - 'cat /proc/devices', - 'input') - self.ssh_command_output_contains( - 'cat /proc/devices', - 'usb') - self.ssh_command_output_contains( - 'cat /proc/devices', - 'fb') - self.ssh_command_output_contains( - 'cat /proc/ioports', - ' : serial') - self.ssh_command_output_contains( - 'cat /proc/ioports', - ' : ata_piix') - self.ssh_command_output_contains( - 'cat /proc/ioports', - ' : piix4_smbus') - self.ssh_command_output_contains( - 'lspci -d 11ab:4620', - 'GT-64120') - self.ssh_command_output_contains( - 'cat /sys/bus/i2c/devices/i2c-0/name', - 'SMBus PIIX4 adapter') - self.ssh_command_output_contains( - 'cat /proc/mtd', - 'YAMON') - # Empty 'Board Config' (64KB) - self.ssh_command_output_contains( - 'md5sum /dev/mtd2ro', - '0dfbe8aa4c20b52e1b8bf3cb6cbdf193') - - def check_mips_malta(self, uname_m, endianess): - wordsize =3D 64 if '64' in uname_m else 32 - kernel_url, kernel_hash =3D self.get_kernel_info(endianess, wordsi= ze) - kernel_path =3D self.fetch_asset(kernel_url, asset_hash=3Dkernel_h= ash) - self.boot_debian_wheezy_image_and_ssh_login(endianess, kernel_path) - - stdout, _ =3D self.ssh_command('uname -a') - self.assertIn(True, [uname_m + " GNU/Linux" in line for line in st= dout]) - - self.run_common_commands(wordsize) - self.shutdown_via_ssh() - # Wait for VM to shut down gracefully - self.vm.wait() - - def test_mips_malta64eb_kernel3_2_0(self): - """ - :avocado: tags=3Darch:mips64 - :avocado: tags=3Dendian:big - :avocado: tags=3Ddevice:pcnet32 - """ - self.check_mips_malta('mips64', 'be') diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 95cdca8320e..f693733b2b7 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -38,6 +38,7 @@ test_timeouts =3D { 'mips_malta' : 480, 'mipsel_malta' : 420, 'mipsel_replay' : 480, + 'mips64_malta' : 240, 'mips64el_malta' : 420, 'netdev_ethtool' : 180, 'ppc_40p' : 240, @@ -183,6 +184,7 @@ tests_mipsel_system_thorough =3D [ ] =20 tests_mips64_system_thorough =3D [ + 'mips64_malta', 'mips64_tuxrun', ] =20 diff --git a/tests/functional/test_mips64_malta.py b/tests/functional/test_= mips64_malta.py new file mode 100755 index 00000000000..53c3e0c1221 --- /dev/null +++ b/tests/functional/test_mips64_malta.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +# +# Functional tests for the big-endian 64-bit MIPS Malta board +# +# SPDX-License-Identifier: GPL-2.0-or-later + +from qemu_test import LinuxKernelTest, Asset +from test_mips_malta import mips_check_wheezy + + +class MaltaMachineConsole(LinuxKernelTest): + + ASSET_WHEEZY_KERNEL =3D Asset( + ('https://people.debian.org/~aurel32/qemu/mips/' + 'vmlinux-3.2.0-4-5kc-malta'), + '3e4ec154db080b3f1839f04dde83120654a33e5e1716863de576c47cb94f68f6') + + ASSET_WHEEZY_DISK =3D Asset( + ('https://people.debian.org/~aurel32/qemu/mips/' + 'debian_wheezy_mips_standard.qcow2'), + 'de03599285b8382ad309309a6c4869f6c6c42a5cfc983342bab9ec0dfa7849a2') + + def test_wheezy(self): + kernel_path =3D self.ASSET_WHEEZY_KERNEL.fetch() + image_path =3D self.ASSET_WHEEZY_DISK.fetch() + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0 root=3D/dev/sda1') + mips_check_wheezy(self, + kernel_path, image_path, kernel_command_line, cpuinfo=3D'MIPS = 20Kc', + dl_file=3D'/boot/initrd.img-3.2.0-4-5kc-malta', + hsum=3D'd98b953bb4a41c0fc0fd8d19bbc691c08989ac52568c1d3054d92d= fd890d3f06') + + +if __name__ =3D=3D '__main__': + LinuxKernelTest.main() --=20 2.48.1