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

Fix test_synchronization system test #5089

Merged
merged 5 commits into from
Mar 20, 2024

Conversation

rafabailon
Copy link
Member

@rafabailon rafabailon commented Mar 8, 2024

Description

Change the execution of queries using the correct script (adding it to the manager during provisioning). Fix the test that gave an error for not using the json format and adjust the condition so that the test passes or fails.

Testing Performed

Steps to Test on Local

First you have to download the code and the branch with the fix, then you just have to execute the commands in order to launch the test.

python3 -m pip install -r requirementes.txt
cd deps/wazuh_testing && python3 setup.py install
cd ../../tests/system/provisioning/one_manager_agent/ && ansible-playbook -i inventory.yml destroy.yml
ansible-playbook -i inventory.yml playbook.yml --extra-vars='{"package_repository":"packages-dev", "repository": "pre-release", "package_version": "4.8.0", "package_revision": "1"}'
cd ../../ && python3 -m pytest -vvrxP test_fim/test_synchronization/test_synchronization.py 

When provisioning you have to ensure that you take the packages from the correct bucket.

Results
------------------------------ Captured log call -------------------------------
DEBUG    wazuh_testing:system_monitoring.py:78 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log
DEBUG    wazuh_testing:system_monitoring.py:82 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log
DEBUG    wazuh_testing:system_monitoring.py:78 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log
DEBUG    wazuh_testing:system_monitoring.py:82 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log
DEBUG    wazuh_testing:system_monitoring.py:185 Cleaning temporal files...
DEBUG    wazuh_testing:system_monitoring.py:174 Checking results...
DEBUG    wazuh_testing:system_monitoring.py:180 Received from wazuh-agent1 the expected message: True
DEBUG    wazuh_testing:system_monitoring.py:180 Received from wazuh-manager the expected message: True
DEBUG    wazuh_testing:system_monitoring.py:78 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log
DEBUG    wazuh_testing:system_monitoring.py:82 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log
DEBUG    wazuh_testing:system_monitoring.py:185 Cleaning temporal files...
DEBUG    wazuh_testing:system_monitoring.py:174 Checking results...
DEBUG    wazuh_testing:system_monitoring.py:180 Received from wazuh-manager the expected message: True
======================== 6 passed in 201.24s (0:03:21) =========================

I have run the test several times to check the functionality

for i in {1..10}; do python3 -m pytest -vvrxP test_fim/test_synchronization/test_synchronization.py; done >> results

All 10 test runs have passed correctly. This is the result, in HTML format, of the execution of the tests report.zip

@rafabailon rafabailon self-assigned this Mar 8, 2024
@rafabailon rafabailon linked an issue Mar 8, 2024 that may be closed by this pull request
Copy link
Member

@juliamagan juliamagan 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 some changes are required. Also, please remember to attach the results using the HTML report.

Copy link
Member

@juliamagan juliamagan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@rauldpm rauldpm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a Jenkins build

Edit: The Test_system pipeline is still in development, pipeline build is not required

@rauldpm rauldpm changed the title Fix test_synchronization That Was Failing Fix test_synchronization system test Mar 20, 2024
@rauldpm rauldpm merged commit d991183 into 4.8.0 Mar 20, 2024
3 of 4 checks passed
@rauldpm rauldpm deleted the feature/fix-5043-test_synchronization-fails branch March 20, 2024 15:12
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.

test_synchronization system test tries to load a list as a JSON
3 participants