From patchwork Sat Mar 18 11:46:21 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: 664736 Delivered-To: patch@linaro.org Received: by 2002:a5d:5602:0:0:0:0:0 with SMTP id l2csp245620wrv; Sat, 18 Mar 2023 04:48:05 -0700 (PDT) X-Google-Smtp-Source: AK7set9mo0+46k9fhbZEtTeCAe7JZEhrSJsR5T99Q4Ea//msx5w2KahsCy2BHrmscBNqSG3UZO19 X-Received: by 2002:ac8:7d0c:0:b0:3d7:b045:d39 with SMTP id g12-20020ac87d0c000000b003d7b0450d39mr15122637qtb.62.1679140085001; Sat, 18 Mar 2023 04:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679140084; cv=none; d=google.com; s=arc-20160816; b=NXyxaepAunM1Ml/mBLVhwyv8GoyksqNw1oMtsA3x/zmL/vs1I9X1LFeDBB5pZ7Swpa HC9LB1Lq4XVGD3Eg2X+kkkD0nXkrcqHJ0d6SUeXyw0bLqKfdGv2ARJ6acwKIGa8zRlPN DOQQCqmhHlpRBox/RO05GqIRmYupHa8R5Jp7+G7orERLzrOjxIL5GeYLN0j629MjkxyS 42928RmezGzIWTfxVaAPNFxPCcGJ+/H2QgnSBkHVhWdhTGu/L732KkWzTQ5bBc9EkK7h neRUweURjLO6pmCkHsNi5D4oSYG7D+t/LPi6zAqYfSAqGW+/a8YOLc50H5J4kHLhu+zm 2cgw== 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=Lrnd6eEaW3DiG1pL1bza2gGCYw8PLKTpHJs+4omwMRQ=; b=eZxfe+AAkwFJwPzEVfXWbNra/GpQSaeGfVh2aOMRlh9jyKiLJlkq47VDQstd6mnXM9 GtbxyHg60LXi6Q//RhwLgoqh6nthBuSFImqOrVo/9Pt8nAUcz3Ok8yjip2ntqSWNIgtb JmS6TwIvZY3t3AQOjHOjgKTjT2ZCKx5RROb+DO0JqekDGXXWbzcZYb3UQaP4+uEy6bzn fmlHsMcG/K/gTSjLCo+LG7Z18ZuE2424U20NOxYqgjHnofxHIKN/gRmsFRG4fHi/KpOO Gi+l3/Fkm8utym6B2yEIYB+TeZPaTY4PTAY727XtoIvxthSkjaGmabgkSWLh9NU4bZn/ rgUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wG3l8ifg; 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 o15-20020a05622a138f00b003db39101abdsi2467398qtk.264.2023.03.18.04.48.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Mar 2023 04:48:04 -0700 (PDT) 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=wG3l8ifg; 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 1pdV1S-0004o5-U3; Sat, 18 Mar 2023 07:46:54 -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 1pdV1Q-0004mQ-6m for qemu-devel@nongnu.org; Sat, 18 Mar 2023 07:46:52 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pdV1N-0007Cs-8I for qemu-devel@nongnu.org; Sat, 18 Mar 2023 07:46:51 -0400 Received: by mail-wm1-x329.google.com with SMTP id t17-20020a05600c451100b003edc906aeeaso20924wmo.1 for ; Sat, 18 Mar 2023 04:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679140008; 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=Lrnd6eEaW3DiG1pL1bza2gGCYw8PLKTpHJs+4omwMRQ=; b=wG3l8ifgE8LIePdiL8PJhQ8Yxy2WYs5K3e+cWvbafOImRsG2dJ3atr0QP63a8tAV+r AUQUIbvQPyKDjHp2xdladcxL4tZNaR0dHXzOskmUzYa898bZkIOJ4UCLiIJeZQ/jdl9w 36yURSZYkhVkOBnFibSW1L2amlFDxnyrjHipsIaIVO6klDhESsguTKERutuGSeyPevNz ygd5ZOtffCTGBqFgsODNlphbAEeZQf852JM+OFtwirs4XZN4YO7kygh2q4WLx46Dfol6 TFhZH09XXP00xiizVW7bwzEC8Vi5e5qkieedNM54UZpxhuS/pYiEByocjiOZk1VM5Mcw bo0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679140008; 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=Lrnd6eEaW3DiG1pL1bza2gGCYw8PLKTpHJs+4omwMRQ=; b=u1KTtjiHWfguRLjS03RCNDeobC1RItfzGKzhVbfPkSZ5PWBgASL47ebBw9Xuoa+mzh 8CjUHKvwmwuWCHMgosiXBC4/tENFXcuZdLAxhAZKM4F+Bs3NPCLlcf0m7502V7Fl2+ol Zhi8FU57kO5EjPcWs8ZOI9n9Ua87LGJnSPomm33FpBkIDfxQp8AgQwsQm0I44Ik7H3dZ xWbojmR7DK1KOdBZAZZDj7ijxZ8jAUqfMwFC0u/6NZ7VAjMD4quKP/7yYM8vpiLGI2cZ tzEvfH8Ul3+1wEMid6cRZOEzJXXAeo/UA2B5feA8cDJqiKygTfHkQgzJEZ35bc8R1n6Y rEyQ== X-Gm-Message-State: AO0yUKXaGsQr4/WPVt2ST/lX9tMlaVHEgk7alospzDGUvC4iGtZ1JqvF qPRv2bhJ5KzvhVZTHDdvhL84kQ== X-Received: by 2002:a05:600c:354e:b0:3ed:377b:19cc with SMTP id i14-20020a05600c354e00b003ed377b19ccmr10456458wmq.0.1679140007919; Sat, 18 Mar 2023 04:46:47 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id fc19-20020a05600c525300b003ed61b8fcdfsm6959205wmb.17.2023.03.18.04.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Mar 2023 04:46:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 575621FFC0; Sat, 18 Mar 2023 11:46:45 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , David Woodhouse , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa Subject: [PULL 08/31] tests/avocado: don't use tags to define drive Date: Sat, 18 Mar 2023 11:46:21 +0000 Message-Id: <20230318114644.1340899-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230318114644.1340899-1-alex.bennee@linaro.org> References: <20230318114644.1340899-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.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=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 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) Reviewed-by: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230315174331.2959-11-alex.bennee@linaro.org> 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")