From 7e24af04d8fee5bd50bb469d294cf0c27520c34b Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Thu, 11 Nov 2021 12:06:09 +0000 Subject: debian/tests: drop which usage to fix adt failure in jammy Command which is obsolete, and prints warnings to stderr now. Replace it with python standard library call to shutil.which(). Signed-off-by: Dimitri John Ledkov --- debian/tests/network_test_base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian/tests') diff --git a/debian/tests/network_test_base.py b/debian/tests/network_test_base.py index 2adbbd4b..221aad15 100644 --- a/debian/tests/network_test_base.py +++ b/debian/tests/network_test_base.py @@ -15,6 +15,7 @@ import os import os.path import time import tempfile +import shutil import subprocess import re import unittest @@ -25,7 +26,7 @@ from glob import glob # check availability of programs, and cleanly skip test if they are not # available for program in ["wpa_supplicant", "hostapd", "dnsmasq", "dhclient"]: - if subprocess.call(["which", program], stdout=subprocess.PIPE) != 0: + if shutil.which(program) is None: sys.stderr.write( "%s is required for this test suite, but not available. Skipping\n" % program -- cgit 1.3.0-6-gf8a5