Skip to content

Commit

Permalink
Dump pythonpath more places
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Feb 27, 2024
1 parent 2c14780 commit c5be197
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/integration/pping_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,17 @@ def get_root_method():
if os.geteuid() == 0:
return []
elif os.system("sudo true") == 0:
print("get_root_method PYTHONPATH:")
for piece in sys.path:
print(piece)
sys.path.append(str(BINDIR))
pythonpath = ":".join(sys.path)
if pythonpath[0] != ":":
pythonpath = ":" + pythonpath
pythonpath = str(BINDIR) + pythonpath
print("get_root_method PYTHONPATH shown to sudo:")
for piece in pythonpath.split(":"):
print(piece if piece else "EMPTY STRING")
return ["sudo", "-E", "PYTHONPATH=%s" % pythonpath]
elif os.system("gosu root true") == 0:
return ["gosu", "root"]
Expand All @@ -100,10 +106,10 @@ def get_pping_output(timeout=5):
assert pping.exists(), "Cannot find pping.py on path"
pping = str(pping)
cmd = get_root_method() + ["/usr/bin/timeout", str(timeout), pping, "-f"]
print('PATH:')
for piece in os.environ.get('PATH', '').split(':'):
print("PATH:")
for piece in os.environ.get("PATH", "").split(":"):
print(piece)
print('PYTHONPATH:')
print("PYTHONPATH:")
for piece in sys.path:
print(piece)
try:
Expand Down

0 comments on commit c5be197

Please sign in to comment.