wazuh / wazuh-qa

Wazuh - Quality Assurance
GNU General Public License v2.0
65 stars 32 forks source link

Investigate and document tests - System #4247

Closed verdx closed 11 months ago

verdx commented 1 year ago
Parent issue https://github.com/wazuh/wazuh-qa/issues/4241
Pipeline state :red_circle: FAILS
Tests state :yellow_circle: Most pass, some Timeout errors
Jenkins link https://ci.wazuh.info/job/Test_system
Branch used 4.4

Description

This issue aims to analyze and document all about the System test. Jenkins parameters, pytest location, steps in the test and current state of it.

State

Tests done - https://ci.wazuh.info/job/Test_system/88 - https://ci.wazuh.info/job/Test_system/89 - https://ci.wazuh.info/job/Test_system/90 - https://ci.wazuh.info/job/Test_system/91 - https://ci.wazuh.info/job/Test_system/92 - https://ci.wazuh.info/job/Test_system/93 - https://ci.wazuh.info/job/Test_system/94

The pipeline fails with the error:

11:35:30  [Pipeline] echo
11:35:30  net.sf.json.JSONException: Invalid JSON String
11:35:30  

The failing function is readJSON, inside getTestProvisioning, inside setParameters, in stage Init Environment, in pipeline test_system.groovy.

As the pipeline does not run, manual tests have been done on an Ubuntu 22 machine and the results are in the following comments.

Basically, the results are that all tests pass but sometimes they fail with a timeout error, all errors would probably be fixed if the timeouts are increased.

Possible subtests

The whole test directory structure is explained here (in this comment are shown the integration tests, but the structure is the same). Basically, the possible tests to run are the directories inside the directory tests/system in https://github.com/wazuh/wazuh-qa. The test you want to run is defined in parameter TEST_PATH. They are the following:

All possible tests ``` ├── test_active_response │   ├── test_analysisd │   └── test_execd ├── test_agentd ├── test_analysisd │   ├── test_all_syscheckd_configurations │   │   └── yaml_generators │   ├── test_error_messages │   ├── test_event_messages │   ├── test_integrity_messages │   ├── test_limit_eps │   ├── test_mitre │   ├── test_predecoder_stage │   ├── test_queue_socket_properties │   ├── test_scan_messages │   ├── test_signature_id │   └── test_syscollector ├── test_api │   ├── test_config │   │   ├── test_bruteforce_blocking_system │   │   ├── test_cache │   │   ├── test_cors │   │   ├── test_DOS_blocking_system │   │   ├── test_drop_privileges │   │   ├── test_experimental_features │   │   ├── test_host_port │   │   ├── test_https │   │   ├── test_jwt_token_exp_timeout │   │   ├── test_logs │   │   ├── test_max_upload_size │   │   ├── test_rbac │   │   └── test_request_timeout │   ├── test_middlewares │   ├── test_rbac │   └── test_statistics ├── test_authd │   ├── files │   └── force_options ├── test_enrollment ├── test_fim │   ├── test_files │   │   ├── test_ambiguous_confs │   │   ├── test_audit │   │   ├── test_basic_usage │   │   ├── test_env_variables │   │   ├── test_file_limit │   │   ├── test_follow_symbolic_link │   │   ├── test_ignore │   │   ├── test_inotify │   │   ├── test_max_eps │   │   ├── test_moving_files │   │   ├── test_prefilter_cmd │   │   ├── test_process_priority │   │   ├── test_recursion_level │   │   ├── test_report_changes │   │   ├── test_restrict │   │   ├── test_scan │   │   ├── test_skip │   │   ├── test_tags │   │   ├── test_timezone_changes │   │   └── test_windows_audit_interval │   ├── test_registry │   │   ├── test_registry_ambiguous_confs │   │   ├── test_registry_basic_usage │   │   ├── test_registry_checks │   │   ├── test_registry_file_limit │   │   ├── test_registry_ignore │   │   ├── test_registry_multiple_registries │   │   ├── test_registry_nodiff │   │   ├── test_registry_report_changes │   │   │   └── test_disk_quota │   │   ├── test_registry_restrict │   │   └── test_registry_tags │   └── test_synchronization ├── test_gcloud │   ├── test_configuration │   └── test_functionality ├── test_github │   └── test_configuration ├── test_integratord ├── test_logcollector │   ├── test_age │   ├── test_command_monitoring │   ├── test_configuration │   ├── test_keep_running │   ├── test_localfile │   ├── test_location │   ├── test_location_custom_sockets │   ├── test_log_format │   ├── test_macos │   ├── test_only_future_events │   ├── test_options │   ├── test_reconnect_time │   └── test_statistics ├── test_logtest │   ├── test_configuration │   ├── test_invalid_rule_decoders_syntax │   ├── test_invalid_socket_input │   ├── test_invalid_token │   ├── test_log_process_options │   ├── test_remove_old_sessions │   ├── test_remove_session │   ├── test_rules_decoders_load │   └── test_ruleset_refresh ├── test_office365 │   └── test_configuration ├── test_remoted │   ├── test_active_response │   ├── test_agent_communication │   ├── test_configuration │   ├── test_manager_messages │   ├── test_multi_groups │   └── test_socket_communication ├── test_rids ├── test_rootcheck ├── test_syscollector ├── test_vulnerability_detector │   ├── test_cpe_helper │   ├── test_feeds │   ├── test_general_settings │   ├── test_providers │   ├── test_scan_results │   ├── test_scan_types │   └── test_vulnerability_inventory ├── test_wazuh_db └── test_wpk ```

Parameters

Local execution

This test suite can be executed locally as well, to do so, you have to follow these steps:

The README.md from its repository offers a complete guide on how to do so, including the required environment and dependencies, alongside other useful information.

  1. Setup the environment
    • Install the tools Docker & Ansible
    • Clone the wazuh-qa repository
      git clone https://github.com/wazuh/wazuh-qa.git
    • Install the python dependencies
      cd wazuh-qa
      pip3 install -r requirements.txt
    • Install the wazuh-testing library
      cd wazuh-qa
      pip3 install deps/wazuh_testing
  2. Provision the correspondent Ansible environment

    Each test has a required Ansible environment that you can find on this table

    • Check the correspondent environment for the test on the environments table
    • Provision the environment
      cd system/provisioning/<correspondent_environment>
      ansible-playbook -i inventory.yml playbook.yml

      More provisioning options can be found in the README

  3. Run the tests
      cd wazuh-qa/tests/system/<test_module>
      python3 -m pytest <test_file [optional]>
verdx commented 1 year ago

:yellow_circle: Active Response log format

One of the three tests fails with a Timeout error.

``` root@ubuntu22:/home/vagrant/wazuh-qa/tests/system# python3 -m pytest test_active_response_log_format/ =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 3 items test_active_response_log_format/test_active_response_log_format.py ..F [100%] ==================================================================================================== FAILURES ===================================================================================================== _________________________________________________________________ test_active_response_log_format[wazuh-agent3-data/messages_425_or_greater.yml] __________________________________________________________________ wazuh_agent = 'wazuh-agent3', message_file = 'data/messages_425_or_greater.yml' @pytest.mark.parametrize('wazuh_agent, message_file', [('wazuh-agent1', messages_files[0]), ('wazuh-agent2', messages_files[1]), ('wazuh-agent3', messages_files[2])]) def test_active_response_log_format(wazuh_agent, message_file): """ description: Check that when an Active Response is activated, the manager sends back the information to the agent and that it appears in active-response.log and ossec.log with the expected format wazuh_min_version: 4.2.0 parameters: - wazuh_agent: type: string brief: tells which agent to insert the log message. - message_file: type: string brief: tells HostManager the location of the yml file with the expected messages and where to look for them input_description: Each agent has a different version with a specific yml file containing the expected messages and their location in the agent's logs expected_output: In case the test passes it will show "Received from {host} the expected message: {message}" in case it failes it will show: "Did not found the expected callback in {host}: {message}" """ # Clear the agents files that will be monitored. enviroment_files = [(wazuh_agent, os.path.join(WAZUH_LOGS_PATH, 'ossec.log')), (wazuh_agent, os.path.join(WAZUH_LOGS_PATH, 'active-responses.log'))] clean_environment(host_manager, enviroment_files) # Add log message to agent monitored source host_manager.modify_file_content(host=wazuh_agent, path=log_path, content=log_sample) # wait for active responses messages to be generated time.sleep(sleep_time) # Run the callback checks for the ossec.log and the active-responses.log HostMonitor(inventory_path=inventory_path, messages_path=os.path.join(local_path, message_file), > tmp_path=tmp_path).run() test_active_response_log_format/test_active_response_log_format.py:110: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent3: (wazuh-agent3).*('\$token': `132`!) /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-27 16:05:17,045 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent3 and path: /var/ossec/logs/active-responses.log 2023-06-27 16:05:17,049 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent3 and path: /var/ossec/logs/active-responses.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_active_response_log_format/tmp/wazuh-agent3_active-responses.log.tmp 2023-06-27 16:05:17,049 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent3 and path: /var/ossec/logs/active-responses.log 2023-06-27 16:05:17,052 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent3 and path: /var/ossec/logs/ossec.log 2023-06-27 16:05:17,055 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent3 and path: /var/ossec/logs/ossec.log 2023-06-27 16:05:17,062 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent3 and message: (wazuh-agent3).*('\$token': `132`!) 2023-06-27 16:05:17,065 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent3 and message: (wazuh-agent3).*('\$token': `132`!) 2023-06-27 16:05:17,068 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent3 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_active_response_log_format/tmp/wazuh-agent3_ossec.log.tmp 2023-06-27 16:05:56,403 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent3 and message: (wazuh-agent3).*('\$token': `132`!) 2023-06-27 16:06:17,092 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent3 and message: (wazuh-agent3).*('\$token': `132`!) 2023-06-27 16:06:17,515 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-27 16:06:17,517 - wazuh_testing - DEBUG - Checking results... 2023-06-27 16:06:17,519 - wazuh_testing - DEBUG - Received from wazuh-agent3 the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent3 and path: /var/ossec/logs/active-responses.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent3 and path: /var/ossec/logs/active-responses.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent3 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent3 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-agent3 the expected message: True ============================================================================================= short test summary info ============================================================================================= FAILED test_active_response_log_format/test_active_response_log_format.py::test_active_response_log_format[wazuh-agent3-data/messages_425_or_greater.yml] - TimeoutError: Did not found the expected callback in... ===================================================================================== 1 failed, 2 passed in 185.46s (0:03:05) ===================================================================================== ```
verdx commented 1 year ago

:yellow_circle: Agent auth

One of the tests fails with a Timeout Error.

``` root@ubuntu22:/home/vagrant/wazuh-qa/tests/system# python3 -m pytest test_agent_auth/ =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 20 items test_agent_auth/test_agent_auth.py .................F.. [100%] ==================================================================================================== FAILURES ===================================================================================================== ________________________________________________________________________________ test_agent_auth[manager_ipv4_agent_both-ipv4-no] _________________________________________________________________________________ test_case = {'name': 'manager_ipv4_agent_both-ipv4-no', 'test_case': [{'agent_network': 'both', 'ip_type': 'ipv4', 'ipv6_enabled': 'no', 'manager_network': 'ipv4'}]}, get_ip_directions = None configure_network = None, modify_ip_address_conf = None, clean_environment = None @pytest.mark.parametrize('test_case', [cases for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_auth(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if 'agent-auth' messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent with 'agent-auth' tool. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*New connection from AGENT_IP' - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Requesting a key from server: MANAGER_IP' - '.*No authentication password provided' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' tags: - authd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") # Start the agent enrollment process using agent-auth for configuration in test_case['test_case']: if 'ipv4' in configuration['ip_type']: host_manager.run_command('wazuh-agent1', f"{WAZUH_PATH}/bin/agent-auth -m {network['manager_network'][0]}") elif 'ipv6' in configuration['ip_type']: host_manager.run_command('wazuh-agent1', f"{WAZUH_PATH}/bin/agent-auth -m {network['manager_network'][1]}") else: host_manager.run_command('wazuh-agent1', f"{WAZUH_PATH}/bin/agent-auth -m wazuh-manager") # Run the callback checks for the ossec.log > HostMonitor(inventory_path=inventory_path, messages_path=messages_path, tmp_path=tmp_path).run(update_position=True) test_agent_auth/test_agent_auth.py:250: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Requesting a key from server: 172\.24\.27\.2 /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-27 16:51:06,215 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-27 16:51:06,218 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_agent_auth/tmp/wazuh-manager_ossec.log.tmp 2023-06-27 16:51:06,218 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-27 16:51:06,221 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-27 16:51:06,227 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-27 16:51:06,233 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_agent_auth/tmp/wazuh-agent1_ossec.log.tmp 2023-06-27 16:51:06,236 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172\.24\.27\.2 2023-06-27 16:51:06,240 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172\.24\.27\.3 2023-06-27 16:51:07,307 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172\.24\.27\.3 2023-06-27 16:51:07,307 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172\.24\.27\.3 2023-06-27 16:51:07,352 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172\.24\.27\.3 2023-06-27 16:51:07,352 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-27 16:51:07,387 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-27 16:51:36,631 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172\.24\.27\.2 2023-06-27 16:51:36,632 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*No authentication password provided 2023-06-27 16:52:07,056 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*No authentication password provided 2023-06-27 16:52:07,056 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-27 16:52:37,357 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-27 16:52:37,357 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-27 16:53:07,797 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-27 16:53:07,797 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-27 16:53:37,979 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-27 16:53:38,490 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-27 16:53:38,491 - wazuh_testing - DEBUG - Checking results... 2023-06-27 16:53:38,495 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-27 16:53:38,496 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-27 16:53:38,497 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True ============================================================================================= short test summary info ============================================================================================= FAILED test_agent_auth/test_agent_auth.py::test_agent_auth[manager_ipv4_agent_both-ipv4-no] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Requesting a key from server: 172\.24\.27\.2 ==================================================================================== 1 failed, 19 passed in 2693.51s (0:44:53) ==================================================================================== root@ubuntu22:/home/vagrant/wazuh-qa/tests/system# ```
verdx commented 1 year ago

