-
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
E2E tests: Add an initial validation stage #3175
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mauromalara
changed the title
3142 validation stage
E2E tests: Add an initial validation stage
Aug 15, 2022
Tasks to check filebeat-indexer and controller-indexer connections. New role related to Wazuh services added. Some changes related to linter corrections.
The alert timestamp was corrected to allow for negative and positive offsets. Timeout for a task has been removed because it already had an implicit timeout.
Now this phase deletes the generated file at the end of the execution.
Debug tasks removed. New task to check Wazuh components added. The error when setting a variable used to search for failures was fixed.
…to 3142-validation-stage
…2-validation-stage-temp
juliamagan
requested changes
Aug 23, 2022
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, but some changes are required
tests/end_to_end/test_basic_cases/test_fim/test_fim_linux/test_fim_linux.py
Outdated
Show resolved
Hide resolved
tests/end_to_end/test_basic_cases/test_fim/test_fim_linux/test_fim_linux.py
Outdated
Show resolved
Hide resolved
tests/end_to_end/test_basic_cases/test_fim/test_fim_linux/test_fim_linux.py
Outdated
Show resolved
Hide resolved
tests/end_to_end/test_basic_cases/test_fim/test_fim_windows/test_fim_windows.py
Outdated
Show resolved
Hide resolved
Last changes are in |
This change allows no stopping all execution when 1 specific validation fails.
…to 3142-validation-stage
juliamagan
requested changes
Aug 25, 2022
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, but some changes are required
jmv74211
suggested changes
Aug 25, 2022
tests/end_to_end/data/ansible_roles/host_checker/tasks/check_controller_indexer.yaml
Outdated
Show resolved
Hide resolved
tests/end_to_end/data/ansible_roles/host_checker/tasks/check_filebeat_indexer.yaml
Outdated
Show resolved
Hide resolved
tests/end_to_end/data/ansible_roles/host_checker/tasks/check_filebeat_indexer.yaml
Outdated
Show resolved
Hide resolved
tests/end_to_end/data/ansible_roles/host_checker/tasks/check_os.yaml
Outdated
Show resolved
Hide resolved
tests/end_to_end/data/ansible_roles/host_checker/tasks/check_wazuh_components.yaml
Outdated
Show resolved
Hide resolved
tests/end_to_end/data/ansible_roles/host_checker/tasks/check_wazuh_components.yaml
Outdated
Show resolved
Hide resolved
tests/end_to_end/data/ansible_roles/host_checker/tasks/check_wazuh_components.yaml
Outdated
Show resolved
Hide resolved
tests/end_to_end/data/ansible_roles/service_controller/tasks/get_installation_type.yaml
Outdated
Show resolved
Hide resolved
tests/end_to_end/data/validation_templates/general_validation.j2
Outdated
Show resolved
Hide resolved
jmv74211
approved these changes
Aug 25, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The validation phase allows to run a general validation prior to all tests (according to the tests selected to run) and then run the particular validation tasks for each test.
This phase is divided into 4 steps:
Add specific validation tasks (for a test module)
To add specific validation tasks to a test, its necessary to add a new playbook inside the test module, in the playbook folder with the default Play structure:
Added
env_requirements.json
: contains information about the requirements of each E2E test.generate_general_play.yaml
: generates the general validation playbook.general_validation.j2
: Jinja2 template used by the generator playbook.The following files were added within the
host_checker
andservice_controller
roles:Updated
conftest.py
: added the initial validation phase fixture.test_fim
: some modifications were made to run the test successfully (these modifications were needed to test the validation phase)Testing performed
It is highly recommended (for debugging) to enable the following pytest arguments:
--tb=short
: shorter traceback format-s
: disable all capturing (to show Ansible output)otherwise, the output will be very noisy, but it'll still work anyway.
The controller node can't establish a connection with the `wazuh-indexer` (general: failed, specific: not ran) 🟢
The connection between Filebeat and `wazuh-indexer` is not established (general: failed, specific: not ran) 🟢
The OS distribution of any of the hosts is not supported by the current tests (general: failed, specific: not ran) 🟢
The Python version of any of the hosts is not supported (general: failed, specific: not ran) 🟢
One or some Wazuh components aren't up and running (general: failed, specific: not ran) 🟢
Run only 1 test that has a specific validation task that must be executed (general: passed, specific: passed) 🟢
python -m pytest --tb=short -xs tests/end_to_end/basic_cases/test_brute_force/test_brute_force_rdp/ --inventory_path /home/mauro/inventory.yaml
Run only 1 test with a validation task that must fail (general: passed, specific: failed) 🟢
Brute Force
Emotet
FIM
Suricata