osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38336?usp=email )
Change subject: testenv: requirements: find programs in /usr/sbin ......................................................................
testenv: requirements: find programs in /usr/sbin
Fix that testenv complains about a missing setcap program, if it is in /usr/sbin/setcap and /usr/sbin is not in PATH as it is the case with Debian. We actually run setcap with sudo when it is needed, and in that case /usr/sbin gets added to PATH in Debian.
Fix for: [testenv] Missing program: setcap
Change-Id: Ibbccba013ac38415ef46467f97bef846b848cf39 --- M _testenv/testenv/requirements.py 1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/36/38336/1
diff --git a/_testenv/testenv/requirements.py b/_testenv/testenv/requirements.py index 7badbe9..d65e436 100644 --- a/_testenv/testenv/requirements.py +++ b/_testenv/testenv/requirements.py @@ -38,6 +38,12 @@ abort = False for program in programs: if not shutil.which(program): + if os.path.exists(os.path.join("/usr/sbin", program)): + # Debian: some programs such as setcap are in /usr/sbin, which + # is not in PATH unless using sudo. Therefore "shutil.which()" + # won't find it. + continue + logging.error(f"Missing program: {program}")
if program == "ttcn3_compiler":