From patchwork Fri Apr 4 01:09:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 878191 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp3552442wrs; Thu, 3 Apr 2025 18:10:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV+yJ7RYVhXNhoJi0Zm0tXIddYFWNVASv5nb0V+SEhqbmOUNGvuMv1YBK3+8D3pqocPIV913g==@linaro.org X-Google-Smtp-Source: AGHT+IGZIn1tLekqonfJe5BrlAoxUdTKjm1T4isBR1opYEQYMExxFxjdJem5lFUgsplAMfeCu3Ll X-Received: by 2002:a05:620a:190d:b0:7c5:562d:ccfa with SMTP id af79cd13be357-7c774e004bfmr238142685a.36.1743729033741; Thu, 03 Apr 2025 18:10:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743729033; cv=none; d=google.com; s=arc-20240605; b=WAOulOiEX1EBYO+pAbePfk1W8AJyrzL6+/lJaiGfGkrYSC6akscDdGcwsRnv/15kIK gGlvuAqTCmYTQBIMGlj4iu988j1r3dg17d6KjqZnC6dPha1r5gH/VI58Us0/tdKb1OyV 8dV+I6wRD6AdlL8QepYu0unzQxx0K1n3NcxnsoBQiggjUE6AP8F8+9ODZKfp0gCHp0mD 5lThcdCaXuvdo9zaqF9o7cFwu2xfrS1ioT+jnmZA/ugHPt2iwc2mpNa70MwNy4g7OuzS VidkedSGW8q6PRNfio7vSN4MxNkier5XSdILHjvxnP444JyuWJ8pDo5T6Hob7I0nMnSo jOvQ== 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=4BGzGdi+Q8YtuavjJZkyQGsY98kSfnKOoGLNVstGZOM=; fh=PF9ef/o3VlrPqKSIkD2nmbLrn/J9ixCbUNSAyHUdgCQ=; b=E3xA+pXmq+DHLAKpbNGC6EMibBbUu2u+CETXEQU2pD/r3F3Ng0rOJadjbxXiZxDZ/7 /mYP4cTJwQFV6tXp/J68LMcIlRXuizlMjFaAqAXmPzSzU8LjPlA7uOh0A2n91kKdlmTH /mqRLvyQPTSdLM2aYheyuB84OEcXts94kYRmGXoRMIr25FsAMV93HrgJMMUSBkuTmrjv NozTxzOIqkBt59ZtxkCIZQAQXrQnT7tX7+tJ9y/0OPIwFdxLes9ofeTE/2GW/wOKCujl LM5E/IttNytZz44zttsSa50LG56NUGdJB9SvwaOL2eOx5ea0xbQlyzcl0dLs0qntRtkO FeTA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kTwQ7i7c; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c76e958f3asi218492485a.141.2025.04.03.18.10.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Apr 2025 18:10:33 -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=kTwQ7i7c; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0VZ2-0008KK-DA; Thu, 03 Apr 2025 21:09:44 -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 1u0VYw-0008IE-Fo for qemu-devel@nongnu.org; Thu, 03 Apr 2025 21:09:38 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0VYu-00081H-Gv for qemu-devel@nongnu.org; Thu, 03 Apr 2025 21:09:37 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-2241053582dso21836595ad.1 for ; Thu, 03 Apr 2025 18:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743728975; x=1744333775; darn=nongnu.org; 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=4BGzGdi+Q8YtuavjJZkyQGsY98kSfnKOoGLNVstGZOM=; b=kTwQ7i7cFyKSF+biVITBYYh/kmhnv25NkMwrQ3VAR3OEffXHTNHklDYVefGjGTkWzF eXkdgJZom5MDvhcxFbKSAUrly9YR8kpNwfDJQ66qq+sUmR5wLo2N9wfa+XzBGIVqO4Cp ep40RuAELOxsSVofP96/X67FoCRi8Y8XWF6r+uDor43QRa52Iw2W60mGYIJeTQJTOE+5 kWlNSdGG01vUyloVZufrSQkzO19Hzs/VWm+PudmmAxkQhRiJLF6/v5/FGcyhZbrqjtko tQMReF1I2FyxDTyHpwfKu5HheFzAWmG44ycBfVrL/n3LQBlOrF31SfQORzCJqpUFQzEM XF3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743728975; x=1744333775; 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=4BGzGdi+Q8YtuavjJZkyQGsY98kSfnKOoGLNVstGZOM=; b=Qf+yl6rgL3Rbebe++xwsTFEse74QdgLQCIEFB9B3av1HR1dTdRRv7A45Gtin6Cvurn 7zBYOkvGkbWiphCBNI//6y/iscHndh0w6qvzB+3t5g8r5737b4ctg4nXlh50gxWKJCI+ 2r2V3IT+j9Kd3DSf/7xUSGpqUE3DFPEzf71Q00utUaV2+8nEow9t6mzy3IbZUmNKNkCf 4uoZfBOPfpLmx8kn0X7a61kf4kKgvFrcNNwh9reLnw4bgBGCQ2qhRBtAn6kOa3cAEPfD 1NzieG5ecWU2WTY4lvu2mZq6wxtTKW+eA7cCsvHa5vyfBV0r9j1UOHFG0w/FZGCDOhX1 O5eg== X-Gm-Message-State: AOJu0Yy7Z60WHDEKrf3DIAuc0JILgQ4KJFifJUk2QU4R9QNXw6gsYl1K 5PvgSTSH27OXI3FD/6gz7nn+8oVI18gDrolMaQF8Xp+6eQYjMezVdq/C9dQuWrySLOlxxLw2CaR b X-Gm-Gg: ASbGncuoX+7fJlEuAlzi7i3cdCnz6K8i8yBzHJzbVvEVNZNcxHxeidHwX1kMx4MUgGZ S0dBB3zS8xjIeLAB3raOpRw2PVkLjmfdFC3ijbj+8tyG16YZ0iZ1FFPw44jaCy2V6q86cWbtQm1 Ktq1f4tM3BGJEvsLOwAlh/gX3l4KcO02ZPzJT15PJ3GAXcrYvNJ/4oslcQFAWqEVNugYVeR1E/V 787zTHfJn1sct9VFcRBmHaRIeGfl/KCFAhGlvfF5Bpgs+65FGfIei5kpXjn+M0RyIECKRhmYme3 kkYzVvK8l010/Z8DQJM6W9pYzb7iev/P9ZvHlhfPud+pCy+vW+0= X-Received: by 2002:a17:902:ef0a:b0:229:1717:8812 with SMTP id d9443c01a7336-22a89eac8d3mr18321405ad.0.1743728974962; Thu, 03 Apr 2025 18:09:34 -0700 (PDT) Received: from stoup.. ([75.147.178.105]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-739d97ee2d9sm2171755b3a.39.2025.04.03.18.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Apr 2025 18:09:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S . Tsirkin" Subject: [PULL 3/6] tests/functional: Add a decorator for skipping tests on particular OS Date: Thu, 3 Apr 2025 18:09:27 -0700 Message-ID: <20250404010930.164329-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250404010930.164329-1-richard.henderson@linaro.org> References: <20250404010930.164329-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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 From: Philippe Mathieu-Daudé Since tests might be failing on some operating systems, introduce the skipIfOperatingSystem() decorator. Acked-by: Michael S. Tsirkin Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-ID: <20250403203241.46692-3-philmd@linaro.org> --- tests/functional/qemu_test/__init__.py | 2 +- tests/functional/qemu_test/decorators.py | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu_test/__init__.py index 45f7befa37..af41c2c6a2 100644 --- a/tests/functional/qemu_test/__init__.py +++ b/tests/functional/qemu_test/__init__.py @@ -15,6 +15,6 @@ from .linuxkernel import LinuxKernelTest from .decorators import skipIfMissingCommands, skipIfNotMachine, \ skipFlakyTest, skipUntrustedTest, skipBigDataTest, skipSlowTest, \ - skipIfMissingImports + skipIfMissingImports, skipIfOperatingSystem from .archive import archive_extract from .uncompress import uncompress diff --git a/tests/functional/qemu_test/decorators.py b/tests/functional/qemu_test/decorators.py index 1651eb739a..50d29de533 100644 --- a/tests/functional/qemu_test/decorators.py +++ b/tests/functional/qemu_test/decorators.py @@ -5,7 +5,7 @@ import importlib import os import platform -from unittest import skipUnless +from unittest import skipIf, skipUnless from .cmd import which @@ -26,6 +26,19 @@ def skipIfMissingCommands(*args): return skipUnless(has_cmds, 'required command(s) "%s" not installed' % ", ".join(args)) +''' +Decorator to skip execution of a test if the current +host operating system does match one of the prohibited +ones. +Example + + @skipIfOperatingSystem("Linux", "Darwin") +''' +def skipIfOperatingSystem(*args): + return skipIf(platform.system() in args, + 'running on an OS (%s) that is not able to run this test' % + ", ".join(args)) + ''' Decorator to skip execution of a test if the current host machine does not match one of the permitted