Skip to content

Commit

Permalink
doc: Add test block to test_wazuh_db_chunks test #1820
Browse files Browse the repository at this point in the history
  • Loading branch information
fedepacher committed Dec 13, 2021
1 parent 95aa136 commit 3974689
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions tests/integration/test_wazuh_db/test_wazuh_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def test_wazuh_db_messages_agent(restart_wazuh, clean_registered_agents, configu
expected_output:
- r'Failed test case stage .*'
- r'Error when executing * in daemon'
- r'Error when executing .* in daemon'
- 'Unable to add agent'
- 'Unable to upgrade agent'
Expand Down Expand Up @@ -385,7 +385,44 @@ def test_wazuh_db_messages_global(connect_to_sockets_module, restart_wazuh, test

def test_wazuh_db_chunks(restart_wazuh, configure_sockets_environment, clean_registered_agents,
connect_to_sockets_module, pre_insert_agents):
"""Check that commands by chunks work properly when agents amount exceed the response maximum size"""
'''
description: Check that commands by chunks work properly when agents amount exceed the response maximum size.
To do this, send a command to the wazuh-db socket and check the response from the socket.
wazuh_min_version: 4.2.0
parameters:
- restart_wazuh:
type: fixture
brief: Reset the 'ossec.log' file and start a new monitor.
- configure_sockets_environment:
type: fixture
brief: Configure environment for sockets and MITM.
- clean_registered_agents:
type: fixture
brief: Remove all agents of wazuhdb.
- connect_to_sockets_module:
type: fixture
brief: Module scope version of 'connect_to_sockets' fixture.
- pre_insert_agents:
type: fixture
brief: Insert agents. Only used for the global queries.
assertions:
- Verify that the socket status response matches with 'due' to fail.
input_description:
- Test cases are defined in the global_messages.yaml file. Status response is expected from global
get-all-agents last_id 0 command, global sync-agent-info-get last_id 0 command, global
get-agents-by-connection-status 0 active command and global disconnect-agents 0 .* syncreq command.
expected_output:
- r'Failed chunks check on .*'
tags:
- wazuh_db
- wdb_socket
'''
def send_chunk_command(command):
response = execute_wazuh_db_query(command)
status = response.split(' ', 1)[0]
Expand Down

0 comments on commit 3974689

Please sign in to comment.