Exemplo n.º 1
0
 def setup(self):
     require_user('root')
     self._nofile = resource.getrlimit(resource.RLIMIT_NOFILE)
     soft, hard = self._nofile
     new_limit = (min(soft, RESPAWNS / 2), min(hard, RESPAWNS / 2))
     resource.setrlimit(resource.RLIMIT_NOFILE, new_limit)
     self._socket_fd_count = count_socket_fds()
Exemplo n.º 2
0
 def setup(self):
     require_user('root')
     self._nofile = resource.getrlimit(resource.RLIMIT_NOFILE)
     soft, hard = self._nofile
     new_limit = (min(soft, RESPAWNS / 2), min(hard, RESPAWNS / 2))
     resource.setrlimit(resource.RLIMIT_NOFILE, new_limit)
     self._socket_fd_count = count_socket_fds()
Exemplo n.º 3
0
 def teardown(self):
     resource.setrlimit(resource.RLIMIT_NOFILE, self._nofile)
     assert self._socket_fd_count == count_socket_fds()
Exemplo n.º 4
0
 def teardown(self):
     resource.setrlimit(resource.RLIMIT_NOFILE, self._nofile)
     assert self._socket_fd_count == count_socket_fds()