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 EPS limit test to Wazuh-QA repository #3181

Closed
wants to merge 79 commits into from
Closed

Conversation

fedepacher
Copy link
Contributor

@fedepacher fedepacher commented Aug 17, 2022

Related issue
#2947

Description

This PR aims to add a new test to the Wazuh QA repository of the new development of the core team. The EPS limits development reduces the load of events processes by creating a circular buffer.

Testing performed

The following results were obtained by running the test on the local machine.

=============================== test session starts ===============================
platform linux -- Python 3.10.4, pytest-7.1.2, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.10.4', 'Platform': 'Linux-5.15.0-1015-aws-x86_64-with-glibc2.35', 'Packages': {'pytest': '7.1.2', 'py': '1.10.0', 'pluggy': '1.0.0'}, 'Plugins': {'html': '3.1.1', 'testinfra': '5.0.0', 'metadata': '2.0.2'}}
rootdir: /home/qa/wazuh-qa/tests/integration, configfile: pytest.ini
plugins: html-3.1.1, testinfra-5.0.0, metadata-2.0.2
collected 16 items

tests/integration/test_analysisd/test_eps/test_disabled.py::test_disabled[5-EPS Limits disabled] PASSED [  6%]
tests/integration/test_analysisd/test_eps/test_enabled.py::test_enabled[5-EPS Limits enabled] PASSED [ 12%]
tests/integration/test_analysisd/test_eps/test_invalid_configuration.py::test_without_maximun[5-EPS Limits without maximun value] PASSED [ 18%]
tests/integration/test_analysisd/test_eps/test_invalid_configuration.py::test_without_timeframe[5-EPS Limits without timeframe value] PASSED [ 25%]
tests/integration/test_analysisd/test_eps/test_invalid_configuration.py::test_without_timeframe_maximun[5-EPS Limits without timeframe value] PASSED [ 31%]
tests/integration/test_analysisd/test_eps/test_invalid_values.py::test_invalid_values[5-EPS Limits with maximun values over the maximun allowed] PASSED [ 37%]
tests/integration/test_analysisd/test_eps/test_invalid_values.py::test_invalid_values[5-EPS Limits with timeframe values over the timeframe allowed] PASSED [ 43%]
tests/integration/test_analysisd/test_eps/test_invalid_values.py::test_invalid_values[5-EPS Limits with timeframe value 0] PASSED [ 50%]
tests/integration/test_analysisd/test_eps/test_invalid_values.py::test_invalid_values[5-EPS Limits with maximun and timeframe values 0] PASSED [ 56%]
tests/integration/test_analysisd/test_eps/test_no_eps_configuration.py::test_disabled[5-EPS Limits disables] PASSED [ 62%]
tests/integration/test_analysisd/test_eps/test_no_eps_configuration.py::test_without_eps_setting[simulate_agent0-configure_local_internal_options_eps0-EPS Limits disables] PASSED [ 68%]
tests/integration/test_analysisd/test_eps/test_process_old_events_instead_new_events.py::test_process_old_events_one_thread[simulate_agent0-configure_local_internal_options_eps0-EPS Limits process old events instead of new ones - One thread] PASSED [ 75%]
tests/integration/test_analysisd/test_eps/test_process_old_events_instead_new_events.py::test_process_old_events_multi_thread[simulate_agent0-configure_local_internal_options_eps0-EPS Limits process old events instead of new ones - Multithread] PASSED [ 81%]
tests/integration/test_analysisd/test_eps/test_start_dropping_events_when_queue_full.py::test_start_dropping_events_when_queue_full[simulate_agent0-configure_local_internal_options_eps0-EPS Limits start dropping events] PASSED [ 87%]
tests/integration/test_analysisd/test_eps/test_start_queuing_events_when_limit_reached.py::test_start_queuing_events_when_limit_reached[simulate_agent0-configure_local_internal_options_eps0-EPS Limits start queueing events] PASSED [ 93%]
tests/integration/test_analysisd/test_eps/test_stop_processing_events.py::test_stops_processing_events[simulate_agent0-configure_local_internal_options_eps0-EPS Limits stop processing events] PASSED [100%]

========================= 16 passed in 349.33s (0:05:49) ==========================

Tester Test path Jenkins Local OS Commit Notes
@fedepacher (Developer) wazuh-qa/tests/integration ⚫⚫⚫ 🟢🟢🟢 c2bab2c 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.

Good first approach. However, there are multiple changes and pending conversations to resolve.
The most important changes to apply are the following:

  • Change the framework in order to not affect the rest of the testing module (Agent simulator and simulate agents )
  • Ensure the logcollector is disabled in the environment
  • Refactor methods when proceeding
  • Use name conventions of the repository

@Rebits
Copy link
Member

Rebits commented Aug 18, 2022

18/08/202

Detected error in simulate_agent fixture. In case of not running tests with python3 (for example running python3.10) all tests that make use of simulate agent script fail. I have talked with @fedepacher in order to avoid if possible this case.

Package/Sources

Commit
wazuh/wazuh@2a39f91

Testing

Test EPS

Centos: 8 Local Notes
R1 🟢
R2 🟢
R3 🟢

  • 🟢: All pass
  • 🟡: Some warnings
  • 🔴: Some errors/fails
  • 🔵: In progress

@jmv74211
Copy link
Contributor

All tests and frameworks have been refactored because they were unstable and not optimized.

The tests documentation can be found in the docstrings of the implemented test modules.

Checks

Local runs Jenkins runs
🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢 Pending
==================================== 15 passed in 383.35s (0:06:23) ====================================

@jmv74211 jmv74211 self-assigned this Sep 29, 2022
@jmv74211 jmv74211 closed this Oct 4, 2022
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