From b34cd8ca4ea1e54f049ef83348b38bd4627126ce Mon Sep 17 00:00:00 2001 From: Valerie Snyder Date: Thu, 1 May 2025 10:45:39 -0400 Subject: [PATCH] Tests: Remove unecessary TCP options for non-Windows ClamD tests The non-Windows ClamD tests use the LocalSocket option. --- unit_tests/clamd_test.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/unit_tests/clamd_test.py b/unit_tests/clamd_test.py index eab900171..3c6f57963 100644 --- a/unit_tests/clamd_test.py +++ b/unit_tests/clamd_test.py @@ -48,7 +48,7 @@ class TC(testcase.TestCase): TC.clamd_socket = 'clamd-test.socket' # <-- A relative path here and in check_clamd to avoid- # test failures caused by (invalid) long socket filepaths. # The max length for a socket file path is _really_ short. - TC.clamd_port_num = 3319 # <-- This is hard-coded into the `check_clamd` program + TC.clamd_port_num = 3319 # <-- This is hard-coded into the `check_clamd` program on Windows. TC.path_db = TC.path_tmp / 'database' TC.path_db.mkdir(parents=True) shutil.copy( @@ -96,9 +96,7 @@ class TC(testcase.TestCase): # Use LocalSocket for Posix, because that's what check_clamd expects. config += ''' LocalSocket {localsocket} - TCPSocket {tcpsocket} - TCPAddr localhost - '''.format(localsocket=TC.clamd_socket, tcpsocket=TC.clamd_port_num) + '''.format(localsocket=TC.clamd_socket) TC.clamd_config = TC.path_tmp / 'clamd-test.conf' TC.clamd_config.write_text(config) @@ -616,9 +614,7 @@ class TC(testcase.TestCase): # Use LocalSocket for Posix, because that's what check_clamd expects. config += ''' LocalSocket {localsocket} - TCPSocket {tcpsocket} - TCPAddr localhost - '''.format(localsocket=TC.clamd_socket, tcpsocket=TC.clamd_port_num) + '''.format(localsocket=TC.clamd_socket) clamd_config = TC.path_tmp / 'clamd-test.conf' clamd_config.write_text(config) @@ -692,9 +688,7 @@ class TC(testcase.TestCase): # Use LocalSocket for Posix, because that's what check_clamd expects. config += ''' LocalSocket {localsocket} - TCPSocket {tcpsocket} - TCPAddr localhost - '''.format(localsocket=TC.clamd_socket, tcpsocket=TC.clamd_port_num) + '''.format(localsocket=TC.clamd_socket) clamd_config = TC.path_tmp / 'clamd-test.conf' clamd_config.write_text(config) @@ -776,9 +770,7 @@ class TC(testcase.TestCase): # Use LocalSocket for Posix, because that's what check_clamd expects. config += ''' LocalSocket {localsocket} - TCPSocket {tcpsocket} - TCPAddr localhost - '''.format(localsocket=TC.clamd_socket, tcpsocket=TC.clamd_port_num) + '''.format(localsocket=TC.clamd_socket) clamd_config = TC.path_tmp / 'clamd-test.conf' clamd_config.write_text(config)