src/wazuh_modules/inventory_sync/qa/README.md
This directory contains integration tests for the Wazuh inventory_sync module. The tests use the Wazuh agent protocol with FlatBuffers to simulate real agent-manager communication.
The integration test framework provides:
Install the required dependencies:
pip install -r requirements.txt
The test framework uses FlatBuffers for protocol communication. The required Python classes are generated automatically when needed, but you can also generate them manually:
python3 generate_flatbuffers.py
This requires the flatc compiler to be installed on your system.
Run all tests against a local manager:
python run_tests.py --manager 127.0.0.1
python run_tests.py --manager 127.0.0.1 --test basic_flow
| Option | Description | Default |
|---|---|---|
--manager | Wazuh manager IP address | 127.0.0.1 |
--port | Manager communication port | 1514 |
--test | Run specific test (without .json extension) | All tests |
--verbose | Enable verbose output | False |
--list-tests | List available tests and exit | False |
basic_flow)Tests the fundamental inventory sync flow:
nodata_flow)Tests handling when no data is sent during sync.
reqret_end_flow)Tests the request-return mechanism for missing data.
simple_reqret_test)Tests basic request-return functionality.
metadata_delta_flow)Tests the metadata delta synchronization mode (Mode 4):
This mode is used when agent metadata changes (hostname, OS, architecture, etc.) and all existing documents need to be updated.
groups_delta_flow)Tests the groups delta synchronization mode (Mode 6):
This mode is used when agent group membership changes and all existing documents need to reflect the new groups.
Test files in test_data/ and expected results in expected_data/ use JSON format to define test scenarios and expected outcomes.
test_data/ directoryexpected_data/ directory--test <test_name>pip install -r requirements.txtThis test framework is part of the Wazuh project and follows the same licensing terms.