mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 04:55:44 +00:00
test(native): run the popen test program with a clean environment
This commit is contained in:
1 parent
536759fca7
commit
25dbc97e68
1 file changed
+2
-1
@@ -77,7 +77,8 @@ class NativeHookPopenTest(unittest.TestCase):
|
||||
|
||||
def run_program(self, mode):
|
||||
hook_env = {"DDNATV_ROOT": str(self.root), "LD_PRELOAD": str(self.hook)}
|
||||
env = {k: v for k, v in os.environ.items() if k not in hook_env}
|
||||
# Only what the program needs: other test modules in the same run change os.environ
|
||||
env = {"PATH": os.environ.get("PATH", "/usr/bin:/bin")}
|
||||
if self.prefix:
|
||||
cmd = list(self.prefix) + [arg for key, value in hook_env.items() for arg in ("-E", f"{key}={value}")]
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user