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 #3419

Merged
merged 2 commits into from
Oct 19, 2022

Conversation

jmv74211
Copy link
Contributor

@jmv74211 jmv74211 commented Oct 5, 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

Copy link
Member

@Rebits Rebits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Rebits Rebits merged commit 94cc6af into 4.4 Oct 19, 2022
@Rebits Rebits deleted the revert-3418-revert-3413-2947-test-eps branch October 19, 2022 10:55
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.

2 participants