Closed Deblintrake09 closed 11 months ago
wazuh-qa
The tests located in the Wazuh-qa repository check the files in the system and the difference of files after a given install,
update
or uninstall
process.
qa-ctl
tool which is not currently working, to set up an environment and launch the tests and gather the reports.To check Installation files:
cd wazuh-qa
python3 deps/wazuh_testing/wazuh_testing/scripts/check_files.py <PARAMETERS>
test/check_files
To check file changes during upgrade:
test/check_files
To check uninstallation files:
test/check_files
check_files
script--before-file
. Path to check_file.py report generated before install/upgrade/uninstall. --after-file
. Path to check_file.py report generated after install/upgrade/uninstall. NOTES: Both parameters are required as this is the data used by the test to validate the changes.
Testing could not be completed:
check_files
script on a local environment, for the pre-installation check, the script was left to work for 6 hours and it did not finish. This check_files script
is a Python script that checks that with a given installed version of wazuh, the expected file structure and permissions are found.
The script uses a series of JSON files that list the expected files, permissions in the different versions of wazuh.
16:57:01 [Pipeline] ansiblePlaybook
16:57:01 [Test_install@2] $ ansible-playbook quality/tests/generic/02-installation/linux/test/conf/test_agent.yaml -i solaris_vagrant_ansible_host -l Agents --private-key /home/ec2-user/workspace/Test_install@2/ssh2845410060375437077.key -u root -e curl_path=/opt/csw/bin/curl -e logs_folder=/home/ec2-user/workspace/Test_install@2/artifacts -e wazuh_base_version=master -e to_version=4.7.0 -e from_version=4.7.0 -e python_path=/usr/testing/bin/python3 -e pytest_path=/usr/testing/bin/pytest -e pytest_args=--tb=short
16:57:02 [WARNING]: Found both group and host with the same name: Agents
16:57:04
16:57:04 PLAY [Agents] ******************************************************************
16:57:09
16:57:09 TASK [Gathering Facts] *********************************************************
This script is used as part of the following test playbooks:
but it is not used
:
In terms of Pipelines it is used in:
Test_install
- only referenced, not launched or usedTest_upgrade
- tests are executed in this pipelinePR_wazuh
- launched by test_upgrade
as part of the pipeline but not used by the pipeline itselftest_nightly
- launched by test_upgrade
as part of the pipeline but not used by the pipeline itself{
"data": [
{
"id": 0,
"name": "/var/ossec",
"description": {
"class": "static",
"group": "ossec",
"mode": "0750",
"prot": "drwxr-x---",
"type": "directory",
"user": "root"
}
},
{
"id": 1,
"name": "/var/ossec/.ssh",
"description": {
"class": "static",
"group": "ossec",
"mode": "0700",
"prot": "drwx------",
"type": "directory",
"user": "root"
}
},
]
}
When failing, the error will state what was expected and what was found, displayed in the following way:
17:22:07
17:22:07 Different:
17:22:07 /var/ossec/.ssh [Wrong: mode]
17:22:07 Expected: root ossec 0700 # drwx------
17:22:07 Found: root ossec 0750 # drwxr-x---
17:22:07
17:22:07 Please review your files.
Applied requested changes
Pipeline Example: https://ci.wazuh.info/view/Tests/job/Test_install/129733
The Test_install pipelines do not use the check-files.py script nor check the file's properties, they are used only for upgrade tests
As part of Installation test suite: wazuh-jenkins/quality/tests/generic/02-installation/linux/test/conf/test_agent.yaml wazuh-jenkins/quality/tests/generic/02-installation/linux/test/conf/test_manager.yaml
Yes, the Python script is referenced but it is not used in the playbooks
In terms of Pipelines it is used in:
- PR_Wazuh
- Nightly
- Test_install
- Test_upgrade
- Test_service
Where is the Test_service pipeline using the check-files?
Shouldn't this knowledge be reflected in the Google Sites documentation?
test_install
to note it is only referenced, but not used. test_service
from list.Updated test_install to note it is only referenced, but not used.
It must be clear that the Test_install pipeline does not use the check-files
the i
nstallation test suite, it is referenced in the following files but they are not used.
In terms of Pipelines it is used in: Test_install - only referenced but not actually used. Test_upgrade - tests are actually executed in this pipeline PR_Wazuh Nightly
Add a note in PR_wazuh
and test_nightly
stating that the check-files are launched in the Tests_ugrade
pipeline and not in the PR_wazuh
or test_nightly
pipelines. Also, refer to the pipelines with their actual names (Nightly -> test_nightly)
Please check the grammar of the entire comment
VERSION:
Vv
ersion ofI
nstallationthis
(these) tests are passing
Applied requested changes.
Great research and description 👏🏻 👏🏻
Only a few changes are required:
What is test
Change the title to “What is being tested”
How to run tests
You mention this in “What is tested”:
[the tests] check the files in the system and the difference of files after a given install, update or uninstall process.
But then you only explain how to check files before/after an install process. Please, add more detail to understand how the tool is used in all the cases.
Parameters for check_files script
PATH: Path base to inspect files recursively. Arg: "--path", default='/'
I don’t quite understand what is this parameter about
Parameters for
I think the title is incomplete, am I right?
BEFORE_FILE: Python Arg. --before-file. Path to check_file.py report before install/upgrade/uninstall.
I would change this “Path to check_file.py report…” By this “Path where the script will report….”
AFTER_FILE: Python Arg. --after-file. Path to check_file.py report after install/upgrade/uninstall.
IDEM above.
/
will be checked. If the path is changed to /var/ossec
only files and folders inside that path would be checked.BEFORE_FILE
and AFTER_FILE
are the paths to the files created by the script before, not where the test will report. These files should exist before launching the tests.
BEFORE_FILE
andAFTER_FILE
are the paths to the files created by the script before, not where the test will report. These files should exist before launching the tests.
I'm still seeing the previous description, you explained it well in the previous comment. Please, expand the following descriptions for everyone to understand:
BEFORE_FILE
: Python Arg. --before-file. Path to check_file.py report before install/upgrade/uninstall.AFTER_FILE
: Python Arg. --after-file. Path to check_file.py report after install/upgrade/uninstall.
Note: Please, check the QA project's fields, especially the ETA cannot be empty.
LGTM
LGTM!
Description
This issue aims to analyze and document all about the
Check Files
test suite, located inwazuh-qa/tests/check_files
. Also Jenkins automation state, Jenkins parameters, pytest location, steps in the test and current state of it.The wazuh-jenkins repository contains a different version of the
Check Files
located in https://github.com/wazuh/wazuh-jenkins/blob/master/quality/tests/generic/common_files/check_files.py. This test will also be researched as part of this issue.State of check_files in
wazuh-qa
:red_circle:qa-ctl
tool that is currently deprecated and not working. It could be adapted automated using the current Deployer pipeline.check_files
script did not finish.State of check_files in
wazuh-jenkins
:green_circle: