]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
kill: Fix test-admins' ability to kill 1932/head
authorZack Cerza <zack@redhat.com>
Fri, 12 Apr 2024 18:25:23 +0000 (12:25 -0600)
committerZack Cerza <zack@redhat.com>
Fri, 12 Apr 2024 18:25:27 +0000 (12:25 -0600)
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 <zack@redhat.com>
teuthology/kill.py

index 8e14109faa6da64a1a73f5e6a8a09e81e49a90a0..f5fb4d4006e120cb7145dc8cfecf073dd37b2b8d 100755 (executable)
@@ -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: