diff --git a/benchexec/containerexecutor.py b/benchexec/containerexecutor.py index dbc319c2d..237291207 100644 --- a/benchexec/containerexecutor.py +++ b/benchexec/containerexecutor.py @@ -346,12 +346,16 @@ def __init__( self._uid = ( uid if uid is not None - else container.CONTAINER_UID if container_system_config else os.getuid() + else container.CONTAINER_UID + if container_system_config + else os.getuid() ) self._gid = ( gid if gid is not None - else container.CONTAINER_GID if container_system_config else os.getgid() + else container.CONTAINER_GID + if container_system_config + else os.getgid() ) self._allow_network = network_access self._env_override = {} diff --git a/benchexec/test_runexecutor.py b/benchexec/test_runexecutor.py index 5f699c44b..cf7dd54d5 100644 --- a/benchexec/test_runexecutor.py +++ b/benchexec/test_runexecutor.py @@ -1097,6 +1097,7 @@ def test_parent_fns(self): self.skipTest("missing /bin/sh") parent_setup_ran = False parent_cleanup_ran = False + def parent_setup_fn(*, grandchild_pid, child_pid, **kwargs): # I don't want to require psutil just for this # I'll just read the procfs @@ -1112,6 +1113,7 @@ def parent_cleanup_fn(parent_setup, exit_code, path): assert parent_setup == 12345 nonlocal parent_cleanup_ran parent_cleanup_ran = True + self.execute_run( "/bin/sh", "-c",