:yellow_circle: Cluster

For test_cluster, different subtests need different inventories, so they will be tested separately:

All subtests ``` root@ubuntu22:/home/vagrant/wazuh-qa/tests/system/test_cluster# python3 -m pytest test_agent_info_sync/ =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 2 items test_agent_info_sync/test_agent_info_sync.py .. [100%] ========================================================================================== 2 passed in 535.39s (0:08:55) ========================================================================================== ```
### :yellow_circle: Test agent key polling One test failed with a Timeout error.
``` root@ubuntu22:/home/vagrant/wazuh-qa/tests/system/test_cluster# python3 -m pytest test_agent_key_polling/ ; python3 -m pytest test_agent_files_deletion/ =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 1 item test_agent_key_polling/test_agent_key_polling.py F [100%] ==================================================================================================== FAILURES ===================================================================================================== _____________________________________________________________________________________________ test_agent_key_polling ______________________________________________________________________________________________ def test_agent_key_polling(): """Check that the agent key polling cycle works correctly. To do this, we use the messages and the hosts defined in data/messages.yml and the hosts inventory. Parameters ---------- inventory_path : str Path to the Ansible hosts inventory """ actual_path = os.path.dirname(os.path.abspath(__file__)) configure_environment(host_manager) host_monitor = HostMonitor(inventory_path=inventory_path, messages_path=os.path.join(actual_path, 'data/messages.yml'), tmp_path=os.path.join(actual_path, 'tmp')) > host_monitor.run() test_agent_key_polling/test_agent_key_polling.py:62: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent2: .*Trying to connect to server \(\[wazuh-worker1.* /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-28 08:36:46,602 - wazuh_testing - DEBUG - Add new file composer process for wazuh-master and path: /var/ossec/logs/ossec.log 2023-06-28 08:36:46,605 - wazuh_testing - DEBUG - Starting file composer for wazuh-master and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_cluster/test_agent_key_polling/tmp/wazuh-master_ossec.log.tmp 2023-06-28 08:36:46,605 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-master and path: /var/ossec/logs/ossec.log 2023-06-28 08:36:46,609 - wazuh_testing - DEBUG - Add new file composer process for wazuh-worker1 and path: /var/ossec/logs/ossec.log 2023-06-28 08:36:46,615 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-worker1 and path: /var/ossec/logs/ossec.log 2023-06-28 08:36:46,618 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent2 and path: /var/ossec/logs/ossec.log 2023-06-28 08:36:46,626 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-master and message: .*Agent key generated for agent 'wazuh-agent2'.* 2023-06-28 08:36:46,631 - wazuh_testing - DEBUG - Starting file composer for wazuh-worker1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_cluster/test_agent_key_polling/tmp/wazuh-worker1_ossec.log.tmp 2023-06-28 08:36:46,633 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-worker1 and message: .*Agent key generated for 'wazuh-agent2'.* 2023-06-28 08:36:46,637 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent2 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_cluster/test_agent_key_polling/tmp/wazuh-agent2_ossec.log.tmp 2023-06-28 08:36:46,648 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent2 and path: /var/ossec/logs/ossec.log 2023-06-28 08:36:46,655 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent2 and message: .*Lost connection with manager. Setting lock.* 2023-06-28 08:36:55,690 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent2 and message: .*Lost connection with manager. Setting lock.* 2023-06-28 08:36:55,690 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent2 and message: .*Trying to connect to server \(\[wazuh-worker1.* 2023-06-28 08:37:35,635 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-master and message: .*Agent key generated for agent 'wazuh-agent2'.* 2023-06-28 08:37:35,843 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-worker1 and message: .*Agent key generated for 'wazuh-agent2'.* 2023-06-28 08:38:26,193 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent2 and message: .*Trying to connect to server \(\[wazuh-worker1.* 2023-06-28 08:38:26,194 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent2 and message: .*Connected to the server \(\[wazuh-worker1.* 2023-06-28 08:39:56,223 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent2 and message: .*Connected to the server \(\[wazuh-worker1.* 2023-06-28 08:39:56,875 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-28 08:39:56,877 - wazuh_testing - DEBUG - Checking results... 2023-06-28 08:39:56,879 - wazuh_testing - DEBUG - Received from wazuh-agent2 the expected message: True 2023-06-28 08:39:56,880 - wazuh_testing - DEBUG - Received from wazuh-master the expected message: True 2023-06-28 08:39:56,880 - wazuh_testing - DEBUG - Received from wazuh-worker1 the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-master and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-master and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-worker1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-worker1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent2 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent2 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-agent2 the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-master the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-worker1 the expected message: True ============================================================================================= short test summary info ============================================================================================= FAILED test_agent_key_polling/test_agent_key_polling.py::test_agent_key_polling - TimeoutError: Did not found the expected callback in wazuh-agent2: .*Trying to connect to server \(\[wazuh-worker1.* ========================================================================================== 1 failed in 291.73s (0:04:51) ========================================================================================== ```
### :green_circle: Test agent file deletion
``` =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 1 item test_agent_files_deletion/test_agent_files_deletion.py . [100%] ========================================================================================== 1 passed in 263.51s (0:04:23) ========================================================================================== ```
### :yellow_circle: Test integrity sync One test fails with a Timeout error
``` root@ubuntu22:/home/vagrant/wazuh-qa/tests/system/test_cluster# python3 -m pytest test_integrity_sync/ ; python3 -m pytest test_ruleset_sync_status/ =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 4 items test_integrity_sync/test_integrity_sync.py ...F [100%] ==================================================================================================== FAILURES ===================================================================================================== _______________________________________________________________________________________________ test_zip_size_limit _______________________________________________________________________________________________ clean_files = None, update_cluster_json = None def test_zip_size_limit(clean_files, update_cluster_json): """Check if zip size limit works and if it is dynamically adapted. Create several large files on the master. The time needed to send them all together should exceed the maximum time allowed and a timeout should be generated on the workers. The test verifies that: - Workers notify the master to cancel the file being sent. - The master reduces the zip size limit. - The master warns that a file that is too large will not be synchronized. - The master warns that not all the files could be synchronized since they did not fit in the zip. - Eventually the zip size limit is increased again. - The workers end up receiving all the files that do not exceed the maximum size. """ too_big_size = configuration['max_zip_size'] + 1024 big_size = configuration['min_zip_size'] - 1024 big_filenames = {file_prefix + str(i) for i in range(5)} # Create a tmp folder and all files inside in the master node. host_manager.run_command(test_hosts[0], f"mkdir {tmp_size_test_path}") create_file(test_hosts[0], os.path.join(tmp_size_test_path, big_file_name), too_big_size) for filename in big_filenames: create_file(test_hosts[0], os.path.join(tmp_size_test_path, filename), big_size) # Move files from tmp folder to destination folder. This way, all files are synced at the same time. host_manager.run_shell(test_hosts[0], f"mv {os.path.join(tmp_size_test_path, 'test_*')} {dst_size_test_path}") # Check whether zip size limit changed, big files are rejected, etc. > HostMonitor(inventory_path=inventory_path, messages_path=messages_path, tmp_path=tmp_path).run() test_integrity_sync/test_integrity_sync.py:277: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-master: .*File too large to be synced: /var/ossec/etc/rules/test_file_too_big /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-28 09:53:44,988 - wazuh_testing - DEBUG - Add new file composer process for wazuh-master and path: /var/ossec/logs/cluster.log 2023-06-28 09:53:44,994 - wazuh_testing - DEBUG - Starting file composer for wazuh-master and path: /var/ossec/logs/cluster.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_cluster/test_integrity_sync/data/tmp/wazuh-master_cluster.log.tmp 2023-06-28 09:53:45,012 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-master and path: /var/ossec/logs/cluster.log 2023-06-28 09:53:45,023 - wazuh_testing - DEBUG - Add new file composer process for wazuh-worker1 and path: /var/ossec/logs/cluster.log 2023-06-28 09:53:45,026 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-worker1 and path: /var/ossec/logs/cluster.log 2023-06-28 09:53:45,032 - wazuh_testing - DEBUG - Add new file composer process for wazuh-worker2 and path: /var/ossec/logs/cluster.log 2023-06-28 09:53:45,043 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-master and message: .*File too large to be synced: /var/ossec/etc/rules/test_file_too_big 2023-06-28 09:53:45,045 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-worker2 and message: .*Files to create: 0 \| Files to update: 0 \| Files to delete: 0.* 2023-06-28 09:53:45,047 - wazuh_testing - DEBUG - Starting file composer for wazuh-worker1 and path: /var/ossec/logs/cluster.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_cluster/test_integrity_sync/data/tmp/wazuh-worker1_cluster.log.tmp 2023-06-28 09:53:45,049 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-worker2 and path: /var/ossec/logs/cluster.log 2023-06-28 09:53:45,050 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-worker1 and message: .*Files to create: 0 \| Files to update: 0 \| Files to delete: 0.* 2023-06-28 09:53:45,052 - wazuh_testing - DEBUG - Starting file composer for wazuh-worker2 and path: /var/ossec/logs/cluster.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_cluster/test_integrity_sync/data/tmp/wazuh-worker2_cluster.log.tmp 2023-06-28 09:54:45,543 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-master and message: .*File too large to be synced: /var/ossec/etc/rules/test_file_too_big 2023-06-28 09:54:45,543 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-master and message: .*Maximum zip size exceeded. Not all files will be compressed during this sync.* 2023-06-28 09:55:45,230 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-worker1 and message: .*Files to create: 0 \| Files to update: 0 \| Files to delete: 0.* 2023-06-28 09:55:45,233 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-worker2 and message: .*Files to create: 0 \| Files to update: 0 \| Files to delete: 0.* 2023-06-28 09:55:45,803 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-master and message: .*Maximum zip size exceeded. Not all files will be compressed during this sync.* 2023-06-28 09:55:45,803 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-master and message: .*Command received: b'cancel_task'.* 2023-06-28 09:56:45,819 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-master and message: .*Command received: b'cancel_task'.* 2023-06-28 09:56:45,819 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-master and message: .*Decreasing sync size limit to .* MB.* 2023-06-28 09:57:46,219 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-master and message: .*Decreasing sync size limit to .* MB.* 2023-06-28 09:57:46,219 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-master and message: .*wazuh-worker1.*Files to create in worker: 1 \| Files to update in worker: 0 \| Files to delete in worker: 0.* 2023-06-28 09:59:26,457 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-master and message: .*wazuh-worker1.*Files to create in worker: 1 \| Files to update in worker: 0 \| Files to delete in worker: 0.* 2023-06-28 09:59:26,457 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-master and message: .*wazuh-worker2.*Files to create in worker: 1 \| Files to update in worker: 0 \| Files to delete in worker: 0.* 2023-06-28 10:01:06,989 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-master and message: .*wazuh-worker2.*Files to create in worker: 1 \| Files to update in worker: 0 \| Files to delete in worker: 0.* 2023-06-28 10:01:06,989 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-master and message: .*Increasing sync size limit to .* MB.* 2023-06-28 10:02:07,349 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-master and message: .*Increasing sync size limit to .* MB.* 2023-06-28 10:02:07,648 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-28 10:02:07,650 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-master and path: /var/ossec/logs/cluster.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-master and path: /var/ossec/logs/cluster.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-worker1 and path: /var/ossec/logs/cluster.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-worker1 and path: /var/ossec/logs/cluster.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-worker2 and path: /var/ossec/logs/cluster.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-worker2 and path: /var/ossec/logs/cluster.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... ============================================================================================= short test summary info ============================================================================================= FAILED test_integrity_sync/test_integrity_sync.py::test_zip_size_limit - TimeoutError: Did not found the expected callback in wazuh-master: .*File too large to be synced: /var/ossec/etc/rules/test_file_too_big ==================================================================================== 1 failed, 3 passed in 1715.20s (0:28:35) ===================================================================================== ```
### :green_circle: Test ruleset sync status All tests pass
``` =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 1 item test_ruleset_sync_status/test_ruleset_sync_status.py . [100%] ========================================================================================== 1 passed in 264.01s (0:04:24) ========================================================================================== ```
### :green_circle: Test agent groups forced change All tests pass.
``` root@ubuntu22:/home/vagrant/wazuh-qa/tests/system# python3 -m pytest test_cluster/test_agent_groups/test_agent_groups_forced_change.py =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 3 items test_cluster/test_agent_groups/test_agent_groups_forced_change.py ... [100%] ========================================================================================= 3 passed in 1122.91s (0:18:42) ========================================================================================== ```
### :green_circle: Test agent default group added All tests pass.
``` root@ubuntu22:/home/vagrant/wazuh-qa/tests/system# python3 -m pytest test_cluster/test_agent_groups/test_agent_default_group_added.py =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 3 items test_cluster/test_agent_groups/test_agent_default_group_added.py ... [100%] ========================================================================================== 3 passed in 614.83s (0:10:14) ========================================================================================== ```
### :red_circle: Test agent groups The only test fail with a Timeout error. ### :green_circle: Test assign agent group with enrollment All tests pass. ### :green_circle: Test assign agent never connected to group All tests pass. ### :green_circle: Test assign agent to a group api All tests pass. ### :green_circle: Test assign agent to a group by tool All tests pass. ### :green_circle: Test assign agent to a group All tests pass. ### :yellow_circle: Test assign groups guess One test fails with a Timeout error
The output of the last seven tests ``` root@ubuntu22:/home/vagrant/wazuh-qa/tests/system# python3 -m pytest test_cluster/test_agent_groups/test_agent_groups.py test_cluster/test_agent_groups/test_assign_agent_group_with_enrollment.py test_cluster/test_agent_groups/test_assign_agent_never_connected_to_group.py test_cluster/test_agent_groups/test_assign_agent_to_a_group_api.py test_cluster/test_agent_groups/test_assign_agent_to_a_group_by_tool.py test_cluster/test_agent_groups/test_assign_agent_to_a_group.py test_cluster/test_agent_groups/test_assign_groups_guess.py =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 26 items test_cluster/test_agent_groups/test_agent_groups.py F [ 3%] test_cluster/test_agent_groups/test_assign_agent_group_with_enrollment.py . [ 7%] test_cluster/test_agent_groups/test_assign_agent_never_connected_to_group.py .. [ 15%] test_cluster/test_agent_groups/test_assign_agent_to_a_group_api.py .... [ 30%] test_cluster/test_agent_groups/test_assign_agent_to_a_group_by_tool.py .. [ 38%] test_cluster/test_agent_groups/test_assign_agent_to_a_group.py .... [ 53%] test_cluster/test_agent_groups/test_assign_groups_guess.py ..........F. [100%] ==================================================================================================== FAILURES ===================================================================================================== ______________________________________________________________________________________ test_agent_groups_create_remove_group ______________________________________________________________________________________ clean_environment = None, delete_group = None def test_agent_groups_create_remove_group(clean_environment, delete_group): """Check agent agent-groups synchronization works as expected. This test will wait for the expected agent-groups messages declared in data/synchronization_messages.yml and data/delete_messages.yml. Additionally, it will ensure agent-group synchronization is working by adding a group to an agent and removing it afterwards.""" # Get the token master_token = host_manager.get_api_token(master_host) # Register agent agent_ip, agent_id, agent_name, manager_ip = register_agent(test_infra_agents[0], worker_host, host_manager) restart_cluster(test_infra_agents, host_manager) # Check that the agent is active sleep(time_to_sync) check_agent_status(agent_id, agent_name, agent_ip, AGENT_STATUS_ACTIVE, host_manager, test_infra_managers) > HostMonitor(inventory_path=inventory_path, messages_path=sync_messages_path, tmp_path=tmp_path).run() test_cluster/test_agent_groups/test_agent_groups.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-worker1: .*Connection received in local server* /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-28 15:03:33,146 - wazuh_testing - DEBUG - Add new file composer process for wazuh-master and path: /var/ossec/logs/cluster.log 2023-06-28 15:03:33,150 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-master and path: /var/ossec/logs/cluster.log 2023-06-28 15:03:33,150 - wazuh_testing - DEBUG - Starting file composer for wazuh-master and path: /var/ossec/logs/cluster.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_cluster/test_agent_groups/tmp/wazuh-master_cluster.log.tmp 2023-06-28 15:03:33,153 - wazuh_testing - DEBUG - Add new file composer process for wazuh-worker1 and path: /var/ossec/logs/cluster.log 2023-06-28 15:03:33,157 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-worker1 and path: /var/ossec/logs/cluster.log 2023-06-28 15:03:33,162 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-worker1 and message: .*Connection received in local server* 2023-06-28 15:03:33,166 - wazuh_testing - DEBUG - Starting file composer for wazuh-worker1 and path: /var/ossec/logs/cluster.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_cluster/test_agent_groups/tmp/wazuh-worker1_cluster.log.tmp 2023-06-28 15:03:33,170 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-master and message: .*SendSync.*Receiving SendSync request \(authd\) from wazuh-worker1.* 2023-06-28 15:03:36,707 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-master and message: .*SendSync.*Receiving SendSync request \(authd\) from wazuh-worker1.* 2023-06-28 15:05:13,230 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-worker1 and message: .*Connection received in local server* 2023-06-28 15:05:13,230 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-worker1 and message: .*Command received: b'sendsync' 2023-06-28 15:06:53,351 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-worker1 and message: .*Command received: b'sendsync' 2023-06-28 15:06:53,860 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-28 15:06:53,861 - wazuh_testing - DEBUG - Checking results... 2023-06-28 15:06:53,864 - wazuh_testing - DEBUG - Received from wazuh-master the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-master and path: /var/ossec/logs/cluster.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-master and path: /var/ossec/logs/cluster.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-worker1 and path: /var/ossec/logs/cluster.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-worker1 and path: /var/ossec/logs/cluster.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-master the expected message: True ____________________________________________________________________________________ test_guess_multigroups[wazuh-worker1-1-1] ____________________________________________________________________________________ n_agents = 1, target_node = 'wazuh-worker1', status_guess_agent_group = '1', clean_environment = None, modify_local_internal_options = None @pytest.mark.parametrize('n_agents', [1, 2]) @pytest.mark.parametrize('status_guess_agent_group', ['0', '1']) @pytest.mark.parametrize('target_node', ['wazuh-master', 'wazuh-worker1']) def test_guess_multigroups(n_agents, target_node, status_guess_agent_group, clean_environment, modify_local_internal_options): ''' description: Check that when an agent registered in the manager and assigned to group is removed, performs a guessing operation and determinates the groups to with the agent was assigned. wazuh_min_version: 4.4.0 parameters: - n_agents: type: Int brief: Number of agents to register. - target_node: type: String brief: Name of the host where the agent will register. - status_guess_agent_group type: String brief: Determine if the group guessing mechanism is enabled or disabled. - clean_enviroment: type: Fixture brief: Reset the wazuh log files at the start of the test. Remove all registered agents from master. - modify_internal_options: type: Fixture brief: Add internal options in local_internal_options.conf assertions: - Verify that after registering the agent key file exists in all nodes. - Verify that after registering the agent appears as never_connected in all nodes. - Verify that after registering it has the 'Null' group assigned. - Verify that after assign group with agent-groups the change is sync with the cluster. expected_output: - The agent 'Agent_name' with ID 'Agent_id' belongs to groups: group_test." ''' # Restart master to apply local internal options restart_cluster([test_infra_managers[0]], host_manager) time.sleep(timeout) # Create new group create_new_agent_group(test_infra_managers[0], group_id, host_manager) # Register agent with agent-auth agents_data = [] for agent in range(n_agents): agent_data = register_agent(test_infra_agents[agent], target_node, host_manager) agents_data.append(agent_data) # Restart agent restart_cluster(test_infra_agents, host_manager) # Check that agent has client key file for agent in range(n_agents): assert check_keys_file(test_infra_agents[agent], host_manager), ERR_MSG_CLIENT_KEYS_IN_MASTER_NOT_FOUND try: # Create new group and assing agent for agent in range(n_agents): assign_agent_to_new_group(test_infra_managers[0], group_id, agents_data[agent][1], host_manager) time.sleep(timeout) # Check that agent has group set to group_test on Managers for agent in range(n_agents): check_agent_groups(agents_data[agent][1], group_id, test_infra_managers, host_manager) # Remove the agent remove_cluster_agents(test_infra_managers[0], [test_infra_agents[0]], host_manager, [agents_data[0][1]]) # Register agent again with agent-auth agent1_ip, agent1_id, agent1_name, ag1_manager_ip = register_agent(test_infra_agents[0], target_node, host_manager) # Check that agent has client key file assert check_keys_file(test_infra_agents[0], host_manager), ERR_MSG_CLIENT_KEYS_IN_MASTER_NOT_FOUND # Restart agent restart_cluster([test_infra_agents[0]], host_manager) time.sleep(timeout) # Check if remoted.guess_agent_group is disabled expected_group = 'default' if int(status_guess_agent_group) == 0 or n_agents == 1 else multigroups_id # Run the callback checks for the ossec.log messages_path = master_messages_path if target_node == 'wazuh-master' else worker_messages_path replace_regex_in_file(['AGENT_ID', 'GROUP_ID'], [agent1_id, expected_group], messages_path) > HostMonitor(inventory_path=inventory_path, messages_path=messages_path, tmp_path=tmp_path).run(update_position=True) test_cluster/test_agent_groups/test_assign_groups_guess.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-master: .*Agent '003' with file 'merged.mg' MD5 .* /usr/local/lib/python3.10/dist-packages/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-28 16:50:24,980 - wazuh_testing - DEBUG - Add new file composer process for wazuh-worker1 and path: /var/ossec/logs/ossec.log 2023-06-28 16:50:24,984 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-worker1 and path: /var/ossec/logs/ossec.log 2023-06-28 16:50:24,984 - wazuh_testing - DEBUG - Starting file composer for wazuh-worker1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_cluster/test_agent_groups/tmp/wazuh-worker1_ossec.log.tmp 2023-06-28 16:50:24,987 - wazuh_testing - DEBUG - Add new file composer process for wazuh-master and path: /var/ossec/logs/ossec.log 2023-06-28 16:50:24,994 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-master and path: /var/ossec/logs/ossec.log 2023-06-28 16:50:25,008 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-master and message: .*Agent '003' with file 'merged.mg' MD5 .* 2023-06-28 16:50:25,011 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-worker1 and message: .*Sending message to master node: '{"daemon_name":"remoted","message":{"command":"assigngroup","parameters":{"agent":"003","md5":.* 2023-06-28 16:50:25,015 - wazuh_testing - DEBUG - Starting file composer for wazuh-master and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_cluster/test_agent_groups/tmp/wazuh-master_ossec.log.tmp 2023-06-28 16:50:25,786 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-worker1 and message: .*Sending message to master node: '{"daemon_name":"remoted","message":{"command":"assigngroup","parameters":{"agent":"003","md5":.* 2023-06-28 16:50:25,786 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-worker1 and message: .*Message received from master node: '{"error":0,"message":"ok","data":{"group":"default"}}' 2023-06-28 16:50:25,801 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-worker1 and message: .*Message received from master node: '{"error":0,"message":"ok","data":{"group":"default"}}' 2023-06-28 16:50:25,801 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-worker1 and message: .*Agent '003' group is 'default' 2023-06-28 16:50:26,158 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-worker1 and message: .*Agent '003' group is 'default' 2023-06-28 16:50:55,214 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-master and message: .*Agent '003' with file 'merged.mg' MD5 .* 2023-06-28 16:50:55,214 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-master and message: .*Group assigned: 'default' 2023-06-28 16:51:05,359 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-master and message: .*Group assigned: 'default' 2023-06-28 16:51:05,920 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-28 16:51:05,923 - wazuh_testing - DEBUG - Checking results... 2023-06-28 16:51:05,925 - wazuh_testing - DEBUG - Received from wazuh-worker1 the expected message: True 2023-06-28 16:51:05,927 - wazuh_testing - DEBUG - Received from wazuh-worker1 the expected message: True 2023-06-28 16:51:05,927 - wazuh_testing - DEBUG - Received from wazuh-worker1 the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-worker1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-worker1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-master and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-master and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-worker1 the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-worker1 the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-worker1 the expected message: True ================================================================================================ warnings summary ================================================================================================= ../../../../../usr/local/lib/python3.10/dist-packages/wazuh_testing/modules/__init__.py:24 /usr/local/lib/python3.10/dist-packages/wazuh_testing/modules/__init__.py:24: PytestUnknownMarkWarning: Unknown pytest.mark.win32 - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html WINDOWS = pytest.mark.win32 ../../../../../usr/local/lib/python3.10/dist-packages/wazuh_testing/modules/__init__.py:25 /usr/local/lib/python3.10/dist-packages/wazuh_testing/modules/__init__.py:25: PytestUnknownMarkWarning: Unknown pytest.mark.linux - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html LINUX = pytest.mark.linux ../../../../../usr/local/lib/python3.10/dist-packages/wazuh_testing/modules/__init__.py:26 /usr/local/lib/python3.10/dist-packages/wazuh_testing/modules/__init__.py:26: PytestUnknownMarkWarning: Unknown pytest.mark.darwin - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html MACOS = pytest.mark.darwin ../../../../../usr/local/lib/python3.10/dist-packages/wazuh_testing/modules/__init__.py:27 /usr/local/lib/python3.10/dist-packages/wazuh_testing/modules/__init__.py:27: PytestUnknownMarkWarning: Unknown pytest.mark.sunos5 - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html SOLARIS = pytest.mark.sunos5 ../../../../../usr/local/lib/python3.10/dist-packages/wazuh_testing/modules/__init__.py:29 /usr/local/lib/python3.10/dist-packages/wazuh_testing/modules/__init__.py:29: PytestUnknownMarkWarning: Unknown pytest.mark.agent - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html AGENT = pytest.mark.agent -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ============================================================================================= short test summary info ============================================================================================= FAILED test_cluster/test_agent_groups/test_agent_groups.py::test_agent_groups_create_remove_group - TimeoutError: Did not found the expected callback in wazuh-worker1: .*Connection received in local server* FAILED test_cluster/test_agent_groups/test_assign_groups_guess.py::test_guess_multigroups[wazuh-worker1-1-1] - TimeoutError: Did not found the expected callback in wazuh-master: .*Agent '003' with file 'merge... ============================================================================== 2 failed, 24 passed, 5 warnings in 7032.71s (1:57:12) ============================================================================== ```
### :green_circle: Test groups sync default All tests pass.
``` root@ubuntu22:/home/vagrant/wazuh-qa/tests/system# python3 -m pytest test_cluster/test_agent_groups/test_groups_sync_default.py ; python3 -m pytest test_cluster/test_agent_groups/test_groups_sync_default.py =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 2 items test_cluster/test_agent_groups/test_groups_sync_default.py .. [100%] ========================================================================================= 2 passed in 6747.78s (1:52:27) ========================================================================================= ```
### :green_circle: Test group sync time All tests pass.
``` root@ubuntu22:/home/vagrant/wazuh-qa/tests/system# python3 -m pytest test_cluster/test_agent_groups/test_groups_sync_time.py =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 2 items test_cluster/test_agent_groups/test_groups_sync_time.py .. [100%] ========================================================================================= 2 passed in 6970.38s (1:56:10) ========================================================================================== ```
verdx commented 1 year ago

