From: Zack Cerza Date: Fri, 12 Apr 2024 18:25:23 +0000 (-0600) Subject: kill: Fix test-admins' ability to kill X-Git-Tag: 1.2.0~50^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e66a632415dc73bb63768eb72c2178d14846b182;p=teuthology.git kill: Fix test-admins' ability to kill By testing access to /bin/true, we were getting false negatives as we meant to be testing for access to /bin/kill. With our configuration, any sudo access indicates access to /bin/kill. Signed-off-by: Zack Cerza --- diff --git a/teuthology/kill.py b/teuthology/kill.py index 8e14109faa..f5fb4d4006 100755 --- a/teuthology/kill.py +++ b/teuthology/kill.py @@ -195,7 +195,7 @@ def kill_processes(run_name, pids=None): log.info("Killing Pids: " + str(to_kill)) sudo_works = False if pids_need_sudo: - sudo_works = subprocess.Popen(['sudo', '-n', 'true']).wait() == 0 + sudo_works = subprocess.Popen(['sudo', '-n', '-l']).wait() == 0 if not sudo_works: log.debug("Passwordless sudo not configured; not using sudo") for pid in to_kill: