From patchwork Wed Feb 26 09:57:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 868509 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f56:0:b0:38f:210b:807b with SMTP id cm22csp721302wrb; Wed, 26 Feb 2025 01:58:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXj5N9zjq4KqJLSlgRI6mWphba8NVYEIp99FPUwUF2f+ZKEENadKnSemQsp2RZVhTs56TBttw==@linaro.org X-Google-Smtp-Source: AGHT+IHn/5i7oojKFKXka15pYFhxor8SH+ggqDTiqf/D+SY9LiCEn5CEouNsHRfAeAmfSPvisDee X-Received: by 2002:a05:6214:20ca:b0:6e6:602f:ef68 with SMTP id 6a1803df08f44-6e8868878femr41416596d6.10.1740563880043; Wed, 26 Feb 2025 01:58:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1740563880; cv=none; d=google.com; s=arc-20240605; b=gfvn+i3uPG1gF+XrNWyEqZnlCfi8tTlCaRLK7rdNgtFyBRtzRUSA4rVeobGoWZX3I3 k8fI/5WX1BictvhefSZTEi1OpRFRhelfBhnLQSNMz8hC+bJejRWhs77usjZLya2OgoNf XLOHpcj/HcxQlQd/hOnGZgsMEtqgOhhGzQCpdiZ8Qlnkbsvxgy3VycK0fYuWcCEL5Ib+ E53A0+/GM+7iwO1Np0tuKXFjvoZ5573S4RFdVf9qu88bU03Kv6iStkgW3aQCa71VH6uO qRU2tMwJAc/CuSxn7Omn5QcZOVmIyq/h9PGdR/xHOwWPETcgm0efNOJ+CCEPvOWTjBUj CO5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s2aEP/JHmTuI8Y3xeJ1CN1qv5nRQAbt1VifI3o4Let8=; fh=mKYVeSjHJKUvhIoxLlaWoOhsu0/LFnbJdOZ+CRgqMEY=; b=JZx0uwduc8ATt0UkHHY3grdeIyIddXQQfluckn+3GIaU29OoEahqB4MKruPQzR99Wg eqKRUYZ7VQ/RAyKTF7pMkwpkK8NWfhCowa7EHhNrROhcAT+58Z08+yNhzF0MjmMS6V3d JRLesW5eS8kbh6fKCQcmfEkatG3dBYy9guiUY1G6mG9AU56oTyx/Q5U6f6fRjhny6CCl 7biep7xJDm6h0t/kpyPkTMv7V/KuviyvoObdmodotIKx+4uZb13fbTEapWlMGbMgG35p b3cgw2mUu9ovJmNZ3yGwc1qWXuab4ADRpswSRnmvPo4tjumUumZFAZeIsfeQ9fZ8qBh+ TTMQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BgKn9SPN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e87b0e52cbsi33150076d6.327.2025.02.26.01.57.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Feb 2025 01:58:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BgKn9SPN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tnEAm-0003Kt-Ov; Wed, 26 Feb 2025 04:57:48 -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 1tnEAk-0003KM-Pp for qemu-devel@nongnu.org; Wed, 26 Feb 2025 04:57: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 1tnEAi-00084J-N6 for qemu-devel@nongnu.org; Wed, 26 Feb 2025 04:57:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740563863; 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=s2aEP/JHmTuI8Y3xeJ1CN1qv5nRQAbt1VifI3o4Let8=; b=BgKn9SPNvRNGXIAXvghAxUWC3ES3e7UoPnUEd0UeQHJeUUUX8FD7LgyBcVXYczCerfkn9R RgoRC+5XiQsL8bt0W9zbq0s5Ky4QgJ/tqiw6KPZQv3QsraI/n9/dU4MIsgTBfKXyZ6M6TU L4gmgU2gqsO7ekt5doQejsiD8jnuhoo= Received: from mx-prod-mc-03.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-412-HGa-WTfOPnWyKzxr2XaMqQ-1; Wed, 26 Feb 2025 04:57:38 -0500 X-MC-Unique: HGa-WTfOPnWyKzxr2XaMqQ-1 X-Mimecast-MFC-AGG-ID: HGa-WTfOPnWyKzxr2XaMqQ_1740563858 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DB57D1955F28; Wed, 26 Feb 2025 09:57:37 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.45.224.144]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 27ED11800358; Wed, 26 Feb 2025 09:57:35 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 01/18] tests/functional: Have microblaze tests inherit common parent class Date: Wed, 26 Feb 2025 10:57:14 +0100 Message-ID: <20250226095731.1172375-2-thuth@redhat.com> In-Reply-To: <20250226095731.1172375-1-thuth@redhat.com> References: <20250226095731.1172375-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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.443, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Have the MicroblazeMachine class being common to both MicroblazeBigEndianMachine and MicroblazeLittleEndianMachine classes. Move the xmaton and ballerina tests to the parent class. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-ID: <20250212123659.52764-11-philmd@linaro.org> [thuth: Add missing ASSET statements to the leaf classes] Signed-off-by: Thomas Huth --- .../functional/test_microblaze_s3adsp1800.py | 27 ++++++++++++++++ .../test_microblazeel_s3adsp1800.py | 31 +++---------------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/tests/functional/test_microblaze_s3adsp1800.py b/tests/functional/test_microblaze_s3adsp1800.py index c4226f49cf3..c93fa14232b 100755 --- a/tests/functional/test_microblaze_s3adsp1800.py +++ b/tests/functional/test_microblaze_s3adsp1800.py @@ -7,6 +7,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. +from qemu_test import exec_command_and_wait_for_pattern from qemu_test import QemuSystemTest, Asset from qemu_test import wait_for_console_pattern @@ -20,6 +21,10 @@ class MicroblazeMachine(QemuSystemTest): 'day17.tar.xz'), '3ba7439dfbea7af4876662c97f8e1f0cdad9231fc166e4861d17042489270057') + ASSET_IMAGE_LE = Asset( + ('http://www.qemu-advent-calendar.org/2023/download/day13.tar.gz'), + 'b9b3d43c5dd79db88ada495cc6e0d1f591153fe41355e925d791fbf44de50c22') + def do_ballerina_be_test(self, machine): self.set_machine(machine) self.archive_extract(self.ASSET_IMAGE_BE) @@ -34,8 +39,30 @@ def do_ballerina_be_test(self, machine): # message, that's why we don't test for a later string here. This # needs some investigation by a microblaze wizard one day... + def do_xmaton_le_test(self, machine): + self.require_netdev('user') + self.set_machine(machine) + self.archive_extract(self.ASSET_IMAGE_LE) + self.vm.set_console() + self.vm.add_args('-kernel', self.scratch_file('day13', 'xmaton.bin')) + tftproot = self.scratch_file('day13') + self.vm.add_args('-nic', f'user,tftp={tftproot}') + self.vm.launch() + wait_for_console_pattern(self, 'QEMU Advent Calendar 2023') + wait_for_console_pattern(self, 'buildroot login:') + exec_command_and_wait_for_pattern(self, 'root', '#') + exec_command_and_wait_for_pattern(self, + 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png', + '821cd3cab8efd16ad6ee5acc3642a8ea') + + +class MicroblazeBigEndianMachine(MicroblazeMachine): + + ASSET_IMAGE_BE = MicroblazeMachine.ASSET_IMAGE_BE + def test_microblaze_s3adsp1800_legacy_be(self): self.do_ballerina_be_test('petalogix-s3adsp1800') + if __name__ == '__main__': QemuSystemTest.main() diff --git a/tests/functional/test_microblazeel_s3adsp1800.py b/tests/functional/test_microblazeel_s3adsp1800.py index 60aab4a45e8..ab59941d57a 100755 --- a/tests/functional/test_microblazeel_s3adsp1800.py +++ b/tests/functional/test_microblazeel_s3adsp1800.py @@ -7,37 +7,16 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. -from qemu_test import exec_command_and_wait_for_pattern -from qemu_test import QemuSystemTest, Asset -from qemu_test import wait_for_console_pattern +from test_microblaze_s3adsp1800 import MicroblazeMachine -class MicroblazeelMachine(QemuSystemTest): +class MicroblazeLittleEndianMachine(MicroblazeMachine): - timeout = 90 - - ASSET_IMAGE_LE = Asset( - ('http://www.qemu-advent-calendar.org/2023/download/day13.tar.gz'), - 'b9b3d43c5dd79db88ada495cc6e0d1f591153fe41355e925d791fbf44de50c22') - - def do_xmaton_le_test(self, machine): - self.require_netdev('user') - self.set_machine(machine) - self.archive_extract(self.ASSET_IMAGE_LE) - self.vm.set_console() - self.vm.add_args('-kernel', self.scratch_file('day13', 'xmaton.bin')) - tftproot = self.scratch_file('day13') - self.vm.add_args('-nic', f'user,tftp={tftproot}') - self.vm.launch() - wait_for_console_pattern(self, 'QEMU Advent Calendar 2023') - wait_for_console_pattern(self, 'buildroot login:') - exec_command_and_wait_for_pattern(self, 'root', '#') - exec_command_and_wait_for_pattern(self, - 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png', - '821cd3cab8efd16ad6ee5acc3642a8ea') + ASSET_IMAGE_LE = MicroblazeMachine.ASSET_IMAGE_LE def test_microblaze_s3adsp1800_legacy_le(self): self.do_xmaton_le_test('petalogix-s3adsp1800') + if __name__ == '__main__': - QemuSystemTest.main() + MicroblazeMachine.main()