:red_circle: Enrollment

All tests fail with a timeout error

``` root@ubuntu22-1:/home/vagrant/wazuh-qa/tests/system# python3 -m pytest test_enrollment/ =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 20 items test_enrollment/test_enrollment.py FFFFFFFFFFFFFFFFFFFF [100%] ==================================================================================================== FAILURES ===================================================================================================== _____________________________________________________________________________ test_agent_enrollment[manager_both_agent_both-ipv4-yes] _____________________________________________________________________________ test_case = {'agent_network': 'both', 'ip_type': 'ipv4', 'ipv6_enabled': 'yes', 'manager_network': 'both'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 10:50:27,648 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 10:50:27,653 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 10:50:27,657 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 10:50:27,666 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 10:50:27,669 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 10:50:27,674 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 10:50:27,675 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 10:50:27,720 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 10:50:28,707 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 10:50:28,708 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 10:50:28,742 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 10:50:28,743 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 10:50:28,774 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 10:51:27,852 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 10:51:27,852 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 10:52:28,000 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 10:52:28,000 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 10:53:28,173 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 10:53:28,173 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 10:54:28,342 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 10:54:28,342 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 10:55:28,517 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 10:55:28,517 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 10:56:28,670 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 10:56:28,671 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 10:57:28,845 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 10:57:28,846 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 10:58:29,028 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 10:58:29,574 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 10:58:29,575 - wazuh_testing - DEBUG - Checking results... 2023-06-29 10:58:29,577 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 10:58:29,578 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 10:58:29,578 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_both_agent_both-ipv4-no] ______________________________________________________________________________ test_case = {'agent_network': 'both', 'ip_type': 'ipv4', 'ipv6_enabled': 'no', 'manager_network': 'both'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from 172.24.27.3.* /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 10:59:54,297 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 10:59:54,302 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 10:59:54,305 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 10:59:54,319 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 10:59:54,328 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 10:59:54,329 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 10:59:54,339 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 10:59:54,343 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 11:00:54,476 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 11:00:54,476 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 11:00:54,478 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 11:00:54,478 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 11:01:54,576 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 11:01:54,577 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:01:54,603 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 11:01:54,603 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 11:02:54,699 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 11:02:54,699 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:02:54,699 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:03:54,813 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:03:54,813 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:04:54,973 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:04:54,973 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:05:55,100 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:05:55,100 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:06:55,250 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:06:55,250 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:07:55,382 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:07:56,363 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 11:07:56,365 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... _____________________________________________________________________________ test_agent_enrollment[manager_both_agent_both-ipv6-yes] _____________________________________________________________________________ test_case = {'agent_network': 'both', 'ip_type': 'ipv6', 'ipv6_enabled': 'yes', 'manager_network': 'both'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 11:09:17,247 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:09:17,253 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:09:17,260 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:09:17,270 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:09:17,285 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 11:09:17,287 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 11:09:17,302 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 11:09:17,342 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 11:10:17,381 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 11:10:17,381 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 11:10:17,463 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 11:10:17,463 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 11:11:17,578 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 11:11:17,578 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:11:17,636 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 11:11:17,636 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 11:12:17,654 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:12:17,743 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 11:12:17,743 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:13:17,863 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:13:17,864 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:14:18,127 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:14:18,128 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:15:18,297 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:15:18,297 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:16:18,522 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:16:18,523 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:17:18,722 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:17:19,530 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 11:17:19,531 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... _____________________________________________________________________________ test_agent_enrollment[manager_both_agent_both-dns-yes] ______________________________________________________________________________ test_case = {'agent_network': 'both', 'ip_type': 'dns', 'ipv6_enabled': 'yes', 'manager_network': 'both'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 11:18:48,321 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:18:48,325 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:18:48,330 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:18:48,340 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:18:48,351 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 11:18:48,356 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 11:18:48,396 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 11:18:48,480 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 11:18:49,468 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 11:18:49,468 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 11:18:49,518 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 11:18:49,518 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:18:49,552 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:19:48,705 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 11:19:48,705 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 11:20:48,907 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 11:20:48,907 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 11:21:49,082 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 11:21:49,083 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:22:49,244 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:22:49,245 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:23:49,457 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:23:49,457 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:24:49,609 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:24:49,609 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:25:49,788 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:25:49,788 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:26:49,945 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:26:50,703 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 11:26:50,704 - wazuh_testing - DEBUG - Checking results... 2023-06-29 11:26:50,706 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 11:26:50,707 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 11:26:50,708 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_ipv4_agent_ipv4-ipv4-yes] _____________________________________________________________________________ test_case = {'agent_network': 'ipv4', 'ip_type': 'ipv4', 'ipv6_enabled': 'yes', 'manager_network': 'ipv4'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from 172.24.27.3.* /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 11:28:25,530 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:28:25,534 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:28:25,538 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:28:25,546 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:28:25,568 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 11:28:25,572 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 11:28:25,583 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 11:28:25,623 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 11:29:25,720 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 11:29:25,720 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 11:29:25,740 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 11:29:25,741 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 11:30:25,863 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 11:30:25,863 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 11:30:25,863 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 11:30:25,863 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:31:25,949 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 11:31:25,949 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:31:25,991 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:32:26,068 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:32:26,068 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:33:26,224 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:33:26,224 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:34:26,370 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:34:26,371 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:35:26,570 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:35:26,570 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:36:26,712 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:36:26,821 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 11:36:26,822 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... _____________________________________________________________________________ test_agent_enrollment[manager_ipv4_agent_ipv4-ipv4-no] ______________________________________________________________________________ test_case = {'agent_network': 'ipv4', 'ip_type': 'ipv4', 'ipv6_enabled': 'no', 'manager_network': 'ipv4'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 11:38:18,012 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:38:18,016 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:38:18,023 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:38:18,032 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:38:18,066 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 11:38:18,075 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 11:38:18,079 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 11:38:18,102 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 11:38:19,141 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 11:38:19,141 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 11:38:19,178 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 11:38:19,178 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:38:19,209 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:39:18,283 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 11:39:18,284 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 11:40:18,426 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 11:40:18,426 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 11:41:18,630 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 11:41:18,631 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:42:18,782 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:42:18,783 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:43:18,989 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:43:18,989 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:44:19,195 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:44:19,196 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:45:19,357 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:45:19,358 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:46:19,499 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:46:19,699 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 11:46:19,700 - wazuh_testing - DEBUG - Checking results... 2023-06-29 11:46:19,702 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 11:46:19,703 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 11:46:19,705 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_ipv4_agent_ipv4-dns-yes] ______________________________________________________________________________ test_case = {'agent_network': 'ipv4', 'ip_type': 'dns', 'ipv6_enabled': 'yes', 'manager_network': 'ipv4'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from 172.24.27.3.* /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 11:48:18,442 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:48:18,446 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:48:18,469 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:48:18,480 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:48:18,499 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 11:48:18,500 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 11:48:18,535 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 11:48:18,563 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/172.24.27.2 2023-06-29 11:49:18,610 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 11:49:18,610 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 11:49:18,688 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/172.24.27.2 2023-06-29 11:49:18,688 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/172.24.27.2 2023-06-29 11:50:18,730 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 11:50:18,730 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:50:18,874 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/172.24.27.2 2023-06-29 11:50:18,874 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 11:51:18,894 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:51:19,101 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 11:51:19,102 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:52:19,301 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 11:52:19,302 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:53:19,451 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 11:53:19,451 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:54:19,681 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 11:54:19,681 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:55:19,825 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 11:55:19,825 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:56:20,037 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 11:56:20,232 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 11:56:20,236 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... ______________________________________________________________________________ test_agent_enrollment[manager_ipv4_agent_ipv4-dns-no] ______________________________________________________________________________ test_case = {'agent_network': 'ipv4', 'ip_type': 'dns', 'ipv6_enabled': 'no', 'manager_network': 'ipv4'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/172.24.27.2 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 11:58:10,528 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:58:10,532 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 11:58:10,536 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:58:10,543 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 11:58:10,566 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 11:58:10,571 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 11:58:10,582 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/172.24.27.2 2023-06-29 11:58:10,614 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 11:58:11,653 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 11:58:11,653 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 11:58:11,685 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 11:58:11,685 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:58:11,717 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 11:59:10,946 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/172.24.27.2 2023-06-29 11:59:10,946 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/172.24.27.2 2023-06-29 12:00:11,187 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/172.24.27.2 2023-06-29 12:00:11,187 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 12:01:11,376 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 12:01:11,376 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:02:11,597 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:02:11,597 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:03:11,776 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:03:11,776 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:04:11,863 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:04:11,863 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:05:11,952 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:05:11,952 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:06:12,070 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:06:12,639 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 12:06:12,640 - wazuh_testing - DEBUG - Checking results... 2023-06-29 12:06:12,642 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:06:12,642 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:06:12,643 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_ipv6_agent_ipv6-ipv6-yes] _____________________________________________________________________________ test_case = {'agent_network': 'ipv6', 'ip_type': 'ipv6', 'ipv6_enabled': 'yes', 'manager_network': 'ipv6'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 12:07:58,795 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:07:58,801 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:07:58,821 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:07:58,824 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 12:07:58,826 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 12:07:58,838 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:07:58,849 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 12:07:58,887 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 12:07:59,861 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 12:07:59,861 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 12:07:59,890 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 12:07:59,890 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:07:59,924 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:08:59,043 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 12:08:59,043 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 12:09:59,163 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 12:09:59,163 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 12:10:59,339 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 12:10:59,339 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:11:59,457 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:11:59,458 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:12:59,549 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:12:59,549 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:13:59,669 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:13:59,669 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:14:59,762 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:14:59,762 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:15:59,892 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:16:00,733 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 12:16:00,734 - wazuh_testing - DEBUG - Checking results... 2023-06-29 12:16:00,737 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:16:00,738 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:16:00,739 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_ipv6_agent_ipv6-dns-yes] ______________________________________________________________________________ test_case = {'agent_network': 'ipv6', 'ip_type': 'dns', 'ipv6_enabled': 'yes', 'manager_network': 'ipv6'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 12:17:43,000 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:17:43,005 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:17:43,011 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:17:43,022 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:17:43,030 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 12:17:43,044 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 12:17:43,062 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 12:17:43,085 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 12:17:44,080 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 12:17:44,080 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 12:17:44,108 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 12:17:44,109 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:17:44,136 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:18:43,205 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 12:18:43,205 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 12:19:43,323 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 12:19:43,323 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 12:20:43,427 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 12:20:43,427 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:21:43,551 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:21:43,551 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:22:43,694 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:22:43,694 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:23:43,789 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:23:43,790 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:24:43,873 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:24:43,873 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:25:43,963 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:25:44,451 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 12:25:44,452 - wazuh_testing - DEBUG - Checking results... 2023-06-29 12:25:44,454 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:25:44,454 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:25:44,454 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_both_agent_ipv4-ipv4-yes] _____________________________________________________________________________ test_case = {'agent_network': 'ipv4', 'ip_type': 'ipv4', 'ipv6_enabled': 'yes', 'manager_network': 'both'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 12:27:22,612 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:27:22,616 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:27:22,620 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:27:22,630 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:27:22,640 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 12:27:22,647 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 12:27:22,697 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 12:27:22,700 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 12:27:23,677 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 12:27:23,677 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 12:27:23,705 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 12:27:23,705 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:27:23,733 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:28:22,781 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 12:28:22,781 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 12:29:22,863 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 12:29:22,863 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 12:30:22,918 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 12:30:22,918 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:31:23,017 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:31:23,018 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:32:23,104 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:32:23,104 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:33:23,188 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:33:23,188 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:34:23,262 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:34:23,262 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:35:23,340 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:35:23,569 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 12:35:23,571 - wazuh_testing - DEBUG - Checking results... 2023-06-29 12:35:23,572 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:35:23,572 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:35:23,573 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_both_agent_ipv4-ipv4-no] ______________________________________________________________________________ test_case = {'agent_network': 'ipv4', 'ip_type': 'ipv4', 'ipv6_enabled': 'no', 'manager_network': 'both'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 12:36:53,439 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:36:53,444 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:36:53,448 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:36:53,458 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:36:53,472 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 12:36:53,479 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 12:36:53,509 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 12:36:53,532 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 12:36:54,513 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 12:36:54,513 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 12:36:54,544 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 12:36:54,544 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:36:54,575 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:37:53,600 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 12:37:53,601 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 12:38:53,712 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 12:38:53,712 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 12:39:53,789 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 12:39:53,789 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:40:53,879 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:40:53,879 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:41:53,934 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:41:53,934 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:42:53,999 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:42:53,999 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:43:54,097 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:43:54,097 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:44:54,177 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:44:54,428 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 12:44:54,429 - wazuh_testing - DEBUG - Checking results... 2023-06-29 12:44:54,431 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:44:54,431 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:44:54,432 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_both_agent_ipv4-dns-yes] ______________________________________________________________________________ test_case = {'agent_network': 'ipv4', 'ip_type': 'dns', 'ipv6_enabled': 'yes', 'manager_network': 'both'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/172.24.27.2 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 12:46:25,072 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:46:25,076 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:46:25,080 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:46:25,084 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:46:25,109 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 12:46:25,116 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 12:46:25,139 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 12:46:25,191 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/172.24.27.2 2023-06-29 12:46:26,170 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 12:46:26,170 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 12:46:26,206 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 12:46:26,206 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:46:26,233 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:47:25,323 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/172.24.27.2 2023-06-29 12:47:25,323 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/172.24.27.2 2023-06-29 12:48:25,444 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/172.24.27.2 2023-06-29 12:48:25,444 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 12:49:25,572 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 12:49:25,572 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:50:25,685 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:50:25,685 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:51:25,792 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 12:51:25,792 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:52:25,909 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 12:52:25,909 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:53:26,007 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 12:53:26,007 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:54:26,129 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 12:54:26,570 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 12:54:26,571 - wazuh_testing - DEBUG - Checking results... 2023-06-29 12:54:26,573 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:54:26,573 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 12:54:26,577 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True ______________________________________________________________________________ test_agent_enrollment[manager_both_agent_ipv4-dns-no] ______________________________________________________________________________ test_case = {'agent_network': 'ipv4', 'ip_type': 'dns', 'ipv6_enabled': 'no', 'manager_network': 'both'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/172.24.27.2 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 12:55:57,795 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:55:57,799 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 12:55:57,806 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:55:57,814 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 12:55:57,833 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 12:55:57,854 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 12:55:57,890 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/172.24.27.2 2023-06-29 12:55:57,921 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 12:55:58,952 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 12:55:58,952 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 12:55:58,979 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 12:55:58,979 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:55:59,006 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 12:56:57,991 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/172.24.27.2 2023-06-29 12:56:57,991 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/172.24.27.2 2023-06-29 12:57:58,127 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/172.24.27.2 2023-06-29 12:57:58,128 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 12:58:58,236 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 12:58:58,236 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:59:58,367 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 12:59:58,368 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:00:58,493 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:00:58,494 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:01:58,584 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:01:58,585 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:02:58,692 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:02:58,692 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:03:58,807 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:03:59,232 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 13:03:59,233 - wazuh_testing - DEBUG - Checking results... 2023-06-29 13:03:59,235 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 13:03:59,235 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 13:03:59,236 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_both_agent_ipv6-ipv6-yes] _____________________________________________________________________________ test_case = {'agent_network': 'ipv6', 'ip_type': 'ipv6', 'ipv6_enabled': 'yes', 'manager_network': 'both'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 13:05:33,568 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:05:33,573 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:05:33,577 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:05:33,582 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:05:33,621 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 13:05:33,627 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 13:05:33,637 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 13:05:33,716 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:06:33,720 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 13:06:33,720 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 13:06:33,850 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:06:33,851 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:07:33,824 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 13:07:33,824 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:07:33,933 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:07:33,934 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 13:08:33,921 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:08:34,043 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 13:08:34,044 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:09:34,152 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:09:34,152 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:10:34,244 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:10:34,245 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:11:34,381 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:11:34,381 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:12:34,483 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:12:34,483 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:13:34,612 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:13:34,959 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 13:13:34,960 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... _____________________________________________________________________________ test_agent_enrollment[manager_both_agent_ipv6-dns-yes] ______________________________________________________________________________ test_case = {'agent_network': 'ipv6', 'ip_type': 'dns', 'ipv6_enabled': 'yes', 'manager_network': 'both'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 13:15:07,193 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:15:07,200 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:15:07,208 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:15:07,212 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:15:07,223 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 13:15:07,240 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 13:15:07,243 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:15:07,264 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 13:15:07,794 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 13:15:07,794 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 13:15:07,821 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 13:15:07,822 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:15:07,850 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:16:07,334 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:16:07,335 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:17:07,418 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:17:07,419 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 13:18:07,537 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 13:18:07,537 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:19:07,628 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:19:07,629 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:20:07,755 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:20:07,755 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:21:07,891 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:21:07,892 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:22:08,044 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:22:08,044 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:23:08,157 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:23:08,719 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 13:23:08,721 - wazuh_testing - DEBUG - Checking results... 2023-06-29 13:23:08,722 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 13:23:08,723 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 13:23:08,725 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_ipv4_agent_both-ipv4-yes] _____________________________________________________________________________ test_case = {'agent_network': 'both', 'ip_type': 'ipv4', 'ipv6_enabled': 'yes', 'manager_network': 'ipv4'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 13:24:40,305 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:24:40,310 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:24:40,313 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:24:40,321 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:24:40,332 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 13:24:40,336 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 13:24:40,342 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 13:24:40,367 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 13:25:40,426 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 13:25:40,427 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 13:25:40,428 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 13:25:40,428 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 13:26:40,515 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 13:26:40,515 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 13:26:40,539 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 13:26:40,539 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:27:40,606 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:27:40,611 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 13:27:40,611 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:28:40,729 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:28:40,729 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:29:40,788 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:29:40,788 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:30:40,861 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:30:40,861 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:31:40,943 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:31:40,944 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:32:41,035 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:32:41,268 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 13:32:41,269 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... _____________________________________________________________________________ test_agent_enrollment[manager_ipv4_agent_both-ipv4-no] ______________________________________________________________________________ test_case = {'agent_network': 'both', 'ip_type': 'ipv4', 'ipv6_enabled': 'no', 'manager_network': 'ipv4'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 13:34:12,452 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:34:12,456 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:34:12,463 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:34:12,468 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:34:12,486 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 13:34:12,494 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 13:34:12,505 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 13:34:12,543 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 13:34:13,537 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 13:34:13,537 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 13:34:13,566 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 13:34:13,566 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:34:13,595 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:35:12,645 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 13:35:12,646 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 13:36:12,764 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 13:36:12,765 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 13:37:12,856 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 13:37:12,857 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:38:13,017 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:38:13,017 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:39:13,133 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:39:13,133 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:40:13,324 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:40:13,324 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:41:13,461 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:41:13,461 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:42:13,623 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:42:14,470 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 13:42:14,472 - wazuh_testing - DEBUG - Checking results... 2023-06-29 13:42:14,474 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 13:42:14,474 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 13:42:14,474 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_ipv6_agent_both-ipv6-yes] _____________________________________________________________________________ test_case = {'agent_network': 'both', 'ip_type': 'ipv6', 'ipv6_enabled': 'yes', 'manager_network': 'ipv6'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 13:43:43,900 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:43:43,904 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:43:43,908 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:43:43,916 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:43:43,926 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 13:43:43,951 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:43:43,966 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 13:43:43,996 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 13:43:45,026 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 13:43:45,026 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 13:43:45,056 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 13:43:45,056 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:43:45,083 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:44:44,116 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:44:44,116 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:45:44,255 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:45:44,255 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 13:46:44,402 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 13:46:44,402 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:47:44,540 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:47:44,540 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:48:44,634 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:48:44,634 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:49:44,753 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:49:44,753 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:50:44,910 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:50:44,910 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:51:45,001 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:51:45,444 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 13:51:45,445 - wazuh_testing - DEBUG - Checking results... 2023-06-29 13:51:45,450 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 13:51:45,451 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 13:51:45,452 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_ipv6_agent_both-dns-yes] ______________________________________________________________________________ test_case = {'agent_network': 'both', 'ip_type': 'dns', 'ipv6_enabled': 'yes', 'manager_network': 'ipv6'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' description: Check if enrollment messages are sent in the correct format and the agent is registered and connected. wazuh_min_version: 4.4.0 parameters: - test_case: type: list brief: List of tests to be performed. - get_ip_directions: type: fixture brief: Get IP from the manager and the agent. - configure_network: type: fixture brief: Configure a custom network environment for testing. - modify_ip_address_conf: type: fixture brief: Add IP to test configuration. - clean_environment: type: fixture brief: Clean environment after every test execution. assertions: - Verify that expected logs are received after registering an agent. - Verify that 'client.keys' are equal in manager and agent. - Verify that the agent is 'Active' input_description: Different use cases are found in the test module and include parameters for 'agent-auth' messages. expected_output: - '.*Received request for a new agent .* from: AGENT_IP' - '.*Agent key generated for.*' - '.*Server IP Address: MANAGER_IP' - '.*Requesting a key from server: MANAGER_IP' - '.*Registering agent to unverified manager' - '.*Using agent name as:*' - '.*Waiting for server reply' - '.*Valid key received' - '.*Waiting .* seconds before server connection' tags: - authd - agentd ''' # Clean ossec.log and cluster.log host_manager.clear_file(host='wazuh-manager', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) host_manager.clear_file(host='wazuh-agent1', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) # Start the agent enrollment process by restarting the wazuh-agent host_manager.control_service(host='wazuh-manager', service='wazuh', state="restarted") host_manager.get_host('wazuh-agent1').ansible('command', f'service wazuh-agent restart', check=False) # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages_path, > tmp_path=tmp_path).run() test_enrollment/test_enrollment.py:232: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.4.4-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-06-29 13:53:16,119 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:53:16,123 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-06-29 13:53:16,130 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:53:16,134 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-06-29 13:53:16,163 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 13:53:16,167 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-agent1_ossec.log.tmp 2023-06-29 13:53:16,175 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_enrollment/tmp/wazuh-manager_ossec.log.tmp 2023-06-29 13:53:16,188 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:54:16,291 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from FDD1:AC8C:0557:7CE2:0000:0000:0000:0003.* 2023-06-29 13:54:16,291 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 13:54:16,335 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:54:16,335 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:55:16,385 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: FDD1:AC8C:0557:7CE2:0000:0000:0000:0003 2023-06-29 13:55:16,385 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:55:16,428 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: wazuh\-manager/FDD1:AC8C:0557:7CE2:0000:0000:0000:0002 2023-06-29 13:55:16,428 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 13:56:16,506 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:56:16,554 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[FDD1:AC8C:0557:7CE2:0000:0000:0000:0002\]:1515'.* 2023-06-29 13:56:16,554 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:57:16,644 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:57:16,644 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:58:16,806 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:58:16,806 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:59:16,994 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:59:16,995 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 14:00:17,134 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 14:00:17,134 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 14:01:17,269 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 14:01:18,144 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 14:01:18,145 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... ============================================================================================= short test summary info ============================================================================================= FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_both_agent_both-ipv4-yes] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_both_agent_both-ipv4-no] - TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from 172.24.27.3.* FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_both_agent_both-ipv6-yes] - TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from FDD1:AC8C:0557:7C... FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_both_agent_both-dns-yes] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/FDD1:... FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_ipv4_agent_ipv4-ipv4-yes] - TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from 172.24.27.3.* FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_ipv4_agent_ipv4-ipv4-no] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_ipv4_agent_ipv4-dns-yes] - TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from 172.24.27.3.* FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_ipv4_agent_ipv4-dns-no] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/172.24... FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_ipv6_agent_ipv6-ipv6-yes] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: FDD1:AC8C:0557:7CE2... FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_ipv6_agent_ipv6-dns-yes] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/FDD1:... FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_both_agent_ipv4-ipv4-yes] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_both_agent_ipv4-ipv4-no] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_both_agent_ipv4-dns-yes] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/172.2... FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_both_agent_ipv4-dns-no] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/172.24... FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_both_agent_ipv6-ipv6-yes] - TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from FDD1:AC8C:0557:7C... FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_both_agent_ipv6-dns-yes] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: wazuh\-manager/FDD1:... FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_ipv4_agent_both-ipv4-yes] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_ipv4_agent_both-ipv4-no] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: 172.24.27.2 FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_ipv6_agent_both-ipv6-yes] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Server IP Address: FDD1:AC8C:0557:7CE2... FAILED test_enrollment/test_enrollment.py::test_agent_enrollment[manager_ipv6_agent_both-dns-yes] - TimeoutError: Did not found the expected callback in wazuh-manager: .*New connection from FDD1:AC8C:0557:7CE... ======================================================================================== 20 failed in 11541.64s (3:12:21) ========================================================================================= root@ubuntu22-1:/home/vagrant/wazuh-qa/tests/system# t1_ossec.log.tmp 2023-06-29 13:34:12,505 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 13:34:12,543 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 13:34:13,537 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*New connection from 172.24.27.3.* 2023-06-29 13:34:13,537 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 13:34:13,566 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Received request for a new agent .* from: 172.24.27.3 2023-06-29 13:34:13,566 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:34:13,595 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent key generated for.* 2023-06-29 13:35:12,645 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Server IP Address: 172.24.27.2 2023-06-29 13:35:12,646 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 13:36:12,764 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Requesting a key from server: 172.24.27.2 2023-06-29 13:36:12,765 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 13:37:12,856 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Connected to enrollment service at '\[172.24.27.2\]:1515'.* 2023-06-29 13:37:12,857 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:38:13,017 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Registering agent to unverified manager 2023-06-29 13:38:13,017 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:39:13,133 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Using agent name as:* 2023-06-29 13:39:13,133 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:40:13,324 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting for server reply 2023-06-29 13:40:13,324 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:41:13,461 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Valid key received 2023-06-29 13:41:13,461 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:42:13,623 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Waiting .* seconds before server connection 2023-06-29 13:42:14,470 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-06-29 13:42:14,472 - wazuh_testing - DEBUG - Checking results... 2023-06-29 13:42:14,474 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 13:42:14,474 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-06-29 13:42:14,474 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True _____________________________________________________________________________ test_agent_enrollment[manager_ipv6_agent_both-ipv6-yes] _____________________________________________________________________________ test_case = {'agent_network': 'both', 'ip_type': 'ipv6', 'ipv6_enabled': 'yes', 'manager_network': 'ipv6'}, get_ip_directions = None, configure_network = None, modify_ip_address_conf = None clean_environment = None @pytest.mark.parametrize('test_case', [cases['test_case'] for cases in test_cases_yaml], ids=[cases['name'] for cases in test_cases_yaml]) def test_agent_enrollment(test_case, get_ip_directions, configure_network, modify_ip_address_conf, clean_environment): ''' ```
verdx commented 1 year ago

