diff --git a/deps/wazuh_testing/wazuh_testing/modules/eps/event_monitor.py b/deps/wazuh_testing/wazuh_testing/modules/analysisd/event_monitor.py similarity index 89% rename from deps/wazuh_testing/wazuh_testing/modules/eps/event_monitor.py rename to deps/wazuh_testing/wazuh_testing/modules/analysisd/event_monitor.py index a43b2a60f9..83f066aee6 100644 --- a/deps/wazuh_testing/wazuh_testing/modules/eps/event_monitor.py +++ b/deps/wazuh_testing/wazuh_testing/modules/analysisd/event_monitor.py @@ -1,6 +1,6 @@ import re -import wazuh_testing as eps +from wazuh_testing import T_10, T_20, T_60 from wazuh_testing.modules.analysisd import ANALYSISD_PREFIX, MAILD_PREFIX from wazuh_testing import LOG_FILE_PATH, ANALYSISD_STATE from wazuh_testing.tools.monitoring import FileMonitor, generate_monitoring_callback_groups @@ -28,8 +28,7 @@ def make_analysisd_callback(pattern, prefix=ANALYSISD_PREFIX): def check_analysisd_event(file_monitor=None, callback='', error_message=None, update_position=True, - timeout=eps.T_60, prefix=ANALYSISD_PREFIX, accum_results=1, - file_to_monitor=LOG_FILE_PATH): + timeout=T_60, prefix=ANALYSISD_PREFIX, accum_results=1, file_to_monitor=LOG_FILE_PATH): """Check if a analysisd event occurs Args: @@ -51,18 +50,18 @@ def check_analysisd_event(file_monitor=None, callback='', error_message=None, up def check_eps_disabled(): """Check if the eps module is disabled""" - check_analysisd_event(callback=fr'.*INFO: EPS limit disabled.*', timeout=eps.T_10) + check_analysisd_event(callback=fr'.*INFO: EPS limit disabled.*', timeout=T_10) def check_eps_enabled(maximum, timeframe): """Check if the eps module is enable""" check_analysisd_event(callback=fr".*INFO: EPS limit enabled, EPS: '{maximum}', timeframe: '{timeframe}'", - timeout=eps.T_10) + timeout=T_10) def check_configuration_error(): """Check the configuration error event in ossec.log""" - check_analysisd_event(timeout=eps.T_10, callback=r".* \(\d+\): Configuration error at.*", + check_analysisd_event(timeout=T_10, callback=r".* \(\d+\): Configuration error at.*", error_message="Could not find the event 'Configuration error at 'etc/ossec.conf' " 'in ossec.log', prefix=MAILD_PREFIX) @@ -97,7 +96,7 @@ def get_messages_info(file_monitor, message, accum_results): """ error_message = f"Could not find this event in {message}" - result = file_monitor.start(timeout=eps.T_20, update_position=True, accum_results=accum_results, + result = file_monitor.start(timeout=T_20, update_position=True, accum_results=accum_results, callback=generate_monitoring_callback_groups(message), error_message=error_message).result() diff --git a/deps/wazuh_testing/wazuh_testing/modules/eps/__init__.py b/deps/wazuh_testing/wazuh_testing/modules/eps/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/integration/test_analysisd/test_eps/test_default_values.py b/tests/integration/test_analysisd/test_eps/test_default_values.py index 4e4ba0d43a..0a064f1138 100644 --- a/tests/integration/test_analysisd/test_eps/test_default_values.py +++ b/tests/integration/test_analysisd/test_eps/test_default_values.py @@ -2,7 +2,7 @@ import pytest from wazuh_testing.tools.configuration import load_configuration_template, get_test_cases_data -from wazuh_testing.modules.eps import event_monitor as evm +from wazuh_testing.modules.analysisd import event_monitor as evm from wazuh_testing.modules.analysisd import ANALYSISD_STATE_INTERNAL_DEFAULT from wazuh_testing.processes import check_if_daemons_are_running diff --git a/tests/integration/test_analysisd/test_eps/test_disabled.py b/tests/integration/test_analysisd/test_eps/test_disabled.py index 1071ea3983..2e96b5861e 100644 --- a/tests/integration/test_analysisd/test_eps/test_disabled.py +++ b/tests/integration/test_analysisd/test_eps/test_disabled.py @@ -2,7 +2,7 @@ import pytest from wazuh_testing.tools.configuration import load_configuration_template, get_test_cases_data -from wazuh_testing.modules.eps import event_monitor as evm +from wazuh_testing.modules.analysisd import event_monitor as evm from wazuh_testing.modules.analysisd import ANALYSISD_STATE_INTERNAL_DEFAULT from wazuh_testing.processes import check_if_daemons_are_running diff --git a/tests/integration/test_analysisd/test_eps/test_enabled.py b/tests/integration/test_analysisd/test_eps/test_enabled.py index da827b6f16..4a9aa54a73 100644 --- a/tests/integration/test_analysisd/test_eps/test_enabled.py +++ b/tests/integration/test_analysisd/test_eps/test_enabled.py @@ -2,7 +2,7 @@ import pytest from wazuh_testing.tools.configuration import load_configuration_template, get_test_cases_data -from wazuh_testing.modules.eps import event_monitor as evm +from wazuh_testing.modules.analysisd import event_monitor as evm from wazuh_testing.modules.analysisd import ANALYSISD_STATE_INTERNAL_DEFAULT from wazuh_testing.processes import check_if_daemons_are_running diff --git a/tests/integration/test_analysisd/test_eps/test_invalid_configuration.py b/tests/integration/test_analysisd/test_eps/test_invalid_configuration.py index 8ffe011942..a6cdd456c3 100644 --- a/tests/integration/test_analysisd/test_eps/test_invalid_configuration.py +++ b/tests/integration/test_analysisd/test_eps/test_invalid_configuration.py @@ -2,7 +2,7 @@ import pytest from wazuh_testing.tools.configuration import load_configuration_template, get_test_cases_data -from wazuh_testing.modules.eps import event_monitor as evm +from wazuh_testing.modules.analysisd import event_monitor as evm from wazuh_testing.tools.services import control_service from wazuh_testing.modules.analysisd import ANALYSISD_STATE_INTERNAL_DEFAULT from wazuh_testing.processes import check_if_daemons_are_running diff --git a/tests/integration/test_analysisd/test_eps/test_invalid_values.py b/tests/integration/test_analysisd/test_eps/test_invalid_values.py index 2d22e00a90..8b6c607dbe 100644 --- a/tests/integration/test_analysisd/test_eps/test_invalid_values.py +++ b/tests/integration/test_analysisd/test_eps/test_invalid_values.py @@ -2,7 +2,7 @@ import pytest from wazuh_testing.tools.configuration import load_configuration_template, get_test_cases_data -from wazuh_testing.modules.eps import event_monitor as evm +from wazuh_testing.modules.analysisd import event_monitor as evm from wazuh_testing.tools.services import control_service from wazuh_testing.modules.analysisd import ANALYSISD_STATE_INTERNAL_DEFAULT from wazuh_testing.processes import check_if_daemons_are_running diff --git a/tests/integration/test_analysisd/test_eps/test_no_eps_configuration.py b/tests/integration/test_analysisd/test_eps/test_no_eps_configuration.py index 59a1bccba9..24482546f4 100644 --- a/tests/integration/test_analysisd/test_eps/test_no_eps_configuration.py +++ b/tests/integration/test_analysisd/test_eps/test_no_eps_configuration.py @@ -3,7 +3,7 @@ import pytest from wazuh_testing.tools.configuration import get_simulate_agent_configuration -from wazuh_testing.modules.eps import event_monitor as evm +from wazuh_testing.modules.analysisd import event_monitor as evm from wazuh_testing.modules.analysisd import ANALYSISD_STATE_INTERNAL_DEFAULT, PERCENTAGE_PROCESS_MSGS diff --git a/tests/integration/test_analysisd/test_eps/test_process_old_events_instead_new_events.py b/tests/integration/test_analysisd/test_eps/test_process_old_events_instead_new_events.py index fd5afe803d..1c630498ec 100644 --- a/tests/integration/test_analysisd/test_eps/test_process_old_events_instead_new_events.py +++ b/tests/integration/test_analysisd/test_eps/test_process_old_events_instead_new_events.py @@ -5,7 +5,7 @@ from wazuh_testing.tools.configuration import load_configuration_template, get_test_cases_data, \ get_syslog_simulator_configuration -from wazuh_testing.modules.eps import event_monitor as evm +from wazuh_testing.modules.analysisd import event_monitor as evm from wazuh_testing.tools.monitoring import FileMonitor from wazuh_testing.tools.run_simulator import syslog_simulator from wazuh_testing.tools import ALERT_FILE_PATH diff --git a/tests/integration/test_analysisd/test_eps/test_start_dropping_events_when_queue_full.py b/tests/integration/test_analysisd/test_eps/test_start_dropping_events_when_queue_full.py index 68b83c8d78..56b014a0db 100644 --- a/tests/integration/test_analysisd/test_eps/test_start_dropping_events_when_queue_full.py +++ b/tests/integration/test_analysisd/test_eps/test_start_dropping_events_when_queue_full.py @@ -4,7 +4,7 @@ from wazuh_testing.tools.configuration import load_configuration_template, get_test_cases_data, \ get_simulate_agent_configuration -from wazuh_testing.modules.eps import event_monitor as evm +from wazuh_testing.modules.analysisd import event_monitor as evm from wazuh_testing.modules.analysisd import PERCENTAGE_PROCESS_MSGS, QUEUE_SIZE diff --git a/tests/integration/test_analysisd/test_eps/test_start_queuing_events_when_limit_reached.py b/tests/integration/test_analysisd/test_eps/test_start_queuing_events_when_limit_reached.py index e32950c619..a15ac39a66 100644 --- a/tests/integration/test_analysisd/test_eps/test_start_queuing_events_when_limit_reached.py +++ b/tests/integration/test_analysisd/test_eps/test_start_queuing_events_when_limit_reached.py @@ -4,7 +4,7 @@ from wazuh_testing.tools.configuration import load_configuration_template, get_test_cases_data, \ get_simulate_agent_configuration -from wazuh_testing.modules.eps import event_monitor as evm +from wazuh_testing.modules.analysisd import event_monitor as evm from wazuh_testing.modules.analysisd import PERCENTAGE_PROCESS_MSGS, QUEUE_SIZE diff --git a/tests/integration/test_analysisd/test_eps/test_stop_processing_events.py b/tests/integration/test_analysisd/test_eps/test_stop_processing_events.py index 82f41e126d..e6285aa020 100644 --- a/tests/integration/test_analysisd/test_eps/test_stop_processing_events.py +++ b/tests/integration/test_analysisd/test_eps/test_stop_processing_events.py @@ -4,7 +4,7 @@ from wazuh_testing.tools.configuration import load_configuration_template, get_test_cases_data, \ get_simulate_agent_configuration -from wazuh_testing.modules.eps import event_monitor as evm +from wazuh_testing.modules.analysisd import event_monitor as evm from wazuh_testing.modules.analysisd import PERCENTAGE_PROCESS_MSGS