From patchwork Wed Mar 15 17:43:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1757540 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=bNaT2vpb; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PcHxR2zFBz1yWp for ; Thu, 16 Mar 2023 04:50:51 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcVGA-0002zu-5M; Wed, 15 Mar 2023 13:49:58 -0400 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 1pcVFk-0001nz-I3 for qemu-devel@nongnu.org; Wed, 15 Mar 2023 13:49:32 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcVFa-000289-BN for qemu-devel@nongnu.org; Wed, 15 Mar 2023 13:49:28 -0400 Received: by mail-wm1-x32d.google.com with SMTP id c8-20020a05600c0ac800b003ed2f97a63eso1583824wmr.3 for ; Wed, 15 Mar 2023 10:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678902560; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Kz7lt0xm5BPRCHm1G6eqVDryZ05MXO1c0h+JE0rLmmA=; b=bNaT2vpbbehdm/qIsy3+TgfhjrFJ3XJLHmB6VUL1Zs3hbPlEekL4nMPtCEWVbHGIft +uqqJZze+SzlmR5+XbGswOw2gV28QZykyeKQDCduFr3rCosoyao3ujrKh73H9FAEK/A9 Zc0rZCrYEEt49SCLyLy6SS7DN7dNMpnehLLgcEU33rRKhymSQiL1ZrY0n+z4UtfTsXMu 7VkEsida0B+zZdCuwHbV+9MZo4FhFi2JmUxbHHPtBQWCQPwBd49YnWjDYYwS7G985rJe gT/k5NFq+3dS3UcnUH1wtWCHqBChTYagQB9kvw/T3NHUHpyxr7iCWHkLdm0ZYzB0a672 WlGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678902560; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kz7lt0xm5BPRCHm1G6eqVDryZ05MXO1c0h+JE0rLmmA=; b=rYchm8YMdFAwinWBuYMpqZI0NafXKhODVIjINhIVN2NsBVtUFT5a1YP3fHOGjKX4y6 2FKhnhQicdC33J8pB/7iAEedA4Q3GHtGGvYs7QooS9FEi0ZvBlyQArydZYo/4AGZji3K nY4U5bKelh6n3NUUPdfoBFGDrbuSX/RhemGTGYinvU5SGOZmi3mA8RpRsfbmyDevyKeb ZqcTwQiiDgYXofNU1HrqVTSrRINVkufWnZzN/UxaT5T5V1f6wrv+nMgYDdoLx6MeV9Fh S+D+vnQ47wMPMcI7rgoO0XIkEIOjEODQ2BCcsM87zpPSbg/Ua9Kk0np5x07fjBnzfAwD EU/w== X-Gm-Message-State: AO0yUKXT8UjRZ5tpZE0/IaROHz1Of4YioIuiV8Q9rIaiOV6Z79JcAffA zCFWUGWyE45DhpotPVfdkxJtUQ== X-Google-Smtp-Source: AK7set+W3U2ebB184rL4uN6qOAW5BkAnAwjXheuRqduGYN8670olbbrt8buVpX+hsof9NfwroTRX/A== X-Received: by 2002:a05:600c:1c17:b0:3ed:2f7b:daf with SMTP id j23-20020a05600c1c1700b003ed2f7b0dafmr4623147wms.10.1678902560244; Wed, 15 Mar 2023 10:49:20 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o19-20020a05600c059300b003eb68bb61c8sm2680607wmd.3.2023.03.15.10.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 10:49:19 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 62FEE1FFC1; Wed, 15 Mar 2023 17:43:32 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Marc-Andr=C3=A9_Lurea?= =?utf-8?q?u?= , qemu-riscv@nongnu.org, Riku Voipio , Igor Mammedov , Xiao Guangrong , Thomas Huth , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Alex Williamson , Hao Wu , Cleber Rosa , Daniel Henrique Barboza , Jan Kiszka , Aurelien Jarno , qemu-arm@nongnu.org, Marcelo Tosatti , Eduardo Habkost , Alexandre Iooss , Gerd Hoffmann , Palmer Dabbelt , Ilya Leoshkevich , qemu-ppc@nongnu.org, Juan Quintela , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Darren Kenny , kvm@vger.kernel.org, Marcel Apfelbaum , Peter Maydell , Richard Henderson , Stafford Horne , Weiwei Li , Sunil V L , Stefan Hajnoczi , Thomas Huth , Vijai Kumar K , Liu Zhiwei , David Gibson , Song Gao , Paolo Bonzini , "Michael S. Tsirkin" , Niek Linnenbank , Greg Kurz , Laurent Vivier , Qiuhao Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Xiaojuan Yang , Mahmoud Mandour , Alexander Bulekov , Jiaxun Yang , qemu-block@nongnu.org, Yanan Wang , David Woodhouse , qemu-s390x@nongnu.org, Strahinja Jankovic , Bandan Das , Alistair Francis , Aleksandar Rikalo , Tyrone Ting , Kevin Wolf , David Hildenbrand , Beraldo Leal , Beniamino Galvani , Paul Durrant , Bin Meng , Sunil Muthuswamy , Hanna Reitz , Peter Xu , =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= , David Woodhouse Subject: [PATCH v2 10/32] tests/avocado: don't use tags to define drive Date: Wed, 15 Mar 2023 17:43:09 +0000 Message-Id: <20230315174331.2959-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315174331.2959-1-alex.bennee@linaro.org> References: <20230315174331.2959-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We are abusing the avocado tags which are intended to provide test selection metadata to provide parameters to our test. This works OK up until the point you need to have ,'s in the field as this is the tag separator character which is the case for a number of the drive parameters. Fix this by making drive a parameter to the common helper function. Fixes: 267fe57c23 (tests: add tuxrun baseline test to avocado) Message-Id: <20230310103123.2118519-12-alex.bennee@linaro.org> Reviewed-by: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée --- tests/avocado/tuxrun_baselines.py | 60 +++++++++++++------------------ 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/tests/avocado/tuxrun_baselines.py b/tests/avocado/tuxrun_baselines.py index 30aaefc1d3..c3fb67f5dc 100644 --- a/tests/avocado/tuxrun_baselines.py +++ b/tests/avocado/tuxrun_baselines.py @@ -67,9 +67,6 @@ def setUp(self): # The name of the kernel Image file self.image = self.get_tag('image', "Image") - # The block device drive type - self.drive = self.get_tag('drive', "virtio-blk-device") - self.root = self.get_tag('root', "vda") # Occasionally we need extra devices to hook things up @@ -99,7 +96,7 @@ def fetch_tuxrun_assets(self, dt=None): return (kernel_image, self.workdir + "/rootfs.ext4", dtb) - def prepare_run(self, kernel, disk, dtb=None, console_index=0): + def prepare_run(self, kernel, disk, drive, dtb=None, console_index=0): """ Setup to run and add the common parameters to the system """ @@ -121,10 +118,8 @@ def prepare_run(self, kernel, disk, dtb=None, console_index=0): if self.extradev: self.vm.add_args('-device', self.extradev) - # Some machines already define a drive device - if self.drive != "none": - self.vm.add_args('-device', - f"{self.drive},drive=hd0") + self.vm.add_args('-device', + f"{drive},drive=hd0") # Some machines need an explicit DTB if dtb: @@ -154,7 +149,9 @@ def run_tuxtest_tests(self, haltmsg): else: self.vm.wait() - def common_tuxrun(self, dt=None, haltmsg="reboot: System halted", + def common_tuxrun(self, dt=None, + drive="virtio-blk-device", + haltmsg="reboot: System halted", console_index=0): """ Common path for LKFT tests. Unless we need to do something @@ -163,7 +160,7 @@ def common_tuxrun(self, dt=None, haltmsg="reboot: System halted", """ (kernel, disk, dtb) = self.fetch_tuxrun_assets(dt) - self.prepare_run(kernel, disk, dtb, console_index) + self.prepare_run(kernel, disk, drive, dtb, console_index) self.vm.launch() self.run_tuxtest_tests(haltmsg) @@ -206,11 +203,11 @@ def test_armv5(self): :avocado: tags=machine:versatilepb :avocado: tags=tuxboot:armv5 :avocado: tags=image:zImage - :avocado: tags=drive:virtio-blk-pci :avocado: tags=console:ttyAMA0 :avocado: tags=shutdown:nowait """ - self.common_tuxrun(dt="versatile-pb.dtb") + self.common_tuxrun(drive="virtio-blk-pci", + dt="versatile-pb.dtb") def test_armv7(self): """ @@ -244,10 +241,9 @@ def test_i386(self): :avocado: tags=machine:q35 :avocado: tags=tuxboot:i386 :avocado: tags=image:bzImage - :avocado: tags=drive:virtio-blk-pci :avocado: tags=shutdown:nowait """ - self.common_tuxrun() + self.common_tuxrun(drive="virtio-blk-pci") def test_mips32(self): """ @@ -257,11 +253,10 @@ def test_mips32(self): :avocado: tags=endian:big :avocado: tags=tuxboot:mips32 :avocado: tags=image:vmlinux - :avocado: tags=drive:driver=ide-hd,bus=ide.0,unit=0 :avocado: tags=root:sda :avocado: tags=shutdown:nowait """ - self.common_tuxrun() + self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0") def test_mips32el(self): """ @@ -270,11 +265,10 @@ def test_mips32el(self): :avocado: tags=cpu:mips32r6-generic :avocado: tags=tuxboot:mips32el :avocado: tags=image:vmlinux - :avocado: tags=drive:driver=ide-hd,bus=ide.0,unit=0 :avocado: tags=root:sda :avocado: tags=shutdown:nowait """ - self.common_tuxrun() + self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0") @skip("QEMU currently broken") # regression against stable QEMU def test_mips64(self): @@ -284,11 +278,10 @@ def test_mips64(self): :avocado: tags=tuxboot:mips64 :avocado: tags=endian:big :avocado: tags=image:vmlinux - :avocado: tags=drive:driver=ide-hd,bus=ide.0,unit=0 :avocado: tags=root:sda :avocado: tags=shutdown:nowait """ - self.common_tuxrun() + self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0") def test_mips64el(self): """ @@ -296,11 +289,10 @@ def test_mips64el(self): :avocado: tags=machine:malta :avocado: tags=tuxboot:mips64el :avocado: tags=image:vmlinux - :avocado: tags=drive:driver=ide-hd,bus=ide.0,unit=0 :avocado: tags=root:sda :avocado: tags=shutdown:nowait """ - self.common_tuxrun() + self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0") def test_ppc32(self): """ @@ -309,10 +301,9 @@ def test_ppc32(self): :avocado: tags=cpu:e500mc :avocado: tags=tuxboot:ppc32 :avocado: tags=image:uImage - :avocado: tags=drive:virtio-blk-pci :avocado: tags=shutdown:nowait """ - self.common_tuxrun() + self.common_tuxrun(drive="virtio-blk-pci") def test_ppc64(self): """ @@ -324,10 +315,9 @@ def test_ppc64(self): :avocado: tags=tuxboot:ppc64 :avocado: tags=image:vmlinux :avocado: tags=extradev:driver=spapr-vscsi - :avocado: tags=drive:scsi-hd :avocado: tags=root:sda """ - self.common_tuxrun() + self.common_tuxrun(drive="scsi-hd") def test_ppc64le(self): """ @@ -338,10 +328,9 @@ def test_ppc64le(self): :avocado: tags=tuxboot:ppc64le :avocado: tags=image:vmlinux :avocado: tags=extradev:driver=spapr-vscsi - :avocado: tags=drive:scsi-hd :avocado: tags=root:sda """ - self.common_tuxrun() + self.common_tuxrun(drive="scsi-hd") def test_riscv32(self): """ @@ -365,10 +354,10 @@ def test_s390(self): :avocado: tags=endian:big :avocado: tags=tuxboot:s390 :avocado: tags=image:bzImage - :avocado: tags=drive:virtio-blk-ccw :avocado: tags=shutdown:nowait """ - self.common_tuxrun(haltmsg="Requesting system halt") + self.common_tuxrun(drive="virtio-blk-ccw", + haltmsg="Requesting system halt") # Note: some segfaults caused by unaligned userspace access @skipIf(os.getenv('GITLAB_CI'), 'Skipping unstable test on GitLab') @@ -380,7 +369,6 @@ def test_sh4(self): :avocado: tags=tuxboot:sh4 :avocado: tags=image:zImage :avocado: tags=root:sda - :avocado: tags=drive:driver=ide-hd,bus=ide.0,unit=0 :avocado: tags=console:ttySC1 """ # The test is currently too unstable to do much in userspace @@ -388,7 +376,9 @@ def test_sh4(self): (kernel, disk, dtb) = self.fetch_tuxrun_assets() # the console comes on the second serial port - self.prepare_run(kernel, disk, console_index=1) + self.prepare_run(kernel, disk, + "driver=ide-hd,bus=ide.0,unit=0", + console_index=1) self.vm.launch() self.wait_for_console_pattern("Welcome to TuxTest") @@ -404,10 +394,9 @@ def test_sparc64(self): :avocado: tags=tuxboot:sparc64 :avocado: tags=image:vmlinux :avocado: tags=root:sda - :avocado: tags=drive:driver=ide-hd,bus=ide.0,unit=0 :avocado: tags=shutdown:nowait """ - self.common_tuxrun() + self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0") def test_x86_64(self): """ @@ -417,7 +406,6 @@ def test_x86_64(self): :avocado: tags=tuxboot:x86_64 :avocado: tags=image:bzImage :avocado: tags=root:sda - :avocado: tags=drive:driver=ide-hd,bus=ide.0,unit=0 :avocado: tags=shutdown:nowait """ - self.common_tuxrun() + self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0")