:yellow_circle: FIM

The provisioning fails if wazuh-branch is not defined because of the following error in the agent role yaml:

- name: "Get agent package"
  ansible.builtin.get_url:
    url: "https://{{package_repository}}.wazuh.com/{{repository}}/apt/pool/main/w/wazuh-agent/wazuh-agent_{{package_version}}-{{package_revision}}_amd64.deb"
    dest: /tmp/wazuh-manager.deb
  when: wazuh_branch is not defined

- name: "Install agent package"
  ansible.builtin.apt:
    deb: /tmp/wazuh-agent.deb
  when: wazuh_branch is not defined

The package is downloaded as wazuh-manager.deb but is installed as wazuh-agent.deb

When called with parameter wazuh_branch, the provisioning is done correctly and the tests can be run, but all tests in test_fim/test_synchronization and some in test_fim/test_files fail with Timeout errors.

``` root@ubuntu22-1:/home/vagrant/wazuh-qa/tests/system# python3 -m pytest test_fim/ =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 15 items test_fim/test_files/test_files_cud.py ..F....F. [ 60%] test_fim/test_synchronization/test_synchronization.py FFFFFF [100%] ==================================================================================================== FAILURES ===================================================================================================== _________________________________________________________________________________________ test_file_cud[testdir1-delete] __________________________________________________________________________________________ folder_path = 'testdir1', case = 'delete' @pytest.mark.parametrize('case', ['add', 'modify', 'delete']) @pytest.mark.parametrize('folder_path', ['testdir1', 'testdir2', 'testdir3']) def test_file_cud(folder_path, case): ''' description: The test will monitor a directory. Finally, it will verify that the FIM event is generated in agent and manager side. wazuh_min_version: 4.2.0 parameters: - folder_path: type: str brief: Name of the folder that will be created in the test. - case: type: str brief: Name of the test case that will be created in the test. assertions: - Verify that FIM events are generated correctly on the manager and agent sides. input_description: Different test cases are included with Pytest parametrize. The test cases are: add, modify and delete files. expected_output: - Different test cases are contained in external YAML file (delete_message.yml and messages.yml) tags: - fim_basic_usage - scheduled - realtime - who_data ''' messages = messages_path[0] enviroment_files = [('wazuh-manager', os.path.join(WAZUH_LOGS_PATH, 'ossec.log')), ('wazuh-agent1', os.path.join(WAZUH_LOGS_PATH, 'ossec.log'))] clean_environment(host_manager, enviroment_files) create_folder_file(host_manager, folder_path) # Restart Wazuh agent host_manager.control_service(host='wazuh-agent1', service='wazuh', state="restarted") # Check if the scan monitors end if (folder_path == scheduled_mode): wait_for_fim_scan_end(HostMonitor, inventory_path, messages_path[2], tmp_path) if (case == 'modify'): host_manager.modify_file_content(host='wazuh-agent1', path=folder_path, content=folder_path) elif(case == 'delete'): host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') messages = messages_path[1] try: # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages, > tmp_path=tmp_path).run() test_fim/test_files/test_files_cud.py:126: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-manager: .*Agent 001 query: syscheck delete /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-07-03 10:16:01,415 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:16:01,418 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:16:01,419 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_files/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:16:01,426 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*File integrity monitoring scan ended.$ 2023-07-03 10:16:04,495 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*File integrity monitoring scan ended.$ 2023-07-03 10:16:05,426 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:16:05,427 - wazuh_testing - DEBUG - Checking results... 2023-07-03 10:16:05,429 - wazuh_testing - DEBUG - Received from wazuh-agent1 the expected message: True 2023-07-03 10:16:09,175 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:16:09,179 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_files/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:16:09,179 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:16:09,182 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:16:09,186 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:16:09,200 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent 001 query: syscheck delete 2023-07-03 10:16:09,203 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:16:09,207 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_files/tmp/wazuh-manager_ossec.log.tmp 2023-07-03 10:16:12,709 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:17:09,309 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent 001 query: syscheck delete 2023-07-03 10:17:09,318 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:17:09,320 - wazuh_testing - DEBUG - Checking results... 2023-07-03 10:17:09,322 - wazuh_testing - DEBUG - Received from wazuh-agent1 the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-agent1 the expected message: True DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-agent1 the expected message: True _________________________________________________________________________________________ test_file_cud[testdir3-modify] __________________________________________________________________________________________ folder_path = 'testdir3', case = 'modify' @pytest.mark.parametrize('case', ['add', 'modify', 'delete']) @pytest.mark.parametrize('folder_path', ['testdir1', 'testdir2', 'testdir3']) def test_file_cud(folder_path, case): ''' description: The test will monitor a directory. Finally, it will verify that the FIM event is generated in agent and manager side. wazuh_min_version: 4.2.0 parameters: - folder_path: type: str brief: Name of the folder that will be created in the test. - case: type: str brief: Name of the test case that will be created in the test. assertions: - Verify that FIM events are generated correctly on the manager and agent sides. input_description: Different test cases are included with Pytest parametrize. The test cases are: add, modify and delete files. expected_output: - Different test cases are contained in external YAML file (delete_message.yml and messages.yml) tags: - fim_basic_usage - scheduled - realtime - who_data ''' messages = messages_path[0] enviroment_files = [('wazuh-manager', os.path.join(WAZUH_LOGS_PATH, 'ossec.log')), ('wazuh-agent1', os.path.join(WAZUH_LOGS_PATH, 'ossec.log'))] clean_environment(host_manager, enviroment_files) create_folder_file(host_manager, folder_path) # Restart Wazuh agent host_manager.control_service(host='wazuh-agent1', service='wazuh', state="restarted") # Check if the scan monitors end if (folder_path == scheduled_mode): wait_for_fim_scan_end(HostMonitor, inventory_path, messages_path[2], tmp_path) if (case == 'modify'): host_manager.modify_file_content(host='wazuh-agent1', path=folder_path, content=folder_path) elif(case == 'delete'): host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') messages = messages_path[1] try: # Run the callback checks for the ossec.log HostMonitor(inventory_path=inventory_path, messages_path=messages, > tmp_path=tmp_path).run() test_fim/test_files/test_files_cud.py:126: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-manager: .*Agent 001 query: (.+) save2 /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-07-03 10:20:40,688 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:20:40,691 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:20:40,692 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_files/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:20:40,695 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:20:40,699 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:20:40,708 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:20:40,712 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_files/tmp/wazuh-manager_ossec.log.tmp 2023-07-03 10:20:40,718 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:20:43,246 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:21:40,809 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:21:41,322 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:21:41,323 - wazuh_testing - DEBUG - Checking results... 2023-07-03 10:21:41,325 - wazuh_testing - DEBUG - Received from wazuh-agent1 the expected message: True ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-agent1 the expected message: True _________________________________________________________________________________ test_synchronization[testdir1-add-wazuh-agent1] _________________________________________________________________________________ folder_path = 'testdir1', case = 'add', host = 'wazuh-agent1' @pytest.mark.parametrize('host', ['wazuh-agent1', 'wazuh-manager']) @pytest.mark.parametrize('case', ['add', 'modify', 'delete']) @pytest.mark.parametrize('folder_path', ['testdir1']) def test_synchronization(folder_path, case, host): ''' Description: The test will monitor a directory and apply changes when agent/manager is stopped. Finally, it will verify that the FIM 'Synchronization' event is generated in agent and manager side. wazuh_min_version: 4.2.0 parameters: - folder_path: type: str brief: Name of the folder that will be created in the test. - case: type: str brief: Name of the test case that will be created in the test. - host: type: str brief: Name of the endpoint that will be use in the test. assertions: - Verify that FIM sync events are generated correctly on the manager and agent sides. input_description: Different test cases are included with Pytest parametrize. The test cases are: add, modify and delete files. expected_output: - Different test cases are contained in external YAML file (agent_initializing_synchronization.yml and manager_initializing_synchronization.yaml) tags: - fim_basic_usage - scheduled ''' message_path = messages_path[3] # Clear logs, create folder to monitored and restart the service create_folder_file(host_manager, folder_path) host_manager.control_service(host='wazuh-agent1', service='wazuh', state="restarted") # Check that the manager contains data to monitor try: HostMonitor(inventory_path=inventory_path, messages_path=messages_path[0], tmp_path=tmp_path).run() except Exception: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') clean_environment(host_manager, enviroment_files) # Stop host host_manager.run_command(host, '/var/ossec/bin/wazuh-control stop') if (case == 'add'): host_manager.run_command('wazuh-agent1', f'touch {folder_path}/{folder_path}.txt') elif (case == 'modify'): host_manager.modify_file_content(host='wazuh-agent1', path=folder_path, content=folder_path) else: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') folder_path = f"'/{folder_path}/{folder_path}.txt'" query = " select * from fim_entry where full_path='\"{}\"'".format(folder_path) # Start host host_manager.run_command(host, '/var/ossec/bin/wazuh-control start') if (host == 'wazuh-manager'): message_path = messages_path[4] try: HostMonitor(inventory_path=inventory_path, messages_path=message_path, > tmp_path=tmp_path).run() test_fim/test_synchronization/test_synchronization.py:149: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Finished FIM sync. /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-07-03 10:22:50,380 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:22:50,383 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:22:50,387 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:22:50,391 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:22:50,391 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:22:50,399 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:22:50,404 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:22:50,407 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-manager_ossec.log.tmp 2023-07-03 10:22:53,439 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:23:50,501 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:23:50,539 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:23:50,541 - wazuh_testing - DEBUG - Checking results... 2023-07-03 10:23:50,547 - wazuh_testing - DEBUG - Received from wazuh-agent1 the expected message: True 2023-07-03 10:24:22,539 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:24:22,543 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:24:22,547 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:24:22,555 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Finished FIM sync. 2023-07-03 10:25:22,745 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Finished FIM sync. 2023-07-03 10:25:23,666 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:25:23,667 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-agent1 the expected message: True DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... ________________________________________________________________________________ test_synchronization[testdir1-add-wazuh-manager] _________________________________________________________________________________ folder_path = 'testdir1', case = 'add', host = 'wazuh-manager' @pytest.mark.parametrize('host', ['wazuh-agent1', 'wazuh-manager']) @pytest.mark.parametrize('case', ['add', 'modify', 'delete']) @pytest.mark.parametrize('folder_path', ['testdir1']) def test_synchronization(folder_path, case, host): ''' Description: The test will monitor a directory and apply changes when agent/manager is stopped. Finally, it will verify that the FIM 'Synchronization' event is generated in agent and manager side. wazuh_min_version: 4.2.0 parameters: - folder_path: type: str brief: Name of the folder that will be created in the test. - case: type: str brief: Name of the test case that will be created in the test. - host: type: str brief: Name of the endpoint that will be use in the test. assertions: - Verify that FIM sync events are generated correctly on the manager and agent sides. input_description: Different test cases are included with Pytest parametrize. The test cases are: add, modify and delete files. expected_output: - Different test cases are contained in external YAML file (agent_initializing_synchronization.yml and manager_initializing_synchronization.yaml) tags: - fim_basic_usage - scheduled ''' message_path = messages_path[3] # Clear logs, create folder to monitored and restart the service create_folder_file(host_manager, folder_path) host_manager.control_service(host='wazuh-agent1', service='wazuh', state="restarted") # Check that the manager contains data to monitor try: HostMonitor(inventory_path=inventory_path, messages_path=messages_path[0], tmp_path=tmp_path).run() except Exception: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') clean_environment(host_manager, enviroment_files) # Stop host host_manager.run_command(host, '/var/ossec/bin/wazuh-control stop') if (case == 'add'): host_manager.run_command('wazuh-agent1', f'touch {folder_path}/{folder_path}.txt') elif (case == 'modify'): host_manager.modify_file_content(host='wazuh-agent1', path=folder_path, content=folder_path) else: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') folder_path = f"'/{folder_path}/{folder_path}.txt'" query = " select * from fim_entry where full_path='\"{}\"'".format(folder_path) # Start host host_manager.run_command(host, '/var/ossec/bin/wazuh-control start') if (host == 'wazuh-manager'): message_path = messages_path[4] try: HostMonitor(inventory_path=inventory_path, messages_path=message_path, > tmp_path=tmp_path).run() test_fim/test_synchronization/test_synchronization.py:149: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-manager: .*Finished FIM sync. /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-07-03 10:25:48,331 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:25:48,334 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:25:48,337 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:25:48,338 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:25:48,342 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:25:48,352 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-manager_ossec.log.tmp 2023-07-03 10:25:48,379 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:25:48,398 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:25:51,415 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:25:51,494 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:25:52,358 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:25:52,359 - wazuh_testing - DEBUG - Checking results... 2023-07-03 10:25:52,361 - wazuh_testing - DEBUG - Received from wazuh-agent1 the expected message: True 2023-07-03 10:25:52,362 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-07-03 10:26:33,631 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:26:33,635 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:26:33,637 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-manager_ossec.log.tmp 2023-07-03 10:26:33,644 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Finished FIM sync. 2023-07-03 10:27:33,681 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Finished FIM sync. 2023-07-03 10:27:34,245 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:27:34,246 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-agent1 the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... _______________________________________________________________________________ test_synchronization[testdir1-modify-wazuh-agent1] ________________________________________________________________________________ folder_path = 'testdir1', case = 'modify', host = 'wazuh-agent1' @pytest.mark.parametrize('host', ['wazuh-agent1', 'wazuh-manager']) @pytest.mark.parametrize('case', ['add', 'modify', 'delete']) @pytest.mark.parametrize('folder_path', ['testdir1']) def test_synchronization(folder_path, case, host): ''' Description: The test will monitor a directory and apply changes when agent/manager is stopped. Finally, it will verify that the FIM 'Synchronization' event is generated in agent and manager side. wazuh_min_version: 4.2.0 parameters: - folder_path: type: str brief: Name of the folder that will be created in the test. - case: type: str brief: Name of the test case that will be created in the test. - host: type: str brief: Name of the endpoint that will be use in the test. assertions: - Verify that FIM sync events are generated correctly on the manager and agent sides. input_description: Different test cases are included with Pytest parametrize. The test cases are: add, modify and delete files. expected_output: - Different test cases are contained in external YAML file (agent_initializing_synchronization.yml and manager_initializing_synchronization.yaml) tags: - fim_basic_usage - scheduled ''' message_path = messages_path[3] # Clear logs, create folder to monitored and restart the service create_folder_file(host_manager, folder_path) host_manager.control_service(host='wazuh-agent1', service='wazuh', state="restarted") # Check that the manager contains data to monitor try: HostMonitor(inventory_path=inventory_path, messages_path=messages_path[0], tmp_path=tmp_path).run() except Exception: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') clean_environment(host_manager, enviroment_files) # Stop host host_manager.run_command(host, '/var/ossec/bin/wazuh-control stop') if (case == 'add'): host_manager.run_command('wazuh-agent1', f'touch {folder_path}/{folder_path}.txt') elif (case == 'modify'): host_manager.modify_file_content(host='wazuh-agent1', path=folder_path, content=folder_path) else: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') folder_path = f"'/{folder_path}/{folder_path}.txt'" query = " select * from fim_entry where full_path='\"{}\"'".format(folder_path) # Start host host_manager.run_command(host, '/var/ossec/bin/wazuh-control start') if (host == 'wazuh-manager'): message_path = messages_path[4] try: HostMonitor(inventory_path=inventory_path, messages_path=message_path, > tmp_path=tmp_path).run() test_fim/test_synchronization/test_synchronization.py:149: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Finished FIM sync. /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-07-03 10:27:59,739 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:27:59,742 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:27:59,746 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:27:59,749 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:27:59,759 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:27:59,763 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-manager_ossec.log.tmp 2023-07-03 10:27:59,768 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:27:59,775 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:28:02,839 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:28:05,179 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:28:05,771 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:28:05,774 - wazuh_testing - DEBUG - Checking results... 2023-07-03 10:28:05,775 - wazuh_testing - DEBUG - Received from wazuh-agent1 the expected message: True 2023-07-03 10:28:05,776 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-07-03 10:28:36,182 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:28:36,186 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:28:36,189 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:28:36,204 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Finished FIM sync. 2023-07-03 10:29:36,402 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Finished FIM sync. 2023-07-03 10:29:37,300 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:29:37,301 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-agent1 the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... _______________________________________________________________________________ test_synchronization[testdir1-modify-wazuh-manager] _______________________________________________________________________________ folder_path = 'testdir1', case = 'modify', host = 'wazuh-manager' @pytest.mark.parametrize('host', ['wazuh-agent1', 'wazuh-manager']) @pytest.mark.parametrize('case', ['add', 'modify', 'delete']) @pytest.mark.parametrize('folder_path', ['testdir1']) def test_synchronization(folder_path, case, host): ''' Description: The test will monitor a directory and apply changes when agent/manager is stopped. Finally, it will verify that the FIM 'Synchronization' event is generated in agent and manager side. wazuh_min_version: 4.2.0 parameters: - folder_path: type: str brief: Name of the folder that will be created in the test. - case: type: str brief: Name of the test case that will be created in the test. - host: type: str brief: Name of the endpoint that will be use in the test. assertions: - Verify that FIM sync events are generated correctly on the manager and agent sides. input_description: Different test cases are included with Pytest parametrize. The test cases are: add, modify and delete files. expected_output: - Different test cases are contained in external YAML file (agent_initializing_synchronization.yml and manager_initializing_synchronization.yaml) tags: - fim_basic_usage - scheduled ''' message_path = messages_path[3] # Clear logs, create folder to monitored and restart the service create_folder_file(host_manager, folder_path) host_manager.control_service(host='wazuh-agent1', service='wazuh', state="restarted") # Check that the manager contains data to monitor try: HostMonitor(inventory_path=inventory_path, messages_path=messages_path[0], tmp_path=tmp_path).run() except Exception: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') clean_environment(host_manager, enviroment_files) # Stop host host_manager.run_command(host, '/var/ossec/bin/wazuh-control stop') if (case == 'add'): host_manager.run_command('wazuh-agent1', f'touch {folder_path}/{folder_path}.txt') elif (case == 'modify'): host_manager.modify_file_content(host='wazuh-agent1', path=folder_path, content=folder_path) else: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') folder_path = f"'/{folder_path}/{folder_path}.txt'" query = " select * from fim_entry where full_path='\"{}\"'".format(folder_path) # Start host host_manager.run_command(host, '/var/ossec/bin/wazuh-control start') if (host == 'wazuh-manager'): message_path = messages_path[4] try: HostMonitor(inventory_path=inventory_path, messages_path=message_path, > tmp_path=tmp_path).run() test_fim/test_synchronization/test_synchronization.py:149: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-manager: .*Finished FIM sync. /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-07-03 10:30:02,885 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:30:02,889 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:30:02,893 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:30:02,893 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:30:02,897 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:30:02,919 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:30:02,923 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-manager_ossec.log.tmp 2023-07-03 10:30:02,924 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:30:05,959 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:30:05,971 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:30:06,911 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:30:06,912 - wazuh_testing - DEBUG - Checking results... 2023-07-03 10:30:06,914 - wazuh_testing - DEBUG - Received from wazuh-agent1 the expected message: True 2023-07-03 10:30:06,915 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-07-03 10:30:50,074 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:30:50,078 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:30:50,082 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-manager_ossec.log.tmp 2023-07-03 10:30:50,089 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Finished FIM sync. 2023-07-03 10:31:50,506 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Finished FIM sync. 2023-07-03 10:31:51,236 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:31:51,237 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-agent1 the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... _______________________________________________________________________________ test_synchronization[testdir1-delete-wazuh-agent1] ________________________________________________________________________________ folder_path = "'/testdir1/testdir1.txt'", case = 'delete', host = 'wazuh-agent1' @pytest.mark.parametrize('host', ['wazuh-agent1', 'wazuh-manager']) @pytest.mark.parametrize('case', ['add', 'modify', 'delete']) @pytest.mark.parametrize('folder_path', ['testdir1']) def test_synchronization(folder_path, case, host): ''' Description: The test will monitor a directory and apply changes when agent/manager is stopped. Finally, it will verify that the FIM 'Synchronization' event is generated in agent and manager side. wazuh_min_version: 4.2.0 parameters: - folder_path: type: str brief: Name of the folder that will be created in the test. - case: type: str brief: Name of the test case that will be created in the test. - host: type: str brief: Name of the endpoint that will be use in the test. assertions: - Verify that FIM sync events are generated correctly on the manager and agent sides. input_description: Different test cases are included with Pytest parametrize. The test cases are: add, modify and delete files. expected_output: - Different test cases are contained in external YAML file (agent_initializing_synchronization.yml and manager_initializing_synchronization.yaml) tags: - fim_basic_usage - scheduled ''' message_path = messages_path[3] # Clear logs, create folder to monitored and restart the service create_folder_file(host_manager, folder_path) host_manager.control_service(host='wazuh-agent1', service='wazuh', state="restarted") # Check that the manager contains data to monitor try: HostMonitor(inventory_path=inventory_path, messages_path=messages_path[0], tmp_path=tmp_path).run() except Exception: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') clean_environment(host_manager, enviroment_files) # Stop host host_manager.run_command(host, '/var/ossec/bin/wazuh-control stop') if (case == 'add'): host_manager.run_command('wazuh-agent1', f'touch {folder_path}/{folder_path}.txt') elif (case == 'modify'): host_manager.modify_file_content(host='wazuh-agent1', path=folder_path, content=folder_path) else: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') folder_path = f"'/{folder_path}/{folder_path}.txt'" query = " select * from fim_entry where full_path='\"{}\"'".format(folder_path) # Start host host_manager.run_command(host, '/var/ossec/bin/wazuh-control start') if (host == 'wazuh-manager'): message_path = messages_path[4] try: HostMonitor(inventory_path=inventory_path, messages_path=message_path, > tmp_path=tmp_path).run() test_fim/test_synchronization/test_synchronization.py:149: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-agent1: .*Finished FIM sync. /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-07-03 10:32:16,897 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:32:16,901 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:32:16,905 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:32:16,909 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:32:16,911 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:32:16,941 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-manager_ossec.log.tmp 2023-07-03 10:32:16,959 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:32:16,971 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:32:20,042 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:32:22,401 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:32:22,951 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:32:22,952 - wazuh_testing - DEBUG - Checking results... 2023-07-03 10:32:22,956 - wazuh_testing - DEBUG - Received from wazuh-agent1 the expected message: True 2023-07-03 10:32:22,956 - wazuh_testing - DEBUG - Received from wazuh-manager the expected message: True 2023-07-03 10:32:51,644 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:32:51,648 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:32:51,659 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:32:51,669 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Finished FIM sync. 2023-07-03 10:33:51,845 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Finished FIM sync. 2023-07-03 10:33:52,753 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:33:52,754 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-agent1 the expected message: True DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-manager the expected message: True DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... _______________________________________________________________________________ test_synchronization[testdir1-delete-wazuh-manager] _______________________________________________________________________________ folder_path = "'/testdir1/testdir1.txt'", case = 'delete', host = 'wazuh-manager' @pytest.mark.parametrize('host', ['wazuh-agent1', 'wazuh-manager']) @pytest.mark.parametrize('case', ['add', 'modify', 'delete']) @pytest.mark.parametrize('folder_path', ['testdir1']) def test_synchronization(folder_path, case, host): ''' Description: The test will monitor a directory and apply changes when agent/manager is stopped. Finally, it will verify that the FIM 'Synchronization' event is generated in agent and manager side. wazuh_min_version: 4.2.0 parameters: - folder_path: type: str brief: Name of the folder that will be created in the test. - case: type: str brief: Name of the test case that will be created in the test. - host: type: str brief: Name of the endpoint that will be use in the test. assertions: - Verify that FIM sync events are generated correctly on the manager and agent sides. input_description: Different test cases are included with Pytest parametrize. The test cases are: add, modify and delete files. expected_output: - Different test cases are contained in external YAML file (agent_initializing_synchronization.yml and manager_initializing_synchronization.yaml) tags: - fim_basic_usage - scheduled ''' message_path = messages_path[3] # Clear logs, create folder to monitored and restart the service create_folder_file(host_manager, folder_path) host_manager.control_service(host='wazuh-agent1', service='wazuh', state="restarted") # Check that the manager contains data to monitor try: HostMonitor(inventory_path=inventory_path, messages_path=messages_path[0], tmp_path=tmp_path).run() except Exception: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') clean_environment(host_manager, enviroment_files) # Stop host host_manager.run_command(host, '/var/ossec/bin/wazuh-control stop') if (case == 'add'): host_manager.run_command('wazuh-agent1', f'touch {folder_path}/{folder_path}.txt') elif (case == 'modify'): host_manager.modify_file_content(host='wazuh-agent1', path=folder_path, content=folder_path) else: host_manager.run_command('wazuh-agent1', f'rm -rf {folder_path}') folder_path = f"'/{folder_path}/{folder_path}.txt'" query = " select * from fim_entry where full_path='\"{}\"'".format(folder_path) # Start host host_manager.run_command(host, '/var/ossec/bin/wazuh-control start') if (host == 'wazuh-manager'): message_path = messages_path[4] try: HostMonitor(inventory_path=inventory_path, messages_path=message_path, > tmp_path=tmp_path).run() test_fim/test_synchronization/test_synchronization.py:149: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:937: in run self.check_result() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def check_result(self): """Check if a TimeoutError occurred.""" logger.debug(f'Checking results...') while not self._queue.empty(): result = self._queue.get(block=True) for host, msg in result.items(): if isinstance(msg, TimeoutError): > raise msg E TimeoutError: Did not found the expected callback in wazuh-manager: .*Finished FIM sync. /usr/local/lib/python3.10/dist-packages/wazuh_testing-4.7.0-py3.10.egg/wazuh_testing/tools/monitoring.py:1022: TimeoutError ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------- 2023-07-03 10:34:18,330 - wazuh_testing - DEBUG - Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:34:18,334 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log 2023-07-03 10:34:18,337 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:34:18,342 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:34:18,351 - wazuh_testing - DEBUG - Starting file composer for wazuh-agent1 and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-agent1_ossec.log.tmp 2023-07-03 10:34:18,357 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:34:18,366 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-manager_ossec.log.tmp 2023-07-03 10:34:18,381 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:34:21,407 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-agent1 and message: .*Sending integrity control message: (.+)$ 2023-07-03 10:35:18,453 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Agent 001 query: (.+) save2 2023-07-03 10:35:18,474 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:35:18,476 - wazuh_testing - DEBUG - Checking results... 2023-07-03 10:35:18,478 - wazuh_testing - DEBUG - Received from wazuh-agent1 the expected message: True 2023-07-03 10:36:03,593 - wazuh_testing - DEBUG - Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:36:03,597 - wazuh_testing - DEBUG - Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log 2023-07-03 10:36:03,604 - wazuh_testing - DEBUG - Starting file composer for wazuh-manager and path: /var/ossec/logs/ossec.log. Composite file in /home/vagrant/wazuh-qa/tests/system/test_fim/test_synchronization/tmp/wazuh-manager_ossec.log.tmp 2023-07-03 10:36:03,617 - wazuh_testing - DEBUG - Starting QueueMonitor for wazuh-manager and message: .*Finished FIM sync. 2023-07-03 10:37:03,751 - wazuh_testing - DEBUG - Finishing QueueMonitor for wazuh-manager and message: .*Finished FIM sync. 2023-07-03 10:37:04,236 - wazuh_testing - DEBUG - Cleaning temporal files... 2023-07-03 10:37:04,238 - wazuh_testing - DEBUG - Checking results... ------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------ DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-agent1 and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... DEBUG wazuh_testing:monitoring.py:1023 Received from wazuh-agent1 the expected message: True DEBUG wazuh_testing:monitoring.py:921 Add new file composer process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:925 Add new file monitor process for wazuh-manager and path: /var/ossec/logs/ossec.log DEBUG wazuh_testing:monitoring.py:1028 Cleaning temporal files... DEBUG wazuh_testing:monitoring.py:1017 Checking results... ============================================================================================= short test summary info ============================================================================================= FAILED test_fim/test_files/test_files_cud.py::test_file_cud[testdir1-delete] - TimeoutError: Did not found the expected callback in wazuh-manager: .*Agent 001 query: syscheck delete FAILED test_fim/test_files/test_files_cud.py::test_file_cud[testdir3-modify] - TimeoutError: Did not found the expected callback in wazuh-manager: .*Agent 001 query: (.+) save2 FAILED test_fim/test_synchronization/test_synchronization.py::test_synchronization[testdir1-add-wazuh-agent1] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Finished FIM sync. FAILED test_fim/test_synchronization/test_synchronization.py::test_synchronization[testdir1-add-wazuh-manager] - TimeoutError: Did not found the expected callback in wazuh-manager: .*Finished FIM sync. FAILED test_fim/test_synchronization/test_synchronization.py::test_synchronization[testdir1-modify-wazuh-agent1] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Finished FIM sync. FAILED test_fim/test_synchronization/test_synchronization.py::test_synchronization[testdir1-modify-wazuh-manager] - TimeoutError: Did not found the expected callback in wazuh-manager: .*Finished FIM sync. FAILED test_fim/test_synchronization/test_synchronization.py::test_synchronization[testdir1-delete-wazuh-agent1] - TimeoutError: Did not found the expected callback in wazuh-agent1: .*Finished FIM sync. FAILED test_fim/test_synchronization/test_synchronization.py::test_synchronization[testdir1-delete-wazuh-manager] - TimeoutError: Did not found the expected callback in wazuh-manager: .*Finished FIM sync. ==================================================================================== 8 failed, 7 passed in 1394.50s (0:23:14) ===================================================================================== ```
verdx commented 1 year ago

