Skip to content

Commit

Permalink
doc: Add test block to test_wazuh_db_messages_global test #1820
Browse files Browse the repository at this point in the history
  • Loading branch information
fedepacher committed Dec 9, 2021
1 parent 2c08f49 commit 95aa136
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions tests/integration/test_wazuh_db/test_wazuh_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,40 @@ def test_wazuh_db_messages_agent(restart_wazuh, clean_registered_agents, configu
for case in module_data]
)
def test_wazuh_db_messages_global(connect_to_sockets_module, restart_wazuh, test_case):
"""Check that every input global message in wazuh-db socket generates the adequate output to wazuh-db socket.
'''
description: Check that every input global message in wazuh-db socket generates the adequate output to wazuh-db
socket. To do this, query the socket with a command taken from the input list of stages (test_case,
input field) and compare the result with the input list of stages (test_case, output field).
Args:
test_case(list): List of test_case stages (dicts with input, output and stage keys).
"""
wazuh_min_version: 4.2.0
parameters:
- restart_wazuh:
type: fixture
brief: Reset the 'ossec.log' file and start a new monitor.
- connect_to_sockets_module:
type: fixture
brief: Module scope version of 'connect_to_sockets' fixture.
- test_case:
type: fixture
brief: List of test_case stages (dicts with input, output and stage keys).
assertions:
- Verify that the socket response matches the expected output of the yaml input file.
input_description:
- Test cases are defined in the global_messages.yaml file. This file contains cases to insert, upgrade, label,
select, get-all-agents, sync-agent-info-get, sync-agent-info-set, belongs table, reset connection status,
get-agents-by-connection-status, disconnect-agents, delete and keepalive commands in global database.
expected_output:
- r'Failed test case stage .*'
- r'Error when executing * in daemon'
tags:
- wazuh_db
- wdb_socket
'''
for index, stage in enumerate(test_case):
if 'ignore' in stage and stage['ignore'] == 'yes':
continue
Expand Down

0 comments on commit 95aa136

Please sign in to comment.