From patchwork Tue Mar 4 22:24:17 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: 870141 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:178f:b0:38f:210b:807b with SMTP id e15csp493859wrg; Tue, 4 Mar 2025 14:30:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXy4U2k6+/G7X5v6dy5XgVO4dUP0fuyzKiV5Pe7KSfIIdIUWHxeeUn17hb1IUDNPH3/tqOCRA==@linaro.org X-Google-Smtp-Source: AGHT+IH5QgHIN4R7gBrjWQ5RdjvrstzvegwvglwdSGxuQSoplDeWb9AUpK3UNj+lbv/nJ1pY1Gef X-Received: by 2002:ac8:5956:0:b0:475:51c:ceb with SMTP id d75a77b69052e-4750b4580c1mr10182611cf.30.1741127420906; Tue, 04 Mar 2025 14:30:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741127420; cv=none; d=google.com; s=arc-20240605; b=JgrPPOMeRwdzsxVD1N2lrln6cDfd3IqOWfySIOw2pAI+hk6WW58zmTMqN/AzHequ/P g+jwQJvmXbMRm+LxlHCpTG12SCE74XA3jJ7m31FY6VOjmME8AaNrGQP7bllflJKHpLrm WcsCWzKE7j7kMqWp6TrVWknFMyucCDLLZ6aRWO+gW0kRwQWnvna0bAUrVKSmx5yqNmZJ 5ulvjQv7G5M3Aie6QmMFyEfEDDM1Qi0RgVzB3s/1jH/puYPxn9o3HFujYiQqrq0KFnWl 8b22f8pMoTjScBA8JLRsUHJcVRB0DMKB4s7go2lxSZ3H0kiNdpLMBB1M52F2voVyzdk8 eg1A== 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=1m7U5T2uale0lc0uqyyH6LsGapDRMZw5OtaQwPrcJTg=; fh=6Bzz00MUAZSz1sM9FDoE/jB6E9D8TQzH70NWpntkZX8=; b=DshVz98orQ2LGZdaBZ2XfYrFrmyX1RxFRPT1Gb2qn0nqVD68r72zaupimz3iNf3X5+ ejNOV9OttaNvjDosFM4ITjqXbR+8xIFITwQXSDUY4U74dv3VUmQEURzPxTGtA1vNA7eH 820dfmW2z/HRgvubkFQY32CUEe2yYn1LN9mAhEDybQuXbyrnbOeAeeQwxaFSsbNqbLrn 6P7T/XUr/eX5tE7eQalavOEs8EsJZ+E5A0BzEdF/MMchzshCVs6uHRz43vzeseFcpFC1 ojxAcr/72yCWlXcdonqTq2XviSwQ/M0NV5HUi8oNNjJK6G/qH67BJPTCe7FG+Kb2ugmK lplw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="jt0/O/CJ"; 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 d75a77b69052e-474dca9c791si55234761cf.226.2025.03.04.14.30.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Mar 2025 14:30:20 -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="jt0/O/CJ"; 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 1tpaiS-00073L-QU; Tue, 04 Mar 2025 17:26:20 -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 1tpah3-0005Q6-MZ for qemu-devel@nongnu.org; Tue, 04 Mar 2025 17:24:59 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpah1-0006Wn-Hz for qemu-devel@nongnu.org; Tue, 04 Mar 2025 17:24:53 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-aaec111762bso1130210066b.2 for ; Tue, 04 Mar 2025 14:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741127090; x=1741731890; 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=1m7U5T2uale0lc0uqyyH6LsGapDRMZw5OtaQwPrcJTg=; b=jt0/O/CJKSS1ZPibu2DkN1vh4YyEXnJyv/ceyw3/aaFW4f/SEGXCzjZv3s/+G9RkDW ZcmK6KmYGzo7P7V/kGZ0vA9LVoJF9eBC3uZL5Dd7PlxdlMEMqjUsALOgqZkFQX/NOHpw ZruesjTGuBN/gF3ReQMcjjw14qacXeQTuczdp5g7bipF9ZMBNOXHYB9Kp6RvHGyeQdM7 JeSFEJl/DoJNAUNJVzbpmRLX1tRIiHLMGcaX4rtmvyo/oi3ykHaUnDFosHzJkAHlwG4c B6dntzOgxGKk/SEumK3z9u5UfryQQZKpWmAVjLV/avhFiC2FveSJApHpmCl3h80c39/P 8tGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741127090; x=1741731890; 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=1m7U5T2uale0lc0uqyyH6LsGapDRMZw5OtaQwPrcJTg=; b=CvE51kTAsnBX52U/ugl5N6vEu3nqX2EvdtKn65FZs8TN+Yi+mb1Y4bpGU+2AV3U3AB nIUcsYG4sKGBaRplhxTn+0xXD8SyEz0/gEY1Rd+j14KYxz0vh7wWA0A8tZgadaAEBKsP Q41rgPjDg0D9LBVUZnPcO91I66TTzDCyUELPyv8FnZsi/FMfCWq5H0OX84RqoqLv3djn bzb+Z4Yyxhv+3hY6K+xSL06XLAgKulI+kT3qnO3+xdtK1bupZpHoTAYK9CKQETErYFPj IIPlRCbU2wnbDNjR432f2EEb17iGHIHB3muIFT9knGr9MweRoq0Bqtb/8hL7pbD/s9E9 6g/g== X-Gm-Message-State: AOJu0YzsRJfqXxIUPib/RVUqvJ++iINODxAa0gxoMCkqeA3IRGbZfCnG 7trqK/Q5gKDZUZfmawAnUzXnYsgWjnaqu8uxTxEY0OPOV5A1oDtyY1CvGracQXM= X-Gm-Gg: ASbGnctM39iS765xD1WoDp/6R0FO1eNOjOKbdfWVkCNePshdNegTgebklkxYng+20b7 SetfhNMq1gmQ7dFWiXoptbYg1J/7sZKUSoWCCGdiTCr+VmgXc3gHFDCgVidHVdo5Gm4gEWzR0N0 9Sr/Ck5bv8ftGdiBVubnjSW+/N76l75cXr0qFGAWRgdcA4ovsnw2hs9/U7pbBzWcSlI9rlhM31A I8m2nohFj7raGrJPZG8PayqTDzolgzrTqnyWGQ5gF+j6cY/rZ/0nVdtxpkCySFzNc4XoMAUxgLw y1VZUczwum06E1KTvbhoBTNqKhgMdVAaAg237tW94fKVFPE= X-Received: by 2002:a17:907:7f8e:b0:abf:6a53:2cd5 with SMTP id a640c23a62f3a-ac20dafc718mr72673666b.48.1741127089633; Tue, 04 Mar 2025 14:24:49 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac165223834sm342885866b.165.2025.03.04.14.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Mar 2025 14:24:45 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 5873F5FD7E; Tue, 4 Mar 2025 22:24:40 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Li-Wen Hsu , Peter Maydell , Laurent Vivier , qemu-arm@nongnu.org, Alexandre Iooss , Paolo Bonzini , Richard Henderson , Riku Voipio , Warner Losh , Brian Cain , Mahmoud Mandour , Kyle Evans , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Ed Maste , Pierrick Bouvier , =?utf-8?q?Marc-Andr=C3=A9_L?= =?utf-8?q?ureau?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v2 10/32] tests/functional: Allow running TCG plugins tests on non-Linux/BSD hosts Date: Tue, 4 Mar 2025 22:24:17 +0000 Message-Id: <20250304222439.2035603-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250304222439.2035603-1-alex.bennee@linaro.org> References: <20250304222439.2035603-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 --- v2 - move the plugin_file helper to testcase.py with the other path helpers --- tests/functional/qemu_test/testcase.py | 12 +++++++++++- tests/functional/test_aarch64_tcg_plugins.py | 5 +++-- 2 files changed, 14 insertions(+), 3 deletions(-) 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'))