From patchwork Fri Mar 10 10:31:23 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: 661621 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp772247wrb; Fri, 10 Mar 2023 02:35:44 -0800 (PST) X-Google-Smtp-Source: AK7set+BjVonWP2LDhgtWgGihxwgl+IaMXsCwRQz8dJjiogZTgtZJIUi5ChgJxq8O14v77/JT2Ln X-Received: by 2002:a05:6214:1c4f:b0:56e:b4e0:1bf3 with SMTP id if15-20020a0562141c4f00b0056eb4e01bf3mr46269896qvb.18.1678444544615; Fri, 10 Mar 2023 02:35:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678444544; cv=none; d=google.com; s=arc-20160816; b=JYEFl/6oUldEvM6RqRPSPCk16KPNPScj2mFHwWFeC4nvq94n0jaQyljusfyz9x2093 Tx4O/hmf7Cb3gWxqnbXgyhp4fc0v00M48Md1qxyeRzeI3IpncR1ErWhR/oN014bidGQC licLmVuQ9uEfahpp201omQR+YX9G+6PfPjLrYcoqzKwBiBwmProfcfYOZYnF62VpgoqB nGelpg1+7qgdLCke/w+XD3fobO2w1XbgiEpuTBiJ/7F1qtU3vy0LyN6Yv1qEC67Hw82B YLmrVLDfvnurWrPzAuMuKUUrvFauxvJViR47bf2JKqjsm1yXPFgQvhzHwjzl9+15/Tqb XNbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=FetjILDiJ9MYJMNfyzvSa3HdWAqlF1zpEkgwiMXEb9M=; b=P3uaIDN3OZJmwz3aaTvTfGbnzzOhXKEp9wwMB1bKlbvaeSDzLbblEepQl5M7RnrGrj 26++hK/YUHE4IEqZRkf8HYFwHdJSJb+PzBcctQ04psVkPbXPHd/jOo5J1y0HA3NArGfN HYouaEQQDQZiqLhpPPMBhDZow5PBDs6l/F5XaZNml3MV+2wU+wZRlIjUffUP9Ww9wbVF 9/5Iapdl8nLKLtfbsBEM8FHTryeQ5ZoCEwykbM6PdIQj15m578RI5LDG+IPwdYC3rvqD cFrlcMK3aOIyQYIqdZjTp5p0K4owyj3yDG9Cdw1oU0dYQUOBKPSEW+/D8Zf67GM1mdlQ Gxfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nYZ55Ucp; 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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w18-20020a0cdf92000000b0056eb33de335si1349661qvl.308.2023.03.10.02.35.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Mar 2023 02:35:44 -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=@linaro.org header.s=google header.b=nYZ55Ucp; 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=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paa2D-0007fU-IT; Fri, 10 Mar 2023 05:31:37 -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 1paa2B-0007d4-0C for qemu-devel@nongnu.org; Fri, 10 Mar 2023 05:31:35 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1paa26-0004IH-Jb for qemu-devel@nongnu.org; Fri, 10 Mar 2023 05:31:34 -0500 Received: by mail-wr1-x42d.google.com with SMTP id j2so4562097wrh.9 for ; Fri, 10 Mar 2023 02:31:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678444289; 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=FetjILDiJ9MYJMNfyzvSa3HdWAqlF1zpEkgwiMXEb9M=; b=nYZ55Ucp2C+joa9i54+jZxgDMogjLOLzo9z4FEmg50phFlThGYyn7Lj/a9xMbapc+r e2ITMTG7OnzOkctP3Pw5CdCeSCSLg+22CPU51SryXg5rbxvj7iq000VT7jJnZT4sSgCk 3tjblMSD2rK+XZOLCazu+UHapGP7bLkeqCY51Gsa029yEdS6iBuiAS99E/htOrBORdlD TWGa+iJQLsqMjAUD5aSUlzXPlEss2WaFHopuYFDYKXpqqkOL/SBinWukDettPCEg5Bdf VVZHD5LdPILBUbYecym40SaVUjh30OyvJsOtHX7hFRAJOkP0RT7EVZr7ySfGz9rHd8uX 1yDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678444289; 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=FetjILDiJ9MYJMNfyzvSa3HdWAqlF1zpEkgwiMXEb9M=; b=I8ElkmDA552GiyRQFvvKcCtIWEgGTLKconpi5XbZcDI7P+Y2R9J9hNJQzKqzXe9hFE v43fFaRdO+H6+5WfskeIRq9r43ewd6ELeRYGesASb1hFskIB7xCT2/HhGsieZ1gBWXmy daTnTHWC46H15g0GIeUQt3M3OyhHVA6RUKQt79exE4Mn+LjF+wKvyJjXh1XgAaayDujm /14UGoh9ymCeuWFpcdet0r8q1Ibu6Z2/tnyo00tFnNjM7FcCQ+/jJPVIUOvVlIF5BGc0 TcjiyBfCQawZqHOZWpgePMBykaKxMNWSC1WXcB0guimlfEeuc+sJaYNAOnQT7KFYjFsy rLGQ== X-Gm-Message-State: AO0yUKWSwQxCv8DtzCGPXJPtVzcuhbmT+krSZnesW9FvXQ5NQn0fuxtH EFblUdt7yR5eTOSMmH2psu8sbA== X-Received: by 2002:adf:cf0a:0:b0:2c9:e713:7889 with SMTP id o10-20020adfcf0a000000b002c9e7137889mr15648427wrj.14.1678444288837; Fri, 10 Mar 2023 02:31:28 -0800 (PST) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d4-20020adfe844000000b002ce37d2464csm1791919wrn.83.2023.03.10.02.31.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 02:31:27 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A15891FFBA; Fri, 10 Mar 2023 10:31:24 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: David Hildenbrand , Wainer dos Santos Moschetta , Richard Henderson , qemu-arm@nongnu.org, Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Cleber Rosa , Thomas Huth , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Beraldo Leal , David Woodhouse Subject: [PATCH 11/11] tests/avocado: don't use tags to define drive Date: Fri, 10 Mar 2023 10:31:23 +0000 Message-Id: <20230310103123.2118519-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310103123.2118519-1-alex.bennee@linaro.org> References: <20230310103123.2118519-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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) Signed-off-by: Alex Bennée Cc: David Woodhouse Reviewed-by: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Philippe Mathieu-Daudé --- 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")