-
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
DTT1 - Iteration 3 - Test module - Module documentation #4850
Comments
Testing ModuleUser documentationThe test module runs tests on the different components of Wazuh. This module can be executed as follows: A. Installing and using Workflow engineThe execution of the workflow is done through the installation of its library. Initially, Python libraries must be installed. we recommended the use of virtual environments. Follow the technical documentation at https://docs.python.org/3/library/venv.html.
Run the module by doing the following steps:
B. Direct executionTo execute the testing module without installing the Workflow engine, it can be done by using the launcher ('module/testing/main.py'):
While in 'wazuh-qa/deployability' python3 modules/testing/main.py --wazuh-revision '{{ wazuh_revision }}' --wazuh-version '{{ wazuh_version }}' --component {{ component }} --tests 'install,restart,stop,uninstall' --targets '{"wazuh-1":"{{ inventory }}"}' --targets '{"wazuh-2":"{{ inventory }}"}' --live 'True' Examples: python3 modules/testing/main.py --wazuh-revision '40714' --wazuh-version '4.7.3' --component 'manager' --tests 'install,restart,stop,uninstall' --targets '{"wazuh-1":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml"}' --targets '{"wazuh-2":"/tmp/dtt1-poc/manager-linux-redhat-8-amd64/inventory.yml"}' --live 'True' python3 modules/testing/main.py --wazuh-revision '40714' --wazuh-version '4.7.3' --component 'agent' --tests 'install,registration,restart,stop,uninstall' --targets '{"wazuh-1":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml"}' --targets '{"agent-1":"/tmp/dtt1-poc/agent-linux-redhat-8-amd64/inventory.yml"}' --targets '{"agent-2":"/tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yml"}' --targets '{"agent-3":"/tmp/dtt1-poc/agent-linux-centos-7-amd64/inventory.yml"}' --live 'True' To be considered:wazuh-1: This is the master node
Technical documentationThe testing module allows the execution of tests on agents and central components. Instructions can be received from the fixture and executed through the Workflow Engine or run through commands on an already provisioned infrastructure. In both cases, the following information will be required: - task: "run-agent-tests"
description: "Run tests install for the agent."
do:
this: process
with:
path: python3
args:
- modules/testing/main.py
- targets:
- wazuh-1: "{working-dir}/manager-linux-ubuntu-22.04-amd64/inventory.yaml"
- agent-1: "{working-dir}/agent-linux-redhat-8-amd64/inventory.yaml"
- tests: "install,registration,restart,stop,uninstall"
- component: "agent"
- wazuh-version: "4.7.3"
- wazuh-revision: "40714"
- live: "True"
depends-on:
- "allocate-{agent}"
- "allocate-manager" In the exposed fixture fragment, the execution of the testing module launcher ( For manual execution, an example command would be: python3 modules/testing/main.py --wazuh-revision '40714' --wazuh-version '4.7.3' --component 'agent' --tests 'install,registration,restart,stop,uninstall' --targets '{"wazuh-1":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml"}' --targets '{"agent-1":"/tmp/dtt1-poc/agent-linux-redhat-8-amd64/inventory.yml"}' --live 'True' The module is composed of:
The testing module receives the infrastructure generated and provisioned by the allocation and provision modules. The module has the ability to execute actions on the hosts as well as perform the necessary validation. The test module must recieve the infrastructure generated and provisioned by the allocation and provision modules. The module can execute actions on the hosts as well as perform the necessary validation. Testing of the manager component includes: Testing of the agent component includes: LicenseWAZUH Copyright (C) 2015 Wazuh Inc. (License GPLv2) |
Required discussion with @fcaffieri about how generic or specific this documentation must be. |
UpdateThe documentation will be moved to General documentation. |
We need to adapt the documentation with these recommendations:
|
Update:Sample has been updated in #4850 (comment) following the standards mentioned at #4850 (comment). |
UpdateSome fixes were done. |
LGTM |
Description
This issue aims to generate usage and technical documentation for the module
Tasks
The text was updated successfully, but these errors were encountered: