From 0da341a78f00d6feae98f38d1dfbe2e9f88d0b93 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrangé" Date: Tue, 17 Dec 2024 15:59:25 +0000 Subject: tests/functional: remove duplicated 'which' function impl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Put the 'which' function into shared code. Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Message-ID: <20241217155953.3950506-5-berrange@redhat.com> Signed-off-by: Thomas Huth --- tests/functional/test_acpi_bits.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'tests/functional/test_acpi_bits.py') diff --git a/tests/functional/test_acpi_bits.py b/tests/functional/test_acpi_bits.py index 3df9562394..1e6d082ecb 100755 --- a/tests/functional/test_acpi_bits.py +++ b/tests/functional/test_acpi_bits.py @@ -47,7 +47,7 @@ from typing import ( ) from qemu.machine import QEMUMachine from unittest import skipIf -from qemu_test import QemuSystemTest, Asset +from qemu_test import QemuSystemTest, Asset, which deps = ["xorriso", "mformat"] # dependent tools needed in the test setup/box. supported_platforms = ['x86_64'] # supported test platforms. @@ -55,17 +55,6 @@ supported_platforms = ['x86_64'] # supported test platforms. # default timeout of 120 secs is sometimes not enough for bits test. BITS_TIMEOUT = 200 -def which(tool): - """ looks up the full path for @tool, returns None if not found - or if @tool does not have executable permissions. - """ - paths=os.getenv('PATH') - for p in paths.split(os.path.pathsep): - p = os.path.join(p, tool) - if os.path.exists(p) and os.access(p, os.X_OK): - return p - return None - def missing_deps(): """ returns True if any of the test dependent tools are absent. """ -- cgit 1.4.1