-
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
Refactor FIM test_synchronization
according to new standard (1)
#2358
Conversation
type: fixture | ||
brief: Remove the test key and restart the agent. | ||
brief: Create the test key. | ||
|
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.
Add the configure_local_internal_options_module
parameter.
''' | ||
description: Check if the 'wazuh-syscheckd' daemon uses the value of the 'enabled' tag to start/stop | ||
the file/registry synchronization. For this purpose, the test will monitor a directory/key. | ||
Finally, it will verify that no FIM 'integrity' event is generated when the synchronization | ||
is disabled, and verify that the FIM 'integrity' event generated corresponds with a | ||
file or a registry when the synchronization is enabled, depending on the test case. | ||
is disablede. |
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 disablede. | |
is disabled. |
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 Cami!
I attach Tests Results:
Test path | Execution | OS | Type | Version | Date | Status | Executed by |
---|---|---|---|---|---|---|---|
test_fim/test_synchronization/test_registry_responses_win32.py | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
test_fim/test_synchronization/test_registry_responses_win32.py | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
test_fim/test_synchronization/test_registry_responses_win32.py | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
test_fim/ | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
test_fim/ | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
test_fim/ | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
test_fim/test_synchronization/test_sync_disabled_win32.py | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
test_fim/test_synchronization/test_sync_disabled_win32.py | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
test_fim/test_synchronization/test_sync_disabled_win32.py | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
test_fim/test_synchronization/test_sync_registry_enabled_win32.py | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
test_fim/test_synchronization/test_sync_registry_enabled_win32.py | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
test_fim/test_synchronization/test_sync_registry_enabled_win32.py | Jenkins | Windows | Agent | 4.3.0 | 20/12/2021 | 🟢 | Seyla |
tests_synchronization
according to new standard (1)
tests_synchronization
according to new standard (1)test_synchronization
according to new standard (1)
Description
Changes applied in this PR:
We add a new folder called fim_module, the purpose of this is to contain all the things related to FIM module. Inside of this folder we have:
We add a new conftest.py inside the folder test/integration/test_fim in order to move all the fixtures define in common inside the folders /test_fim, test_files, and test_synchronization
in order to not duplicate code.
We add the auto-configuration of the test in order to not set manually the local internal options.
We add a new file called wazuh_variables when we put all the variables to use related to Wazuh in order to not hardcoded code inside the test, and with the purpose of if anything changes that will
changes just these files and not all the tests that contain the variables
We changed the import in order to only import the functions that use in the test and not all the module
We changed YAML, now this file only contains one configuration, we note that when we put more than one, the test that does not apply with the configuration will be automatically skipped and this is wrong, if not applied the
test just not run. When this changes the test only runs nine times and there isn't a skipped test.
We delete wazuh_disabled_sync_conf_win32.yaml and created wazuh_sync_conf_yaml with the general config and variables that can be set inside the test. With this change we evited have three different YAML, we only
need one and set the variables.
By default the FIM test run in 3 different modes - scheduled, real-time, who-data, but we have a lot of tests that test only one mode, in this case, we need to specify inside the test the mode, if we do not define this, Pytest
mark test with skip
We redefined test test_sync_disabled_win32.py, we divide it into 4 different cases. In order that can use one YAML and avoid the use of the condition if-else inside the code
Configuration options
Configuration options
Test
test_fim/
Tests
pycodestyle --max-line-length=120 --show-source --show-pep8 file.py
.