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

ITs for logtest verbose mode added #1587

Merged
merged 5 commits into from
Sep 28, 2021
Merged

Conversation

nmkoremblum
Copy link
Contributor

@nmkoremblum nmkoremblum commented Jul 8, 2021

Related issue
close #1584

Description

Hi team,

This PR aims to close the issue #1584. As for the new Logtest feature, that allows it to use the verbose mode to debug the rules (see Wazuh-logtest: verbose mode #9204, we have created the following Integration Tests:

  • Test rule match case if the rules_debug option is omitted
  • Test rule match case if the rules_debug option is set to true
  • Test rule match case if the rules_debug option is set to false
  • Test rule match case if the rules_debug option is erroneous (string)
  • Test rule match case if the rules_debug option is erroneous (number)
  • Test rule match case if the rules_debug option is erroneous (object)
  • Test rule match case if the rules_debug option is erroneous (array)
  • Test rule match case if the options field is erroneous (boolean)
  • Test rule match case if the options field is erroneous (array)
  • Test rule match case if the options field is erroneous (number)
  • Test rule match case if the options field is erroneous (string)

Tests

  • Proven that tests pass when they have to pass.
  • Proven that tests fail when they have to fail.
  • Python codebase satisfies PEP-8 style style guide. pycodestyle --max-line-length=120 --show-source --show-pep8 file.py.
  • Python codebase is documented following the Google Style for Python docstrings.
  • The test is documented in wazuh-qa/docs.
  • provision_documentation.sh generate the docs without errors.

@JcabreraC
Copy link
Member

Test

# python3 -m pytest tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py -vvs
======================================== test session starts ========================================
platform linux -- Python 3.6.9, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.6.9', 'Platform': 'Linux-5.4.0-77-generic-x86_64-with-Ubuntu-18.04-bionic', 'Packages': {'pytest': '6.2.3', 'py': '1.10.0', 'pluggy': '0.13.1'}, 'Plugins': {'html': '3.1.1', 'testinfra': '5.0.0', 'metadata': '1.9.0'}}
rootdir: /home/Wazuh/wazuh-qa/tests/integration, configfile: pytest.ini
plugins: html-3.1.1, testinfra-5.0.0, metadata-1.9.0
collected 11 items                                                                                  

tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py::test_rules_verbose[The rules_debug field is omitted] PASSED
tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py::test_rules_verbose[The rules_debug field is set to true] PASSED
tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py::test_rules_verbose[The rules_debug field is set to false] PASSED
tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py::test_rules_verbose[The rules_debug field is set to a bad type (string)] PASSED
tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py::test_rules_verbose[The rules_debug field is set to a bad type (number)] PASSED
tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py::test_rules_verbose[The rules_debug field is set to a bad type (object)] PASSED
tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py::test_rules_verbose[The rules_debug field is set to a bad type (array)] PASSED
tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py::test_rules_verbose[The options field is set to a bad type (boolean)] PASSED
tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py::test_rules_verbose[The options field is set to a bad type (array)] PASSED
tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py::test_rules_verbose[The options field is set to a bad type (number)] PASSED
tests/integration/test_logtest/test_log_process_options/test_rules_verbose.py::test_rules_verbose[The options field is set to a bad type (string)] PASSED

======================================== 11 passed in 10.60s ========================================

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.

Great job, but some changes are required

@Rebits
Copy link
Member

Rebits commented Aug 27, 2021

This test seems to work correctly, running without fail.

Local Status Report
R1 🟢 R1
R2 🟢 R2
R3 🟢 R3

@nmkoremblum nmkoremblum requested a review from Rebits August 27, 2021 18:30
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.

Minor changes in daemons handling are required

@nmkoremblum nmkoremblum requested a review from Rebits September 17, 2021 18:37
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.

GJ but minor changes are required.

@nmkoremblum nmkoremblum force-pushed the 1584-logtest-verbose-mode-ITs branch from a57a2b5 to 04d9465 Compare September 20, 2021 13:15
@nmkoremblum nmkoremblum requested a review from Rebits September 20, 2021 13:16
@Rebits
Copy link
Member

Rebits commented Sep 20, 2021

Local Status Report
R1 🟢 R1
R2 🟢 R2
R3 🟢 R3

Rebits
Rebits previously approved these changes Sep 20, 2021
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

@nmkoremblum nmkoremblum force-pushed the 1584-logtest-verbose-mode-ITs branch from 6de2c9a to f728492 Compare September 20, 2021 16:00
@Rebits
Copy link
Member

Rebits commented Sep 23, 2021

Local Status Report
R1 🟢 R1
R2 🟢 R2
R3 🟢 R3

@snaow snaow merged commit b04ee07 into master Sep 28, 2021
@snaow snaow deleted the 1584-logtest-verbose-mode-ITs branch September 28, 2021 07:50
@snaow snaow mentioned this pull request Sep 28, 2021
11 tasks
@snaow snaow mentioned this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ITs logtest use of verbose mode
5 participants