-
Notifications
You must be signed in to change notification settings - Fork 32
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
Create local_internal_options configuration handler fixture #1835
Conversation
Define default internal_option_configurations for wazuh daemons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GJ, some changes are required
tests/integration/conftest.py
Outdated
@@ -602,3 +602,30 @@ def create_file_structure_function(get_files_list): | |||
yield | |||
|
|||
delete_file_structure(get_files_list) | |||
|
|||
|
|||
@pytest.fixture(scope="module") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pytest.fixture(scope="module") | |
@pytest.fixture(scope='module') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 87039c1
tests/integration/conftest.py
Outdated
logger.error('Configure Local Internal Options: DEBUG - Set local_internal_option to ' + | ||
f"{str(local_internal_options)}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logger lever should be info
or debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 87039c1
tests/integration/conftest.py
Outdated
logger.error('Configure Local Internal Options: DEBUG - Restore local_internal_option to ' + | ||
f"{str(backup_local_internal_options)}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 87039c1
We can test these changes before the merge in temporal branch: |
…ture Logger of local internal option module fixture change to debug level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GJ some requested changes. I think you would have to make a custom class for the logger and use an appropriate format.
REMOTED_LOCAL_INTERNAL_OPTIONS = {'remoted.debug': '2', 'wazuh_database.interval': '2', 'wazuh_db.commit_time': '2', | ||
'wazuh_db.commit_time_max': '3' }.update(DISABLE_MONITORD_ROTATE_LOG_OPTION) | ||
VD_LOCAL_INTERNAL_OPTIONS = {'wazuh_modules.debug': '2'}.update(DISABLE_MONITORD_ROTATE_LOG_OPTION) | ||
WPK_LOCAL_INTERNAL_OPTIONS = {'wazuh_modules.debug': '2'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix indentations of this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 453f1c6
tests/integration/conftest.py
Outdated
|
||
backup_local_internal_options = conf.get_local_internal_options_dict() | ||
|
||
logger.error('Configure Local Internal Options: DEBUG - Set local_internal_option to ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to logger.debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+
is not neccessary
tests/integration/conftest.py
Outdated
|
||
yield | ||
|
||
logger.error('Configure Local Internal Options: DEBUG - Restore local_internal_option to ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to logger.debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 87039c1
Description
This PR closes #1829. It adds a common Wazuh
local_internal_options
configuration handler fixture for all integration tests.Usage
In order to use this fixture, it is necessary to define a
local_internal_options
variable. This should be a dictionary with the necessary internal options for the test. For example:With this variable defined the fixture will works for each test which calls it.
This fixture is defined for module scope cases. In those tests that changes
local_internal_options
according to a list, it is recommended to use the currently defined fixture.Tests
pycodestyle --max-line-length=120 --show-source --show-pep8 file.py
.