Skip to content

Commit d79f002

Browse files
authored
Merge pull request syslog-ng#5128 from HofiOne/light-fiexes
Light fixes
2 parents 67f84bd + 645bc25 commit d79f002

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/light/functional_tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def setup(request):
8585
global base_number_of_open_fds
8686
number_of_open_fds = len(psutil.Process().open_files())
8787
assert base_number_of_open_fds + 1 == number_of_open_fds, "Previous testcase has unclosed opened fds"
88-
assert len(psutil.Process().connections(kind="inet")) == 0, "Previous testcase has unclosed opened sockets"
88+
assert len(psutil.Process().net_connections(kind="inet")) == 0, "Previous testcase has unclosed opened sockets"
8989
testcase_parameters = request.getfixturevalue("testcase_parameters")
9090

9191
copy_file(testcase_parameters.get_testcase_file(), Path.cwd())

tests/light/src/syslog_ng/syslog_ng_cli.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def is_process_running(self):
8080
def __wait_for_control_socket_alive(self):
8181
def is_alive(s):
8282
if not s.is_process_running():
83-
self.__process = None
8483
self.__error_handling("syslog-ng is not running")
8584
return s.__syslog_ng_ctl.is_control_socket_alive()
8685
return wait_until_true(is_alive, self)
@@ -167,6 +166,10 @@ def __handle_core_file(self):
167166
core_file.replace(Path(core_file))
168167
if core_file_found:
169168
raise Exception("syslog-ng core file was found and processed")
169+
if self.__process.returncode in [-6, -9, -11]:
170+
ret_code = self.__process.returncode
171+
self.__process = None
172+
raise Exception("syslog-ng process crashed with signal {}".format(ret_code))
170173

171174
def set_start_parameters(self, stderr, debug, trace, verbose, startup_debug, no_caps, config_path, persist_path, pid_path, control_socket_path):
172175
self.__stderr = stderr

0 commit comments

Comments
 (0)