:green_circle: JWT Invalidation

All tests passed.

``` root@ubuntu22-1:/home/vagrant/wazuh-qa/tests/system# python3 -m pytest test_jwt_invalidation/ =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 19 items test_jwt_invalidation/test_change_rbac_mode.py .... [ 21%] test_jwt_invalidation/test_change_security_resources.py .... [ 42%] test_jwt_invalidation/test_disconnected_nodes.py . [ 47%] test_jwt_invalidation/test_revoke_endpoint.py ...... [ 78%] test_jwt_invalidation/test_update_password.py .... [100%] ========================================================================================= 19 passed in 1709.44s (0:28:29) ========================================================================================= ```
verdx commented 1 year ago

:green_circle: Multigroups

All tests passed.

``` root@ubuntu22:/home/vagrant/wazuh-qa/tests/system# python3 -m pytest test_multigroups/ =============================================================================================== test session starts =============================================================================================== platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.2.0 rootdir: /home/vagrant/wazuh-qa/tests/system, configfile: pytest.ini plugins: html-3.1.1, metadata-3.0.0, testinfra-5.0.0 collected 4 items test_multigroups/test_multigroups.py .... [100%] ========================================================================================= 4 passed in 1377.16s (0:22:57) ========================================================================================= ```
juliamagan commented 1 year ago

Need to update https://github.com/wazuh/wazuh-qa/issues/4247#issue-1774284592 for system tests. The tests path in the spreadsheets is wrong, it should be system instead of integration. We should document how tests are launched locally (we can use the README), what environments there are, and that we should be aware that some tests may leave the environment dirty and cause other tests to fail. Jenkins parameters are shown but not explained.

QU3B1M commented 1 year ago

Applied requested changes

Main comment (https://github.com/wazuh/wazuh-qa/issues/4247#issue-1774284592) updated with requested changes.

juliamagan commented 1 year ago

Tests shown in All possible tests are integration tests

davidjiglesias commented 11 months ago

Rest to be completed as part of redesign work