Skip to content

Commit

Permalink
Use gosu onstead of sudo for pping tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Nov 21, 2023
1 parent a8ef22d commit 5d404b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/integration/pping_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ def test_pping_should_post_event_when_host_is_unreachable(
def get_root_method():
if os.geteuid() == 0:
return []
elif os.system("gosu root true") == 0:
return ["gosu", "root"]
elif os.system("sudo true") == 0:
sys.path.append(str(BINDIR))
pythonpath = ":".join(sys.path)
return ["sudo", "-E", "PYTHONDIR=%s" % pythonpath]
elif os.system("gosu root true") == 0:
return ["gosu", "root"]
else:
assert False, "cannot become root"

Expand Down

0 comments on commit 5d404b4

Please sign in to comment.