From patchwork Thu Apr 3 15:18:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 877922 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp3320165wrs; Thu, 3 Apr 2025 08:19:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU48ZSIbPcSn5TkN7fjxT06AY43Kl8B/E3YejlPxft+XM8IX/rVpbS7cUafdGaXFzhWPaGq/A==@linaro.org X-Google-Smtp-Source: AGHT+IFXKilV0C9yNvTgOluJ79P6e6hkq3nWabkoDFOI41Eu3Oi02Sza2s7NTRnS6WETVOfq3Nyg X-Received: by 2002:a05:6214:d08:b0:6e6:6599:edf6 with SMTP id 6a1803df08f44-6ef02d0d889mr104826796d6.34.1743693583747; Thu, 03 Apr 2025 08:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743693583; cv=none; d=google.com; s=arc-20240605; b=MUcxXIDj81pad7a2rIH3l83VzQDLT+zAhpHYeU1PRPwEdZFe2RzjiEdODet5VGlrpI 5V724jkTPkfgWtvCVx7QXTh0aO4R7WbOEiFscg/fs6+grhkHk6ob8vsJxzjR7s5bKxJn wHkyyayx8nNk5wIz6fC/uwJ9tpRcQ7W3a3r55MuyM9oMng2d5yhS7F5vdJmekTtVShFz FqJ800vZhTcHg2U3CNxKWNE8c2XA/iUBj25CGUbR40Uaezg8vXuVd2FzpbKlLMMIKt/w mnGFO8PVtKfNao8DyQuIJqjp21wEQzHMzzyV3Zg3xn2EmAtfTQCPyq8KMmpaIb19UdLj lOOw== 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=otH5kJZDaqXFqi3K0/tLZ6a2mur9OK5+mhfeGaUByik=; fh=uZabDrQmZm0L+6w9TkaKSHx4mVelHvsyKGr5umV4YlI=; b=Vyn6VqqRtTyxSnpCATwsGVR+ofTn8uXY8cjWWKoJwu3+PaFvozCN8wIJEYLcdZRhJ+ bRBqCFmSC/dEndwRLRtyO2u5v9Lln0+zrSP5kZZH0HGt0D4bKrXvOz/up48aTpR5mJGS DnG6aYtAmCbChux3pDKc3mR+AlAzfT4eoNinJwCxqg8JrCwLX1/WEhi8+PnCD1GSgsOp dHBnt92Aic22y9OJqCBdoxCpCPSM6fZCHmfX5x3hq8U1Q7cdG1Q1dESCqqfET3Vy0BAf nJytMSkVmKS54KassxoGZ5FTuuQeKM+BtL4LOdP/Fmaut3merm1o2PeaRtG1kCXmoyQ/ oPTA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tKL8E6jT; 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 6a1803df08f44-6ef0f1278d7si12949266d6.313.2025.04.03.08.19.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Apr 2025 08:19:43 -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=tKL8E6jT; 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 1u0MLD-0007eX-Sn; Thu, 03 Apr 2025 11:18:51 -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 1u0MLB-0007dy-O8 for qemu-devel@nongnu.org; Thu, 03 Apr 2025 11:18:49 -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 1u0MLA-0000QF-2R for qemu-devel@nongnu.org; Thu, 03 Apr 2025 11:18:49 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4394036c0efso7482785e9.2 for ; Thu, 03 Apr 2025 08:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743693526; x=1744298326; 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=otH5kJZDaqXFqi3K0/tLZ6a2mur9OK5+mhfeGaUByik=; b=tKL8E6jTsXSSFPJieviyKjKwhYMk6R51K4noAf5+p2FCAOI2WJNEG0PZZJ9MqZhYAd tJljaR51Xvi5I3s0VYmttWMo1UfucEhHVhIfFAmizaszr+k6TVr61Cxzg0gXSILfSr7m +9rOXynmUXHWqfY48mvlHs/SQZbD5cCbxswMAq6LOTmsXB3B3tvIiaJCvCN8LmaOWJzS C8VKK4lpbWc/WcADt1MYQg7rSxHSB3O3anMk+TvYBDC/rc1B9pocS7CpT4pVNsvjo+UX RFvutrvWw7zDw+vGK7yUDG99EEo7UciFkwFkywED6Za5ikia4WeLuwHbRvDqz6TykohB SflA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743693526; x=1744298326; 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=otH5kJZDaqXFqi3K0/tLZ6a2mur9OK5+mhfeGaUByik=; b=eon6/I3jSle0gtXqIG3D2aZQJcxkngsrDoVC5g72yL8Vvs1v3iDC4XNXEwq7ODWqfO k/oRogTkHT3UM2rOA4/IkFyP2vWTtMUHuiTftcIenm58TOl9w8ER6r9onH3vRP7V97sJ v82c7C7MSexpurbFez6+8axgYMaqwJNUNGzjYUuFv18zI5q1ajRZPAiAR2coogBUvfj6 flqno4uUfeH5qRD8XjLXIZJjgmecrudqBYTb7cOl3qgP9046NmME2CHj+ZGpSa1MHiRP kYdKCJeY18FXYS8ZKsXJWJyEZMWnr6lqKbNv/+xJbifi7cV2113XGYDR9oTsVKEY50w3 G6Xw== X-Gm-Message-State: AOJu0YwjS8fI9roJ9Zrmir78g9mTLko5/JR55O+rTfb0vBImNwYJ89NF r2K4pAUY6kz1m7NalkHozLDo/xZFIUEXwl0dYT6OUNtFAIYDAx2Aw0G0l6cS99P88BsN71JDbBZ W X-Gm-Gg: ASbGncsAgj7PED+qGnEwlZscqSQaFXT8latBUrKFW7us97NzoWuHEqz2TXEzMaEmbKT 9Qx23egowdijogoZCzRiWmqG4bnhcLbIEZs8JzArk44tqgf0JGJCuIVXeCClsV6vDbK2hYLCp3L 3k0CF8f3XXXvsInH985GXmhBQ3M+nHjudIYxZD3og8WAu5Mk4pyvN51eUPDWEJ3EzRt840bP+Se ncuUVuUpfdAIGe5ckas3avTCCGjDdILxw+rMjHM7q5oWv8PEPu7jpaV/YCqu2FTmEwkGhBHNzG4 yWig/GCnqbjPkrsOvN6gXT1lw7vNTn4Cr5rFfMm0oR7yJv6mGfTm8oEq11ZVsYxH+ZRhq+PrIkF QaGWyHZsVArkCzI+jerg= X-Received: by 2002:a05:6000:250f:b0:39c:1f10:c736 with SMTP id ffacd0b85a97d-39c1f10c765mr13657417f8f.43.1743693525801; Thu, 03 Apr 2025 08:18:45 -0700 (PDT) Received: from localhost.localdomain (145.171.88.92.rev.sfr.net. [92.88.171.145]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c301a732asm2084187f8f.30.2025.04.03.08.18.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 08:18:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gustavo Romero , Peter Maydell , Laurent Vivier , Ani Sinha , Udo Steinberg , "Michael S. Tsirkin" , qemu-arm@nongnu.org, Paolo Bonzini , Igor Mammedov , Andrew Jones , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Fabiano Rosas , =?utf-8?q?Alex_Benn=C3=A9e?= , Shannon Zhao Subject: [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS Date: Thu, 3 Apr 2025 17:18:17 +0200 Message-ID: <20250403151829.44858-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403151829.44858-1-philmd@linaro.org> References: <20250403151829.44858-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@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=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 Since tests might be failing on some operating systems, introduce the skipIfOperatingSystem() decorator. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- 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 45f7befa374..af41c2c6a22 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 1651eb739a7..b6a1d41c55c 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 not match one of the permitted +ones. +Example + + @skipIfOperatingSystem("Linux", "Darwin") +''' +def skipIfOperatingSystem(*args): + return skipIf(platform.system() in args, + 'not running on one of the required OS(s) "%s"' % + ", ".join(args)) + ''' Decorator to skip execution of a test if the current host machine does not match one of the permitted