diff --git a/deps/wazuh_testing/wazuh_testing/modules/eps/event_monitor.py b/deps/wazuh_testing/wazuh_testing/modules/eps/event_monitor.py index 190f606e48..8a7a43a6af 100644 --- a/deps/wazuh_testing/wazuh_testing/modules/eps/event_monitor.py +++ b/deps/wazuh_testing/wazuh_testing/modules/eps/event_monitor.py @@ -54,9 +54,9 @@ def check_eps_disabled(): check_analysisd_event(callback=fr'.*INFO: EPS limit disabled.*', timeout=eps.T_10) -def check_eps_enabled(maximun, timeframe): +def check_eps_enabled(maximum, timeframe): """Check if the eps module is enable""" - check_analysisd_event(callback=fr".*INFO: EPS limit enabled, EPS: '{maximun}', timeframe: '{timeframe}'", + check_analysisd_event(callback=fr".*INFO: EPS limit enabled, EPS: '{maximum}', timeframe: '{timeframe}'", timeout=eps.T_10) diff --git a/deps/wazuh_testing/wazuh_testing/scripts/simulate_agents.py b/deps/wazuh_testing/wazuh_testing/scripts/simulate_agents.py index 2f06ae8d72..d7aee4f7f2 100644 --- a/deps/wazuh_testing/wazuh_testing/scripts/simulate_agents.py +++ b/deps/wazuh_testing/wazuh_testing/scripts/simulate_agents.py @@ -41,13 +41,13 @@ def process_script_parameters(args): args (argparse.Namespace): Script args. """ # Add keepalive and receive_message modules if they are not specified in script parameters - if None == args.disable_keepalive: + if args.disable_keepalive is None: if 'keepalive' not in args.modules: args.modules.append('keepalive') args.modules_eps.append('0') - if None == args.disable_receive: + if args.disable_receive is None: if 'receive_messages' not in args.modules: args.modules.append('receive_messages') args.modules_eps.append('0') @@ -139,7 +139,7 @@ def create_injectors(agents, manager_address, protocol, limit_msg): agents (list): List of agents to create the injectors (1 injector/agent). manager_address (str): Manager IP address to connect the agents. protocol (str): TCP or UDP protocol to connect the agents to the manager. - limit_msg (int): Maximun amount of message to be sent. + limit_msg (int): Maximum amount of message to be sent. Returns: list: List of injector objects. @@ -164,10 +164,10 @@ def start(injector, time_alive, flag_disable_keepalive): """ try: injector.run() - if not flag_disable_keepalive: - sleep(time_alive) - else: + if flag_disable_keepalive: injector.wait() + else: + sleep(time_alive) finally: stop(injector) diff --git a/deps/wazuh_testing/wazuh_testing/tools/agent_simulator.py b/deps/wazuh_testing/wazuh_testing/tools/agent_simulator.py index ad2b7fb9b7..2c0e3797a2 100644 --- a/deps/wazuh_testing/wazuh_testing/tools/agent_simulator.py +++ b/deps/wazuh_testing/wazuh_testing/tools/agent_simulator.py @@ -1545,7 +1545,7 @@ class Injector: thread_number (int): total number of threads created. This may change depending on the modules used in the agent. threads (list): list containing all the threads created. - limit_msg (int): Maximun amount of message to be sent. + limit_msg (int): Maximum amount of message to be sent. Examples: To create an Injector, you need to create an agent, a sender and then, create the injector using both of them. @@ -1601,7 +1601,7 @@ class InjectorThread(threading.Thread): agent (Agent): agent owner of the injector and the sender. module (str): module used to send events (fim, syscollector, etc). stop_thread (int): 0 if the thread is running, 1 if it is stopped. - limit_msg (int): Maximun amount of message to be sent. + limit_msg (int): Maximum amount of message to be sent. """ def __init__(self, thread_id, name, sender, agent, module, limit_msg): super(InjectorThread, self).__init__() diff --git a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_disabled.yaml b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_disabled.yaml index 3a2efc06f5..2e4d7c48db 100644 --- a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_disabled.yaml +++ b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_disabled.yaml @@ -6,7 +6,7 @@ - eps: elements: - maximum: - value: MAXIMUN + value: MAXIMUM - timeframe: value: TIMEFRAME diff --git a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_enabled.yaml b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_enabled.yaml index 3a2efc06f5..2e4d7c48db 100644 --- a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_enabled.yaml +++ b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_enabled.yaml @@ -6,7 +6,7 @@ - eps: elements: - maximum: - value: MAXIMUN + value: MAXIMUM - timeframe: value: TIMEFRAME diff --git a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_invalid_values.yaml b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_invalid_values.yaml index 3a2efc06f5..2e4d7c48db 100644 --- a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_invalid_values.yaml +++ b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_invalid_values.yaml @@ -6,7 +6,7 @@ - eps: elements: - maximum: - value: MAXIMUN + value: MAXIMUM - timeframe: value: TIMEFRAME diff --git a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_process_old_events_instead_new_events.yaml b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_process_old_events_instead_new_events.yaml index 3a2efc06f5..2e4d7c48db 100644 --- a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_process_old_events_instead_new_events.yaml +++ b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_process_old_events_instead_new_events.yaml @@ -6,7 +6,7 @@ - eps: elements: - maximum: - value: MAXIMUN + value: MAXIMUM - timeframe: value: TIMEFRAME diff --git a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_start_dropping_events_when_queue_full.yaml b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_start_dropping_events_when_queue_full.yaml index 3a2efc06f5..2e4d7c48db 100644 --- a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_start_dropping_events_when_queue_full.yaml +++ b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_start_dropping_events_when_queue_full.yaml @@ -6,7 +6,7 @@ - eps: elements: - maximum: - value: MAXIMUN + value: MAXIMUM - timeframe: value: TIMEFRAME diff --git a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_start_queuing_events_when_limit_reached.yaml b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_start_queuing_events_when_limit_reached.yaml index 3a2efc06f5..2e4d7c48db 100644 --- a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_start_queuing_events_when_limit_reached.yaml +++ b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_start_queuing_events_when_limit_reached.yaml @@ -6,7 +6,7 @@ - eps: elements: - maximum: - value: MAXIMUN + value: MAXIMUM - timeframe: value: TIMEFRAME diff --git a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_stop_processing_events.yaml b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_stop_processing_events.yaml index 3a2efc06f5..2e4d7c48db 100644 --- a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_stop_processing_events.yaml +++ b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_stop_processing_events.yaml @@ -6,7 +6,7 @@ - eps: elements: - maximum: - value: MAXIMUN + value: MAXIMUM - timeframe: value: TIMEFRAME diff --git a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_maximun.yaml b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_maximum.yaml similarity index 100% rename from tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_maximun.yaml rename to tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_maximum.yaml diff --git a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_timeframe.yaml b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_timeframe.yaml index 34664d09b7..4e7d122b45 100644 --- a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_timeframe.yaml +++ b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_timeframe.yaml @@ -6,7 +6,7 @@ - eps: elements: - maximum: - value: MAXIMUN + value: MAXIMUM - section: remote elements: diff --git a/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_timeframe_maximun.yaml b/tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_timeframe_maximum.yaml similarity index 100% rename from tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_timeframe_maximun.yaml rename to tests/integration/test_analysisd/test_eps/data/configuration_template/configuration_without_timeframe_maximum.yaml diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_disabled.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_disabled.yaml index fb74cd4c3d..60d51ee746 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_disabled.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_disabled.yaml @@ -1,8 +1,8 @@ - name: 'EPS Limits disabled' description: 'EPS Limits disabled' configuration_parameters: - MAXIMUN: '0' + MAXIMUM: '0' TIMEFRAME: '5' metadata: - maximun: 0 + maximum: 0 timeframe: 5 diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_enabled.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_enabled.yaml index 431925290b..c82c4e05cf 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_enabled.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_enabled.yaml @@ -1,8 +1,8 @@ - name: 'EPS Limits enabled' description: 'EPS Limits enabled' configuration_parameters: - MAXIMUN: '10' + MAXIMUM: '10' TIMEFRAME: '5' metadata: - maximun: 10 + maximum: 10 timeframe: 5 diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_invalid_values.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_invalid_values.yaml index 53d0df843a..879a05264e 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_invalid_values.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_invalid_values.yaml @@ -1,35 +1,35 @@ -- name: 'EPS Limits with maximun values over the maximun allowed' - description: 'EPS Limits with maximun values over the maximun allowed' +- name: 'EPS Limits with maximum values over the maximum allowed' + description: 'EPS Limits with maximum values over the maximum allowed' configuration_parameters: - MAXIMUN: '100001' + MAXIMUM: '100001' TIMEFRAME: '5' metadata: - maximun: 100001 + maximum: 100001 timeframe: 5 - name: 'EPS Limits with timeframe values over the timeframe allowed' description: 'EPS Limits with timeframe values over the timeframe allowed' configuration_parameters: - MAXIMUN: '10' + MAXIMUM: '10' TIMEFRAME: '3601' metadata: - maximun: 10 + maximum: 10 timeframe: 3601 - name: 'EPS Limits with timeframe value 0' description: 'EPS Limits with timeframe value 0' configuration_parameters: - MAXIMUN: '10' + MAXIMUM: '10' TIMEFRAME: '0' metadata: - maximun: 10 + maximum: 10 timeframe: 0 -- name: 'EPS Limits with maximun and timeframe values 0' - description: 'EPS Limits with maximun and timeframe values 0' +- name: 'EPS Limits with maximum and timeframe values 0' + description: 'EPS Limits with maximum and timeframe values 0' configuration_parameters: - MAXIMUN: '0' + MAXIMUM: '0' TIMEFRAME: '0' metadata: - maximun: 0 + maximum: 0 timeframe: 0 diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_no_eps_configuration.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_no_eps_configuration.yaml index 58af1f1f3c..3894a9b309 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_no_eps_configuration.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_no_eps_configuration.yaml @@ -1,8 +1,8 @@ - name: 'EPS Limits disables' description: 'EPS Limits disables' configuration_parameters: - MAXIMUN: '0' + MAXIMUM: '0' TIMEFRAME: '5' metadata: - maximun: 0 + maximum: 0 timeframe: 5 diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_process_old_events_multi_thread.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_process_old_events_multi_thread.yaml index 6eaac1df8a..3b759629b3 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_process_old_events_multi_thread.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_process_old_events_multi_thread.yaml @@ -1,8 +1,8 @@ - name: 'EPS Limits process old events instead of new ones - Multithread' description: 'EPS Limits process old events instead of new ones - Multithread' configuration_parameters: - MAXIMUN: '10' + MAXIMUM: '10' TIMEFRAME: '5' metadata: - maximun: 10 + maximum: 10 timeframe: 5 diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_process_old_events_one_thread.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_process_old_events_one_thread.yaml index f019ae79b7..5ac863a975 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_process_old_events_one_thread.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_process_old_events_one_thread.yaml @@ -1,8 +1,8 @@ - name: 'EPS Limits process old events instead of new ones - One thread' description: 'EPS Limits process old events instead of new ones - One thread' configuration_parameters: - MAXIMUN: '100' + MAXIMUM: '100' TIMEFRAME: '5' metadata: - maximun: 100 + maximum: 100 timeframe: 5 diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_start_dropping_events.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_start_dropping_events.yaml index b0c5c2e8ff..d00da949c3 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_start_dropping_events.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_start_dropping_events.yaml @@ -1,8 +1,8 @@ - name: 'EPS Limits start dropping events' description: 'EPS Limits start dropping events' configuration_parameters: - MAXIMUN: '1' + MAXIMUM: '1' TIMEFRAME: '5' metadata: - maximun: 1 + maximum: 1 timeframe: 5 diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_start_queueing_events.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_start_queueing_events.yaml index 479e83d025..f2873d7292 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_start_queueing_events.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_start_queueing_events.yaml @@ -1,8 +1,8 @@ - name: 'EPS Limits start queueing events' description: 'EPS Limits start queueing events' configuration_parameters: - MAXIMUN: '100' + MAXIMUM: '100' TIMEFRAME: '5' metadata: - maximun: 100 + maximum: 100 timeframe: 5 diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_stop_process_events.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_stop_process_events.yaml index aa82ebfa68..d0f59dffec 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_stop_process_events.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_stop_process_events.yaml @@ -1,8 +1,8 @@ - name: 'EPS Limits stop processing events' description: 'EPS Limits stop processing events' configuration_parameters: - MAXIMUN: '100' + MAXIMUM: '100' TIMEFRAME: '5' metadata: - maximun: 100 + maximum: 100 timeframe: 5 diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_maximun.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_maximun.yaml index 02f401a024..c06afd775a 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_maximun.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_maximun.yaml @@ -1,5 +1,5 @@ -- name: 'EPS Limits without maximun value' - description: 'EPS Limits without maximun value' +- name: 'EPS Limits without maximum value' + description: 'EPS Limits without maximum value' configuration_parameters: TIMEFRAME: '5' metadata: diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_timeframe.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_timeframe.yaml index 04923c0ed0..1f3c895eb2 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_timeframe.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_timeframe.yaml @@ -1,6 +1,6 @@ - name: 'EPS Limits without timeframe value' description: 'EPS Limits without timeframe value' configuration_parameters: - MAXIMUN: '500' + MAXIMUM: '500' metadata: - maximun: 500 + maximum: 500 diff --git a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_timeframe_maximun.yaml b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_timeframe_maximun.yaml index 04923c0ed0..1f3c895eb2 100644 --- a/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_timeframe_maximun.yaml +++ b/tests/integration/test_analysisd/test_eps/data/test_cases/cases_without_timeframe_maximun.yaml @@ -1,6 +1,6 @@ - name: 'EPS Limits without timeframe value' description: 'EPS Limits without timeframe value' configuration_parameters: - MAXIMUN: '500' + MAXIMUM: '500' metadata: - maximun: 500 + maximum: 500 diff --git a/tests/integration/test_analysisd/test_eps/test_enabled.py b/tests/integration/test_analysisd/test_eps/test_enabled.py index d93d742aff..219c698ff1 100644 --- a/tests/integration/test_analysisd/test_eps/test_enabled.py +++ b/tests/integration/test_analysisd/test_eps/test_enabled.py @@ -63,13 +63,13 @@ def test_enabled(configuration, metadata, set_wazuh_configuration_eps, - Verify that when the `maximum` value is set to a values greater than 0 and lower than 100000 and, `timeframe` value is set to a value greater than 0 and lower than 3600, the module EPS limits is running. - Verify that the wazuh-analysisd daemon is running. - + input_description: - The `cases_enabled.yaml` file provides the module configuration for this test. expected_output: - r'(.*)wazuh-analysisd: INFO: EPS limit enabled, EPS: (.*), timeframe: (.*)' ''' - evm.check_eps_enabled(metadata['maximun'], metadata['timeframe']) + evm.check_eps_enabled(metadata['maximum'], metadata['timeframe']) # Check that wazuh-analysisd is running check_if_deamon_is_running('wazuh-analysisd') 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 40c306ffac..1bd508b97f 100644 --- a/tests/integration/test_analysisd/test_eps/test_invalid_configuration.py +++ b/tests/integration/test_analysisd/test_eps/test_invalid_configuration.py @@ -16,16 +16,16 @@ TEST_CASES_PATH = os.path.join(TEST_DATA_PATH, 'test_cases') # Configuration and cases data -t1_configurations_path = os.path.join(CONFIGURATIONS_PATH, 'configuration_without_maximun.yaml') -t1_cases_path = os.path.join(TEST_CASES_PATH, 'cases_without_maximun.yaml') +t1_configurations_path = os.path.join(CONFIGURATIONS_PATH, 'configuration_without_maximum.yaml') +t1_cases_path = os.path.join(TEST_CASES_PATH, 'cases_without_maximum.yaml') t2_configurations_path = os.path.join(CONFIGURATIONS_PATH, 'configuration_without_timeframe.yaml') t2_cases_path = os.path.join(TEST_CASES_PATH, 'cases_without_timeframe.yaml') -t3_configurations_path = os.path.join(CONFIGURATIONS_PATH, 'configuration_without_timeframe_maximun.yaml') -t3_cases_path = os.path.join(TEST_CASES_PATH, 'cases_without_timeframe_maximun.yaml') +t3_configurations_path = os.path.join(CONFIGURATIONS_PATH, 'configuration_without_timeframe_maximum.yaml') +t3_cases_path = os.path.join(TEST_CASES_PATH, 'cases_without_timeframe_maximum.yaml') -# Test configurations without maximun value (t1) +# Test configurations without maximum value (t1) t1_configuration_parameters, t1_configuration_metadata, t1_case_ids = get_test_cases_data(t1_cases_path) t1_configurations = load_configuration_template(t1_configurations_path, t1_configuration_parameters, t1_configuration_metadata) @@ -35,7 +35,7 @@ t2_configurations = load_configuration_template(t2_configurations_path, t2_configuration_parameters, t2_configuration_metadata) -# Test configurations without timeframe and maximun values (t3) +# Test configurations without timeframe and maximum values (t3) t3_configuration_parameters, t3_configuration_metadata, t3_case_ids = get_test_cases_data(t3_cases_path) t3_configurations = load_configuration_template(t3_configurations_path, t3_configuration_parameters, t3_configuration_metadata) @@ -43,7 +43,7 @@ @pytest.mark.parametrize('configuration, metadata', zip(t1_configurations, t1_configuration_metadata), ids=t1_case_ids) @pytest.mark.parametrize('configure_local_internal_options_eps', [ANALYSISD_STATE_INTERNAL_DEFAULT], indirect=True) -def test_without_maximun(configuration, metadata, set_wazuh_configuration_eps, +def test_without_maximum(configuration, metadata, set_wazuh_configuration_eps, truncate_monitored_files, restart_wazuh_daemon_after_finishing): ''' description: Check that wazuh manager is not started when `maximum` value is not present in the @@ -149,7 +149,7 @@ def test_without_timeframe(configuration, metadata, set_wazuh_configuration_eps, @pytest.mark.parametrize('configuration, metadata', zip(t3_configurations, t3_configuration_metadata), ids=t3_case_ids) @pytest.mark.parametrize('configure_local_internal_options_eps', [ANALYSISD_STATE_INTERNAL_DEFAULT], indirect=True) -def test_without_timeframe_maximun(configuration, metadata, set_wazuh_configuration_eps, +def test_without_timeframe_maximum(configuration, metadata, set_wazuh_configuration_eps, truncate_monitored_files, restart_wazuh_daemon_after_finishing): ''' description: Check that wazuh manager is not started when `maximum` and/or `timeframe` are not present in the 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 245df33ddd..26a9fa424a 100644 --- a/tests/integration/test_analysisd/test_eps/test_invalid_values.py +++ b/tests/integration/test_analysisd/test_eps/test_invalid_values.py @@ -29,7 +29,7 @@ @pytest.mark.parametrize('configuration, metadata', zip(t1_configurations, t1_configuration_metadata), ids=t1_case_ids) @pytest.mark.parametrize('configure_local_internal_options_eps', [ANALYSISD_STATE_INTERNAL_DEFAULT], indirect=True) def test_invalid_values(configuration, metadata, set_wazuh_configuration_eps, - truncate_monitored_files, restart_wazuh_daemon_after_finishing): + truncate_monitored_files, restart_wazuh_daemon_after_finishing): ''' description: Check that wazuh manager is not started when an invalid value is set to `maximum` and/or `timeframe`. 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 02990fbe4e..e4a8b6378c 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 @@ -35,7 +35,7 @@ @pytest.mark.parametrize('configuration, metadata', zip(t1_configurations, t1_configuration_metadata), ids=t1_case_ids) @pytest.mark.parametrize('configure_local_internal_options_eps', [ANALYSISD_STATE_INTERNAL_DEFAULT], indirect=True) def test_disabled(configuration, metadata, set_wazuh_configuration_eps, - truncate_monitored_files, restart_wazuh_daemon_function): + truncate_monitored_files, restart_wazuh_daemon_function): ''' description: Check that limits EPS is disabled when it is not configured. 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 46aab15107..3cb2dc34bf 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 @@ -40,13 +40,14 @@ # Get simulate agent configurations (t2) params_process_old_events_multithread = get_simulate_agent_configuration(configurations_simulate_agent_path) -maximun_eps_t2 = [metadata['maximun'] for metadata in t2_configuration_metadata] +maximum_eps_t2 = [metadata['maximum'] for metadata in t2_configuration_metadata] timeframe_eps_t2 = [metadata['timeframe'] for metadata in t2_configuration_metadata] # It is sent `width_frame` time frame width to reduce test time execution frame_width = 3 -total_msg = maximun_eps_t2[0] * timeframe_eps_t2[0] * frame_width +total_msg = maximum_eps_t2[0] * timeframe_eps_t2[0] * frame_width params_process_old_events_multithread.update({'total_msg': total_msg}) + @pytest.mark.parametrize('configuration, metadata', zip(t1_configurations, t1_configuration_metadata), ids=t1_case_ids) @pytest.mark.parametrize('configure_local_internal_options_eps', [timeframe_eps_t1], indirect=True) @pytest.mark.parametrize('simulate_agent', [params_process_old_events_one_thread], indirect=True) @@ -138,12 +139,12 @@ def test_process_old_events_one_thread(configuration, metadata, set_wazuh_config @pytest.mark.parametrize('configure_local_internal_options_eps', [timeframe_eps_t2], indirect=True) @pytest.mark.parametrize('simulate_agent', [params_process_old_events_multithread], indirect=True) def test_process_old_events_multi_thread(configuration, metadata, set_wazuh_configuration_eps, - truncate_monitored_files, delete_alerts_folder, - restart_wazuh_daemon_function, simulate_agent): + truncate_monitored_files, delete_alerts_folder, + restart_wazuh_daemon_function, simulate_agent): ''' description: Check that `wazuh-analysisd` processes queued events first instead of new events when the moving average frees up some space. To do this, read the alerts.log file and find the numerated alerts - messages with the FileMonitor tool. To do so, it iterates the `n` frames of `maximun` * `timeframe` and + messages with the FileMonitor tool. To do so, it iterates the `n` frames of `maximum` * `timeframe` and checks if the message number belongs to the respective frame. test_phases: @@ -195,7 +196,7 @@ def test_process_old_events_multi_thread(configuration, metadata, set_wazuh_conf sleep(metadata['timeframe'] / 2) events_received = evm.get_analysisd_state('events_received') index = 0 - frame = metadata['timeframe'] * metadata['maximun'] + frame = metadata['timeframe'] * metadata['maximum'] # Iterate over each frame to find the respective numerated message belongs to the frame while (index + 1) * frame <= events_received: start_index = index * frame 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 bd5ea25e34..eb618d082a 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 @@ -79,7 +79,7 @@ def test_start_dropping_events_when_queue_full(configuration, metadata, set_wazu assertions: - The `events_processed` value in the `/var/ossec/var/run/wazuh-analysisd.state` file must be lower or equal - than `maximun` * `timeframe` and greater than a percentage of `maximun` * `timeframe` to confirm that + than `maximum` * `timeframe` and greater than a percentage of `maximum` * `timeframe` to confirm that `events_processed` is not null. The `events_received` value must be greater than `events_processed` and, the `events_dropped` value greater than 0 and finaly, `event_queue_usage` is equal to 1.0. @@ -94,9 +94,9 @@ def test_start_dropping_events_when_queue_full(configuration, metadata, set_wazu event_queue_usage = evm.get_analysisd_state('event_queue_usage') # Check that processed events reach the EPS limit - assert events_processed <= float(metadata['maximun'] * metadata['timeframe']) and \ - events_processed >= float(metadata['maximun'] * metadata['timeframe']) * PERCENTAGE_PROCESS_MSGS, \ - 'events_processed must be lower or equal to maximun * timeframe' + assert events_processed <= float(metadata['maximum'] * metadata['timeframe']) and \ + events_processed >= float(metadata['maximum'] * metadata['timeframe']) * PERCENTAGE_PROCESS_MSGS, \ + 'events_processed must be lower or equal to maximum * timeframe' # Check that events continue receiving although the EPS limit was reached assert events_received > events_processed, 'events_received must be bigger than events_processed' @@ -111,4 +111,4 @@ def test_start_dropping_events_when_queue_full(configuration, metadata, set_wazu # Check that events_dropped are in the range of events_received - events_processed assert events_processed <= events_received - events_dropped, 'events_processed must be lower than' \ - 'events_received - events_dropped' \ No newline at end of file + 'events_received - events_dropped' 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 9f784aced0..e82271a1a4 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 @@ -29,11 +29,11 @@ # Get simulate agent configurations (t1) params_start_queuing_events_when_limit_reached = get_simulate_agent_configuration(configurations_simulate_agent_path) -maximun_eps = [metadata['maximun'] for metadata in t1_configuration_metadata] +maximum_eps = [metadata['maximum'] for metadata in t1_configuration_metadata] timeframe_eps_t1 = [metadata['timeframe'] for metadata in t1_configuration_metadata] # It is sent `width_frame` time frame width to reduce test time execution width_frame = 3 -total_msg = maximun_eps[0] * timeframe_eps_t1[0] * width_frame +total_msg = maximum_eps[0] * timeframe_eps_t1[0] * width_frame if total_msg > QUEUE_SIZE: total_msg = QUEUE_SIZE - 1 params_start_queuing_events_when_limit_reached.update({'total_msg': total_msg}) @@ -43,11 +43,11 @@ @pytest.mark.parametrize('configure_local_internal_options_eps', [timeframe_eps_t1], indirect=True) @pytest.mark.parametrize('simulate_agent', [params_start_queuing_events_when_limit_reached], indirect=True) def test_start_queuing_events_when_limit_reached(configuration, metadata, set_wazuh_configuration_eps, - truncate_monitored_files, restart_wazuh_daemon_function, - simulate_agent): + truncate_monitored_files, restart_wazuh_daemon_function, + simulate_agent): ''' description: Check that the `events_processed` value in the `/var/ossec/var/run/wazuh-analysisd.state` file must - be lower or equal than `maximun` * `timeframe` and, the `events_received` value must be greater than + be lower or equal than `maximum` * `timeframe` and, the `events_received` value must be greater than `events_processed` and, the `events_dropped` value equal to 0 and finaly, `event_queue_usage` is lower than 1.0. @@ -83,7 +83,7 @@ def test_start_queuing_events_when_limit_reached(configuration, metadata, set_wa assertions: - The `events_processed` value in the `/var/ossec/var/run/wazuh-analysisd.state` file must be lower or equal - than `maximun` * `timeframe` and greater than a percentage of `maximun` * `timeframe` to confirm that + than `maximum` * `timeframe` and greater than a percentage of `maximum` * `timeframe` to confirm that `events_processed` is not null. The `events_received` value must be greater than `events_processed` and, the `events_dropped` value equal to 0 and finaly, `event_queue_usage` is lower than 1.0. @@ -98,9 +98,9 @@ def test_start_queuing_events_when_limit_reached(configuration, metadata, set_wa event_queue_usage = evm.get_analysisd_state('event_queue_usage') # Check that processed events reach the EPS limit - assert events_processed <= float(metadata['maximun'] * metadata['timeframe']) and \ - events_processed >= float(metadata['maximun'] * metadata['timeframe']) * PERCENTAGE_PROCESS_MSGS, \ - 'events_processed must be lower or equal to maximun * timeframe' + assert events_processed <= float(metadata['maximum'] * metadata['timeframe']) and \ + events_processed >= float(metadata['maximum'] * metadata['timeframe']) * PERCENTAGE_PROCESS_MSGS, \ + 'events_processed must be lower or equal to maximum * timeframe' # Check that events continue receiving although the EPS limit was reached assert events_received > events_processed, 'events_received must be bigger than events_processed' 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 85fe1d1722..97ff093bfe 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 @@ -29,9 +29,9 @@ # Get simulate agent configurations (t1) params_stop_processing_events = get_simulate_agent_configuration(configurations_simulate_agent_path) -maximun_eps = [metadata['maximun'] for metadata in t1_configuration_metadata] +maximum_eps = [metadata['maximum'] for metadata in t1_configuration_metadata] timeframe_eps_t1 = [metadata['timeframe'] for metadata in t1_configuration_metadata] -total_msg = maximun_eps[0] * timeframe_eps_t1[0] * 3 +total_msg = maximum_eps[0] * timeframe_eps_t1[0] * 3 if total_msg > QUEUE_SIZE: total_msg = QUEUE_SIZE - 1 params_stop_processing_events.update({'total_msg': total_msg}) @@ -44,7 +44,7 @@ def test_stops_processing_events(configuration, metadata, set_wazuh_configuratio restart_wazuh_daemon_function, simulate_agent): ''' description: Check that the `events_processed` value in the `/var/ossec/var/run/wazuh-analysisd.state` file must - be lower or equal than `maximun` * `timeframe` + be lower or equal than `maximum` * `timeframe` test_phases: - Set a custom Wazuh configuration. @@ -78,7 +78,7 @@ def test_stops_processing_events(configuration, metadata, set_wazuh_configuratio assertions: - The `events_processed` value in the `/var/ossec/var/run/wazuh-analysisd.state` file must be lower or equal - than `maximun` * `timeframe` and greater than a percentage of `maximun` * `timeframe` to confirm that + than `maximum` * `timeframe` and greater than a percentage of `maximum` * `timeframe` to confirm that `events_processed` is not null. input_description: @@ -89,6 +89,6 @@ def test_stops_processing_events(configuration, metadata, set_wazuh_configuratio events_processed = evm.get_analysisd_state('events_processed') # Check that processed events reach the EPS limit - assert events_processed <= float(metadata['maximun'] * metadata['timeframe']) and \ - events_processed >= float(metadata['maximun'] * metadata['timeframe']) * PERCENTAGE_PROCESS_MSGS, \ - 'events_processed must be lower or equal to maximun * timeframe' + assert events_processed <= float(metadata['maximum'] * metadata['timeframe']) and \ + events_processed >= float(metadata['maximum'] * metadata['timeframe']) * PERCENTAGE_PROCESS_MSGS, \ + 'events_processed must be lower or equal to maximum * timeframe' diff --git a/tests/reliability/agent_connection/test_keep_alive.py b/tests/reliability/agent_connection/test_keep_alive.py index 6dbc428cf0..bc67f668b1 100644 --- a/tests/reliability/agent_connection/test_keep_alive.py +++ b/tests/reliability/agent_connection/test_keep_alive.py @@ -73,7 +73,7 @@ def test_keep_alives(get_report): ''' description: Check if the communication between managers and agents works as expected. - This test ensures that ACK and keep alive does not overcome the specified maximum. The condition is checked using + This test ensures that ACK and keep alive does not overcome the specified maximum. The condition is checked using the agentd statistics data and the keep-alives received by the manager in the logs file. wazuh_min_version: 4.4.0 @@ -86,7 +86,7 @@ def test_keep_alives(get_report): assertions: - Verify agents maximum difference between ack and keepalive is less than specified maximum. - Verify that the max_difference between keeps alives of all the agents in the managers side is less that - the specified maximun. + the specified maximum. - Verify the number of keepalives of each agent is the expected. input_description: JSON environment reports