Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new analysisd test suite: test_limit_eps #3413

Merged
merged 81 commits into from
Oct 5, 2022
Merged

Add new analysisd test suite: test_limit_eps #3413

merged 81 commits into from
Oct 5, 2022

Conversation

jmv74211
Copy link
Contributor

@jmv74211 jmv74211 commented Oct 4, 2022

Related issue
#2947

Description

This PR adds a new testing suite for analysisd that verifies the correct functioning of the new feature introduced in 4.4, the limitation of event analysis per second.

The added modules and tests are mentioned below:

  • test_basic.py

    • test_enabled: Prueba que el módulo se activa en los casos esperados
    • test_disabled: Prueba que el módulo no se activa en los casos esperados
  • test_configuration.py:

    • test_accepted_values: Check that the EPS limitation is activated under accepted parameters.
    • test_invalid_values: Check for configuration error and wazuh-analysisd if the EPS limiting configuration has unaccepted values. Done for the following cases:
      • Maximum value above the allowed value.
      • Timeframe value above the allowed value.
      • Timeframe = 0
      • Maximum, timeframe = 0
    • test_missing_configuration: Check what happens if tags are missing in the event analysis limitation settings. Done for the following cases:
      • Missing <timeframe>.
      • Missing <maximum>.
      • Missing <timeframe> and <maximum>.
  • test_event_processing.py:

    • test_limitation: Check if after passing the event processing limit, the processing is stopped until the next timeframe.
    • test_queueing_events_after_limitation: Check if after stopping processing events (due to limit reached), the received events are stored in the events queue if it is not full.
    • test_dropping_events_when_queue_is_full: Check that after the event analysis block, if the events queue is full, the events are dropped.
    • test_event_processing_in_order_single_thread: Check that events are processed in order according to the position within the queue, and that events that are being received during the blocking phase are being added to the end of the queue when using single-thread processing.
    • test_event_processing_in_order_multi_thread: Check that events are processed in order according to the position within the queue, and that events that are being received during the blocking phase are being added to the end of the queue when using multi-thread processing.

Testing performed

Tester Test path Jenkins Local OS Commit Notes
@user (Developer) test_analysisd/test_limit_eps 🟢🟢🟢🟢🟢 🟢🟢🟢 CentOS 7 e9c49fc Nothing to highlight

@jmv74211 jmv74211 requested a review from Rebits October 4, 2022 12:30
@jmv74211 jmv74211 self-assigned this Oct 4, 2022
@jmv74211 jmv74211 marked this pull request as draft October 4, 2022 14:14
@jmv74211 jmv74211 marked this pull request as ready for review October 4, 2022 15:49
@Rebits Rebits merged commit a0a43c6 into 4.4 Oct 5, 2022
@Rebits Rebits deleted the 2947-test-eps branch October 5, 2022 08:06
@jmv74211 jmv74211 restored the 2947-test-eps branch October 5, 2022 08:23
@davidjiglesias davidjiglesias deleted the 2947-test-eps branch September 8, 2023 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants