From patchwork Sat Mar 8 21:53:05 2025 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: 871578 Delivered-To: patch@linaro.org Received: by 2002:a5d:64ce:0:b0:38f:210b:807b with SMTP id f14csp332147wri; Sat, 8 Mar 2025 13:56:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW3Wl0fQS5niOXN+UEphHIne6B0jOIUQj+uHQodeUXWaZyiwhR96F3jEc7/te4Y11PqQQbF9Q==@linaro.org X-Google-Smtp-Source: AGHT+IHtSNED7P6xFmtcWKyAmjt5LLddIukNFla3GRArshmhZ9nsD351HJnvsFajL8VSZxi5DYTh X-Received: by 2002:a05:6214:d6d:b0:6e8:ede1:237 with SMTP id 6a1803df08f44-6e9006941c4mr93695236d6.43.1741470968312; Sat, 08 Mar 2025 13:56:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741470968; cv=none; d=google.com; s=arc-20240605; b=bFx7AnrNTZfaASA/L8RcCFyieD9asR3AkX46LsOeK4LzXn5IlsO/geUgavX2XWZSiQ Vn2V9IQ0VBXlmXqd0DO6WTQEFSLCnUOuvp6jFmL8RMPvHCgAl4nCeWL4Z8C+Y08zgKFX 0ZFnRnyy99Lg6nNL4EtaM7tS5vP+XKemAgOq6qo1X41Ax16Hp+XdcxViulQEkYZPALwm w5GPoR3nApMRIAcFr3J8KZY+qTxOQV6jYT6Tl/d2OCnmvf6aVHm8cPyrWG1t8j4ABMox reWcm/UcO0Rr6GKLytytfFOeop+V/l2HUSJy3AhTbZc76I5/gp0PNVVr0FeWKWlbcDAh EnrQ== 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=bx+oIRZTzQSfOA5NYqkM6PIAwaVGgxdotXJe0o6oYIE=; fh=+LXuE2omSsxqK1//40YdnyHs3tu7yt+NJ1OJey+T1h4=; b=eiXGCZI5Yp7pjbop7LK/PnrZEhAP7ctJbwetu5luR3tL7qaxXTMjszjY6aEIfFrX9Q UNRAOzAqk/7bHiRGe9wxT/rBnbP9eo2cgkrfvWhELjvRWL1LsRK0FBg0qqTPGhAcn6/e cqL8jUW6f9U9TLlFMNG+v0skTSjCXFLK6MwSUJ/ExpB/STl6ha7QTmrf5wgXk2ZozM95 sYCUFi+C2UYf7x9n8BT7GfDJKpUG9uGy+j4zRZmCNWSpX4yrBhALFtXuKkj/wX5qvaI7 n/yl1dStVrOe7zA+39T89ru5XyoOGm1DGpNXFH6qPBr7Z01MWDlKs4dGr+yjwKz1C0Eu b96g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gSCYxwhD; 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-6e91067ac36si11057596d6.305.2025.03.08.13.56.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Mar 2025 13:56:08 -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=gSCYxwhD; 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 1tr274-0003JD-6R; Sat, 08 Mar 2025 16:53:42 -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 1tr270-0003GN-5A for qemu-devel@nongnu.org; Sat, 08 Mar 2025 16:53:38 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tr26y-0000vj-2H for qemu-devel@nongnu.org; Sat, 08 Mar 2025 16:53:37 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3912e96c8e8so1581303f8f.2 for ; Sat, 08 Mar 2025 13:53:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741470814; x=1742075614; 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=bx+oIRZTzQSfOA5NYqkM6PIAwaVGgxdotXJe0o6oYIE=; b=gSCYxwhDzn/LapZFii909z48hl3XdqxVvSBhZarbaEYj7qM1EZNNlUN+M5qp4Ee2Th gvetwp34HerhD27wFb0PHxcWXsy/I8myVnDFYlwTlHvrFTBCCkSwwAkU9EBrAoz0eh2v 0mFJ8TDqD1uKahg8bIxO0iA3K2/fmhSKh+0WOpCnfan6e7NXM2T8cRcWyAV8JdhaxwDC k+RDi+su2ZsbCodI0oY/zk7DW9oRzK8gGufm9GjDYiUscv9puCJVdanPo0AJ1e94MSan 8sJh8axWOyrExJx2dXPXB0nJbgiGSO4odr8IzJFDwx989bsBk3ZdsHoq8GhfriLvTILx FpXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741470814; x=1742075614; 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=bx+oIRZTzQSfOA5NYqkM6PIAwaVGgxdotXJe0o6oYIE=; b=ZlaxgmvquO8yfgZsERcpwjGHfS8Dhx2Y4CA3V10sYX0wWF4pp2e503I0dLGa2Q8fo3 SdvWyOnxW2tn62a+I69Ot67BnVcT+ygpnAmC+AUbywV96TIFtFdaZZa5+L/BOqPqImVp E/S/xFe4X+5Jdq+zGlpVcK9ttBgyGJglaW8ly8DTfOmRg5q/nSK1sZCzVeiNbvvOnp90 6PBPm+S4qucl1EcMy4nm3o826sMB2Op3aXtVEYkjsOlbItvsJT/D8IDlLIQo+syssW9s 6la1Ye9N4GQm5q8Nyq4qLKM7jXjrSEgt95CL7BTBeEpZpFGa1Jv2hoEjg6MFjmGYOjJX JPZw== X-Gm-Message-State: AOJu0YzseRrdOMEswiaQcd5dW87mFtovekAvuMsd4LSztUPANJxtNpJN /L5bEwNkMItAxzojgleYIMJMWNBnsQDawWx1GeX/D511tW9Bq849GvcKiPxa7Ns= X-Gm-Gg: ASbGnct2jXk6LE2m0DCCAk+kUWSYD+pUETnSADpCalXGIesT8cRqVFqMTbqy7+PHRsV UJw3jhr0zrZHsh5VM66x2jQAGe7XSUa9Nk8Y42C2MBrjH5Y24fJEK6NIa7aJsOFZkpAUUBZYNmJ a8UAyMb5EquffykaXia8EB4hnGYTEtgcl5N7m4YegHjbaYt3P6tIm7tOlzjwDPht03R50ZNzqTY PulPYwd4ihSO3+3KrUf+yrjw2TRodMNt2aoqZoUEd7TJUqZhM6pH1E0S/WhG0yTtVE8bi9OxFLX 29ti6TNEDKLZji8nrEbEkj6isn0KwhAlRCRytcRIxkh+/a0= X-Received: by 2002:a05:6000:1545:b0:390:f9d0:5e4 with SMTP id ffacd0b85a97d-39132d513c9mr7170501f8f.21.1741470814355; Sat, 08 Mar 2025 13:53:34 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd42b7245sm125155525e9.17.2025.03.08.13.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Mar 2025 13:53:31 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 77E18603EA; Sat, 8 Mar 2025 21:53:27 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier , =?utf-8?q?Daniel_P_=2E_Berr?= =?utf-8?q?ang=C3=A9?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 10/31] tests/functional: Allow running TCG plugins tests on non-Linux/BSD hosts Date: Sat, 8 Mar 2025 21:53:05 +0000 Message-Id: <20250308215326.2907828-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250308215326.2907828-1-alex.bennee@linaro.org> References: <20250308215326.2907828-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.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é Not all platforms use the '.so' suffix for shared libraries, which is how plugins are built. Use the recently introduced dso_suffix() helper to get the proper host suffix. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2804 Suggested-by: Pierrick Bouvier Suggested-by: Daniel P. Berrangé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Thomas Huth Message-Id: <20250220080215.49165-4-philmd@linaro.org> [AJB: moved plugin_file into testcase.py] Signed-off-by: Alex Bennée Message-Id: <20250304222439.2035603-11-alex.bennee@linaro.org> diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py index 869f3949fe..9e1839586b 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -27,7 +27,7 @@ from .archive import archive_extract from .asset import Asset -from .config import BUILD_DIR +from .config import BUILD_DIR, dso_suffix from .uncompress import uncompress @@ -184,6 +184,16 @@ def scratch_file(self, *args): def log_file(self, *args): return str(Path(self.outputdir, *args)) + ''' + @params plugin name + + Return the full path to the plugin taking into account any host OS + specific suffixes. + ''' + def plugin_file(self, plugin_name): + sfx = dso_suffix() + return os.path.join('tests', 'tcg', 'plugins', f'{plugin_name}.{sfx}') + def assets_available(self): for name, asset in vars(self.__class__).items(): if name.startswith("ASSET_") and type(asset) == Asset: diff --git a/tests/functional/test_aarch64_tcg_plugins.py b/tests/functional/test_aarch64_tcg_plugins.py index 7e8beacc83..4ea71f5f88 100755 --- a/tests/functional/test_aarch64_tcg_plugins.py +++ b/tests/functional/test_aarch64_tcg_plugins.py @@ -13,6 +13,7 @@ import tempfile import mmap +import os import re from qemu.machine.machine import VMLaunchFailure @@ -74,7 +75,7 @@ def test_aarch64_virt_insn(self): suffix=".log") self.run_vm(kernel_path, kernel_command_line, - "tests/tcg/plugins/libinsn.so", plugin_log.name, + self.plugin_file('libinsn'), plugin_log.name, console_pattern) with plugin_log as lf, \ @@ -100,7 +101,7 @@ def test_aarch64_virt_insn_icount(self): suffix=".log") self.run_vm(kernel_path, kernel_command_line, - "tests/tcg/plugins/libinsn.so", plugin_log.name, + self.plugin_file('libinsn'), plugin_log.name, console_pattern, args=('-icount', 'shift=1'))