[2024-04-23 22:29:12] [DEBUG] [275569] [MainThread] [workflow_engine]: Validating input file: modules/workflow_engine/examples/agent/aws/test-agent-windows-complete.yaml [2024-04-23 22:29:12] [DEBUG] [275569] [MainThread] [workflow_engine]: Loading schema file: /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/workflow_engine/schemas/schema_v1.json [2024-04-23 22:29:12] [DEBUG] [275569] [MainThread] [workflow_engine]: Loading yaml file: modules/workflow_engine/examples/agent/aws/test-agent-windows-complete.yaml [2024-04-23 22:29:12] [DEBUG] [275569] [MainThread] [workflow_engine]: Loading workflow file: modules/workflow_engine/examples/agent/aws/test-agent-windows-complete.yaml [2024-04-23 22:29:12] [DEBUG] [275569] [MainThread] [workflow_engine]: Process workflow. [2024-04-23 22:29:12] [INFO] [275569] [MainThread] [workflow_engine]: Executing DAG tasks. [2024-04-23 22:29:12] [INFO] [275569] [MainThread] [workflow_engine]: Executing tasks in parallel. [2024-04-23 22:29:12] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-manager-linux-ubuntu-22.04-amd64] Starting task. [2024-04-23 22:29:12] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "allocate-manager-linux-ubuntu-22.04-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=large', '--composite-name=linux-ubuntu-22.04-amd64', '--inventory-output=/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa'] [2024-04-23 22:30:07] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "allocate-manager-linux-ubuntu-22.04-amd64" execution with result: [2024-04-23 22:29:13] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:29:13] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:29:13] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa [2024-04-23 22:29:13] [DEBUG] ALLOCATOR: No config provided. Generating from payload [2024-04-23 22:29:13] [DEBUG] ALLOCATOR: Generating new key pair [2024-04-23 22:29:13] [DEBUG] ALLOCATOR: Creating base directory: /tmp/wazuh-qa/AWS-702483D2-C44C-4A57-AB3A-43A8AC6156D8 [2024-04-23 22:29:33] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-702483D2-C44C-4A57-AB3A-43A8AC6156D8 directory to /tmp/wazuh-qa/i-0c11312b037cb398a [2024-04-23 22:29:33] [INFO] ALLOCATOR: Instance i-0c11312b037cb398a created. [2024-04-23 22:29:34] [INFO] ALLOCATOR: Instance i-0c11312b037cb398a started. [2024-04-23 22:29:35] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml [2024-04-23 22:29:35] [WARNING] ALLOCATOR: Error on attempt 1 of 30: [Errno None] Unable to connect to port 2200 on 18.208.152.12 [2024-04-23 22:30:07] [INFO] ALLOCATOR: SSH connection successful. [2024-04-23 22:30:07] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/track.yaml  [2024-04-23 22:30:07] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-manager-linux-ubuntu-22.04-amd64] Finished task in 54.46 seconds. [2024-04-23 22:30:07] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [provision-manager-linux-ubuntu-22.04-amd64] Starting task. [2024-04-23 22:30:07] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "provision-manager-linux-ubuntu-22.04-amd64" with arguments: ['modules/provision/main.py', '--inventory=/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml', "--install={'component': 'wazuh-manager', 'type': 'assistant', 'version': '4.7.3', 'live': True}"] [2024-04-23 22:34:44] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "provision-manager-linux-ubuntu-22.04-amd64" execution with result: [2024-04-23 22:30:07] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:30:07] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:30:07] [DEBUG] PROVISIONER: Setting dependencies: {} for wazuh-manager component. [2024-04-23 22:30:07] [INFO] PROVISIONER: Initiating provisionment. [2024-04-23 22:30:07] [DEBUG] PROVISIONER: Running action install for components: [ComponentInfo(component='wazuh-manager', type='assistant', version='4.7.3', dependencies=None, live=True)] [2024-04-23 22:30:07] [INFO] PROVISIONER: Provisioning "wazuh-manager"... [2024-04-23 22:30:07] [DEBUG] PROVISIONER: Get OS family for ec2-18-208-152-12.compute-1.amazonaws.com. [2024-04-23 22:30:07] [DEBUG] PROVISIONER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:30:07] [DEBUG] PROVISIONER: Running playbook: {'hosts': 'ec2-18-208-152-12.compute-1.amazonaws.com', 'become': True, 'gather_facts': True, 'tasks': [{'name': 'Capture ansible_os_family', 'set_fact': {'ansible_os_family': "{{ ansible_facts['distribution_file_variety'] }}", 'cacheable': 'yes'}}]} Using /etc/ansible/ansible.cfg as config file PLAY [ec2-18-208-152-12.compute-1.amazonaws.com] ******************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Capture ansible_os_family] *********************************************** ok: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=false   ansible_facts:  ansible_os_family: Debian PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=2  changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:30:17] [DEBUG] PROVISIONER: Playbook {'hosts': 'ec2-18-208-152-12.compute-1.amazonaws.com', 'become': True, 'gather_facts': True, 'tasks': [{'name': 'Capture ansible_os_family', 'set_fact': {'ansible_os_family': "{{ ansible_facts['distribution_file_variety'] }}", 'cacheable': 'yes'}}]} finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-23 22:30:17] [DEBUG] PROVISIONER: OS family: Debian. [2024-04-23 22:30:17] [DEBUG] PROVISIONER: Render playbook with vars: {'component': 'wazuh-manager', 'version': '4.7.3', 'live': True, 'type': 'assistant', 'dependencies': None, 'templates_path': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/playbooks/wazuh/assistant/install', 'templates_order': ['download.j2', 'install.j2'], 'ansible_os_family': 'Debian'}. [2024-04-23 22:30:17] [DEBUG] PROVISIONER: Templates found: ['download.j2', 'install.j2'] [2024-04-23 22:30:17] [DEBUG] PROVISIONER: Rendering template download.j2 [2024-04-23 22:30:17] [DEBUG] PROVISIONER: Rendering template install.j2 [2024-04-23 22:30:17] [DEBUG] PROVISIONER: [{'name': 'Install the required packages', 'shell': '\nsudo apt-get update && apt-get -y install curl\n'}, {'name': 'Download the Wazuh installation assistant', 'shell': 'curl -sO https://packages.wazuh.com/4.7/wazuh-install.sh'}, {'name': 'Install wazuh-manager with assistant', 'shell': 'bash ./wazuh-install.sh -a -i'}] [2024-04-23 22:30:17] [DEBUG] PROVISIONER: Tasks to execute: [{'name': 'Install the required packages', 'shell': '\nsudo apt-get update && apt-get -y install curl\n'}, {'name': 'Download the Wazuh installation assistant', 'shell': 'curl -sO https://packages.wazuh.com/4.7/wazuh-install.sh'}, {'name': 'Install wazuh-manager with assistant', 'shell': 'bash ./wazuh-install.sh -a -i'}]. [2024-04-23 22:30:17] [INFO] PROVISIONER: Execute install for wazuh-manager. [2024-04-23 22:30:17] [DEBUG] PROVISIONER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:30:17] [DEBUG] PROVISIONER: Running playbook: {'hosts': 'ec2-18-208-152-12.compute-1.amazonaws.com', 'become': True, 'gather_facts': True, 'tasks': [{'name': 'Install the required packages', 'shell': '\nsudo apt-get update && apt-get -y install curl\n'}, {'name': 'Download the Wazuh installation assistant', 'shell': 'curl -sO https://packages.wazuh.com/4.7/wazuh-install.sh'}, {'name': 'Install wazuh-manager with assistant', 'shell': 'bash ./wazuh-install.sh -a -i'}]} Using /etc/ansible/ansible.cfg as config file PLAY [ec2-18-208-152-12.compute-1.amazonaws.com] ******************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Install the required packages] ******************************************* changed: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=true   cmd: |2-    sudo apt-get update && apt-get -y install curl  delta: '0:00:14.160409'  end: '2024-04-24 01:30:42.560826'  msg: ''  rc: 0  start: '2024-04-24 01:30:28.400417'  stderr: ''  stderr_lines:   stdout: |-  Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy InRelease  Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]  Get:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]  Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]  Get:5 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [14.1 MB]  Get:6 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy/universe Translation-en [5652 kB]  Get:7 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1392 kB]  Get:8 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy/universe amd64 c-n-f Metadata [286 kB]  Get:9 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [217 kB]  Get:10 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy/multiverse Translation-en [112 kB]  Get:11 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy/multiverse amd64 c-n-f Metadata [8372 B]  Get:12 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1610 kB]  Get:13 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [303 kB]  Get:14 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [16.1 kB]  Get:15 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [1830 kB]  Get:16 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [311 kB]  Get:17 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 c-n-f Metadata [520 B]  Get:18 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1070 kB]  Get:19 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [244 kB]  Get:20 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [22.1 kB]  Get:21 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [42.7 kB]  Get:22 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/multiverse Translation-en [10.4 kB]  Get:23 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 c-n-f Metadata [472 B]  Get:24 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [67.1 kB]  Get:25 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports/main Translation-en [11.0 kB]  Get:26 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [388 B]  Get:27 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports/restricted amd64 c-n-f Metadata [116 B]  Get:28 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [28.4 kB]  Get:29 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [243 kB]  Get:30 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports/universe Translation-en [16.2 kB]  Get:31 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [644 B]  Get:32 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-backports/multiverse amd64 c-n-f Metadata [116 B]  Get:33 http://security.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [11.4 kB]  Get:34 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [1768 kB]  Get:35 http://security.ubuntu.com/ubuntu jammy-security/restricted Translation-en [299 kB]  Get:36 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 c-n-f Metadata [520 B]  Get:37 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [848 kB]  Get:38 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [162 kB]  Get:39 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [16.8 kB]  Get:40 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [37.2 kB]  Get:41 http://security.ubuntu.com/ubuntu jammy-security/multiverse Translation-en [7588 B]  Get:42 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [260 B]  Fetched 31.1 MB in 3s (10.1 MB/s)  Reading package lists...  Reading package lists...  Building dependency tree...  Reading state information...  The following additional packages will be installed:  libcurl4  The following packages will be upgraded:  curl libcurl4  2 upgraded, 0 newly installed, 0 to remove and 190 not upgraded.  Need to get 484 kB of archives.  After this operation, 0 B of additional disk space will be used.  Get:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 curl amd64 7.81.0-1ubuntu1.16 [194 kB]  Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libcurl4 amd64 7.81.0-1ubuntu1.16 [290 kB]  Fetched 484 kB in 0s (19.5 MB/s)  (Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 64295 files and directories currently installed.)  Preparing to unpack .../curl_7.81.0-1ubuntu1.16_amd64.deb ...  Unpacking curl (7.81.0-1ubuntu1.16) over (7.81.0-1ubuntu1.10) ...  Preparing to unpack .../libcurl4_7.81.0-1ubuntu1.16_amd64.deb ...  Unpacking libcurl4:amd64 (7.81.0-1ubuntu1.16) over (7.81.0-1ubuntu1.10) ...  Setting up libcurl4:amd64 (7.81.0-1ubuntu1.16) ...  Setting up curl (7.81.0-1ubuntu1.16) ...  Processing triggers for man-db (2.10.2-1) ...  Processing triggers for libc-bin (2.35-0ubuntu3.1) ...  stdout_lines:  TASK [Download the Wazuh installation assistant] ******************************* changed: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=true   cmd: curl -sO https://packages.wazuh.com/4.7/wazuh-install.sh  delta: '0:00:00.073387'  end: '2024-04-24 01:30:47.004798'  msg: ''  rc: 0  start: '2024-04-24 01:30:46.931411'  stderr: ''  stderr_lines:   stdout: ''  stdout_lines:  TASK [Install wazuh-manager with assistant] ************************************ changed: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=true   cmd: bash ./wazuh-install.sh -a -i  delta: '0:03:52.183079'  end: '2024-04-24 01:34:43.623385'  msg: ''  rc: 0  start: '2024-04-24 01:30:51.440306'  stderr: ''  stderr_lines:   stdout: |-  24/04/2024 01:30:51 INFO: Starting Wazuh installation assistant. Wazuh version: 4.7.3  24/04/2024 01:30:51 INFO: Verbose logging redirected to /var/log/wazuh-install.log  24/04/2024 01:30:55 WARNING: Hardware and system checks ignored.  24/04/2024 01:30:55 INFO: Wazuh web interface port will be 443.  24/04/2024 01:30:58 INFO: --- Dependencies ----  24/04/2024 01:30:58 INFO: Installing apt-transport-https.  24/04/2024 01:31:04 INFO: Wazuh repository added.  24/04/2024 01:31:04 INFO: --- Configuration files ---  24/04/2024 01:31:04 INFO: Generating configuration files.  24/04/2024 01:31:05 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.  24/04/2024 01:31:05 INFO: --- Wazuh indexer ---  24/04/2024 01:31:05 INFO: Starting Wazuh indexer installation.  24/04/2024 01:32:15 INFO: Wazuh indexer installation finished.  24/04/2024 01:32:15 INFO: Wazuh indexer post-install configuration finished.  24/04/2024 01:32:15 INFO: Starting service wazuh-indexer.  24/04/2024 01:32:25 INFO: wazuh-indexer service started.  24/04/2024 01:32:25 INFO: Initializing Wazuh indexer cluster security settings.  24/04/2024 01:32:36 INFO: Wazuh indexer cluster initialized.  24/04/2024 01:32:36 INFO: --- Wazuh server ---  24/04/2024 01:32:36 INFO: Starting the Wazuh manager installation.  24/04/2024 01:33:13 INFO: Wazuh manager installation finished.  24/04/2024 01:33:13 INFO: Starting service wazuh-manager.  24/04/2024 01:33:29 INFO: wazuh-manager service started.  24/04/2024 01:33:29 INFO: Starting Filebeat installation.  24/04/2024 01:33:36 INFO: Filebeat installation finished.  24/04/2024 01:33:36 INFO: Filebeat post-install configuration finished.  24/04/2024 01:33:36 INFO: Starting service filebeat.  24/04/2024 01:33:37 INFO: filebeat service started.  24/04/2024 01:33:37 INFO: --- Wazuh dashboard ---  24/04/2024 01:33:37 INFO: Starting Wazuh dashboard installation.  24/04/2024 01:34:22 INFO: Wazuh dashboard installation finished.  24/04/2024 01:34:22 INFO: Wazuh dashboard post-install configuration finished.  24/04/2024 01:34:22 INFO: Starting service wazuh-dashboard.  24/04/2024 01:34:23 INFO: wazuh-dashboard service started.  24/04/2024 01:34:42 INFO: Initializing Wazuh dashboard web application.  24/04/2024 01:34:43 INFO: Wazuh dashboard web application initialized.  24/04/2024 01:34:43 INFO: --- Summary ---  24/04/2024 01:34:43 INFO: You can access the web interface https://:443  User: admin  Password: 9SLRI9Hw+I+jlafU?OZcr7l8T07sSvLN  24/04/2024 01:34:43 INFO: Installation finished.  stdout_lines:  PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=4  changed=3  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:34:44] [DEBUG] PROVISIONER: Playbook {'hosts': 'ec2-18-208-152-12.compute-1.amazonaws.com', 'become': True, 'gather_facts': True, 'tasks': [{'name': 'Install the required packages', 'shell': '\nsudo apt-get update && apt-get -y install curl\n'}, {'name': 'Download the Wazuh installation assistant', 'shell': 'curl -sO https://packages.wazuh.com/4.7/wazuh-install.sh'}, {'name': 'Install wazuh-manager with assistant', 'shell': 'bash ./wazuh-install.sh -a -i'}]} finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 4}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 3}} [2024-04-23 22:34:44] [INFO] PROVISIONER: Provision of "wazuh-manager" complete successfully. [2024-04-23 22:34:44] [INFO] PROVISIONER: All components provisioned successfully. [2024-04-23 22:34:44] [DEBUG] PROVISIONER: Provision summary: {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 4}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 3}}  [2024-04-23 22:34:44] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [provision-manager-linux-ubuntu-22.04-amd64] Finished task in 277.38 seconds. [2024-04-23 22:34:44] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [allocate-agent-linux-ubuntu-20.04-amd64] Starting task. [2024-04-23 22:34:44] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-agent-linux-debian-12-amd64] Starting task. [2024-04-23 22:34:44] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Running task "allocate-agent-linux-ubuntu-20.04-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=medium', '--composite-name=linux-ubuntu-20.04-amd64', '--inventory-output=/tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa'] [2024-04-23 22:34:44] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [allocate-agent-linux-oracle-9-amd64] Starting task. [2024-04-23 22:34:44] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "allocate-agent-linux-debian-12-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=medium', '--composite-name=linux-debian-12-amd64', '--inventory-output=/tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/agent-linux-debian-12-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa'] [2024-04-23 22:34:44] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Running task "allocate-agent-linux-oracle-9-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=medium', '--composite-name=linux-oracle-9-amd64', '--inventory-output=/tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/agent-linux-oracle-9-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa'] [2024-04-23 22:35:38] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Finished task "allocate-agent-linux-ubuntu-20.04-amd64" execution with result: [2024-04-23 22:34:45] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:34:45] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:34:45] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa [2024-04-23 22:34:45] [DEBUG] ALLOCATOR: No config provided. Generating from payload [2024-04-23 22:34:45] [DEBUG] ALLOCATOR: Generating new key pair [2024-04-23 22:34:45] [DEBUG] ALLOCATOR: Creating base directory: /tmp/wazuh-qa/AWS-B28F45D8-7C31-4D8B-977F-4A5D14E32F47 [2024-04-23 22:35:04] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-B28F45D8-7C31-4D8B-977F-4A5D14E32F47 directory to /tmp/wazuh-qa/i-0ece015de0adea97b [2024-04-23 22:35:04] [INFO] ALLOCATOR: Instance i-0ece015de0adea97b created. [2024-04-23 22:35:06] [INFO] ALLOCATOR: Instance i-0ece015de0adea97b started. [2024-04-23 22:35:06] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml [2024-04-23 22:35:06] [WARNING] ALLOCATOR: Error on attempt 1 of 30: [Errno None] Unable to connect to port 2200 on 3.93.231.93 [2024-04-23 22:35:38] [INFO] ALLOCATOR: SSH connection successful. [2024-04-23 22:35:38] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/track.yaml  [2024-04-23 22:35:38] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [allocate-agent-linux-ubuntu-20.04-amd64] Finished task in 54.09 seconds. [2024-04-23 22:35:38] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [allocate-agent-linux-centos-8-amd64] Starting task. [2024-04-23 22:35:38] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Running task "allocate-agent-linux-centos-8-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=medium', '--composite-name=linux-centos-8-amd64', '--inventory-output=/tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/agent-linux-centos-8-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa'] [2024-04-23 22:35:38] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "allocate-agent-linux-debian-12-amd64" execution with result: [2024-04-23 22:34:45] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:34:45] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:34:45] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa [2024-04-23 22:34:45] [DEBUG] ALLOCATOR: No config provided. Generating from payload [2024-04-23 22:34:45] [DEBUG] ALLOCATOR: Generating new key pair [2024-04-23 22:34:45] [DEBUG] ALLOCATOR: Creating base directory: /tmp/wazuh-qa/AWS-3A7C72EC-34DF-4B62-A417-AAEE77B427D6 [2024-04-23 22:35:05] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-3A7C72EC-34DF-4B62-A417-AAEE77B427D6 directory to /tmp/wazuh-qa/i-07299b4ee85290836 [2024-04-23 22:35:05] [INFO] ALLOCATOR: Instance i-07299b4ee85290836 created. [2024-04-23 22:35:06] [INFO] ALLOCATOR: Instance i-07299b4ee85290836 started. [2024-04-23 22:35:07] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml [2024-04-23 22:35:07] [WARNING] ALLOCATOR: Error on attempt 1 of 30: [Errno None] Unable to connect to port 2200 on 3.84.141.14 [2024-04-23 22:35:38] [INFO] ALLOCATOR: SSH connection successful. [2024-04-23 22:35:38] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/agent-linux-debian-12-amd64/track.yaml  [2024-04-23 22:35:38] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-agent-linux-debian-12-amd64] Finished task in 54.39 seconds. [2024-04-23 22:35:38] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-agent-linux-redhat-9-amd64] Starting task. [2024-04-23 22:35:38] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "allocate-agent-linux-redhat-9-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=medium', '--composite-name=linux-redhat-9-amd64', '--inventory-output=/tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/agent-linux-redhat-9-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa'] [2024-04-23 22:37:10] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "allocate-agent-linux-redhat-9-amd64" execution with result: [2024-04-23 22:35:39] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:35:39] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:35:39] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa [2024-04-23 22:35:39] [DEBUG] ALLOCATOR: No config provided. Generating from payload [2024-04-23 22:35:39] [DEBUG] ALLOCATOR: Generating new key pair [2024-04-23 22:35:39] [DEBUG] ALLOCATOR: Creating base directory: /tmp/wazuh-qa/AWS-1F252B1D-0286-480A-9E71-D1911B4815CF [2024-04-23 22:35:59] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-1F252B1D-0286-480A-9E71-D1911B4815CF directory to /tmp/wazuh-qa/i-049213986f69fa375 [2024-04-23 22:35:59] [INFO] ALLOCATOR: Instance i-049213986f69fa375 created. [2024-04-23 22:36:00] [INFO] ALLOCATOR: Instance i-049213986f69fa375 started. [2024-04-23 22:36:01] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml [2024-04-23 22:36:08] [WARNING] ALLOCATOR: Error on attempt 1 of 30: [Errno None] Unable to connect to port 2200 on 3.88.70.199 [2024-04-23 22:36:39] [WARNING] ALLOCATOR: Error on attempt 2 of 30: [Errno None] Unable to connect to port 2200 on 3.88.70.199 [2024-04-23 22:37:10] [INFO] ALLOCATOR: SSH connection successful. [2024-04-23 22:37:10] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/agent-linux-redhat-9-amd64/track.yaml  [2024-04-23 22:37:10] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-agent-linux-redhat-9-amd64] Finished task in 91.75 seconds. [2024-04-23 22:37:10] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-agent-windows-desktop-10-amd64] Starting task. [2024-04-23 22:37:10] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "allocate-agent-windows-desktop-10-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=medium', '--composite-name=windows-desktop-10-amd64', '--inventory-output=/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/agent-windows-desktop-10-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa'] [2024-04-23 22:38:14] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Finished task "allocate-agent-linux-oracle-9-amd64" execution with result: [2024-04-23 22:34:45] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:34:45] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:34:45] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa [2024-04-23 22:34:45] [DEBUG] ALLOCATOR: No config provided. Generating from payload [2024-04-23 22:34:45] [DEBUG] ALLOCATOR: Generating new key pair [2024-04-23 22:34:45] [DEBUG] ALLOCATOR: Creating base directory: /tmp/wazuh-qa/AWS-30F0E72A-483E-4B8D-97F1-FC7769B1847D [2024-04-23 22:35:05] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-30F0E72A-483E-4B8D-97F1-FC7769B1847D directory to /tmp/wazuh-qa/i-0e25020c9e8ca19ce [2024-04-23 22:35:05] [INFO] ALLOCATOR: Instance i-0e25020c9e8ca19ce created. [2024-04-23 22:35:07] [INFO] ALLOCATOR: Instance i-0e25020c9e8ca19ce started. [2024-04-23 22:35:07] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml [2024-04-23 22:36:12] [WARNING] ALLOCATOR: Error on attempt 1 of 30: [Errno None] Unable to connect to port 2200 on 18.233.6.29 [2024-04-23 22:36:42] [WARNING] ALLOCATOR: Error on attempt 2 of 30: [Errno None] Unable to connect to port 2200 on 18.233.6.29 [2024-04-23 22:37:12] [WARNING] ALLOCATOR: Error on attempt 3 of 30: [Errno None] Unable to connect to port 2200 on 18.233.6.29 [2024-04-23 22:37:42] [WARNING] ALLOCATOR: Error on attempt 4 of 30: [Errno None] Unable to connect to port 2200 on 18.233.6.29 [2024-04-23 22:38:14] [INFO] ALLOCATOR: SSH connection successful. [2024-04-23 22:38:14] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/agent-linux-oracle-9-amd64/track.yaml  [2024-04-23 22:38:14] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [allocate-agent-linux-oracle-9-amd64] Finished task in 210.27 seconds. [2024-04-23 22:38:14] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [allocate-agent-windows-server-2012r2-amd64] Starting task. [2024-04-23 22:38:14] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Running task "allocate-agent-windows-server-2012r2-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=medium', '--composite-name=windows-server-2012r2-amd64', '--inventory-output=/tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/agent-windows-server-2012r2-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa'] [2024-04-23 22:38:35] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Finished task "allocate-agent-linux-centos-8-amd64" execution with result: [2024-04-23 22:35:39] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:35:39] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:35:39] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa [2024-04-23 22:35:39] [DEBUG] ALLOCATOR: No config provided. Generating from payload [2024-04-23 22:35:39] [DEBUG] ALLOCATOR: Generating new key pair [2024-04-23 22:35:39] [DEBUG] ALLOCATOR: Creating base directory: /tmp/wazuh-qa/AWS-16C5D583-4291-48F5-B0F8-0E9E2485F525 [2024-04-23 22:35:59] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-16C5D583-4291-48F5-B0F8-0E9E2485F525 directory to /tmp/wazuh-qa/i-0f42997e9c5ebfbe8 [2024-04-23 22:35:59] [INFO] ALLOCATOR: Instance i-0f42997e9c5ebfbe8 created. [2024-04-23 22:36:00] [INFO] ALLOCATOR: Instance i-0f42997e9c5ebfbe8 started. [2024-04-23 22:36:01] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml [2024-04-23 22:36:32] [WARNING] ALLOCATOR: Error on attempt 1 of 30: [Errno None] Unable to connect to port 2200 on 54.174.2.110 [2024-04-23 22:37:03] [WARNING] ALLOCATOR: Error on attempt 2 of 30: [Errno None] Unable to connect to port 2200 on 54.174.2.110 [2024-04-23 22:37:33] [WARNING] ALLOCATOR: Error on attempt 3 of 30: [Errno None] Unable to connect to port 2200 on 54.174.2.110 [2024-04-23 22:38:03] [WARNING] ALLOCATOR: Error on attempt 4 of 30: [Errno None] Unable to connect to port 2200 on 54.174.2.110 [2024-04-23 22:38:35] [INFO] ALLOCATOR: SSH connection successful. [2024-04-23 22:38:35] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/agent-linux-centos-8-amd64/track.yaml  [2024-04-23 22:38:35] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [allocate-agent-linux-centos-8-amd64] Finished task in 176.63 seconds. [2024-04-23 22:38:35] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [allocate-agent-windows-server-2016-amd64] Starting task. [2024-04-23 22:38:35] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Running task "allocate-agent-windows-server-2016-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=medium', '--composite-name=windows-server-2016-amd64', '--inventory-output=/tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/agent-windows-server-2016-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa'] [2024-04-23 22:44:59] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Finished task "allocate-agent-windows-server-2012r2-amd64" execution with result: [2024-04-23 22:38:15] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:38:15] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:38:15] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa [2024-04-23 22:38:15] [DEBUG] ALLOCATOR: No config provided. Generating from payload [2024-04-23 22:38:15] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-A8D2AAF6-5AB9-4787-AB99-1B285F455C6A [2024-04-23 22:38:33] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-A8D2AAF6-5AB9-4787-AB99-1B285F455C6A directory to /tmp/wazuh-qa/i-0c89bdda05ba701ed [2024-04-23 22:38:33] [INFO] ALLOCATOR: Instance i-0c89bdda05ba701ed created. [2024-04-23 22:38:34] [INFO] ALLOCATOR: Instance i-0c89bdda05ba701ed started. [2024-04-23 22:38:35] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml [2024-04-23 22:39:05] [WARNING] ALLOCATOR: Error on attempt 1 of 30: HTTPSConnectionPool(host='ec2-3-84-16-102.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-3-84-16-102.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:39:36] [WARNING] ALLOCATOR: Error on attempt 2 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:40:06] [WARNING] ALLOCATOR: Error on attempt 3 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:40:36] [WARNING] ALLOCATOR: Error on attempt 4 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:41:07] [WARNING] ALLOCATOR: Error on attempt 5 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:42:07] [WARNING] ALLOCATOR: Error on attempt 6 of 30: HTTPSConnectionPool(host='ec2-3-84-16-102.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-3-84-16-102.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:43:07] [WARNING] ALLOCATOR: Error on attempt 7 of 30: HTTPSConnectionPool(host='ec2-3-84-16-102.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-3-84-16-102.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:43:38] [WARNING] ALLOCATOR: Error on attempt 8 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:44:08] [WARNING] ALLOCATOR: Error on attempt 9 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:44:59] [INFO] ALLOCATOR: WinRM connection successful. [2024-04-23 22:44:59] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/track.yaml  [2024-04-23 22:44:59] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [allocate-agent-windows-server-2012r2-amd64] Finished task in 404.71 seconds. [2024-04-23 22:44:59] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [allocate-agent-windows-server-2019-amd64] Starting task. [2024-04-23 22:44:59] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Running task "allocate-agent-windows-server-2019-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=medium', '--composite-name=windows-server-2019-amd64', '--inventory-output=/tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/agent-windows-server-2019-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa'] [2024-04-23 22:47:11] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Finished task "allocate-agent-windows-server-2016-amd64" execution with result: [2024-04-23 22:38:35] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:38:35] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:38:35] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa [2024-04-23 22:38:35] [DEBUG] ALLOCATOR: No config provided. Generating from payload [2024-04-23 22:38:35] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-6F75216F-CD4E-45BD-8F86-7BB62490177D [2024-04-23 22:38:53] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-6F75216F-CD4E-45BD-8F86-7BB62490177D directory to /tmp/wazuh-qa/i-073a03bac8c3ab3ff [2024-04-23 22:38:53] [INFO] ALLOCATOR: Instance i-073a03bac8c3ab3ff created. [2024-04-23 22:38:55] [INFO] ALLOCATOR: Instance i-073a03bac8c3ab3ff started. [2024-04-23 22:38:55] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml [2024-04-23 22:39:25] [WARNING] ALLOCATOR: Error on attempt 1 of 30: HTTPSConnectionPool(host='ec2-44-204-84-64.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-44-204-84-64.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:39:56] [WARNING] ALLOCATOR: Error on attempt 2 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:40:26] [WARNING] ALLOCATOR: Error on attempt 3 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:40:57] [WARNING] ALLOCATOR: Error on attempt 4 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:41:27] [WARNING] ALLOCATOR: Error on attempt 5 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:41:58] [WARNING] ALLOCATOR: Error on attempt 6 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:42:44] [WARNING] ALLOCATOR: Error on attempt 7 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:43:14] [WARNING] ALLOCATOR: Error on attempt 8 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:43:45] [WARNING] ALLOCATOR: Error on attempt 9 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:44:15] [WARNING] ALLOCATOR: Error on attempt 10 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:44:45] [WARNING] ALLOCATOR: Error on attempt 11 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:45:16] [WARNING] ALLOCATOR: Error on attempt 12 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:45:46] [WARNING] ALLOCATOR: Error on attempt 13 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:46:38] [WARNING] ALLOCATOR: Error on attempt 14 of 30:  [2024-04-23 22:47:11] [INFO] ALLOCATOR: WinRM connection successful. [2024-04-23 22:47:11] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/agent-windows-server-2016-amd64/track.yaml  [2024-04-23 22:47:11] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [allocate-agent-windows-server-2016-amd64] Finished task in 516.13 seconds. [2024-04-23 22:47:11] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [allocate-agent-windows-server-2022-amd64] Starting task. [2024-04-23 22:47:11] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Running task "allocate-agent-windows-server-2022-amd64" with arguments: ['modules/allocation/main.py', '--action=create', '--provider=aws', '--size=medium', '--composite-name=windows-server-2022-amd64', '--inventory-output=/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml', '--track-output=/tmp/dtt1-poc/agent-windows-server-2022-amd64/track.yaml', '--label-termination-date=1d', '--label-team=qa'] [2024-04-23 22:49:01] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Finished task "allocate-agent-windows-server-2019-amd64" execution with result: [2024-04-23 22:44:59] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:44:59] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:45:00] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa [2024-04-23 22:45:00] [DEBUG] ALLOCATOR: No config provided. Generating from payload [2024-04-23 22:45:00] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-DA03529F-E23E-4899-A8BA-970EDEA3D09A [2024-04-23 22:45:18] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-DA03529F-E23E-4899-A8BA-970EDEA3D09A directory to /tmp/wazuh-qa/i-01dcdeaf50da7a968 [2024-04-23 22:45:18] [INFO] ALLOCATOR: Instance i-01dcdeaf50da7a968 created. [2024-04-23 22:45:20] [INFO] ALLOCATOR: Instance i-01dcdeaf50da7a968 started. [2024-04-23 22:45:21] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml [2024-04-23 22:45:51] [WARNING] ALLOCATOR: Error on attempt 1 of 30: HTTPSConnectionPool(host='ec2-44-205-255-20.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-44-205-255-20.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:46:51] [WARNING] ALLOCATOR: Error on attempt 2 of 30: HTTPSConnectionPool(host='ec2-44-205-255-20.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-44-205-255-20.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:47:51] [WARNING] ALLOCATOR: Error on attempt 3 of 30: HTTPSConnectionPool(host='ec2-44-205-255-20.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-44-205-255-20.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:48:23] [WARNING] ALLOCATOR: Error on attempt 4 of 30: the specified credentials were rejected by the server [2024-04-23 22:49:01] [INFO] ALLOCATOR: WinRM connection successful. [2024-04-23 22:49:01] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/agent-windows-server-2019-amd64/track.yaml  [2024-04-23 22:49:01] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [allocate-agent-windows-server-2019-amd64] Finished task in 241.95 seconds. [2024-04-23 22:49:01] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [run-agent-linux-ubuntu-20.04-amd64-tests] Starting task. [2024-04-23 22:49:01] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Running task "run-agent-linux-ubuntu-20.04-amd64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml'}", '--tests=install,registration,connection,basic_info,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-23 22:49:39] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Finished task "allocate-agent-windows-server-2022-amd64" execution with result: [2024-04-23 22:47:11] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:47:11] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:47:11] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa [2024-04-23 22:47:12] [DEBUG] ALLOCATOR: No config provided. Generating from payload [2024-04-23 22:47:12] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-A6E2FA6E-0461-4E95-A595-07280E396684 [2024-04-23 22:47:30] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-A6E2FA6E-0461-4E95-A595-07280E396684 directory to /tmp/wazuh-qa/i-069d59dd72298c086 [2024-04-23 22:47:30] [INFO] ALLOCATOR: Instance i-069d59dd72298c086 created. [2024-04-23 22:47:31] [INFO] ALLOCATOR: Instance i-069d59dd72298c086 started. [2024-04-23 22:47:32] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml [2024-04-23 22:48:02] [WARNING] ALLOCATOR: Error on attempt 1 of 30: HTTPSConnectionPool(host='ec2-3-87-214-177.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-3-87-214-177.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:49:02] [WARNING] ALLOCATOR: Error on attempt 2 of 30: HTTPSConnectionPool(host='ec2-3-87-214-177.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-3-87-214-177.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:49:39] [INFO] ALLOCATOR: WinRM connection successful. [2024-04-23 22:49:39] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/agent-windows-server-2022-amd64/track.yaml  [2024-04-23 22:49:39] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [allocate-agent-windows-server-2022-amd64] Finished task in 147.96 seconds. [2024-04-23 22:49:39] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [run-agent-linux-debian-12-amd64-tests] Starting task. [2024-04-23 22:49:39] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Running task "run-agent-linux-debian-12-amd64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml'}", '--tests=install,registration,connection,basic_info,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-23 22:56:30] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "allocate-agent-windows-desktop-10-amd64" execution with result: [2024-04-23 22:37:11] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:37:11] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:37:11] [INFO] ALLOCATOR: Creating instance at /tmp/wazuh-qa [2024-04-23 22:37:11] [DEBUG] ALLOCATOR: No config provided. Generating from payload [2024-04-23 22:37:11] [DEBUG] ALLOCATOR: Creating temp directory: /tmp/wazuh-qa/AWS-D663CD0E-2177-4E66-8F19-F1A81B5FFA96 [2024-04-23 22:37:29] [DEBUG] ALLOCATOR: Renaming temp /tmp/wazuh-qa/AWS-D663CD0E-2177-4E66-8F19-F1A81B5FFA96 directory to /tmp/wazuh-qa/i-05531a90ce4ba73ad [2024-04-23 22:37:29] [INFO] ALLOCATOR: Instance i-05531a90ce4ba73ad created. [2024-04-23 22:37:31] [INFO] ALLOCATOR: Instance i-05531a90ce4ba73ad started. [2024-04-23 22:37:31] [INFO] ALLOCATOR: Inventory file generated at /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml [2024-04-23 22:38:01] [WARNING] ALLOCATOR: Error on attempt 1 of 30: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:39:01] [WARNING] ALLOCATOR: Error on attempt 2 of 30: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:39:32] [WARNING] ALLOCATOR: Error on attempt 3 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:40:02] [WARNING] ALLOCATOR: Error on attempt 4 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:40:33] [WARNING] ALLOCATOR: Error on attempt 5 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:41:03] [WARNING] ALLOCATOR: Error on attempt 6 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:41:33] [WARNING] ALLOCATOR: Error on attempt 7 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:42:04] [WARNING] ALLOCATOR: Error on attempt 8 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:42:35] [WARNING] ALLOCATOR: Error on attempt 9 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:43:05] [WARNING] ALLOCATOR: Error on attempt 10 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:43:36] [WARNING] ALLOCATOR: Error on attempt 11 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:44:06] [WARNING] ALLOCATOR: Error on attempt 12 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:44:37] [WARNING] ALLOCATOR: Error on attempt 13 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:45:07] [WARNING] ALLOCATOR: Error on attempt 14 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:45:38] [WARNING] ALLOCATOR: Error on attempt 15 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:46:08] [WARNING] ALLOCATOR: Error on attempt 16 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:46:39] [WARNING] ALLOCATOR: Error on attempt 17 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:47:09] [WARNING] ALLOCATOR: Error on attempt 18 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:47:39] [WARNING] ALLOCATOR: Error on attempt 19 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:48:10] [WARNING] ALLOCATOR: Error on attempt 20 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:48:40] [WARNING] ALLOCATOR: Error on attempt 21 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:49:11] [WARNING] ALLOCATOR: Error on attempt 22 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:49:41] [WARNING] ALLOCATOR: Error on attempt 23 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:50:41] [WARNING] ALLOCATOR: Error on attempt 24 of 30: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')) [2024-04-23 22:51:12] [WARNING] ALLOCATOR: Error on attempt 25 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:51:42] [WARNING] ALLOCATOR: Error on attempt 26 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:52:12] [WARNING] ALLOCATOR: Error on attempt 27 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:52:43] [WARNING] ALLOCATOR: Error on attempt 28 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:53:14] [WARNING] ALLOCATOR: Error on attempt 29 of 30: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) [2024-04-23 22:54:11] [WARNING] ALLOCATOR: Error on attempt 30 of 30:  [2024-04-23 22:54:41] [ERROR] ALLOCATOR: Connection attempts failed after 30 tries. Connection timeout. [2024-04-23 22:54:41] [INFO] ALLOCATOR: Track file generated at /tmp/dtt1-poc/agent-windows-desktop-10-amd64/track.yaml [2024-04-23 22:54:41] [WARNING] ALLOCATOR: Rolling back instance creation. [2024-04-23 22:56:30] [INFO] ALLOCATOR: Instance i-05531a90ce4ba73ad deleted. [2024-04-23 22:56:30] [INFO] ALLOCATOR: Instance i-05531a90ce4ba73ad deleted.  [2024-04-23 22:56:30] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-agent-windows-desktop-10-amd64] Finished task in 1160.09 seconds. [2024-04-23 22:56:30] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [run-agent-linux-redhat-9-amd64-tests] Starting task. [2024-04-23 22:56:30] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "run-agent-linux-redhat-9-amd64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml'}", '--tests=install,registration,connection,basic_info,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-23 22:57:28] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Finished task "run-agent-linux-debian-12-amd64-tests" execution with result: [2024-04-23 22:49:39] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:49:39] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:49:39] [INFO] TESTER: Running tests for ec2-18-208-152-12.compute-1.amazonaws.com [2024-04-23 22:49:39] [INFO] TESTER: Running tests for ec2-3-84-141-14.compute-1.amazonaws.com [2024-04-23 22:49:39] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'wazuh_version': '4.7.3', 'wazuh_revision': '40714', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': True, 'hosts_ip': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-84-141-14.compute-1.amazonaws.com'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability', 'current_user': 'fcaffieri'} [2024-04-23 22:49:39] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-23 22:49:39] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:49:39] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-84-141-14.compute-1.amazonaws.com']}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-18-208-152-12.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004080'  end: '2024-04-23 22:49:42.002597'  item: ec2-18-208-152-12.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 22:49:41.998517'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  changed: [localhost] => (item=ec2-3-84-141-14.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004101'  end: '2024-04-23 22:49:42.158983'  item: ec2-3-84-141-14.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 22:49:42.154882'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:49:42] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-84-141-14.compute-1.amazonaws.com']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:49:42] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:49:42] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:49:42] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test install for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_install.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:52.762858'  end: '2024-04-23 22:50:37.219053'  msg: ''  rc: 0  start: '2024-04-23 22:49:44.456195'  stderr: |-  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  --2024-04-24 01:50:10-- https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.7.3-1_amd64.deb  Resolving packages.wazuh.com (packages.wazuh.com)... 99.86.229.57, 99.86.229.76, 99.86.229.65, ...  Connecting to packages.wazuh.com (packages.wazuh.com)|99.86.229.57|:443... connected.  HTTP request sent, awaiting response... 200 OK  Length: 9362524 (8.9M) [binary/octet-stream]  Saving to: ‘wazuh-agent_4.7.3-1_amd64.deb’    0K .......... .......... .......... .......... .......... 0% 46.1M 0s  50K .......... .......... .......... .......... .......... 1% 98.1M 0s  100K .......... .......... .......... .......... .......... 1% 64.6M 0s  150K .......... .......... .......... .......... .......... 2% 138M 0s  200K .......... .......... .......... .......... .......... 2% 159M 0s  250K .......... .......... .......... .......... .......... 3% 3.15M 1s  300K .......... .......... .......... .......... .......... 3% 158M 0s  350K .......... .......... .......... .......... .......... 4% 131M 0s  400K .......... .......... .......... .......... .......... 4% 157M 0s  450K .......... .......... .......... .......... .......... 5% 159M 0s  500K .......... .......... .......... .......... .......... 6% 4.46M 0s  550K .......... .......... .......... .......... .......... 6% 22.2M 0s  600K .......... .......... .......... .......... .......... 7% 12.7M 0s  650K .......... .......... .......... .......... .......... 7% 66.8M 0s  700K .......... .......... .......... .......... .......... 8% 49.9M 0s  750K .......... .......... .......... .......... .......... 8% 7.09M 0s  800K .......... .......... .......... .......... .......... 9% 159M 0s  850K .......... .......... .......... .......... .......... 9% 159M 0s  900K .......... .......... .......... .......... .......... 10% 159M 0s  950K .......... .......... .......... .......... .......... 10% 136M 0s  1000K .......... .......... .......... .......... .......... 11% 3.54M 0s  1050K .......... .......... .......... .......... .......... 12% 146M 0s  1100K .......... .......... .......... .......... .......... 12% 157M 0s  1150K .......... .......... .......... .......... .......... 13% 120M 0s  1200K .......... .......... .......... .......... .......... 13% 160M 0s  1250K .......... .......... .......... .......... .......... 14% 156M 0s  1300K .......... .......... .......... .......... .......... 14% 156M 0s  1350K .......... .......... .......... .......... .......... 15% 73.8M 0s  1400K .......... .......... .......... .......... .......... 15% 156M 0s  1450K .......... .......... .......... .......... .......... 16% 156M 0s  1500K .......... .......... .......... .......... .......... 16% 15.0M 0s  1550K .......... .......... .......... .......... .......... 17% 126M 0s  1600K .......... .......... .......... .......... .......... 18% 162M 0s  1650K .......... .......... .......... .......... .......... 18% 160M 0s  1700K .......... .......... .......... .......... .......... 19% 157M 0s  1750K .......... .......... .......... .......... .......... 19% 2.83M 0s  1800K .......... .......... .......... .......... .......... 20% 149M 0s  1850K .......... .......... .......... .......... .......... 20% 160M 0s  1900K .......... .......... .......... .......... .......... 21% 153M 0s  1950K .......... .......... .......... .......... .......... 21% 138M 0s  2000K .......... .......... .......... .......... .......... 22% 7.89M 0s  2050K .......... .......... .......... .......... .......... 22% 116M 0s  2100K .......... .......... .......... .......... .......... 23% 149M 0s  2150K .......... .......... .......... .......... .......... 24% 144M 0s  2200K .......... .......... .......... .......... .......... 24% 159M 0s  2250K .......... .......... .......... .......... .......... 25% 166M 0s  2300K .......... .......... .......... .......... .......... 25% 164M 0s  2350K .......... .......... .......... .......... .......... 26% 137M 0s  2400K .......... .......... .......... .......... .......... 26% 164M 0s  2450K .......... .......... .......... .......... .......... 27% 163M 0s  2500K .......... .......... .......... .......... .......... 27% 156M 0s  2550K .......... .......... .......... .......... .......... 28% 12.4M 0s  2600K .......... .......... .......... .......... .......... 28% 133M 0s  2650K .......... .......... .......... .......... .......... 29% 152M 0s  2700K .......... .......... .......... .......... .......... 30% 165M 0s  2750K .......... .......... .......... .......... .......... 30% 133M 0s  2800K .......... .......... .......... .......... .......... 31% 15.7M 0s  2850K .......... .......... .......... .......... .......... 31% 80.4M 0s  2900K .......... .......... .......... .......... .......... 32% 153M 0s  2950K .......... .......... .......... .......... .......... 32% 144M 0s  3000K .......... .......... .......... .......... .......... 33% 164M 0s  3050K .......... .......... .......... .......... .......... 33% 7.84M 0s  3100K .......... .......... .......... .......... .......... 34% 139M 0s  3150K .......... .......... .......... .......... .......... 34% 114M 0s  3200K .......... .......... .......... .......... .......... 35% 163M 0s  3250K .......... .......... .......... .......... .......... 36% 154M 0s  3300K .......... .......... .......... .......... .......... 36% 153M 0s  3350K .......... .......... .......... .......... .......... 37% 127M 0s  3400K .......... .......... .......... .......... .......... 37% 165M 0s  3450K .......... .......... .......... .......... .......... 38% 163M 0s  3500K .......... .......... .......... .......... .......... 38% 162M 0s  3550K .......... .......... .......... .......... .......... 39% 10.2M 0s  3600K .......... .......... .......... .......... .......... 39% 141M 0s  3650K .......... .......... .......... .......... .......... 40% 145M 0s  3700K .......... .......... .......... .......... .......... 41% 153M 0s  3750K .......... .......... .......... .......... .......... 41% 135M 0s  3800K .......... .......... .......... .......... .......... 42% 12.1M 0s  3850K .......... .......... .......... .......... .......... 42% 148M 0s  3900K .......... .......... .......... .......... .......... 43% 116M 0s  3950K .......... .......... .......... .......... .......... 43% 130M 0s  4000K .......... .......... .......... .......... .......... 44% 153M 0s  4050K .......... .......... .......... .......... .......... 44% 5.95M 0s  4100K .......... .......... .......... .......... .......... 45% 123M 0s  4150K .......... .......... .......... .......... .......... 45% 143M 0s  4200K .......... .......... .......... .......... .......... 46% 138M 0s  4250K .......... .......... .......... .......... .......... 47% 145M 0s  4300K .......... .......... .......... .......... .......... 47% 164M 0s  4350K .......... .......... .......... .......... .......... 48% 128M 0s  4400K .......... .......... .......... .......... .......... 48% 161M 0s  4450K .......... .......... .......... .......... .......... 49% 154M 0s  4500K .......... .......... .......... .......... .......... 49% 90.4M 0s  4550K .......... .......... .......... .......... .......... 50% 133M 0s  4600K .......... .......... .......... .......... .......... 50% 28.7M 0s  4650K .......... .......... .......... .......... .......... 51% 150M 0s  4700K .......... .......... .......... .......... .......... 51% 151M 0s  4750K .......... .......... .......... .......... .......... 52% 108M 0s  4800K .......... .......... .......... .......... .......... 53% 161M 0s  4850K .......... .......... .......... .......... .......... 53% 17.2M 0s  4900K .......... .......... .......... .......... .......... 54% 155M 0s  4950K .......... .......... .......... .......... .......... 54% 129M 0s  5000K .......... .......... .......... .......... .......... 55% 168M 0s  5050K .......... .......... .......... .......... .......... 55% 167M 0s  5100K .......... .......... .......... .......... .......... 56% 4.68M 0s  5150K .......... .......... .......... .......... .......... 56% 90.4M 0s  5200K .......... .......... .......... .......... .......... 57% 108M 0s  5250K .......... .......... .......... .......... .......... 57% 163M 0s  5300K .......... .......... .......... .......... .......... 58% 165M 0s  5350K .......... .......... .......... .......... .......... 59% 92.5M 0s  5400K .......... .......... .......... .......... .......... 59% 169M 0s  5450K .......... .......... .......... .......... .......... 60% 167M 0s  5500K .......... .......... .......... .......... .......... 60% 164M 0s  5550K .......... .......... .......... .......... .......... 61% 145M 0s  5600K .......... .......... .......... .......... .......... 61% 10.9M 0s  5650K .......... .......... .......... .......... .......... 62% 145M 0s  5700K .......... .......... .......... .......... .......... 62% 164M 0s  5750K .......... .......... .......... .......... .......... 63% 135M 0s  5800K .......... .......... .......... .......... .......... 63% 166M 0s  5850K .......... .......... .......... .......... .......... 64% 6.70M 0s  5900K .......... .......... .......... .......... .......... 65% 135M 0s  5950K .......... .......... .......... .......... .......... 65% 137M 0s  6000K .......... .......... .......... .......... .......... 66% 165M 0s  6050K .......... .......... .......... .......... .......... 66% 168M 0s  6100K .......... .......... .......... .......... .......... 67% 4.88M 0s  6150K .......... .......... .......... .......... .......... 67% 113M 0s  6200K .......... .......... .......... .......... .......... 68% 81.1M 0s  6250K .......... .......... .......... .......... .......... 68% 145M 0s  6300K .......... .......... .......... .......... .......... 69% 165M 0s  6350K .......... .......... .......... .......... .......... 69% 137M 0s  6400K .......... .......... .......... .......... .......... 70% 163M 0s  6450K .......... .......... .......... .......... .......... 71% 162M 0s  6500K .......... .......... .......... .......... .......... 71% 165M 0s  6550K .......... .......... .......... .......... .......... 72% 143M 0s  6600K .......... .......... .......... .......... .......... 72% 167M 0s  6650K .......... .......... .......... .......... .......... 73% 18.5M 0s  6700K .......... .......... .......... .......... .......... 73% 156M 0s  6750K .......... .......... .......... .......... .......... 74% 139M 0s  6800K .......... .......... .......... .......... .......... 74% 166M 0s  6850K .......... .......... .......... .......... .......... 75% 164M 0s  6900K .......... .......... .......... .......... .......... 76% 17.2M 0s  6950K .......... .......... .......... .......... .......... 76% 145M 0s  7000K .......... .......... .......... .......... .......... 77% 169M 0s  7050K .......... .......... .......... .......... .......... 77% 167M 0s  7100K .......... .......... .......... .......... .......... 78% 170M 0s  7150K .......... .......... .......... .......... .......... 78% 5.10M 0s  7200K .......... .......... .......... .......... .......... 79% 74.8M 0s  7250K .......... .......... .......... .......... .......... 79% 146M 0s  7300K .......... .......... .......... .......... .......... 80% 160M 0s  7350K .......... .......... .......... .......... .......... 80% 150M 0s  7400K .......... .......... .......... .......... .......... 81% 124M 0s  7450K .......... .......... .......... .......... .......... 82% 168M 0s  7500K .......... .......... .......... .......... .......... 82% 124M 0s  7550K .......... .......... .......... .......... .......... 83% 145M 0s  7600K .......... .......... .......... .......... .......... 83% 152M 0s  7650K .......... .......... .......... .......... .......... 84% 30.5M 0s  7700K .......... .......... .......... .......... .......... 84% 160M 0s  7750K .......... .......... .......... .......... .......... 85% 155M 0s  7800K .......... .......... .......... .......... .......... 85% 170M 0s  7850K .......... .......... .......... .......... .......... 86% 158M 0s  7900K .......... .......... .......... .......... .......... 86% 18.1M 0s  7950K .......... .......... .......... .......... .......... 87% 121M 0s  8000K .......... .......... .......... .......... .......... 88% 154M 0s  8050K .......... .......... .......... .......... .......... 88% 157M 0s  8100K .......... .......... .......... .......... .......... 89% 166M 0s  8150K .......... .......... .......... .......... .......... 89% 4.18M 0s  8200K .......... .......... .......... .......... .......... 90% 105M 0s  8250K .......... .......... .......... .......... .......... 90% 157M 0s  8300K .......... .......... .......... .......... .......... 91% 56.7M 0s  8350K .......... .......... .......... .......... .......... 91% 51.8M 0s  8400K .......... .......... .......... .......... .......... 92% 45.1M 0s  8450K .......... .......... .......... .......... .......... 92% 49.6M 0s  8500K .......... .......... .......... .......... .......... 93% 63.5M 0s  8550K .......... .......... .......... .......... .......... 94% 47.4M 0s  8600K .......... .......... .......... .......... .......... 94% 54.5M 0s  8650K .......... .......... .......... .......... .......... 95% 116M 0s  8700K .......... .......... .......... .......... .......... 95% 14.0M 0s  8750K .......... .......... .......... .......... .......... 96% 129M 0s  8800K .......... .......... .......... .......... .......... 96% 164M 0s  8850K .......... .......... .......... .......... .......... 97% 165M 0s  8900K .......... .......... .......... .......... .......... 97% 165M 0s  8950K .......... .......... .......... .......... .......... 98% 23.3M 0s  9000K .......... .......... .......... .......... .......... 98% 169M 0s  9050K .......... .......... .......... .......... .......... 99% 169M 0s  9100K .......... .......... .......... .......... ... 100% 174M=0.2s    2024-04-24 01:50:11 (36.8 MB/s) - ‘wazuh-agent_4.7.3-1_amd64.deb’ saved [9362524/9362524]    Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Created symlink /etc/systemd/system/multi-user.target.wants/wazuh-agent.service → /lib/systemd/system/wazuh-agent.service.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Job for wazuh-agent.service failed because the control process exited with error code.  See "systemctl status wazuh-agent.service" and "journalctl -xeu wazuh-agent.service" for details.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:49:44] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:49:44] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 2 items    modules/testing/tests/test_agent/test_install.py::test_installation [32m[2024-04-23 22:49:45] [INFO] TESTER: Checking connection to debian-12[0m  [32m[2024-04-23 22:49:46] [INFO] TESTER: Connection established successfully in debian-12[0m  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  [32m[2024-04-23 22:49:52] [INFO] TESTER: Checking connection to ubuntu-22.04[0m  [32m[2024-04-23 22:49:54] [INFO] TESTER: Connection established successfully in ubuntu-22.04[0m  commands  systemctl is-active firewalld  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active firewalld  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  True  result.get('output')  inactive  [32m[2024-04-23 22:50:00] [INFO] TESTER: No Firewall to disable on debian-12[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 22:50:04] [INFO] TESTER: Manager is already installed in ubuntu-22.04[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  os_type  linux  [32m[2024-04-23 22:50:07] [INFO] TESTER: Installing Agent in debian-12[0m  command  wget https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.7.3-1_amd64.deb && sudo WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-linux-debian-12-amd64' dpkg -i ./wazuh-agent_4.7.3-1_amd64.deb  ret  Selecting previously unselected package wazuh-agent.(Reading database ... 29966 files and directories currently installed.)Preparing to unpack .../wazuh-agent_4.7.3-1_amd64.deb ...Unpacking wazuh-agent (4.7.3-1) ...Setting up wazuh-agent (4.7.3-1) ...  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', "wget https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.7.3-1_amd64.deb && sudo WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-linux-debian-12-amd64' dpkg -i ./wazuh-agent_4.7.3-1_amd64.deb"]  result.get('success')  True  result.get('output')  Selecting previously unselected package wazuh-agent.(Reading database ... 29966 files and directories currently installed.)Preparing to unpack .../wazuh-agent_4.7.3-1_amd64.deb ...Unpacking wazuh-agent (4.7.3-1) ...Setting up wazuh-agent (4.7.3-1) ...  command  systemctl daemon-reload  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl daemon-reload']  result.get('success')  False  result.get('output')  None  command  systemctl enable wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl enable wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl start wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl start wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl status wazuh-agent  ret  × wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:50:26 UTC; 3s ago Process: 1808 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 22msApr 24 01:50:26 ip-172-31-91-221 systemd[1]: Starting wazuh-agent.service - Wazuh agent...Apr 24 01:50:26 ip-172-31-91-221 env[1816]: 2024/04/24 01:50:26 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:50:26 ip-172-31-91-221 env[1816]: 2024/04/24 01:50:26 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:50:26 ip-172-31-91-221 env[1808]: wazuh-agentd: Configuration error. ExitingApr 24 01:50:26 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:50:26 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:50:26 ip-172-31-91-221 systemd[1]: Failed to start wazuh-agent.service - Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  × wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:50:26 UTC; 3s ago Process: 1808 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 22msApr 24 01:50:26 ip-172-31-91-221 systemd[1]: Starting wazuh-agent.service - Wazuh agent...Apr 24 01:50:26 ip-172-31-91-221 env[1816]: 2024/04/24 01:50:26 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:50:26 ip-172-31-91-221 env[1816]: 2024/04/24 01:50:26 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:50:26 ip-172-31-91-221 env[1808]: wazuh-agentd: Configuration error. ExitingApr 24 01:50:26 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:50:26 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:50:26 ip-172-31-91-221 systemd[1]: Failed to start wazuh-agent.service - Wazuh agent.  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  PASSED  modules/testing/tests/test_agent/test_install.py::test_status [32m[2024-04-23 22:50:32] [INFO] TESTER: Getting status of debian-12[0m  commands  systemctl status wazuh-agent  ret  × wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:50:26 UTC; 10s ago Process: 1808 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 22msApr 24 01:50:26 ip-172-31-91-221 systemd[1]: Starting wazuh-agent.service - Wazuh agent...Apr 24 01:50:26 ip-172-31-91-221 env[1816]: 2024/04/24 01:50:26 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:50:26 ip-172-31-91-221 env[1816]: 2024/04/24 01:50:26 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:50:26 ip-172-31-91-221 env[1808]: wazuh-agentd: Configuration error. ExitingApr 24 01:50:26 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:50:26 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:50:26 ip-172-31-91-221 systemd[1]: Failed to start wazuh-agent.service - Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  × wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:50:26 UTC; 10s ago Process: 1808 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 22msApr 24 01:50:26 ip-172-31-91-221 systemd[1]: Starting wazuh-agent.service - Wazuh agent...Apr 24 01:50:26 ip-172-31-91-221 env[1816]: 2024/04/24 01:50:26 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:50:26 ip-172-31-91-221 env[1816]: 2024/04/24 01:50:26 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:50:26 ip-172-31-91-221 env[1808]: wazuh-agentd: Configuration error. ExitingApr 24 01:50:26 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:50:26 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:50:26 ip-172-31-91-221 systemd[1]: Failed to start wazuh-agent.service - Wazuh agent.  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 2 passed, 2 warnings in 52.03s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:50:37] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:50:37] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:50:37] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:50:37] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test registration for agent] ********************************************* changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_registration.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:10.983681'  end: '2024-04-23 22:51:50.483262'  msg: ''  rc: 0  start: '2024-04-23 22:50:39.499581'  stderr: |-  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:50:39] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:50:39] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 4 items    modules/testing/tests/test_agent/test_registration.py::test_status [32m[2024-04-23 22:50:40] [INFO] TESTER: Checking connection to debian-12[0m  [32m[2024-04-23 22:50:41] [INFO] TESTER: Connection established successfully in debian-12[0m  commands  systemctl is-active wazuh-agent  ret  failed  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  failed  failed  commands  systemctl is-active wazuh-agent  ret  failed  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  failed  [32m[2024-04-23 22:50:49] [INFO] TESTER: os_type linux[0m  command  sed -i 's/
MANAGER_IP<\/address>/
172.31.86.48<\/address>/g' /var/ossec/etc/ossec.conf  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', "sed -i 's/
MANAGER_IP<\\/address>/
172.31.86.48<\\/address>/g' /var/ossec/etc/ossec.conf"]  result.get('success')  False  result.get('output')  None  command  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  commands  cat /var/ossec/etc/ossec.conf  ret 
172.31.86.48
1514 tcp
debian, debian12 10 60 yes aes yes agent-linux-debian-12-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/dpkg.log   ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/ossec.conf']  result.get('success')  True  result.get('output') 
172.31.86.48
1514 tcp
debian, debian12 10 60 yes aes yes agent-linux-debian-12-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/dpkg.log   [32m[2024-04-23 22:51:06] [INFO] TESTER: Getting status of debian-12[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: active (running) since Wed 2024-04-24 01:51:02 UTC; 8s ago Process: 1898 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 29 (limit: 4633) Memory: 33.9M CPU: 1.559s CGroup: /system.slice/wazuh-agent.service ├─1920 /var/ossec/bin/wazuh-execd ├─1931 /var/ossec/bin/wazuh-agentd ├─1944 /var/ossec/bin/wazuh-syscheckd ├─1957 /var/ossec/bin/wazuh-logcollector └─1974 /var/ossec/bin/wazuh-modulesdApr 24 01:50:55 ip-172-31-91-221 systemd[1]: Starting wazuh-agent.service - Wazuh agent...Apr 24 01:50:55 ip-172-31-91-221 env[1898]: Starting Wazuh v4.7.3...Apr 24 01:50:56 ip-172-31-91-221 env[1898]: Started wazuh-execd...Apr 24 01:50:57 ip-172-31-91-221 env[1898]: Started wazuh-agentd...Apr 24 01:50:58 ip-172-31-91-221 env[1898]: Started wazuh-syscheckd...Apr 24 01:50:59 ip-172-31-91-221 env[1898]: Started wazuh-logcollector...Apr 24 01:51:00 ip-172-31-91-221 env[1898]: Started wazuh-modulesd...Apr 24 01:51:02 ip-172-31-91-221 env[1898]: Completed.Apr 24 01:51:02 ip-172-31-91-221 systemd[1]: Started wazuh-agent.service - Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: active (running) since Wed 2024-04-24 01:51:02 UTC; 8s ago Process: 1898 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 29 (limit: 4633) Memory: 33.9M CPU: 1.559s CGroup: /system.slice/wazuh-agent.service ├─1920 /var/ossec/bin/wazuh-execd ├─1931 /var/ossec/bin/wazuh-agentd ├─1944 /var/ossec/bin/wazuh-syscheckd ├─1957 /var/ossec/bin/wazuh-logcollector └─1974 /var/ossec/bin/wazuh-modulesdApr 24 01:50:55 ip-172-31-91-221 systemd[1]: Starting wazuh-agent.service - Wazuh agent...Apr 24 01:50:55 ip-172-31-91-221 env[1898]: Starting Wazuh v4.7.3...Apr 24 01:50:56 ip-172-31-91-221 env[1898]: Started wazuh-execd...Apr 24 01:50:57 ip-172-31-91-221 env[1898]: Started wazuh-agentd...Apr 24 01:50:58 ip-172-31-91-221 env[1898]: Started wazuh-syscheckd...Apr 24 01:50:59 ip-172-31-91-221 env[1898]: Started wazuh-logcollector...Apr 24 01:51:00 ip-172-31-91-221 env[1898]: Started wazuh-modulesd...Apr 24 01:51:02 ip-172-31-91-221 env[1898]: Completed.Apr 24 01:51:02 ip-172-31-91-221 systemd[1]: Started wazuh-agent.service - Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_registration.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:51:30+00:00", "status_code": 0, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:51:23+00:00", "status_code": 0, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 3, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_registration.py::test_connection commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_registration.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 4 passed, 2 warnings in 70.19s (0:01:10) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:51:50] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:51:50] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:51:50] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:51:50] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test connection for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_connection.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:27.064783'  end: '2024-04-23 22:53:19.844434'  msg: ''  rc: 0  start: '2024-04-23 22:51:52.779651'  stderr: |-  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:51:53] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:51:53] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 6 items    modules/testing/tests/test_agent/test_connection.py::test_connection [32m[2024-04-23 22:51:53] [INFO] TESTER: Checking connection to debian-12[0m  [32m[2024-04-23 22:51:55] [INFO] TESTER: Connection established successfully in debian-12[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  002 agent-linux-debian-12-amd64 any 4f2965e011689d66aaa1d43166c5754e3058e5bc98fa134280f99e43cc650489  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  002 agent-linux-debian-12-amd64 any 4f2965e011689d66aaa1d43166c5754e3058e5bc98fa134280f99e43cc650489  command  sed -i 's/[^<]*<\/protocol>/tcp<\/protocol>/g' /var/ossec/etc/ossec.conf  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', "sed -i 's/[^<]*<\\/protocol>/tcp<\\/protocol>/g' /var/ossec/etc/ossec.conf"]  result.get('success')  False  result.get('output')  None  command  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  commands  cat /var/ossec/etc/ossec.conf  ret 
172.31.86.48
1514 tcp
debian, debian12 10 60 yes aes yes agent-linux-debian-12-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/dpkg.log   ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/ossec.conf']  result.get('success')  True  result.get('output') 
172.31.86.48
1514 tcp
debian, debian12 10 60 yes aes yes agent-linux-debian-12-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/dpkg.log   commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    PASSED  modules/testing/tests/test_agent/test_connection.py::test_status [32m[2024-04-23 22:52:43] [INFO] TESTER: Getting status of debian-12[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: active (running) since Wed 2024-04-24 01:52:23 UTC; 23s ago Process: 3533 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 4633) Memory: 23.3M CPU: 10.909s CGroup: /system.slice/wazuh-agent.service ├─3555 /var/ossec/bin/wazuh-execd ├─3566 /var/ossec/bin/wazuh-agentd ├─3580 /var/ossec/bin/wazuh-syscheckd ├─3595 /var/ossec/bin/wazuh-logcollector └─3614 /var/ossec/bin/wazuh-modulesdApr 24 01:52:15 ip-172-31-91-221 systemd[1]: Starting wazuh-agent.service - Wazuh agent...Apr 24 01:52:15 ip-172-31-91-221 env[3533]: Starting Wazuh v4.7.3...Apr 24 01:52:16 ip-172-31-91-221 env[3533]: Started wazuh-execd...Apr 24 01:52:17 ip-172-31-91-221 env[3533]: Started wazuh-agentd...Apr 24 01:52:19 ip-172-31-91-221 env[3533]: Started wazuh-syscheckd...Apr 24 01:52:20 ip-172-31-91-221 env[3533]: Started wazuh-logcollector...Apr 24 01:52:21 ip-172-31-91-221 env[3533]: Started wazuh-modulesd...Apr 24 01:52:23 ip-172-31-91-221 env[3533]: Completed.Apr 24 01:52:23 ip-172-31-91-221 systemd[1]: Started wazuh-agent.service - Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: active (running) since Wed 2024-04-24 01:52:23 UTC; 23s ago Process: 3533 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 4633) Memory: 23.3M CPU: 10.909s CGroup: /system.slice/wazuh-agent.service ├─3555 /var/ossec/bin/wazuh-execd ├─3566 /var/ossec/bin/wazuh-agentd ├─3580 /var/ossec/bin/wazuh-syscheckd ├─3595 /var/ossec/bin/wazuh-logcollector └─3614 /var/ossec/bin/wazuh-modulesdApr 24 01:52:15 ip-172-31-91-221 systemd[1]: Starting wazuh-agent.service - Wazuh agent...Apr 24 01:52:15 ip-172-31-91-221 env[3533]: Starting Wazuh v4.7.3...Apr 24 01:52:16 ip-172-31-91-221 env[3533]: Started wazuh-execd...Apr 24 01:52:17 ip-172-31-91-221 env[3533]: Started wazuh-agentd...Apr 24 01:52:19 ip-172-31-91-221 env[3533]: Started wazuh-syscheckd...Apr 24 01:52:20 ip-172-31-91-221 env[3533]: Started wazuh-logcollector...Apr 24 01:52:21 ip-172-31-91-221 env[3533]: Started wazuh-modulesd...Apr 24 01:52:23 ip-172-31-91-221 env[3533]: Completed.Apr 24 01:52:23 ip-172-31-91-221 systemd[1]: Started wazuh-agent.service - Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_connection.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:53:06+00:00", "status_code": 0, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:53:06+00:00", "status_code": 0, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 3, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_connection.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED  modules/testing/tests/test_agent/test_connection.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret  ESTAB 0 0 172.31.91.221:36630 172.31.86.48:1514  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  True  result.get('output')  ESTAB 0 0 172.31.91.221:36630 172.31.86.48:1514  PASSED  modules/testing/tests/test_agent/test_connection.py::test_processes commands  pgrep wazuh  ret  35553566358035953614  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  True  result.get('output')  35553566358035953614  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 6 passed, 2 warnings in 86.33s (0:01:26) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:53:20] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:53:20] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:53:20] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:53:20] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test basic_info for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_basic_info.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:40.086785'  end: '2024-04-23 22:54:02.231207'  msg: ''  rc: 0  start: '2024-04-23 22:53:22.144422'  stderr: |-  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:53:22] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:53:22] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version [32m[2024-04-23 22:53:22] [INFO] TESTER: Checking connection to debian-12[0m  [32m[2024-04-23 22:53:24] [INFO] TESTER: Connection established successfully in debian-12[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  002 agent-linux-debian-12-amd64 any 4f2965e011689d66aaa1d43166c5754e3058e5bc98fa134280f99e43cc650489  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  002 agent-linux-debian-12-amd64 any 4f2965e011689d66aaa1d43166c5754e3058e5bc98fa134280f99e43cc650489  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:53:46+00:00", "status_code": 0, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:53:46+00:00", "status_code": 0, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 3, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version commands  /var/ossec/bin/wazuh-control info -v  ret  v4.7.3  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/wazuh-control info -v']  result.get('success')  True  result.get('output')  v4.7.3  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision commands  /var/ossec/bin/wazuh-control info -r  ret  40714  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/wazuh-control info -r']  result.get('success')  True  result.get('output')  40714  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 2 warnings in 39.34s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:54:02] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:54:02] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:54:02] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:54:02] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test restart for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_restart.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:48.414611'  end: '2024-04-23 22:54:52.947981'  msg: ''  rc: 0  start: '2024-04-23 22:54:04.533370'  stderr: |-  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:54:05] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:54:05] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 7 items    modules/testing/tests/test_agent/test_restart.py::test_restart [32m[2024-04-23 22:54:05] [INFO] TESTER: Checking connection to debian-12[0m  [32m[2024-04-23 22:54:07] [INFO] TESTER: Connection established successfully in debian-12[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  002 agent-linux-debian-12-amd64 any 4f2965e011689d66aaa1d43166c5754e3058e5bc98fa134280f99e43cc650489  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  002 agent-linux-debian-12-amd64 any 4f2965e011689d66aaa1d43166c5754e3058e5bc98fa134280f99e43cc650489  [32m[2024-04-23 22:54:19] [INFO] TESTER: Restarting wazuh-agent in debian-12[0m  commands  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_restart.py::test_status [32m[2024-04-23 22:54:31] [INFO] TESTER: Getting status of debian-12[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: active (running) since Wed 2024-04-24 01:54:31 UTC; 2s ago Process: 4638 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 35 (limit: 4633) Memory: 31.0M CPU: 6.941s CGroup: /system.slice/wazuh-agent.service ├─4660 /var/ossec/bin/wazuh-execd ├─4671 /var/ossec/bin/wazuh-agentd ├─4685 /var/ossec/bin/wazuh-syscheckd ├─4699 /var/ossec/bin/wazuh-logcollector ├─4719 /var/ossec/bin/wazuh-modulesd ├─5316 sh -c "/bin/ps -p 4660 > /dev/null 2>&1" └─5317 /bin/ps -p 4660Apr 24 01:54:23 ip-172-31-91-221 systemd[1]: Starting wazuh-agent.service - Wazuh agent...Apr 24 01:54:23 ip-172-31-91-221 env[4638]: Starting Wazuh v4.7.3...Apr 24 01:54:24 ip-172-31-91-221 env[4638]: Started wazuh-execd...Apr 24 01:54:25 ip-172-31-91-221 env[4638]: Started wazuh-agentd...Apr 24 01:54:26 ip-172-31-91-221 env[4638]: Started wazuh-syscheckd...Apr 24 01:54:28 ip-172-31-91-221 env[4638]: Started wazuh-logcollector...Apr 24 01:54:29 ip-172-31-91-221 env[4638]: Started wazuh-modulesd...Apr 24 01:54:31 ip-172-31-91-221 env[4638]: Completed.Apr 24 01:54:31 ip-172-31-91-221 systemd[1]: Started wazuh-agent.service - Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: active (running) since Wed 2024-04-24 01:54:31 UTC; 2s ago Process: 4638 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 35 (limit: 4633) Memory: 31.0M CPU: 6.941s CGroup: /system.slice/wazuh-agent.service ├─4660 /var/ossec/bin/wazuh-execd ├─4671 /var/ossec/bin/wazuh-agentd ├─4685 /var/ossec/bin/wazuh-syscheckd ├─4699 /var/ossec/bin/wazuh-logcollector ├─4719 /var/ossec/bin/wazuh-modulesd ├─5316 sh -c "/bin/ps -p 4660 > /dev/null 2>&1" └─5317 /bin/ps -p 4660Apr 24 01:54:23 ip-172-31-91-221 systemd[1]: Starting wazuh-agent.service - Wazuh agent...Apr 24 01:54:23 ip-172-31-91-221 env[4638]: Starting Wazuh v4.7.3...Apr 24 01:54:24 ip-172-31-91-221 env[4638]: Started wazuh-execd...Apr 24 01:54:25 ip-172-31-91-221 env[4638]: Started wazuh-agentd...Apr 24 01:54:26 ip-172-31-91-221 env[4638]: Started wazuh-syscheckd...Apr 24 01:54:28 ip-172-31-91-221 env[4638]: Started wazuh-logcollector...Apr 24 01:54:29 ip-172-31-91-221 env[4638]: Started wazuh-modulesd...Apr 24 01:54:31 ip-172-31-91-221 env[4638]: Completed.Apr 24 01:54:31 ip-172-31-91-221 systemd[1]: Started wazuh-agent.service - Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_restart.py::test_connection commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_restart.py::test_isActive commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  PASSED  modules/testing/tests/test_agent/test_restart.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED  modules/testing/tests/test_agent/test_restart.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret  ESTAB 0 0 172.31.91.221:55506 172.31.86.48:1514  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  True  result.get('output')  ESTAB 0 0 172.31.91.221:55506 172.31.86.48:1514  PASSED  modules/testing/tests/test_agent/test_restart.py::test_processes commands  pgrep wazuh  ret  46604671468546994719  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  True  result.get('output')  46604671468546994719  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 7 passed, 2 warnings in 47.68s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:54:53] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:54:53] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:54:53] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:54:53] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test stop for agent] ***************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_stop.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:53.992710'  end: '2024-04-23 22:55:49.232835'  msg: ''  rc: 0  start: '2024-04-23 22:54:55.240125'  stderr: |-  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:54:55] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:54:55] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_stop.py::test_service [32m[2024-04-23 22:54:55] [INFO] TESTER: Checking connection to debian-12[0m  [32m[2024-04-23 22:54:57] [INFO] TESTER: Connection established successfully in debian-12[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  002 agent-linux-debian-12-amd64 any 4f2965e011689d66aaa1d43166c5754e3058e5bc98fa134280f99e43cc650489  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  002 agent-linux-debian-12-amd64 any 4f2965e011689d66aaa1d43166c5754e3058e5bc98fa134280f99e43cc650489  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    [32m[2024-04-23 22:55:23] [INFO] TESTER: Stopping wazuh-agent in debian-12[0m  commands  systemctl stop wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl stop wazuh-agent']  result.get('success')  False  result.get('output')  None  [32m[2024-04-23 22:55:27] [INFO] TESTER: Getting status of debian-12[0m  commands  systemctl status wazuh-agent  ret  ○ wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: inactive (dead) since Wed 2024-04-24 01:55:27 UTC; 2s ago Duration: 55.452s Process: 4638 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Process: 5567 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) CPU: 11.375sApr 24 01:55:26 ip-172-31-91-221 systemd[1]: Stopping wazuh-agent.service - Wazuh agent...Apr 24 01:55:26 ip-172-31-91-221 env[5567]: Killing wazuh-modulesd...Apr 24 01:55:26 ip-172-31-91-221 env[5567]: Killing wazuh-logcollector...Apr 24 01:55:26 ip-172-31-91-221 env[5567]: Killing wazuh-syscheckd...Apr 24 01:55:27 ip-172-31-91-221 env[5567]: Killing wazuh-agentd...Apr 24 01:55:27 ip-172-31-91-221 env[5567]: Killing wazuh-execd...Apr 24 01:55:27 ip-172-31-91-221 env[5567]: Wazuh v4.7.3 StoppedApr 24 01:55:27 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Deactivated successfully.Apr 24 01:55:27 ip-172-31-91-221 systemd[1]: Stopped wazuh-agent.service - Wazuh agent.Apr 24 01:55:27 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Consumed 11.375s CPU time.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ○ wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; preset: enabled) Active: inactive (dead) since Wed 2024-04-24 01:55:27 UTC; 2s ago Duration: 55.452s Process: 4638 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Process: 5567 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) CPU: 11.375sApr 24 01:55:26 ip-172-31-91-221 systemd[1]: Stopping wazuh-agent.service - Wazuh agent...Apr 24 01:55:26 ip-172-31-91-221 env[5567]: Killing wazuh-modulesd...Apr 24 01:55:26 ip-172-31-91-221 env[5567]: Killing wazuh-logcollector...Apr 24 01:55:26 ip-172-31-91-221 env[5567]: Killing wazuh-syscheckd...Apr 24 01:55:27 ip-172-31-91-221 env[5567]: Killing wazuh-agentd...Apr 24 01:55:27 ip-172-31-91-221 env[5567]: Killing wazuh-execd...Apr 24 01:55:27 ip-172-31-91-221 env[5567]: Wazuh v4.7.3 StoppedApr 24 01:55:27 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Deactivated successfully.Apr 24 01:55:27 ip-172-31-91-221 systemd[1]: Stopped wazuh-agent.service - Wazuh agent.Apr 24 01:55:27 ip-172-31-91-221 systemd[1]: wazuh-agent.service: Consumed 11.375s CPU time.  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:55:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:55:21+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:55:27+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:55:24+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}], "total_affected_items": 3, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  disconnected  PASSED  modules/testing/tests/test_agent/test_stop.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_stop.py::test_processes commands  pgrep wazuh  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  False  result.get('output')  None  PASSED[32m[2024-04-23 22:55:38] [INFO] TESTER: Restarting wazuh-agent in debian-12[0m  commands  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None      =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 2 warnings in 53.25s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:55:49] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:55:49] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:55:49] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:55:49] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test uninstall for agent] ************************************************ changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_uninstall.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:09.194274'  end: '2024-04-23 22:57:00.896655'  msg: ''  rc: 0  start: '2024-04-23 22:55:51.702381'  stderr: |-  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Failed to disable unit: Unit file wazuh-agent.service does not exist.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-84-141-14.compute-1.amazonaws.com]:2200,[3.84.141.14]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:55:52] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:55:52] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 5 items    modules/testing/tests/test_agent/test_uninstall.py::test_uninstall [32m[2024-04-23 22:55:52] [INFO] TESTER: Checking connection to debian-12[0m  [32m[2024-04-23 22:55:54] [INFO] TESTER: Connection established successfully in debian-12[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  002 agent-linux-debian-12-amd64 any 4f2965e011689d66aaa1d43166c5754e3058e5bc98fa134280f99e43cc650489  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  002 agent-linux-debian-12-amd64 any 4f2965e011689d66aaa1d43166c5754e3058e5bc98fa134280f99e43cc650489  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 22:56:17] [INFO] TESTER: Uninstalling Agent in debian-12[0m  command  apt-get remove --purge wazuh-agent -y  ret  Reading package lists...Building dependency tree...Reading state information...The following packages will be REMOVED: wazuh-agent*0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.After this operation, 31.5 MB disk space will be freed.(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 30345 files and directories currently installed.)Removing wazuh-agent (4.7.3-1) ...(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 29982 files and directories currently installed.)Purging configuration files for wazuh-agent (4.7.3-1) ...  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'apt-get remove --purge wazuh-agent -y']  result.get('success')  True  result.get('output')  Reading package lists...Building dependency tree...Reading state information...The following packages will be REMOVED: wazuh-agent*0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.After this operation, 31.5 MB disk space will be freed.(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 30345 files and directories currently installed.)Removing wazuh-agent (4.7.3-1) ...(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 29982 files and directories currently installed.)Purging configuration files for wazuh-agent (4.7.3-1) ...  command  systemctl disable wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl disable wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl daemon-reload  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl daemon-reload']  result.get('success')  False  result.get('output')  None  commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, DisconnectedList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, DisconnectedList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, DisconnectedList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory commands  test -d /var/ossec && echo "True" || echo "False"  ret  False  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  False  False  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}], "total_affected_items": 3, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  disconnected  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_processes commands  pgrep wazuh  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-07299b4ee85290836/debian-12-amd64-key-7957', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'admin@ec2-3-84-141-14.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  False  result.get('output')  None  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 5 passed, 2 warnings in 68.46s (0:01:08) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:57:01] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-debian-12-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:57:01] [INFO] TESTER: Cleaning up [2024-04-23 22:57:01] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:57:01] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=false   path: /tmp/tests  state: absent PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=2  changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:57:15] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-23 22:57:15] [INFO] TESTER: Cleaning up [2024-04-23 22:57:15] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:57:15] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=false   path: /tmp/tests  state: absent PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=2  changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:57:28] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}}  [2024-04-23 22:57:28] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [run-agent-linux-debian-12-amd64-tests] Finished task in 469.28 seconds. [2024-04-23 22:57:28] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [run-agent-linux-oracle-9-amd64-tests] Starting task. [2024-04-23 22:57:28] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Running task "run-agent-linux-oracle-9-amd64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml'}", '--tests=install,registration,connection,basic_info,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-23 22:57:31] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Finished task "run-agent-linux-ubuntu-20.04-amd64-tests" execution with result: [2024-04-23 22:49:02] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:49:02] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:49:02] [INFO] TESTER: Running tests for ec2-18-208-152-12.compute-1.amazonaws.com [2024-04-23 22:49:02] [INFO] TESTER: Running tests for ec2-3-93-231-93.compute-1.amazonaws.com [2024-04-23 22:49:02] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'wazuh_version': '4.7.3', 'wazuh_revision': '40714', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': True, 'hosts_ip': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-93-231-93.compute-1.amazonaws.com'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability', 'current_user': 'fcaffieri'} [2024-04-23 22:49:02] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-23 22:49:02] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:49:02] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-93-231-93.compute-1.amazonaws.com']}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-18-208-152-12.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004160'  end: '2024-04-23 22:49:04.178034'  item: ec2-18-208-152-12.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 22:49:04.173874'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  changed: [localhost] => (item=ec2-3-93-231-93.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004051'  end: '2024-04-23 22:49:04.333199'  item: ec2-3-93-231-93.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 22:49:04.329148'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:49:04] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-93-231-93.compute-1.amazonaws.com']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:49:04] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:49:04] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:49:04] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test install for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_install.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:55.664875'  end: '2024-04-23 22:50:02.245701'  msg: ''  rc: 0  start: '2024-04-23 22:49:06.580826'  stderr: |-  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  --2024-04-24 01:49:37-- https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.7.3-1_amd64.deb  Resolving packages.wazuh.com (packages.wazuh.com)... 99.86.229.76, 99.86.229.65, 99.86.229.57, ...  Connecting to packages.wazuh.com (packages.wazuh.com)|99.86.229.76|:443... connected.  HTTP request sent, awaiting response... 200 OK  Length: 9362524 (8.9M) [binary/octet-stream]  Saving to: ‘wazuh-agent_4.7.3-1_amd64.deb’    0K .......... .......... .......... .......... .......... 0% 18.5M 0s  50K .......... .......... .......... .......... .......... 1% 41.5M 0s  100K .......... .......... .......... .......... .......... 1% 23.4M 0s  150K .......... .......... .......... .......... .......... 2% 49.3M 0s  200K .......... .......... .......... .......... .......... 2% 118M 0s  250K .......... .......... .......... .......... .......... 3% 19.3M 0s  300K .......... .......... .......... .......... .......... 3% 45.2M 0s  350K .......... .......... .......... .......... .......... 4% 54.8M 0s  400K .......... .......... .......... .......... .......... 4% 54.7M 0s  450K .......... .......... .......... .......... .......... 5% 117M 0s  500K .......... .......... .......... .......... .......... 6% 33.7M 0s  550K .......... .......... .......... .......... .......... 6% 22.1M 0s  600K .......... .......... .......... .......... .......... 7% 92.6M 0s  650K .......... .......... .......... .......... .......... 7% 130M 0s  700K .......... .......... .......... .......... .......... 8% 124M 0s  750K .......... .......... .......... .......... .......... 8% 30.2M 0s  800K .......... .......... .......... .......... .......... 9% 7.59M 0s  850K .......... .......... .......... .......... .......... 9% 21.5M 0s  900K .......... .......... .......... .......... .......... 10% 115M 0s  950K .......... .......... .......... .......... .......... 10% 79.4M 0s  1000K .......... .......... .......... .......... .......... 11% 58.2M 0s  1050K .......... .......... .......... .......... .......... 12% 57.5M 0s  1100K .......... .......... .......... .......... .......... 12% 120M 0s  1150K .......... .......... .......... .......... .......... 13% 18.3M 0s  1200K .......... .......... .......... .......... .......... 13% 80.4M 0s  1250K .......... .......... .......... .......... .......... 14% 49.5M 0s  1300K .......... .......... .......... .......... .......... 14% 55.5M 0s  1350K .......... .......... .......... .......... .......... 15% 110M 0s  1400K .......... .......... .......... .......... .......... 15% 42.7M 0s  1450K .......... .......... .......... .......... .......... 16% 8.96M 0s  1500K .......... .......... .......... .......... .......... 16% 129M 0s  1550K .......... .......... .......... .......... .......... 17% 31.1M 0s  1600K .......... .......... .......... .......... .......... 18% 91.8M 0s  1650K .......... .......... .......... .......... .......... 18% 25.5M 0s  1700K .......... .......... .......... .......... .......... 19% 10.3M 0s  1750K .......... .......... .......... .......... .......... 19% 22.1M 0s  1800K .......... .......... .......... .......... .......... 20% 149M 0s  1850K .......... .......... .......... .......... .......... 20% 19.5M 0s  1900K .......... .......... .......... .......... .......... 21% 13.8M 0s  1950K .......... .......... .......... .......... .......... 21% 24.4M 0s  2000K .......... .......... .......... .......... .......... 22% 20.5M 0s  2050K .......... .......... .......... .......... .......... 22% 111M 0s  2100K .......... .......... .......... .......... .......... 23% 25.1M 0s  2150K .......... .......... .......... .......... .......... 24% 13.4M 0s  2200K .......... .......... .......... .......... .......... 24% 59.1M 0s  2250K .......... .......... .......... .......... .......... 25% 105M 0s  2300K .......... .......... .......... .......... .......... 25% 24.0M 0s  2350K .......... .......... .......... .......... .......... 26% 18.2M 0s  2400K .......... .......... .......... .......... .......... 26% 20.2M 0s  2450K .......... .......... .......... .......... .......... 27% 76.1M 0s  2500K .......... .......... .......... .......... .......... 27% 122M 0s  2550K .......... .......... .......... .......... .......... 28% 35.5M 0s  2600K .......... .......... .......... .......... .......... 28% 54.7M 0s  2650K .......... .......... .......... .......... .......... 29% 47.2M 0s  2700K .......... .......... .......... .......... .......... 30% 116M 0s  2750K .......... .......... .......... .......... .......... 30% 39.7M 0s  2800K .......... .......... .......... .......... .......... 31% 24.2M 0s  2850K .......... .......... .......... .......... .......... 31% 59.4M 0s  2900K .......... .......... .......... .......... .......... 32% 65.3M 0s  2950K .......... .......... .......... .......... .......... 32% 93.5M 0s  3000K .......... .......... .......... .......... .......... 33% 41.6M 0s  3050K .......... .......... .......... .......... .......... 33% 31.6M 0s  3100K .......... .......... .......... .......... .......... 34% 49.1M 0s  3150K .......... .......... .......... .......... .......... 34% 68.9M 0s  3200K .......... .......... .......... .......... .......... 35% 118M 0s  3250K .......... .......... .......... .......... .......... 36% 58.5M 0s  3300K .......... .......... .......... .......... .......... 36% 51.5M 0s  3350K .......... .......... .......... .......... .......... 37% 37.8M 0s  3400K .......... .......... .......... .......... .......... 37% 132M 0s  3450K .......... .......... .......... .......... .......... 38% 65.4M 0s  3500K .......... .......... .......... .......... .......... 38% 74.6M 0s  3550K .......... .......... .......... .......... .......... 39% 61.6M 0s  3600K .......... .......... .......... .......... .......... 39% 68.7M 0s  3650K .......... .......... .......... .......... .......... 40% 125M 0s  3700K .......... .......... .......... .......... .......... 41% 46.3M 0s  3750K .......... .......... .......... .......... .......... 41% 68.0M 0s  3800K .......... .......... .......... .......... .......... 42% 92.4M 0s  3850K .......... .......... .......... .......... .......... 42% 104M 0s  3900K .......... .......... .......... .......... .......... 43% 30.7M 0s  3950K .......... .......... .......... .......... .......... 43% 45.3M 0s  4000K .......... .......... .......... .......... .......... 44% 45.4M 0s  4050K .......... .......... .......... .......... .......... 44% 28.6M 0s  4100K .......... .......... .......... .......... .......... 45% 142M 0s  4150K .......... .......... .......... .......... .......... 45% 64.0M 0s  4200K .......... .......... .......... .......... .......... 46% 31.6M 0s  4250K .......... .......... .......... .......... .......... 47% 138M 0s  4300K .......... .......... .......... .......... .......... 47% 130M 0s  4350K .......... .......... .......... .......... .......... 48% 52.8M 0s  4400K .......... .......... .......... .......... .......... 48% 86.7M 0s  4450K .......... .......... .......... .......... .......... 49% 101M 0s  4500K .......... .......... .......... .......... .......... 49% 96.7M 0s  4550K .......... .......... .......... .......... .......... 50% 110M 0s  4600K .......... .......... .......... .......... .......... 50% 40.5M 0s  4650K .......... .......... .......... .......... .......... 51% 86.1M 0s  4700K .......... .......... .......... .......... .......... 51% 102M 0s  4750K .......... .......... .......... .......... .......... 52% 54.9M 0s  4800K .......... .......... .......... .......... .......... 53% 73.4M 0s  4850K .......... .......... .......... .......... .......... 53% 63.0M 0s  4900K .......... .......... .......... .......... .......... 54% 61.0M 0s  4950K .......... .......... .......... .......... .......... 54% 20.0M 0s  5000K .......... .......... .......... .......... .......... 55% 88.2M 0s  5050K .......... .......... .......... .......... .......... 55% 144M 0s  5100K .......... .......... .......... .......... .......... 56% 43.8M 0s  5150K .......... .......... .......... .......... .......... 56% 55.3M 0s  5200K .......... .......... .......... .......... .......... 57% 30.0M 0s  5250K .......... .......... .......... .......... .......... 57% 125M 0s  5300K .......... .......... .......... .......... .......... 58% 18.6M 0s  5350K .......... .......... .......... .......... .......... 59% 27.6M 0s  5400K .......... .......... .......... .......... .......... 59% 39.3M 0s  5450K .......... .......... .......... .......... .......... 60% 117M 0s  5500K .......... .......... .......... .......... .......... 60% 19.7M 0s  5550K .......... .......... .......... .......... .......... 61% 18.2M 0s  5600K .......... .......... .......... .......... .......... 61% 18.9M 0s  5650K .......... .......... .......... .......... .......... 62% 16.8M 0s  5700K .......... .......... .......... .......... .......... 62% 120M 0s  5750K .......... .......... .......... .......... .......... 63% 15.4M 0s  5800K .......... .......... .......... .......... .......... 63% 22.5M 0s  5850K .......... .......... .......... .......... .......... 64% 17.6M 0s  5900K .......... .......... .......... .......... .......... 65% 126M 0s  5950K .......... .......... .......... .......... .......... 65% 18.1M 0s  6000K .......... .......... .......... .......... .......... 66% 18.0M 0s  6050K .......... .......... .......... .......... .......... 66% 6.63M 0s  6100K .......... .......... .......... .......... .......... 67% 17.6M 0s  6150K .......... .......... .......... .......... .......... 67% 131M 0s  6200K .......... .......... .......... .......... .......... 68% 20.6M 0s  6250K .......... .......... .......... .......... .......... 68% 16.9M 0s  6300K .......... .......... .......... .......... .......... 69% 17.6M 0s  6350K .......... .......... .......... .......... .......... 69% 16.6M 0s  6400K .......... .......... .......... .......... .......... 70% 6.99M 0s  6450K .......... .......... .......... .......... .......... 71% 9.07M 0s  6500K .......... .......... .......... .......... .......... 71% 123M 0s  6550K .......... .......... .......... .......... .......... 72% 36.1M 0s  6600K .......... .......... .......... .......... .......... 72% 77.8M 0s  6650K .......... .......... .......... .......... .......... 73% 13.3M 0s  6700K .......... .......... .......... .......... .......... 73% 46.2M 0s  6750K .......... .......... .......... .......... .......... 74% 25.7M 0s  6800K .......... .......... .......... .......... .......... 74% 35.4M 0s  6850K .......... .......... .......... .......... .......... 75% 13.9M 0s  6900K .......... .......... .......... .......... .......... 76% 130M 0s  6950K .......... .......... .......... .......... .......... 76% 122M 0s  7000K .......... .......... .......... .......... .......... 77% 81.0M 0s  7050K .......... .......... .......... .......... .......... 77% 191M 0s  7100K .......... .......... .......... .......... .......... 78% 258M 0s  7150K .......... .......... .......... .......... .......... 78% 182M 0s  7200K .......... .......... .......... .......... .......... 79% 166M 0s  7250K .......... .......... .......... .......... .......... 79% 262M 0s  7300K .......... .......... .......... .......... .......... 80% 269M 0s  7350K .......... .......... .......... .......... .......... 80% 245M 0s  7400K .......... .......... .......... .......... .......... 81% 48.0M 0s  7450K .......... .......... .......... .......... .......... 82% 263M 0s  7500K .......... .......... .......... .......... .......... 82% 127M 0s  7550K .......... .......... .......... .......... .......... 83% 217M 0s  7600K .......... .......... .......... .......... .......... 83% 249M 0s  7650K .......... .......... .......... .......... .......... 84% 171M 0s  7700K .......... .......... .......... .......... .......... 84% 95.6M 0s  7750K .......... .......... .......... .......... .......... 85% 140M 0s  7800K .......... .......... .......... .......... .......... 85% 93.4M 0s  7850K .......... .......... .......... .......... .......... 86% 100M 0s  7900K .......... .......... .......... .......... .......... 86% 98.0M 0s  7950K .......... .......... .......... .......... .......... 87% 76.3M 0s  8000K .......... .......... .......... .......... .......... 88% 111M 0s  8050K .......... .......... .......... .......... .......... 88% 53.7M 0s  8100K .......... .......... .......... .......... .......... 89% 108M 0s  8150K .......... .......... .......... .......... .......... 89% 122M 0s  8200K .......... .......... .......... .......... .......... 90% 144M 0s  8250K .......... .......... .......... .......... .......... 90% 128M 0s  8300K .......... .......... .......... .......... .......... 91% 92.0M 0s  8350K .......... .......... .......... .......... .......... 91% 112M 0s  8400K .......... .......... .......... .......... .......... 92% 37.4M 0s  8450K .......... .......... .......... .......... .......... 92% 35.4M 0s  8500K .......... .......... .......... .......... .......... 93% 107M 0s  8550K .......... .......... .......... .......... .......... 94% 130M 0s  8600K .......... .......... .......... .......... .......... 94% 149M 0s  8650K .......... .......... .......... .......... .......... 95% 140M 0s  8700K .......... .......... .......... .......... .......... 95% 71.6M 0s  8750K .......... .......... .......... .......... .......... 96% 106M 0s  8800K .......... .......... .......... .......... .......... 96% 96.6M 0s  8850K .......... .......... .......... .......... .......... 97% 45.3M 0s  8900K .......... .......... .......... .......... .......... 97% 122M 0s  8950K .......... .......... .......... .......... .......... 98% 59.5M 0s  9000K .......... .......... .......... .......... .......... 98% 94.5M 0s  9050K .......... .......... .......... .......... .......... 99% 134M 0s  9100K .......... .......... .......... .......... ... 100% 114M=0.2s    2024-04-24 01:49:37 (38.9 MB/s) - ‘wazuh-agent_4.7.3-1_amd64.deb’ saved [9362524/9362524]    Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Created symlink /etc/systemd/system/multi-user.target.wants/wazuh-agent.service → /lib/systemd/system/wazuh-agent.service.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Job for wazuh-agent.service failed because the control process exited with error code.  See "systemctl status wazuh-agent.service" and "journalctl -xe" for details.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:49:07] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:49:07] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 2 items    modules/testing/tests/test_agent/test_install.py::test_installation [32m[2024-04-23 22:49:07] [INFO] TESTER: Checking connection to ubuntu-20.04[0m  [32m[2024-04-23 22:49:08] [INFO] TESTER: Connection established successfully in ubuntu-20.04[0m  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  [32m[2024-04-23 22:49:16] [INFO] TESTER: Checking connection to ubuntu-22.04[0m  [32m[2024-04-23 22:49:18] [INFO] TESTER: Connection established successfully in ubuntu-22.04[0m  commands  systemctl is-active firewalld  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active firewalld  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  True  result.get('output')  inactive  [32m[2024-04-23 22:49:26] [INFO] TESTER: No Firewall to disable on ubuntu-20.04[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 22:49:30] [INFO] TESTER: Manager is already installed in ubuntu-22.04[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  os_type  linux  [32m[2024-04-23 22:49:33] [INFO] TESTER: Installing Agent in ubuntu-20.04[0m  command  wget https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.7.3-1_amd64.deb && sudo WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-linux-ubuntu-2004-amd64' dpkg -i ./wazuh-agent_4.7.3-1_amd64.deb  ret  Selecting previously unselected package wazuh-agent.(Reading database ... 61929 files and directories currently installed.)Preparing to unpack .../wazuh-agent_4.7.3-1_amd64.deb ...Unpacking wazuh-agent (4.7.3-1) ...Setting up wazuh-agent (4.7.3-1) ...Processing triggers for systemd (245.4-4ubuntu3.21) ...  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', "wget https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.7.3-1_amd64.deb && sudo WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-linux-ubuntu-2004-amd64' dpkg -i ./wazuh-agent_4.7.3-1_amd64.deb"]  result.get('success')  True  result.get('output')  Selecting previously unselected package wazuh-agent.(Reading database ... 61929 files and directories currently installed.)Preparing to unpack .../wazuh-agent_4.7.3-1_amd64.deb ...Unpacking wazuh-agent (4.7.3-1) ...Setting up wazuh-agent (4.7.3-1) ...Processing triggers for systemd (245.4-4ubuntu3.21) ...  command  systemctl daemon-reload  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl daemon-reload']  result.get('success')  False  result.get('output')  None  command  systemctl enable wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl enable wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl start wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl start wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:49:51 UTC; 3s ago Process: 3772 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE)Apr 24 01:49:51 ip-172-31-84-160 systemd[1]: Starting Wazuh agent...Apr 24 01:49:51 ip-172-31-84-160 env[3780]: 2024/04/24 01:49:51 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:49:51 ip-172-31-84-160 env[3780]: 2024/04/24 01:49:51 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:49:51 ip-172-31-84-160 env[3772]: wazuh-agentd: Configuration error. ExitingApr 24 01:49:51 ip-172-31-84-160 systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:49:51 ip-172-31-84-160 systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:49:51 ip-172-31-84-160 systemd[1]: Failed to start Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:49:51 UTC; 3s ago Process: 3772 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE)Apr 24 01:49:51 ip-172-31-84-160 systemd[1]: Starting Wazuh agent...Apr 24 01:49:51 ip-172-31-84-160 env[3780]: 2024/04/24 01:49:51 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:49:51 ip-172-31-84-160 env[3780]: 2024/04/24 01:49:51 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:49:51 ip-172-31-84-160 env[3772]: wazuh-agentd: Configuration error. ExitingApr 24 01:49:51 ip-172-31-84-160 systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:49:51 ip-172-31-84-160 systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:49:51 ip-172-31-84-160 systemd[1]: Failed to start Wazuh agent.  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  PASSED  modules/testing/tests/test_agent/test_install.py::test_status [32m[2024-04-23 22:49:58] [INFO] TESTER: Getting status of ubuntu-20.04[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:49:51 UTC; 10s ago Process: 3772 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE)Apr 24 01:49:51 ip-172-31-84-160 systemd[1]: Starting Wazuh agent...Apr 24 01:49:51 ip-172-31-84-160 env[3780]: 2024/04/24 01:49:51 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:49:51 ip-172-31-84-160 env[3780]: 2024/04/24 01:49:51 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:49:51 ip-172-31-84-160 env[3772]: wazuh-agentd: Configuration error. ExitingApr 24 01:49:51 ip-172-31-84-160 systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:49:51 ip-172-31-84-160 systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:49:51 ip-172-31-84-160 systemd[1]: Failed to start Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:49:51 UTC; 10s ago Process: 3772 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE)Apr 24 01:49:51 ip-172-31-84-160 systemd[1]: Starting Wazuh agent...Apr 24 01:49:51 ip-172-31-84-160 env[3780]: 2024/04/24 01:49:51 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:49:51 ip-172-31-84-160 env[3780]: 2024/04/24 01:49:51 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:49:51 ip-172-31-84-160 env[3772]: wazuh-agentd: Configuration error. ExitingApr 24 01:49:51 ip-172-31-84-160 systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:49:51 ip-172-31-84-160 systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:49:51 ip-172-31-84-160 systemd[1]: Failed to start Wazuh agent.  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 2 passed, 2 warnings in 54.93s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:50:02] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:50:02] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:50:02] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:50:02] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test registration for agent] ********************************************* changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_registration.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:21.510123'  end: '2024-04-23 22:51:27.013892'  msg: ''  rc: 0  start: '2024-04-23 22:50:05.503769'  stderr: |-  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:50:05] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:50:05] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 4 items    modules/testing/tests/test_agent/test_registration.py::test_status [32m[2024-04-23 22:50:06] [INFO] TESTER: Checking connection to ubuntu-20.04[0m  [32m[2024-04-23 22:50:07] [INFO] TESTER: Connection established successfully in ubuntu-20.04[0m  commands  systemctl is-active wazuh-agent  ret  failed  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  failed  failed  commands  systemctl is-active wazuh-agent  ret  failed  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  failed  [32m[2024-04-23 22:50:16] [INFO] TESTER: os_type linux[0m  command  sed -i 's/
MANAGER_IP<\/address>/
172.31.86.48<\/address>/g' /var/ossec/etc/ossec.conf  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', "sed -i 's/
MANAGER_IP<\\/address>/
172.31.86.48<\\/address>/g' /var/ossec/etc/ossec.conf"]  result.get('success')  False  result.get('output')  None  command  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  commands  cat /var/ossec/etc/ossec.conf  ret 
172.31.86.48
1514 tcp
ubuntu, ubuntu20, ubuntu20.04 10 60 yes aes yes agent-linux-ubuntu-2004-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/auth.log syslog /var/log/syslog syslog /var/log/dpkg.log syslog /var/log/kern.log   ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/ossec.conf']  result.get('success')  True  result.get('output') 
172.31.86.48
1514 tcp
ubuntu, ubuntu20, ubuntu20.04 10 60 yes aes yes agent-linux-ubuntu-2004-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/auth.log syslog /var/log/syslog syslog /var/log/dpkg.log syslog /var/log/kern.log   [32m[2024-04-23 22:50:35] [INFO] TESTER: Getting status of ubuntu-20.04[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2024-04-24 01:50:31 UTC; 8s ago Process: 4790 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 29 (limit: 4632) Memory: 29.4M CGroup: /system.slice/wazuh-agent.service ├─4812 /var/ossec/bin/wazuh-execd ├─4823 /var/ossec/bin/wazuh-agentd ├─4836 /var/ossec/bin/wazuh-syscheckd ├─4849 /var/ossec/bin/wazuh-logcollector └─4866 /var/ossec/bin/wazuh-modulesdApr 24 01:50:23 ip-172-31-84-160 systemd[1]: Starting Wazuh agent...Apr 24 01:50:23 ip-172-31-84-160 env[4790]: Starting Wazuh v4.7.3...Apr 24 01:50:24 ip-172-31-84-160 env[4790]: Started wazuh-execd...Apr 24 01:50:25 ip-172-31-84-160 env[4790]: Started wazuh-agentd...Apr 24 01:50:26 ip-172-31-84-160 env[4790]: Started wazuh-syscheckd...Apr 24 01:50:28 ip-172-31-84-160 env[4790]: Started wazuh-logcollector...Apr 24 01:50:29 ip-172-31-84-160 env[4790]: Started wazuh-modulesd...Apr 24 01:50:31 ip-172-31-84-160 env[4790]: Completed.Apr 24 01:50:31 ip-172-31-84-160 systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2024-04-24 01:50:31 UTC; 8s ago Process: 4790 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 29 (limit: 4632) Memory: 29.4M CGroup: /system.slice/wazuh-agent.service ├─4812 /var/ossec/bin/wazuh-execd ├─4823 /var/ossec/bin/wazuh-agentd ├─4836 /var/ossec/bin/wazuh-syscheckd ├─4849 /var/ossec/bin/wazuh-logcollector └─4866 /var/ossec/bin/wazuh-modulesdApr 24 01:50:23 ip-172-31-84-160 systemd[1]: Starting Wazuh agent...Apr 24 01:50:23 ip-172-31-84-160 env[4790]: Starting Wazuh v4.7.3...Apr 24 01:50:24 ip-172-31-84-160 env[4790]: Started wazuh-execd...Apr 24 01:50:25 ip-172-31-84-160 env[4790]: Started wazuh-agentd...Apr 24 01:50:26 ip-172-31-84-160 env[4790]: Started wazuh-syscheckd...Apr 24 01:50:28 ip-172-31-84-160 env[4790]: Started wazuh-logcollector...Apr 24 01:50:29 ip-172-31-84-160 env[4790]: Started wazuh-modulesd...Apr 24 01:50:31 ip-172-31-84-160 env[4790]: Completed.Apr 24 01:50:31 ip-172-31-84-160 systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_registration.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  false  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  false  commands  tar -xvf wazuh-install-files.tar  ret  wazuh-install-files/wazuh-install-files/wazuh-passwords.txtwazuh-install-files/wazuh-indexer.pemwazuh-install-files/wazuh-server.pemwazuh-install-files/root-ca.keywazuh-install-files/admin.pemwazuh-install-files/wazuh-dashboard-key.pemwazuh-install-files/config.ymlwazuh-install-files/root-ca.pemwazuh-install-files/wazuh-indexer-key.pemwazuh-install-files/wazuh-server-key.pemwazuh-install-files/wazuh-dashboard.pemwazuh-install-files/admin-key.pem  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'tar -xvf wazuh-install-files.tar']  result.get('success')  True  result.get('output')  wazuh-install-files/wazuh-install-files/wazuh-passwords.txtwazuh-install-files/wazuh-indexer.pemwazuh-install-files/wazuh-server.pemwazuh-install-files/root-ca.keywazuh-install-files/admin.pemwazuh-install-files/wazuh-dashboard-key.pemwazuh-install-files/config.ymlwazuh-install-files/root-ca.pemwazuh-install-files/wazuh-indexer-key.pemwazuh-install-files/wazuh-server-key.pemwazuh-install-files/wazuh-dashboard.pemwazuh-install-files/admin-key.pem  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:51:00+00:00", "status_code": 0, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"ip": "any", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "not synced", "id": "002", "status_code": 0, "name": "agent-linux-debian-12-amd64", "node_name": "unknown", "registerIP": "any", "status": "never_connected"}], "total_affected_items": 3, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_registration.py::test_connection commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, DisconnectedList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, DisconnectedList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, DisconnectedList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_registration.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 4 passed, 2 warnings in 80.73s (0:01:20) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:51:27] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:51:27] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:51:27] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:51:27] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test connection for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_connection.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:31.614950'  end: '2024-04-23 22:53:00.944081'  msg: ''  rc: 0  start: '2024-04-23 22:51:29.329131'  stderr: |-  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:51:29] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:51:29] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 6 items    modules/testing/tests/test_agent/test_connection.py::test_connection [32m[2024-04-23 22:51:29] [INFO] TESTER: Checking connection to ubuntu-20.04[0m  [32m[2024-04-23 22:51:31] [INFO] TESTER: Connection established successfully in ubuntu-20.04[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  001 agent-linux-ubuntu-2004-amd64 any cc13553fd7bf182e299fff9ed7c17650172f7f839beedcfd9d823eb71e214ee1  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  001 agent-linux-ubuntu-2004-amd64 any cc13553fd7bf182e299fff9ed7c17650172f7f839beedcfd9d823eb71e214ee1  command  sed -i 's/[^<]*<\/protocol>/tcp<\/protocol>/g' /var/ossec/etc/ossec.conf  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', "sed -i 's/[^<]*<\\/protocol>/tcp<\\/protocol>/g' /var/ossec/etc/ossec.conf"]  result.get('success')  False  result.get('output')  None  command  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  commands  cat /var/ossec/etc/ossec.conf  ret 
172.31.86.48
1514 tcp
ubuntu, ubuntu20, ubuntu20.04 10 60 yes aes yes agent-linux-ubuntu-2004-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/auth.log syslog /var/log/syslog syslog /var/log/dpkg.log syslog /var/log/kern.log   ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/ossec.conf']  result.get('success')  True  result.get('output') 
172.31.86.48
1514 tcp
ubuntu, ubuntu20, ubuntu20.04 10 60 yes aes yes agent-linux-ubuntu-2004-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/auth.log syslog /var/log/syslog syslog /var/log/dpkg.log syslog /var/log/kern.log   commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    PASSED  modules/testing/tests/test_agent/test_connection.py::test_status [32m[2024-04-23 22:52:22] [INFO] TESTER: Getting status of ubuntu-20.04[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2024-04-24 01:52:02 UTC; 24s ago Process: 7978 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 4632) Memory: 16.7M CGroup: /system.slice/wazuh-agent.service ├─8000 /var/ossec/bin/wazuh-execd ├─8011 /var/ossec/bin/wazuh-agentd ├─8025 /var/ossec/bin/wazuh-syscheckd ├─8039 /var/ossec/bin/wazuh-logcollector └─8059 /var/ossec/bin/wazuh-modulesdApr 24 01:51:55 ip-172-31-84-160 systemd[1]: Starting Wazuh agent...Apr 24 01:51:55 ip-172-31-84-160 env[7978]: Starting Wazuh v4.7.3...Apr 24 01:51:56 ip-172-31-84-160 env[7978]: Started wazuh-execd...Apr 24 01:51:57 ip-172-31-84-160 env[7978]: Started wazuh-agentd...Apr 24 01:51:58 ip-172-31-84-160 env[7978]: Started wazuh-syscheckd...Apr 24 01:51:59 ip-172-31-84-160 env[7978]: Started wazuh-logcollector...Apr 24 01:52:00 ip-172-31-84-160 env[7978]: Started wazuh-modulesd...Apr 24 01:52:02 ip-172-31-84-160 env[7978]: Completed.Apr 24 01:52:02 ip-172-31-84-160 systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2024-04-24 01:52:02 UTC; 24s ago Process: 7978 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 4632) Memory: 16.7M CGroup: /system.slice/wazuh-agent.service ├─8000 /var/ossec/bin/wazuh-execd ├─8011 /var/ossec/bin/wazuh-agentd ├─8025 /var/ossec/bin/wazuh-syscheckd ├─8039 /var/ossec/bin/wazuh-logcollector └─8059 /var/ossec/bin/wazuh-modulesdApr 24 01:51:55 ip-172-31-84-160 systemd[1]: Starting Wazuh agent...Apr 24 01:51:55 ip-172-31-84-160 env[7978]: Starting Wazuh v4.7.3...Apr 24 01:51:56 ip-172-31-84-160 env[7978]: Started wazuh-execd...Apr 24 01:51:57 ip-172-31-84-160 env[7978]: Started wazuh-agentd...Apr 24 01:51:58 ip-172-31-84-160 env[7978]: Started wazuh-syscheckd...Apr 24 01:51:59 ip-172-31-84-160 env[7978]: Started wazuh-logcollector...Apr 24 01:52:00 ip-172-31-84-160 env[7978]: Started wazuh-modulesd...Apr 24 01:52:02 ip-172-31-84-160 env[7978]: Completed.Apr 24 01:52:02 ip-172-31-84-160 systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_connection.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:52:46+00:00", "status_code": 0, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:52:46+00:00", "status_code": 0, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 3, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_connection.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED  modules/testing/tests/test_agent/test_connection.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret  ESTAB 0 0 172.31.84.160:51662 172.31.86.48:1514  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  True  result.get('output')  ESTAB 0 0 172.31.84.160:51662 172.31.86.48:1514  PASSED  modules/testing/tests/test_agent/test_connection.py::test_processes commands  pgrep wazuh  ret  80008011802580398059  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  True  result.get('output')  80008011802580398059  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 6 passed, 2 warnings in 90.87s (0:01:30) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:53:01] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:53:01] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:53:01] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:53:01] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test basic_info for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_basic_info.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:43.168071'  end: '2024-04-23 22:53:46.402612'  msg: ''  rc: 0  start: '2024-04-23 22:53:03.234541'  stderr: |-  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:53:03] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:53:03] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version [32m[2024-04-23 22:53:03] [INFO] TESTER: Checking connection to ubuntu-20.04[0m  [32m[2024-04-23 22:53:05] [INFO] TESTER: Connection established successfully in ubuntu-20.04[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  001 agent-linux-ubuntu-2004-amd64 any cc13553fd7bf182e299fff9ed7c17650172f7f839beedcfd9d823eb71e214ee1  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  001 agent-linux-ubuntu-2004-amd64 any cc13553fd7bf182e299fff9ed7c17650172f7f839beedcfd9d823eb71e214ee1  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:53:36+00:00", "status_code": 0, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:53:36+00:00", "status_code": 0, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 3, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version commands  /var/ossec/bin/wazuh-control info -v  ret  v4.7.3  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/wazuh-control info -v']  result.get('success')  True  result.get('output')  v4.7.3  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision commands  /var/ossec/bin/wazuh-control info -r  ret  40714  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/wazuh-control info -r']  result.get('success')  True  result.get('output')  40714  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 2 warnings in 42.43s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:53:46] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:53:46] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:53:46] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:53:46] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test restart for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_restart.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:56.011164'  end: '2024-04-23 22:54:44.706209'  msg: ''  rc: 0  start: '2024-04-23 22:53:48.695045'  stderr: |-  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:53:49] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:53:49] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 7 items    modules/testing/tests/test_agent/test_restart.py::test_restart [32m[2024-04-23 22:53:49] [INFO] TESTER: Checking connection to ubuntu-20.04[0m  [32m[2024-04-23 22:53:50] [INFO] TESTER: Connection established successfully in ubuntu-20.04[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  001 agent-linux-ubuntu-2004-amd64 any cc13553fd7bf182e299fff9ed7c17650172f7f839beedcfd9d823eb71e214ee1  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  001 agent-linux-ubuntu-2004-amd64 any cc13553fd7bf182e299fff9ed7c17650172f7f839beedcfd9d823eb71e214ee1  [32m[2024-04-23 22:54:06] [INFO] TESTER: Restarting wazuh-agent in ubuntu-20.04[0m  commands  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_restart.py::test_status [32m[2024-04-23 22:54:18] [INFO] TESTER: Getting status of ubuntu-20.04[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2024-04-24 01:54:18 UTC; 4s ago Process: 11718 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 4632) Memory: 16.6M CGroup: /system.slice/wazuh-agent.service ├─11740 /var/ossec/bin/wazuh-execd ├─11751 /var/ossec/bin/wazuh-agentd ├─11765 /var/ossec/bin/wazuh-syscheckd ├─11780 /var/ossec/bin/wazuh-logcollector └─11800 /var/ossec/bin/wazuh-modulesdApr 24 01:54:10 ip-172-31-84-160 systemd[1]: Starting Wazuh agent...Apr 24 01:54:10 ip-172-31-84-160 env[11718]: Starting Wazuh v4.7.3...Apr 24 01:54:11 ip-172-31-84-160 env[11718]: Started wazuh-execd...Apr 24 01:54:12 ip-172-31-84-160 env[11718]: Started wazuh-agentd...Apr 24 01:54:13 ip-172-31-84-160 env[11718]: Started wazuh-syscheckd...Apr 24 01:54:14 ip-172-31-84-160 env[11718]: Started wazuh-logcollector...Apr 24 01:54:15 ip-172-31-84-160 env[11718]: Started wazuh-modulesd...Apr 24 01:54:18 ip-172-31-84-160 env[11718]: Completed.Apr 24 01:54:18 ip-172-31-84-160 systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2024-04-24 01:54:18 UTC; 4s ago Process: 11718 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 4632) Memory: 16.6M CGroup: /system.slice/wazuh-agent.service ├─11740 /var/ossec/bin/wazuh-execd ├─11751 /var/ossec/bin/wazuh-agentd ├─11765 /var/ossec/bin/wazuh-syscheckd ├─11780 /var/ossec/bin/wazuh-logcollector └─11800 /var/ossec/bin/wazuh-modulesdApr 24 01:54:10 ip-172-31-84-160 systemd[1]: Starting Wazuh agent...Apr 24 01:54:10 ip-172-31-84-160 env[11718]: Starting Wazuh v4.7.3...Apr 24 01:54:11 ip-172-31-84-160 env[11718]: Started wazuh-execd...Apr 24 01:54:12 ip-172-31-84-160 env[11718]: Started wazuh-agentd...Apr 24 01:54:13 ip-172-31-84-160 env[11718]: Started wazuh-syscheckd...Apr 24 01:54:14 ip-172-31-84-160 env[11718]: Started wazuh-logcollector...Apr 24 01:54:15 ip-172-31-84-160 env[11718]: Started wazuh-modulesd...Apr 24 01:54:18 ip-172-31-84-160 env[11718]: Completed.Apr 24 01:54:18 ip-172-31-84-160 systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_restart.py::test_connection commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Active ID: 002, Name: agent-linux-debian-12-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_restart.py::test_isActive commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  PASSED  modules/testing/tests/test_agent/test_restart.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED  modules/testing/tests/test_agent/test_restart.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret  ESTAB 0 0 172.31.84.160:37478 172.31.86.48:1514  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  True  result.get('output')  ESTAB 0 0 172.31.84.160:37478 172.31.86.48:1514  PASSED  modules/testing/tests/test_agent/test_restart.py::test_processes commands  pgrep wazuh  ret  1174011751117651178011800  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  True  result.get('output')  1174011751117651178011800  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 7 passed, 2 warnings in 55.27s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:54:44] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:54:44] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:54:44] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:54:44] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test stop for agent] ***************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_stop.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:58.941181'  end: '2024-04-23 22:55:47.061092'  msg: ''  rc: 0  start: '2024-04-23 22:54:48.119911'  stderr: |-  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:54:48] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:54:48] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_stop.py::test_service [32m[2024-04-23 22:54:48] [INFO] TESTER: Checking connection to ubuntu-20.04[0m  [32m[2024-04-23 22:54:50] [INFO] TESTER: Connection established successfully in ubuntu-20.04[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  001 agent-linux-ubuntu-2004-amd64 any cc13553fd7bf182e299fff9ed7c17650172f7f839beedcfd9d823eb71e214ee1  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  001 agent-linux-ubuntu-2004-amd64 any cc13553fd7bf182e299fff9ed7c17650172f7f839beedcfd9d823eb71e214ee1  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    [32m[2024-04-23 22:55:18] [INFO] TESTER: Stopping wazuh-agent in ubuntu-20.04[0m  commands  systemctl stop wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl stop wazuh-agent']  result.get('success')  False  result.get('output')  None  [32m[2024-04-23 22:55:23] [INFO] TESTER: Getting status of ubuntu-20.04[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: inactive (dead) since Wed 2024-04-24 01:55:23 UTC; 4s ago Process: 11718 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Process: 14268 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS)Apr 24 01:54:18 ip-172-31-84-160 systemd[1]: Started Wazuh agent.Apr 24 01:55:22 ip-172-31-84-160 systemd[1]: Stopping Wazuh agent...Apr 24 01:55:22 ip-172-31-84-160 env[14268]: Killing wazuh-modulesd...Apr 24 01:55:22 ip-172-31-84-160 env[14268]: Killing wazuh-logcollector...Apr 24 01:55:22 ip-172-31-84-160 env[14268]: Killing wazuh-syscheckd...Apr 24 01:55:23 ip-172-31-84-160 env[14268]: Killing wazuh-agentd...Apr 24 01:55:23 ip-172-31-84-160 env[14268]: Killing wazuh-execd...Apr 24 01:55:23 ip-172-31-84-160 env[14268]: Wazuh v4.7.3 StoppedApr 24 01:55:23 ip-172-31-84-160 systemd[1]: wazuh-agent.service: Succeeded.Apr 24 01:55:23 ip-172-31-84-160 systemd[1]: Stopped Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled) Active: inactive (dead) since Wed 2024-04-24 01:55:23 UTC; 4s ago Process: 11718 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Process: 14268 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS)Apr 24 01:54:18 ip-172-31-84-160 systemd[1]: Started Wazuh agent.Apr 24 01:55:22 ip-172-31-84-160 systemd[1]: Stopping Wazuh agent...Apr 24 01:55:22 ip-172-31-84-160 env[14268]: Killing wazuh-modulesd...Apr 24 01:55:22 ip-172-31-84-160 env[14268]: Killing wazuh-logcollector...Apr 24 01:55:22 ip-172-31-84-160 env[14268]: Killing wazuh-syscheckd...Apr 24 01:55:23 ip-172-31-84-160 env[14268]: Killing wazuh-agentd...Apr 24 01:55:23 ip-172-31-84-160 env[14268]: Killing wazuh-execd...Apr 24 01:55:23 ip-172-31-84-160 env[14268]: Wazuh v4.7.3 StoppedApr 24 01:55:23 ip-172-31-84-160 systemd[1]: wazuh-agent.service: Succeeded.Apr 24 01:55:23 ip-172-31-84-160 systemd[1]: Stopped Wazuh agent.  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:55:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:55:21+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:55:27+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:55:24+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}], "total_affected_items": 3, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  disconnected  PASSED  modules/testing/tests/test_agent/test_stop.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_stop.py::test_processes commands  pgrep wazuh  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  False  result.get('output')  None  PASSED[32m[2024-04-23 22:55:35] [INFO] TESTER: Restarting wazuh-agent in ubuntu-20.04[0m  commands  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None      =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 2 warnings in 58.20s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:55:47] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:55:47] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:55:47] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:55:47] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test uninstall for agent] ************************************************ changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_uninstall.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:18.294043'  end: '2024-04-23 22:57:07.647312'  msg: ''  rc: 0  start: '2024-04-23 22:55:49.353269'  stderr: |-  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Removed /etc/systemd/system/multi-user.target.wants/wazuh-agent.service.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-93-231-93.compute-1.amazonaws.com]:2200,[3.93.231.93]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:55:49] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:55:49] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 5 items    modules/testing/tests/test_agent/test_uninstall.py::test_uninstall [32m[2024-04-23 22:55:50] [INFO] TESTER: Checking connection to ubuntu-20.04[0m  [32m[2024-04-23 22:55:51] [INFO] TESTER: Connection established successfully in ubuntu-20.04[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  001 agent-linux-ubuntu-2004-amd64 any cc13553fd7bf182e299fff9ed7c17650172f7f839beedcfd9d823eb71e214ee1  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  001 agent-linux-ubuntu-2004-amd64 any cc13553fd7bf182e299fff9ed7c17650172f7f839beedcfd9d823eb71e214ee1  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 22:56:18] [INFO] TESTER: Uninstalling Agent in ubuntu-20.04[0m  command  apt-get remove --purge wazuh-agent -y  ret  Reading package lists...Building dependency tree...Reading state information...The following packages will be REMOVED: wazuh-agent*0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.After this operation, 31.5 MB disk space will be freed.(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 62309 files and directories currently installed.)Removing wazuh-agent (4.7.3-1) ...(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 61946 files and directories currently installed.)Purging configuration files for wazuh-agent (4.7.3-1) ...dpkg: warning: while removing wazuh-agent, directory '/usr/lib/systemd/system' not empty so not removedProcessing triggers for systemd (245.4-4ubuntu3.21) ...  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'apt-get remove --purge wazuh-agent -y']  result.get('success')  True  result.get('output')  Reading package lists...Building dependency tree...Reading state information...The following packages will be REMOVED: wazuh-agent*0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.After this operation, 31.5 MB disk space will be freed.(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 62309 files and directories currently installed.)Removing wazuh-agent (4.7.3-1) ...(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 61946 files and directories currently installed.)Purging configuration files for wazuh-agent (4.7.3-1) ...dpkg: warning: while removing wazuh-agent, directory '/usr/lib/systemd/system' not empty so not removedProcessing triggers for systemd (245.4-4ubuntu3.21) ...  command  systemctl disable wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl disable wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl daemon-reload  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl daemon-reload']  result.get('success')  False  result.get('output')  None  commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, DisconnectedList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, DisconnectedList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, DisconnectedList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory commands  test -d /var/ossec && echo "True" || echo "False"  ret  False  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  False  False  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}], "total_affected_items": 3, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  disconnected  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_processes commands  pgrep wazuh  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0ece015de0adea97b/ubuntu-20.04-amd64-key-9794', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-3-93-231-93.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  False  result.get('output')  None  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 5 passed, 2 warnings in 77.45s (0:01:17) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:57:07] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:57:07] [INFO] TESTER: Cleaning up [2024-04-23 22:57:07] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:57:07] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=false   path: /tmp/tests  state: absent PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=2  changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:57:19] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-23 22:57:19] [INFO] TESTER: Cleaning up [2024-04-23 22:57:19] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:57:19] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=false   path: /tmp/tests  state: absent PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=2  changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:57:31] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}}  [2024-04-23 22:57:31] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [run-agent-linux-ubuntu-20.04-amd64-tests] Finished task in 509.96 seconds. [2024-04-23 22:57:31] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [run-agent-linux-centos-8-amd64-tests] Starting task. [2024-04-23 22:57:31] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Running task "run-agent-linux-centos-8-amd64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml'}", '--tests=install,registration,connection,basic_info,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-23 23:04:47] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "run-agent-linux-redhat-9-amd64-tests" execution with result: [2024-04-23 22:56:31] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:56:31] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:56:31] [INFO] TESTER: Running tests for ec2-18-208-152-12.compute-1.amazonaws.com [2024-04-23 22:56:31] [INFO] TESTER: Running tests for ec2-3-88-70-199.compute-1.amazonaws.com [2024-04-23 22:56:31] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'wazuh_version': '4.7.3', 'wazuh_revision': '40714', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': True, 'hosts_ip': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-88-70-199.compute-1.amazonaws.com'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability', 'current_user': 'fcaffieri'} [2024-04-23 22:56:31] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-23 22:56:31] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:56:31] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-88-70-199.compute-1.amazonaws.com']}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-18-208-152-12.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004218'  end: '2024-04-23 22:56:33.455428'  item: ec2-18-208-152-12.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 22:56:33.451210'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  changed: [localhost] => (item=ec2-3-88-70-199.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004141'  end: '2024-04-23 22:56:33.615610'  item: ec2-3-88-70-199.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 22:56:33.611469'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:56:33] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-88-70-199.compute-1.amazonaws.com']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:56:33] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:56:33] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:56:33] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test install for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_install.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:15.779044'  end: '2024-04-23 22:57:51.666622'  msg: ''  rc: 0  start: '2024-04-23 22:56:35.887578'  stderr: |-  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  % Total % Received % Xferd Average Speed Time Time Time Current  Dload Upload Total Spent Left Speed  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 38 9247k 38 3586k 0 0 19.7M 0 --:--:-- --:--:-- --:--:-- 19.6M100 9247k 100 9247k 0 0 22.0M 0 --:--:-- --:--:-- --:--:-- 21.9M  warning: wazuh-agent-4.7.3-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 29111145: NOKEY  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Created symlink /etc/systemd/system/multi-user.target.wants/wazuh-agent.service → /usr/lib/systemd/system/wazuh-agent.service.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Job for wazuh-agent.service failed because the control process exited with error code.  See "systemctl status wazuh-agent.service" and "journalctl -xeu wazuh-agent.service" for details.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:56:36] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:56:36] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 2 items    modules/testing/tests/test_agent/test_install.py::test_installation [32m[2024-04-23 22:56:36] [INFO] TESTER: Checking connection to redhat-9[0m  [32m[2024-04-23 22:56:38] [INFO] TESTER: Connection established successfully in redhat-9[0m  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  [32m[2024-04-23 22:56:44] [INFO] TESTER: Checking connection to ubuntu-22.04[0m  [32m[2024-04-23 22:56:46] [INFO] TESTER: Connection established successfully in ubuntu-22.04[0m  commands  systemctl is-active firewalld  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active firewalld  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  True  result.get('output')  inactive  [32m[2024-04-23 22:56:52] [INFO] TESTER: No Firewall to disable on redhat-9[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 22:56:55] [INFO] TESTER: Manager is already installed in ubuntu-22.04[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  os_type  linux  [32m[2024-04-23 22:56:58] [INFO] TESTER: Installing Agent in redhat-9[0m  command  curl -o wazuh-agent-4.7.3-1.x86_64.rpm https://packages.wazuh.com/4.x/yum/wazuh-agent-4.7.3-1.x86_64.rpm && sudo WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-linux-redhat-9-amd64' rpm -ihv wazuh-agent-4.7.3-1.x86_64.rpm  ret  Verifying... ########################################Preparing... ########################################Updating / installing...wazuh-agent-4.7.3-1 ########################################  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', "curl -o wazuh-agent-4.7.3-1.x86_64.rpm https://packages.wazuh.com/4.x/yum/wazuh-agent-4.7.3-1.x86_64.rpm && sudo WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-linux-redhat-9-amd64' rpm -ihv wazuh-agent-4.7.3-1.x86_64.rpm"]  result.get('success')  True  result.get('output')  Verifying... ########################################Preparing... ########################################Updating / installing...wazuh-agent-4.7.3-1 ########################################  command  systemctl daemon-reload  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl daemon-reload']  result.get('success')  False  result.get('output')  None  command  systemctl enable wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl enable wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl start wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl start wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl status wazuh-agent  ret  × wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:57:42 UTC; 3s ago Process: 14653 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 25msApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14661]: 2024/04/24 01:57:42 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14661]: 2024/04/24 01:57:42 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14653]: wazuh-agentd: Configuration error. ExitingApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: Failed to start Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  × wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:57:42 UTC; 3s ago Process: 14653 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 25msApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14661]: 2024/04/24 01:57:42 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14661]: 2024/04/24 01:57:42 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14653]: wazuh-agentd: Configuration error. ExitingApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: Failed to start Wazuh agent.  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  PASSED  modules/testing/tests/test_agent/test_install.py::test_status [32m[2024-04-23 22:57:48] [INFO] TESTER: Getting status of redhat-9[0m  commands  systemctl status wazuh-agent  ret  × wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:57:42 UTC; 9s ago Process: 14653 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 25msApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14661]: 2024/04/24 01:57:42 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14661]: 2024/04/24 01:57:42 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14653]: wazuh-agentd: Configuration error. ExitingApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: Failed to start Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  × wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:57:42 UTC; 9s ago Process: 14653 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 25msApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14661]: 2024/04/24 01:57:42 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14661]: 2024/04/24 01:57:42 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:57:42 ip-172-31-86-52.ec2.internal env[14653]: wazuh-agentd: Configuration error. ExitingApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:57:42 ip-172-31-86-52.ec2.internal systemd[1]: Failed to start Wazuh agent.  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 2 passed, 2 warnings in 75.05s (0:01:15) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:57:51] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:57:51] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:57:51] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:57:51] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test registration for agent] ********************************************* changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_registration.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:11.254613'  end: '2024-04-23 22:59:05.232454'  msg: ''  rc: 0  start: '2024-04-23 22:57:53.977841'  stderr: |-  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:57:54] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:57:54] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 4 items    modules/testing/tests/test_agent/test_registration.py::test_status [32m[2024-04-23 22:57:54] [INFO] TESTER: Checking connection to redhat-9[0m  [32m[2024-04-23 22:57:56] [INFO] TESTER: Connection established successfully in redhat-9[0m  commands  systemctl is-active wazuh-agent  ret  failed  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  failed  failed  commands  systemctl is-active wazuh-agent  ret  failed  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  failed  [32m[2024-04-23 22:58:04] [INFO] TESTER: os_type linux[0m  command  sed -i 's/
MANAGER_IP<\/address>/
172.31.86.48<\/address>/g' /var/ossec/etc/ossec.conf  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', "sed -i 's/
MANAGER_IP<\\/address>/
172.31.86.48<\\/address>/g' /var/ossec/etc/ossec.conf"]  result.get('success')  False  result.get('output')  None  command  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  commands  cat /var/ossec/etc/ossec.conf  ret 
172.31.86.48
1514 tcp
rhel, rhel9, rhel9.2 10 60 yes aes yes agent-linux-redhat-9-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
audit /var/log/audit/audit.log syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure syslog /var/log/maillog   ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/ossec.conf']  result.get('success')  True  result.get('output') 
172.31.86.48
1514 tcp
rhel, rhel9, rhel9.2 10 60 yes aes yes agent-linux-redhat-9-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
audit /var/log/audit/audit.log syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure syslog /var/log/maillog   [32m[2024-04-23 22:58:21] [INFO] TESTER: Getting status of redhat-9[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 01:58:17 UTC; 7s ago Process: 14802 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 29 (limit: 22632) Memory: 38.8M CPU: 3.363s CGroup: /system.slice/wazuh-agent.service ├─14829 /var/ossec/bin/wazuh-execd ├─14841 /var/ossec/bin/wazuh-agentd ├─14855 /var/ossec/bin/wazuh-syscheckd ├─14869 /var/ossec/bin/wazuh-logcollector └─14887 /var/ossec/bin/wazuh-modulesdApr 24 01:58:10 ip-172-31-86-52.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:58:10 ip-172-31-86-52.ec2.internal env[14802]: Starting Wazuh v4.7.3...Apr 24 01:58:11 ip-172-31-86-52.ec2.internal env[14802]: Started wazuh-execd...Apr 24 01:58:12 ip-172-31-86-52.ec2.internal env[14802]: Started wazuh-agentd...Apr 24 01:58:13 ip-172-31-86-52.ec2.internal env[14802]: Started wazuh-syscheckd...Apr 24 01:58:14 ip-172-31-86-52.ec2.internal env[14802]: Started wazuh-logcollector...Apr 24 01:58:15 ip-172-31-86-52.ec2.internal env[14802]: Started wazuh-modulesd...Apr 24 01:58:17 ip-172-31-86-52.ec2.internal env[14802]: Completed.Apr 24 01:58:17 ip-172-31-86-52.ec2.internal systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 01:58:17 UTC; 7s ago Process: 14802 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 29 (limit: 22632) Memory: 38.8M CPU: 3.363s CGroup: /system.slice/wazuh-agent.service ├─14829 /var/ossec/bin/wazuh-execd ├─14841 /var/ossec/bin/wazuh-agentd ├─14855 /var/ossec/bin/wazuh-syscheckd ├─14869 /var/ossec/bin/wazuh-logcollector └─14887 /var/ossec/bin/wazuh-modulesdApr 24 01:58:10 ip-172-31-86-52.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:58:10 ip-172-31-86-52.ec2.internal env[14802]: Starting Wazuh v4.7.3...Apr 24 01:58:11 ip-172-31-86-52.ec2.internal env[14802]: Started wazuh-execd...Apr 24 01:58:12 ip-172-31-86-52.ec2.internal env[14802]: Started wazuh-agentd...Apr 24 01:58:13 ip-172-31-86-52.ec2.internal env[14802]: Started wazuh-syscheckd...Apr 24 01:58:14 ip-172-31-86-52.ec2.internal env[14802]: Started wazuh-logcollector...Apr 24 01:58:15 ip-172-31-86-52.ec2.internal env[14802]: Started wazuh-modulesd...Apr 24 01:58:17 ip-172-31-86-52.ec2.internal env[14802]: Completed.Apr 24 01:58:17 ip-172-31-86-52.ec2.internal systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_registration.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T01:58:38+00:00", "status_code": 0, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 4, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_registration.py::test_connection commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_registration.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 4 passed, 2 warnings in 70.46s (0:01:10) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:59:05] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:59:05] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:59:05] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:59:05] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test connection for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_connection.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:22.333874'  end: '2024-04-23 23:00:29.983358'  msg: ''  rc: 0  start: '2024-04-23 22:59:07.649484'  stderr: |-  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:59:08] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:59:08] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 6 items    modules/testing/tests/test_agent/test_connection.py::test_connection [32m[2024-04-23 22:59:08] [INFO] TESTER: Checking connection to redhat-9[0m  [32m[2024-04-23 22:59:09] [INFO] TESTER: Connection established successfully in redhat-9[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  003 agent-linux-redhat-9-amd64 any d3987afbcf5d3e703052cc76de5dd1a02ef8f3dbb1e28b9c53e7790e7ea64e71  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  003 agent-linux-redhat-9-amd64 any d3987afbcf5d3e703052cc76de5dd1a02ef8f3dbb1e28b9c53e7790e7ea64e71  command  sed -i 's/[^<]*<\/protocol>/tcp<\/protocol>/g' /var/ossec/etc/ossec.conf  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', "sed -i 's/[^<]*<\\/protocol>/tcp<\\/protocol>/g' /var/ossec/etc/ossec.conf"]  result.get('success')  False  result.get('output')  None  command  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  commands  cat /var/ossec/etc/ossec.conf  ret 
172.31.86.48
1514 tcp
rhel, rhel9, rhel9.2 10 60 yes aes yes agent-linux-redhat-9-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
audit /var/log/audit/audit.log syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure syslog /var/log/maillog   ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/ossec.conf']  result.get('success')  True  result.get('output') 
172.31.86.48
1514 tcp
rhel, rhel9, rhel9.2 10 60 yes aes yes agent-linux-redhat-9-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
audit /var/log/audit/audit.log syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure syslog /var/log/maillog   commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, ActiveList of agentless devices:  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    PASSED  modules/testing/tests/test_agent/test_connection.py::test_status [32m[2024-04-23 22:59:56] [INFO] TESTER: Getting status of redhat-9[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 01:59:37 UTC; 22s ago Process: 16563 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 22632) Memory: 40.0M CPU: 13.360s CGroup: /system.slice/wazuh-agent.service ├─16590 /var/ossec/bin/wazuh-execd ├─16602 /var/ossec/bin/wazuh-agentd ├─16617 /var/ossec/bin/wazuh-syscheckd ├─16633 /var/ossec/bin/wazuh-logcollector └─16653 /var/ossec/bin/wazuh-modulesdApr 24 01:59:30 ip-172-31-86-52.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:59:30 ip-172-31-86-52.ec2.internal env[16563]: Starting Wazuh v4.7.3...Apr 24 01:59:31 ip-172-31-86-52.ec2.internal env[16563]: Started wazuh-execd...Apr 24 01:59:32 ip-172-31-86-52.ec2.internal env[16563]: Started wazuh-agentd...Apr 24 01:59:33 ip-172-31-86-52.ec2.internal env[16563]: Started wazuh-syscheckd...Apr 24 01:59:34 ip-172-31-86-52.ec2.internal env[16563]: Started wazuh-logcollector...Apr 24 01:59:35 ip-172-31-86-52.ec2.internal env[16563]: Started wazuh-modulesd...Apr 24 01:59:37 ip-172-31-86-52.ec2.internal env[16563]: Completed.Apr 24 01:59:37 ip-172-31-86-52.ec2.internal systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 01:59:37 UTC; 22s ago Process: 16563 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 22632) Memory: 40.0M CPU: 13.360s CGroup: /system.slice/wazuh-agent.service ├─16590 /var/ossec/bin/wazuh-execd ├─16602 /var/ossec/bin/wazuh-agentd ├─16617 /var/ossec/bin/wazuh-syscheckd ├─16633 /var/ossec/bin/wazuh-logcollector └─16653 /var/ossec/bin/wazuh-modulesdApr 24 01:59:30 ip-172-31-86-52.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:59:30 ip-172-31-86-52.ec2.internal env[16563]: Starting Wazuh v4.7.3...Apr 24 01:59:31 ip-172-31-86-52.ec2.internal env[16563]: Started wazuh-execd...Apr 24 01:59:32 ip-172-31-86-52.ec2.internal env[16563]: Started wazuh-agentd...Apr 24 01:59:33 ip-172-31-86-52.ec2.internal env[16563]: Started wazuh-syscheckd...Apr 24 01:59:34 ip-172-31-86-52.ec2.internal env[16563]: Started wazuh-logcollector...Apr 24 01:59:35 ip-172-31-86-52.ec2.internal env[16563]: Started wazuh-modulesd...Apr 24 01:59:37 ip-172-31-86-52.ec2.internal env[16563]: Completed.Apr 24 01:59:37 ip-172-31-86-52.ec2.internal systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_connection.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:00:11+00:00", "status_code": 0, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:00:11+00:00", "status_code": 0, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:00:15+00:00", "status_code": 0, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_connection.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED  modules/testing/tests/test_agent/test_connection.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret  ESTAB 0 0 172.31.86.52:44128 172.31.86.48:1514  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  True  result.get('output')  ESTAB 0 0 172.31.86.52:44128 172.31.86.48:1514  PASSED  modules/testing/tests/test_agent/test_connection.py::test_processes commands  pgrep wazuh  ret  1659016602166171663316653  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  True  result.get('output')  1659016602166171663316653  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 6 passed, 2 warnings in 81.59s (0:01:21) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:00:30] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:00:30] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:00:30] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:00:30] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test basic_info for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_basic_info.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:38.527074'  end: '2024-04-23 23:01:10.836836'  msg: ''  rc: 0  start: '2024-04-23 23:00:32.309762'  stderr: |-  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:00:32] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:00:32] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version [32m[2024-04-23 23:00:32] [INFO] TESTER: Checking connection to redhat-9[0m  [32m[2024-04-23 23:00:34] [INFO] TESTER: Connection established successfully in redhat-9[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  003 agent-linux-redhat-9-amd64 any d3987afbcf5d3e703052cc76de5dd1a02ef8f3dbb1e28b9c53e7790e7ea64e71  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  003 agent-linux-redhat-9-amd64 any d3987afbcf5d3e703052cc76de5dd1a02ef8f3dbb1e28b9c53e7790e7ea64e71  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:01:01+00:00", "status_code": 0, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:01:02+00:00", "status_code": 0, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:00:54+00:00", "status_code": 0, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version commands  /var/ossec/bin/wazuh-control info -v  ret  v4.7.3  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/wazuh-control info -v']  result.get('success')  True  result.get('output')  v4.7.3  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision commands  /var/ossec/bin/wazuh-control info -r  ret  40714  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/wazuh-control info -r']  result.get('success')  True  result.get('output')  40714  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 2 warnings in 37.79s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:01:11] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:01:11] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:01:11] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:01:11] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test restart for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_restart.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:49.431080'  end: '2024-04-23 23:02:02.536551'  msg: ''  rc: 0  start: '2024-04-23 23:01:13.105471'  stderr: |-  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:01:13] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:01:13] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 7 items    modules/testing/tests/test_agent/test_restart.py::test_restart [32m[2024-04-23 23:01:13] [INFO] TESTER: Checking connection to redhat-9[0m  [32m[2024-04-23 23:01:15] [INFO] TESTER: Connection established successfully in redhat-9[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  003 agent-linux-redhat-9-amd64 any d3987afbcf5d3e703052cc76de5dd1a02ef8f3dbb1e28b9c53e7790e7ea64e71  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  003 agent-linux-redhat-9-amd64 any d3987afbcf5d3e703052cc76de5dd1a02ef8f3dbb1e28b9c53e7790e7ea64e71  [32m[2024-04-23 23:01:28] [INFO] TESTER: Restarting wazuh-agent in redhat-9[0m  commands  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_restart.py::test_status [32m[2024-04-23 23:01:39] [INFO] TESTER: Getting status of redhat-9[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 02:01:39 UTC; 3s ago Process: 17893 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 22632) Memory: 42.1M CPU: 8.741s CGroup: /system.slice/wazuh-agent.service ├─17921 /var/ossec/bin/wazuh-execd ├─17933 /var/ossec/bin/wazuh-agentd ├─17948 /var/ossec/bin/wazuh-syscheckd ├─17964 /var/ossec/bin/wazuh-logcollector └─17984 /var/ossec/bin/wazuh-modulesdApr 24 02:01:32 ip-172-31-86-52.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 02:01:32 ip-172-31-86-52.ec2.internal env[17893]: Starting Wazuh v4.7.3...Apr 24 02:01:33 ip-172-31-86-52.ec2.internal env[17893]: Started wazuh-execd...Apr 24 02:01:34 ip-172-31-86-52.ec2.internal env[17893]: Started wazuh-agentd...Apr 24 02:01:35 ip-172-31-86-52.ec2.internal env[17893]: Started wazuh-syscheckd...Apr 24 02:01:36 ip-172-31-86-52.ec2.internal env[17893]: Started wazuh-logcollector...Apr 24 02:01:37 ip-172-31-86-52.ec2.internal env[17893]: Started wazuh-modulesd...Apr 24 02:01:39 ip-172-31-86-52.ec2.internal env[17893]: Completed.Apr 24 02:01:39 ip-172-31-86-52.ec2.internal systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 02:01:39 UTC; 3s ago Process: 17893 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 22632) Memory: 42.1M CPU: 8.741s CGroup: /system.slice/wazuh-agent.service ├─17921 /var/ossec/bin/wazuh-execd ├─17933 /var/ossec/bin/wazuh-agentd ├─17948 /var/ossec/bin/wazuh-syscheckd ├─17964 /var/ossec/bin/wazuh-logcollector └─17984 /var/ossec/bin/wazuh-modulesdApr 24 02:01:32 ip-172-31-86-52.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 02:01:32 ip-172-31-86-52.ec2.internal env[17893]: Starting Wazuh v4.7.3...Apr 24 02:01:33 ip-172-31-86-52.ec2.internal env[17893]: Started wazuh-execd...Apr 24 02:01:34 ip-172-31-86-52.ec2.internal env[17893]: Started wazuh-agentd...Apr 24 02:01:35 ip-172-31-86-52.ec2.internal env[17893]: Started wazuh-syscheckd...Apr 24 02:01:36 ip-172-31-86-52.ec2.internal env[17893]: Started wazuh-logcollector...Apr 24 02:01:37 ip-172-31-86-52.ec2.internal env[17893]: Started wazuh-modulesd...Apr 24 02:01:39 ip-172-31-86-52.ec2.internal env[17893]: Completed.Apr 24 02:01:39 ip-172-31-86-52.ec2.internal systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_restart.py::test_connection commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_restart.py::test_isActive commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  PASSED  modules/testing/tests/test_agent/test_restart.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED  modules/testing/tests/test_agent/test_restart.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret  ESTAB 0 0 172.31.86.52:54270 172.31.86.48:1514  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  True  result.get('output')  ESTAB 0 0 172.31.86.52:54270 172.31.86.48:1514  PASSED  modules/testing/tests/test_agent/test_restart.py::test_processes commands  pgrep wazuh  ret  1792117933179481796417984  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  True  result.get('output')  1792117933179481796417984  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 7 passed, 2 warnings in 48.68s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:02:02] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:02:02] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:02:02] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:02:02] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test stop for agent] ***************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_stop.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:50.721414'  end: '2024-04-23 23:02:55.879159'  msg: ''  rc: 0  start: '2024-04-23 23:02:05.157745'  stderr: |-  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:02:05] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:02:05] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_stop.py::test_service [32m[2024-04-23 23:02:05] [INFO] TESTER: Checking connection to redhat-9[0m  [32m[2024-04-23 23:02:07] [INFO] TESTER: Connection established successfully in redhat-9[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  003 agent-linux-redhat-9-amd64 any d3987afbcf5d3e703052cc76de5dd1a02ef8f3dbb1e28b9c53e7790e7ea64e71  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  003 agent-linux-redhat-9-amd64 any d3987afbcf5d3e703052cc76de5dd1a02ef8f3dbb1e28b9c53e7790e7ea64e71  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    [32m[2024-04-23 23:02:31] [INFO] TESTER: Stopping wazuh-agent in redhat-9[0m  commands  systemctl stop wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl stop wazuh-agent']  result.get('success')  False  result.get('output')  None  [32m[2024-04-23 23:02:34] [INFO] TESTER: Getting status of redhat-9[0m  commands  systemctl status wazuh-agent  ret  ○ wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: inactive (dead) since Wed 2024-04-24 02:02:34 UTC; 3s ago Duration: 54.385s Process: 17893 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Process: 18959 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) CPU: 13.740sApr 24 02:02:33 ip-172-31-86-52.ec2.internal systemd[1]: Stopping Wazuh agent...Apr 24 02:02:33 ip-172-31-86-52.ec2.internal env[18959]: Killing wazuh-modulesd...Apr 24 02:02:33 ip-172-31-86-52.ec2.internal env[18959]: Killing wazuh-logcollector...Apr 24 02:02:34 ip-172-31-86-52.ec2.internal env[18959]: Killing wazuh-syscheckd...Apr 24 02:02:34 ip-172-31-86-52.ec2.internal env[18959]: Killing wazuh-agentd...Apr 24 02:02:34 ip-172-31-86-52.ec2.internal env[18959]: Killing wazuh-execd...Apr 24 02:02:34 ip-172-31-86-52.ec2.internal env[18959]: Wazuh v4.7.3 StoppedApr 24 02:02:34 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Deactivated successfully.Apr 24 02:02:34 ip-172-31-86-52.ec2.internal systemd[1]: Stopped Wazuh agent.Apr 24 02:02:34 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Consumed 13.740s CPU time.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ○ wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: inactive (dead) since Wed 2024-04-24 02:02:34 UTC; 3s ago Duration: 54.385s Process: 17893 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Process: 18959 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) CPU: 13.740sApr 24 02:02:33 ip-172-31-86-52.ec2.internal systemd[1]: Stopping Wazuh agent...Apr 24 02:02:33 ip-172-31-86-52.ec2.internal env[18959]: Killing wazuh-modulesd...Apr 24 02:02:33 ip-172-31-86-52.ec2.internal env[18959]: Killing wazuh-logcollector...Apr 24 02:02:34 ip-172-31-86-52.ec2.internal env[18959]: Killing wazuh-syscheckd...Apr 24 02:02:34 ip-172-31-86-52.ec2.internal env[18959]: Killing wazuh-agentd...Apr 24 02:02:34 ip-172-31-86-52.ec2.internal env[18959]: Killing wazuh-execd...Apr 24 02:02:34 ip-172-31-86-52.ec2.internal env[18959]: Wazuh v4.7.3 StoppedApr 24 02:02:34 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Deactivated successfully.Apr 24 02:02:34 ip-172-31-86-52.ec2.internal systemd[1]: Stopped Wazuh agent.Apr 24 02:02:34 ip-172-31-86-52.ec2.internal systemd[1]: wazuh-agent.service: Consumed 13.740s CPU time.  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:02:34+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:02:33+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:02:34+00:00", "status_code": 0, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:02:35+00:00", "status_code": 0, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  disconnected  PASSED  modules/testing/tests/test_agent/test_stop.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_stop.py::test_processes commands  pgrep wazuh  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  False  result.get('output')  None  PASSED[32m[2024-04-23 23:02:44] [INFO] TESTER: Restarting wazuh-agent in redhat-9[0m  commands  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None      =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 2 warnings in 49.83s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:02:56] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:02:56] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:02:56] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:02:56] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test uninstall for agent] ************************************************ changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_uninstall.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:24.824428'  end: '2024-04-23 23:04:22.989466'  msg: ''  rc: 0  start: '2024-04-23 23:02:58.165038'  stderr: |-  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Failed to disable unit: Unit file wazuh-agent.service does not exist.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-3-88-70-199.compute-1.amazonaws.com]:2200,[3.88.70.199]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:02:58] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:02:58] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 5 items    modules/testing/tests/test_agent/test_uninstall.py::test_uninstall [32m[2024-04-23 23:02:58] [INFO] TESTER: Checking connection to redhat-9[0m  [32m[2024-04-23 23:03:00] [INFO] TESTER: Connection established successfully in redhat-9[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  003 agent-linux-redhat-9-amd64 any d3987afbcf5d3e703052cc76de5dd1a02ef8f3dbb1e28b9c53e7790e7ea64e71  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  003 agent-linux-redhat-9-amd64 any d3987afbcf5d3e703052cc76de5dd1a02ef8f3dbb1e28b9c53e7790e7ea64e71  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 23:03:21] [INFO] TESTER: Uninstalling Agent in redhat-9[0m  command  yum remove wazuh-agent -y  ret  Updating Subscription Management repositories.Unable to read consumer identityThis system is not registered with an entitlement server. You can use subscription-manager to register.Dependencies resolved.================================================================================ Package Architecture Version Repository Size================================================================================Removing: wazuh-agent x86_64 4.7.3-1 @System 26 MTransaction Summary================================================================================Remove 1 PackageFreed space: 26 MRunning transaction checkTransaction check succeeded.Running transaction testTransaction test succeeded.Running transaction Preparing : 1/1 Running scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Erasing : wazuh-agent-4.7.3-1.x86_64 1/1 warning: /var/ossec/etc/ossec.conf saved as /var/ossec/etc/ossec.conf.rpmsavewarning: /var/ossec/etc/client.keys saved as /var/ossec/etc/client.keys.rpmsave Running scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Verifying : wazuh-agent-4.7.3-1.x86_64 1/1 Installed products updated.Removed: wazuh-agent-4.7.3-1.x86_64 Complete!  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'yum remove wazuh-agent -y']  result.get('success')  True  result.get('output')  Updating Subscription Management repositories.Unable to read consumer identityThis system is not registered with an entitlement server. You can use subscription-manager to register.Dependencies resolved.================================================================================ Package Architecture Version Repository Size================================================================================Removing: wazuh-agent x86_64 4.7.3-1 @System 26 MTransaction Summary================================================================================Remove 1 PackageFreed space: 26 MRunning transaction checkTransaction check succeeded.Running transaction testTransaction test succeeded.Running transaction Preparing : 1/1 Running scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Erasing : wazuh-agent-4.7.3-1.x86_64 1/1 warning: /var/ossec/etc/ossec.conf saved as /var/ossec/etc/ossec.conf.rpmsavewarning: /var/ossec/etc/client.keys saved as /var/ossec/etc/client.keys.rpmsave Running scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Verifying : wazuh-agent-4.7.3-1.x86_64 1/1 Installed products updated.Removed: wazuh-agent-4.7.3-1.x86_64 Complete!  command  rm -rf /var/ossec  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'rm -rf /var/ossec']  result.get('success')  False  result.get('output')  None  command  systemctl disable wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl disable wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl daemon-reload  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl daemon-reload']  result.get('success')  False  result.get('output')  None  commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory commands  test -d /var/ossec && echo "True" || echo "False"  ret  False  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  False  False  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:08+00:00", "status_code": 0, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:06+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:06+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  disconnected  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_processes commands  pgrep wazuh  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-049213986f69fa375/redhat-9-amd64-key-1963', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-3-88-70-199.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  False  result.get('output')  None  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 5 passed, 2 warnings in 84.08s (0:01:24) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:04:23] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-redhat-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:04:23] [INFO] TESTER: Cleaning up [2024-04-23 23:04:23] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:04:23] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=false   path: /tmp/tests  state: absent PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=2  changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:04:36] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-23 23:04:36] [INFO] TESTER: Cleaning up [2024-04-23 23:04:36] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:04:36] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=false   path: /tmp/tests  state: absent PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=2  changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:04:47] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}}  [2024-04-23 23:04:47] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [run-agent-linux-redhat-9-amd64-tests] Finished task in 496.64 seconds. [2024-04-23 23:04:47] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [run-agent-windows-server-2012r2-amd64-tests] Starting task. [2024-04-23 23:04:47] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "run-agent-windows-server-2012r2-amd64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml'}", '--tests=install,registration,connection,basic_info,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-23 23:05:39] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Finished task "run-agent-linux-oracle-9-amd64-tests" execution with result: [2024-04-23 22:57:29] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:57:29] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:57:29] [INFO] TESTER: Running tests for ec2-18-208-152-12.compute-1.amazonaws.com [2024-04-23 22:57:29] [INFO] TESTER: Running tests for ec2-18-233-6-29.compute-1.amazonaws.com [2024-04-23 22:57:29] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'wazuh_version': '4.7.3', 'wazuh_revision': '40714', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': True, 'hosts_ip': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-18-233-6-29.compute-1.amazonaws.com'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability', 'current_user': 'fcaffieri'} [2024-04-23 22:57:29] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-23 22:57:29] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:57:29] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-18-233-6-29.compute-1.amazonaws.com']}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-18-208-152-12.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004658'  end: '2024-04-23 22:57:31.493529'  item: ec2-18-208-152-12.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 22:57:31.488871'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  changed: [localhost] => (item=ec2-18-233-6-29.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.006252'  end: '2024-04-23 22:57:31.682516'  item: ec2-18-233-6-29.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 22:57:31.676264'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:57:32] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-18-233-6-29.compute-1.amazonaws.com']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:57:32] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:57:32] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:57:32] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test install for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_install.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:21.584892'  end: '2024-04-23 22:58:56.367144'  msg: ''  rc: 0  start: '2024-04-23 22:57:34.782252'  stderr: |-  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Removed "/etc/systemd/system/multi-user.target.wants/firewalld.service".  Removed "/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service".  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  % Total % Received % Xferd Average Speed Time Time Time Current  Dload Upload Total Spent Left Speed  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0100 9247k 100 9247k 0 0 96.0M 0 --:--:-- --:--:-- --:--:-- 96.0M  warning: wazuh-agent-4.7.3-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 29111145: NOKEY  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Created symlink /etc/systemd/system/multi-user.target.wants/wazuh-agent.service → /usr/lib/systemd/system/wazuh-agent.service.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Job for wazuh-agent.service failed because the control process exited with error code.  See "systemctl status wazuh-agent.service" and "journalctl -xeu wazuh-agent.service" for details.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:57:35] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:57:35] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 2 items    modules/testing/tests/test_agent/test_install.py::test_installation [32m[2024-04-23 22:57:35] [INFO] TESTER: Checking connection to oracle-9[0m  [32m[2024-04-23 22:57:37] [INFO] TESTER: Connection established successfully in oracle-9[0m  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  [32m[2024-04-23 22:57:44] [INFO] TESTER: Checking connection to ubuntu-22.04[0m  [32m[2024-04-23 22:57:45] [INFO] TESTER: Connection established successfully in ubuntu-22.04[0m  commands  systemctl is-active firewalld  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active firewalld  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  True  result.get('output')  active  command  sudo systemctl stop firewalld  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'sudo systemctl stop firewalld']  result.get('success')  False  result.get('output')  None  command  sudo systemctl disable firewalld  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'sudo systemctl disable firewalld']  result.get('success')  False  result.get('output')  None  [32m[2024-04-23 22:57:58] [INFO] TESTER: Firewall disabled on oracle-9[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 22:58:01] [INFO] TESTER: Manager is already installed in ubuntu-22.04[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  os_type  linux  [32m[2024-04-23 22:58:05] [INFO] TESTER: Installing Agent in oracle-9[0m  command  curl -o wazuh-agent-4.7.3-1.x86_64.rpm https://packages.wazuh.com/4.x/yum/wazuh-agent-4.7.3-1.x86_64.rpm && sudo WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-linux-oracle-9-amd64' rpm -ihv wazuh-agent-4.7.3-1.x86_64.rpm  ret  Verifying... ########################################Preparing... ########################################Updating / installing...wazuh-agent-4.7.3-1 ########################################  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', "curl -o wazuh-agent-4.7.3-1.x86_64.rpm https://packages.wazuh.com/4.x/yum/wazuh-agent-4.7.3-1.x86_64.rpm && sudo WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-linux-oracle-9-amd64' rpm -ihv wazuh-agent-4.7.3-1.x86_64.rpm"]  result.get('success')  True  result.get('output')  Verifying... ########################################Preparing... ########################################Updating / installing...wazuh-agent-4.7.3-1 ########################################  command  systemctl daemon-reload  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl daemon-reload']  result.get('success')  False  result.get('output')  None  command  systemctl enable wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl enable wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl start wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl start wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl status wazuh-agent  ret  × wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:58:45 UTC; 3s ago Process: 11923 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 24msApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11931]: 2024/04/24 01:58:45 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11931]: 2024/04/24 01:58:45 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11923]: wazuh-agentd: Configuration error. ExitingApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: Failed to start Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  × wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:58:45 UTC; 3s ago Process: 11923 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 24msApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11931]: 2024/04/24 01:58:45 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11931]: 2024/04/24 01:58:45 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11923]: wazuh-agentd: Configuration error. ExitingApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: Failed to start Wazuh agent.  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  PASSED  modules/testing/tests/test_agent/test_install.py::test_status [32m[2024-04-23 22:58:52] [INFO] TESTER: Getting status of oracle-9[0m  commands  systemctl status wazuh-agent  ret  × wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:58:45 UTC; 9s ago Process: 11923 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 24msApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11931]: 2024/04/24 01:58:45 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11931]: 2024/04/24 01:58:45 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11923]: wazuh-agentd: Configuration error. ExitingApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: Failed to start Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  × wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:58:45 UTC; 9s ago Process: 11923 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE) CPU: 24msApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11931]: 2024/04/24 01:58:45 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11931]: 2024/04/24 01:58:45 wazuh-agentd: ERROR: (1215): No client configured. Exiting.Apr 24 01:58:45 ip-172-31-89-92.ec2.internal env[11923]: wazuh-agentd: Configuration error. ExitingApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited, status=1/FAILUREApr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.Apr 24 01:58:45 ip-172-31-89-92.ec2.internal systemd[1]: Failed to start Wazuh agent.  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 2 passed, 2 warnings in 80.70s (0:01:20) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:58:56] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:58:56] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:58:56] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:58:56] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test registration for agent] ********************************************* changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_registration.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:07.165371'  end: '2024-04-23 23:00:05.823505'  msg: ''  rc: 0  start: '2024-04-23 22:58:58.658134'  stderr: |-  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:58:59] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:58:59] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 4 items    modules/testing/tests/test_agent/test_registration.py::test_status [32m[2024-04-23 22:58:59] [INFO] TESTER: Checking connection to oracle-9[0m  [32m[2024-04-23 22:59:00] [INFO] TESTER: Connection established successfully in oracle-9[0m  commands  systemctl is-active wazuh-agent  ret  failed  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  failed  failed  commands  systemctl is-active wazuh-agent  ret  failed  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  failed  [32m[2024-04-23 22:59:08] [INFO] TESTER: os_type linux[0m  command  sed -i 's/
MANAGER_IP<\/address>/
172.31.86.48<\/address>/g' /var/ossec/etc/ossec.conf  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', "sed -i 's/
MANAGER_IP<\\/address>/
172.31.86.48<\\/address>/g' /var/ossec/etc/ossec.conf"]  result.get('success')  False  result.get('output')  None  command  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  commands  cat /var/ossec/etc/ossec.conf  ret 
172.31.86.48
1514 tcp
ol, ol9, ol9.2 10 60 yes aes yes agent-linux-oracle-9-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure syslog /var/log/maillog   ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/ossec.conf']  result.get('success')  True  result.get('output') 
172.31.86.48
1514 tcp
ol, ol9, ol9.2 10 60 yes aes yes agent-linux-oracle-9-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure syslog /var/log/maillog   [32m[2024-04-23 22:59:24] [INFO] TESTER: Getting status of oracle-9[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 01:59:19 UTC; 6s ago Process: 12092 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 29 (limit: 22563) Memory: 16.9M CPU: 3.382s CGroup: /system.slice/wazuh-agent.service ├─12119 /var/ossec/bin/wazuh-execd ├─12131 /var/ossec/bin/wazuh-agentd ├─12145 /var/ossec/bin/wazuh-syscheckd ├─12159 /var/ossec/bin/wazuh-logcollector └─12177 /var/ossec/bin/wazuh-modulesdApr 24 01:59:12 ip-172-31-89-92.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:59:12 ip-172-31-89-92.ec2.internal env[12092]: Starting Wazuh v4.7.3...Apr 24 01:59:13 ip-172-31-89-92.ec2.internal env[12092]: Started wazuh-execd...Apr 24 01:59:14 ip-172-31-89-92.ec2.internal env[12092]: Started wazuh-agentd...Apr 24 01:59:15 ip-172-31-89-92.ec2.internal env[12092]: Started wazuh-syscheckd...Apr 24 01:59:16 ip-172-31-89-92.ec2.internal env[12092]: Started wazuh-logcollector...Apr 24 01:59:17 ip-172-31-89-92.ec2.internal env[12092]: Started wazuh-modulesd...Apr 24 01:59:19 ip-172-31-89-92.ec2.internal env[12092]: Completed.Apr 24 01:59:19 ip-172-31-89-92.ec2.internal systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 01:59:19 UTC; 6s ago Process: 12092 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 29 (limit: 22563) Memory: 16.9M CPU: 3.382s CGroup: /system.slice/wazuh-agent.service ├─12119 /var/ossec/bin/wazuh-execd ├─12131 /var/ossec/bin/wazuh-agentd ├─12145 /var/ossec/bin/wazuh-syscheckd ├─12159 /var/ossec/bin/wazuh-logcollector └─12177 /var/ossec/bin/wazuh-modulesdApr 24 01:59:12 ip-172-31-89-92.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 01:59:12 ip-172-31-89-92.ec2.internal env[12092]: Starting Wazuh v4.7.3...Apr 24 01:59:13 ip-172-31-89-92.ec2.internal env[12092]: Started wazuh-execd...Apr 24 01:59:14 ip-172-31-89-92.ec2.internal env[12092]: Started wazuh-agentd...Apr 24 01:59:15 ip-172-31-89-92.ec2.internal env[12092]: Started wazuh-syscheckd...Apr 24 01:59:16 ip-172-31-89-92.ec2.internal env[12092]: Started wazuh-logcollector...Apr 24 01:59:17 ip-172-31-89-92.ec2.internal env[12092]: Started wazuh-modulesd...Apr 24 01:59:19 ip-172-31-89-92.ec2.internal env[12092]: Completed.Apr 24 01:59:19 ip-172-31-89-92.ec2.internal systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_registration.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T01:59:41+00:00", "status_code": 0, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T01:59:41+00:00", "status_code": 0, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 5, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_registration.py::test_connection commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Never connectedList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Never connectedList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Never connectedList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_registration.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 4 passed, 2 warnings in 66.38s (0:01:06) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:00:06] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:00:06] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:00:06] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:00:06] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test connection for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_connection.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:21.544651'  end: '2024-04-23 23:01:29.704450'  msg: ''  rc: 0  start: '2024-04-23 23:00:08.159799'  stderr: |-  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:00:08] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:00:08] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 6 items    modules/testing/tests/test_agent/test_connection.py::test_connection [32m[2024-04-23 23:00:08] [INFO] TESTER: Checking connection to oracle-9[0m  [32m[2024-04-23 23:00:10] [INFO] TESTER: Connection established successfully in oracle-9[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  004 agent-linux-oracle-9-amd64 any 39627f377d123704bed36c978b8763ef2f9f6b8cef81a8a8e5ee61578d7ffe0b  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  004 agent-linux-oracle-9-amd64 any 39627f377d123704bed36c978b8763ef2f9f6b8cef81a8a8e5ee61578d7ffe0b  command  sed -i 's/[^<]*<\/protocol>/tcp<\/protocol>/g' /var/ossec/etc/ossec.conf  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', "sed -i 's/[^<]*<\\/protocol>/tcp<\\/protocol>/g' /var/ossec/etc/ossec.conf"]  result.get('success')  False  result.get('output')  None  command  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  commands  cat /var/ossec/etc/ossec.conf  ret 
172.31.86.48
1514 tcp
ol, ol9, ol9.2 10 60 yes aes yes agent-linux-oracle-9-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure syslog /var/log/maillog   ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/ossec.conf']  result.get('success')  True  result.get('output') 
172.31.86.48
1514 tcp
ol, ol9, ol9.2 10 60 yes aes yes agent-linux-oracle-9-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure syslog /var/log/maillog   commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    PASSED  modules/testing/tests/test_agent/test_connection.py::test_status [32m[2024-04-23 23:00:57] [INFO] TESTER: Getting status of oracle-9[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 02:00:37 UTC; 22s ago Process: 13966 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 22563) Memory: 16.0M CPU: 13.534s CGroup: /system.slice/wazuh-agent.service ├─13993 /var/ossec/bin/wazuh-execd ├─14005 /var/ossec/bin/wazuh-agentd ├─14020 /var/ossec/bin/wazuh-syscheckd ├─14035 /var/ossec/bin/wazuh-logcollector └─14053 /var/ossec/bin/wazuh-modulesdApr 24 02:00:30 ip-172-31-89-92.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 02:00:30 ip-172-31-89-92.ec2.internal env[13966]: Starting Wazuh v4.7.3...Apr 24 02:00:31 ip-172-31-89-92.ec2.internal env[13966]: Started wazuh-execd...Apr 24 02:00:32 ip-172-31-89-92.ec2.internal env[13966]: Started wazuh-agentd...Apr 24 02:00:33 ip-172-31-89-92.ec2.internal env[13966]: Started wazuh-syscheckd...Apr 24 02:00:34 ip-172-31-89-92.ec2.internal env[13966]: Started wazuh-logcollector...Apr 24 02:00:35 ip-172-31-89-92.ec2.internal env[13966]: Started wazuh-modulesd...Apr 24 02:00:37 ip-172-31-89-92.ec2.internal env[13966]: Completed.Apr 24 02:00:37 ip-172-31-89-92.ec2.internal systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 02:00:37 UTC; 22s ago Process: 13966 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 22563) Memory: 16.0M CPU: 13.534s CGroup: /system.slice/wazuh-agent.service ├─13993 /var/ossec/bin/wazuh-execd ├─14005 /var/ossec/bin/wazuh-agentd ├─14020 /var/ossec/bin/wazuh-syscheckd ├─14035 /var/ossec/bin/wazuh-logcollector └─14053 /var/ossec/bin/wazuh-modulesdApr 24 02:00:30 ip-172-31-89-92.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 02:00:30 ip-172-31-89-92.ec2.internal env[13966]: Starting Wazuh v4.7.3...Apr 24 02:00:31 ip-172-31-89-92.ec2.internal env[13966]: Started wazuh-execd...Apr 24 02:00:32 ip-172-31-89-92.ec2.internal env[13966]: Started wazuh-agentd...Apr 24 02:00:33 ip-172-31-89-92.ec2.internal env[13966]: Started wazuh-syscheckd...Apr 24 02:00:34 ip-172-31-89-92.ec2.internal env[13966]: Started wazuh-logcollector...Apr 24 02:00:35 ip-172-31-89-92.ec2.internal env[13966]: Started wazuh-modulesd...Apr 24 02:00:37 ip-172-31-89-92.ec2.internal env[13966]: Completed.Apr 24 02:00:37 ip-172-31-89-92.ec2.internal systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_connection.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:01:11+00:00", "status_code": 0, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:01:12+00:00", "status_code": 0, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:01:15+00:00", "status_code": 0, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_connection.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED  modules/testing/tests/test_agent/test_connection.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret  ESTAB 0 0 172.31.89.92:51130 172.31.86.48:1514  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  True  result.get('output')  ESTAB 0 0 172.31.89.92:51130 172.31.86.48:1514  PASSED  modules/testing/tests/test_agent/test_connection.py::test_processes commands  pgrep wazuh  ret  1399314005140201403514053  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  True  result.get('output')  1399314005140201403514053  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 6 passed, 2 warnings in 80.79s (0:01:20) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:01:29] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:01:29] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:01:29] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:01:29] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test basic_info for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_basic_info.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:39.589472'  end: '2024-04-23 23:02:11.609438'  msg: ''  rc: 0  start: '2024-04-23 23:01:32.019966'  stderr: |-  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:01:32] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:01:32] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version [32m[2024-04-23 23:01:32] [INFO] TESTER: Checking connection to oracle-9[0m  [32m[2024-04-23 23:01:34] [INFO] TESTER: Connection established successfully in oracle-9[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  004 agent-linux-oracle-9-amd64 any 39627f377d123704bed36c978b8763ef2f9f6b8cef81a8a8e5ee61578d7ffe0b  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  004 agent-linux-oracle-9-amd64 any 39627f377d123704bed36c978b8763ef2f9f6b8cef81a8a8e5ee61578d7ffe0b  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:02:03+00:00", "status_code": 0, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:02:02+00:00", "status_code": 0, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:01:55+00:00", "status_code": 0, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version commands  /var/ossec/bin/wazuh-control info -v  ret  v4.7.3  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/wazuh-control info -v']  result.get('success')  True  result.get('output')  v4.7.3  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision commands  /var/ossec/bin/wazuh-control info -r  ret  40714  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/wazuh-control info -r']  result.get('success')  True  result.get('output')  40714  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 2 warnings in 38.85s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:02:11] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:02:11] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:02:11] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:02:11] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test restart for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_restart.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:48.797482'  end: '2024-04-23 23:03:02.765458'  msg: ''  rc: 0  start: '2024-04-23 23:02:13.967976'  stderr: |-  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:02:14] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:02:14] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 7 items    modules/testing/tests/test_agent/test_restart.py::test_restart [32m[2024-04-23 23:02:14] [INFO] TESTER: Checking connection to oracle-9[0m  [32m[2024-04-23 23:02:16] [INFO] TESTER: Connection established successfully in oracle-9[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  004 agent-linux-oracle-9-amd64 any 39627f377d123704bed36c978b8763ef2f9f6b8cef81a8a8e5ee61578d7ffe0b  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  004 agent-linux-oracle-9-amd64 any 39627f377d123704bed36c978b8763ef2f9f6b8cef81a8a8e5ee61578d7ffe0b  [32m[2024-04-23 23:02:27] [INFO] TESTER: Restarting wazuh-agent in oracle-9[0m  commands  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_restart.py::test_status [32m[2024-04-23 23:02:39] [INFO] TESTER: Getting status of oracle-9[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 02:02:38 UTC; 3s ago Process: 15389 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 22563) Memory: 17.6M CPU: 8.685s CGroup: /system.slice/wazuh-agent.service ├─15416 /var/ossec/bin/wazuh-execd ├─15428 /var/ossec/bin/wazuh-agentd ├─15443 /var/ossec/bin/wazuh-syscheckd ├─15456 /var/ossec/bin/wazuh-logcollector └─15473 /var/ossec/bin/wazuh-modulesdApr 24 02:02:32 ip-172-31-89-92.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 02:02:32 ip-172-31-89-92.ec2.internal env[15389]: Starting Wazuh v4.7.3...Apr 24 02:02:33 ip-172-31-89-92.ec2.internal env[15389]: Started wazuh-execd...Apr 24 02:02:34 ip-172-31-89-92.ec2.internal env[15389]: Started wazuh-agentd...Apr 24 02:02:34 ip-172-31-89-92.ec2.internal env[15389]: Started wazuh-syscheckd...Apr 24 02:02:35 ip-172-31-89-92.ec2.internal env[15389]: Started wazuh-logcollector...Apr 24 02:02:36 ip-172-31-89-92.ec2.internal env[15389]: Started wazuh-modulesd...Apr 24 02:02:38 ip-172-31-89-92.ec2.internal env[15389]: Completed.Apr 24 02:02:38 ip-172-31-89-92.ec2.internal systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: active (running) since Wed 2024-04-24 02:02:38 UTC; 3s ago Process: 15389 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 22563) Memory: 17.6M CPU: 8.685s CGroup: /system.slice/wazuh-agent.service ├─15416 /var/ossec/bin/wazuh-execd ├─15428 /var/ossec/bin/wazuh-agentd ├─15443 /var/ossec/bin/wazuh-syscheckd ├─15456 /var/ossec/bin/wazuh-logcollector └─15473 /var/ossec/bin/wazuh-modulesdApr 24 02:02:32 ip-172-31-89-92.ec2.internal systemd[1]: Starting Wazuh agent...Apr 24 02:02:32 ip-172-31-89-92.ec2.internal env[15389]: Starting Wazuh v4.7.3...Apr 24 02:02:33 ip-172-31-89-92.ec2.internal env[15389]: Started wazuh-execd...Apr 24 02:02:34 ip-172-31-89-92.ec2.internal env[15389]: Started wazuh-agentd...Apr 24 02:02:34 ip-172-31-89-92.ec2.internal env[15389]: Started wazuh-syscheckd...Apr 24 02:02:35 ip-172-31-89-92.ec2.internal env[15389]: Started wazuh-logcollector...Apr 24 02:02:36 ip-172-31-89-92.ec2.internal env[15389]: Started wazuh-modulesd...Apr 24 02:02:38 ip-172-31-89-92.ec2.internal env[15389]: Completed.Apr 24 02:02:38 ip-172-31-89-92.ec2.internal systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_restart.py::test_connection commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_restart.py::test_isActive commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  PASSED  modules/testing/tests/test_agent/test_restart.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED  modules/testing/tests/test_agent/test_restart.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret  ESTAB 0 0 172.31.89.92:41246 172.31.86.48:1514  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  True  result.get('output')  ESTAB 0 0 172.31.89.92:41246 172.31.86.48:1514  PASSED  modules/testing/tests/test_agent/test_restart.py::test_processes commands  pgrep wazuh  ret  1541615428154431545615473  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  True  result.get('output')  1541615428154431545615473  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 7 passed, 2 warnings in 48.05s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:03:03] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:03:03] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:03:03] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:03:03] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test stop for agent] ***************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_stop.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:49.742357'  end: '2024-04-23 23:03:54.835823'  msg: ''  rc: 0  start: '2024-04-23 23:03:05.093466'  stderr: |-  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:03:05] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:03:05] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_stop.py::test_service [32m[2024-04-23 23:03:05] [INFO] TESTER: Checking connection to oracle-9[0m  [32m[2024-04-23 23:03:07] [INFO] TESTER: Connection established successfully in oracle-9[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  004 agent-linux-oracle-9-amd64 any 39627f377d123704bed36c978b8763ef2f9f6b8cef81a8a8e5ee61578d7ffe0b  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  004 agent-linux-oracle-9-amd64 any 39627f377d123704bed36c978b8763ef2f9f6b8cef81a8a8e5ee61578d7ffe0b  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    [32m[2024-04-23 23:03:30] [INFO] TESTER: Stopping wazuh-agent in oracle-9[0m  commands  systemctl stop wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl stop wazuh-agent']  result.get('success')  False  result.get('output')  None  [32m[2024-04-23 23:03:34] [INFO] TESTER: Getting status of oracle-9[0m  commands  systemctl status wazuh-agent  ret  ○ wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: inactive (dead) since Wed 2024-04-24 02:03:32 UTC; 3s ago Duration: 53.560s Process: 15389 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Process: 16520 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) CPU: 13.632sApr 24 02:03:31 ip-172-31-89-92.ec2.internal systemd[1]: Stopping Wazuh agent...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Killing wazuh-modulesd...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Killing wazuh-logcollector...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Killing wazuh-syscheckd...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Killing wazuh-agentd...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Killing wazuh-execd...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Wazuh v4.7.3 StoppedApr 24 02:03:32 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Deactivated successfully.Apr 24 02:03:32 ip-172-31-89-92.ec2.internal systemd[1]: Stopped Wazuh agent.Apr 24 02:03:32 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Consumed 13.632s CPU time.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ○ wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; preset: disabled) Active: inactive (dead) since Wed 2024-04-24 02:03:32 UTC; 3s ago Duration: 53.560s Process: 15389 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Process: 16520 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) CPU: 13.632sApr 24 02:03:31 ip-172-31-89-92.ec2.internal systemd[1]: Stopping Wazuh agent...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Killing wazuh-modulesd...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Killing wazuh-logcollector...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Killing wazuh-syscheckd...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Killing wazuh-agentd...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Killing wazuh-execd...Apr 24 02:03:32 ip-172-31-89-92.ec2.internal env[16520]: Wazuh v4.7.3 StoppedApr 24 02:03:32 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Deactivated successfully.Apr 24 02:03:32 ip-172-31-89-92.ec2.internal systemd[1]: Stopped Wazuh agent.Apr 24 02:03:32 ip-172-31-89-92.ec2.internal systemd[1]: wazuh-agent.service: Consumed 13.632s CPU time.  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:33+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:03:24+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:03:36+00:00", "status_code": 0, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  disconnected  PASSED  modules/testing/tests/test_agent/test_stop.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_stop.py::test_processes commands  pgrep wazuh  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  False  result.get('output')  None  PASSED[32m[2024-04-23 23:03:44] [INFO] TESTER: Restarting wazuh-agent in oracle-9[0m  commands  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None      =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 2 warnings in 49.01s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:03:55] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:03:55] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:03:55] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:03:55] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test uninstall for agent] ************************************************ changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_uninstall.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:19.548812'  end: '2024-04-23 23:05:16.707485'  msg: ''  rc: 0  start: '2024-04-23 23:03:57.158673'  stderr: |-  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Failed to disable unit: Unit file wazuh-agent.service does not exist.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-233-6-29.compute-1.amazonaws.com]:2200,[18.233.6.29]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:03:57] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:03:57] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 5 items    modules/testing/tests/test_agent/test_uninstall.py::test_uninstall [32m[2024-04-23 23:03:57] [INFO] TESTER: Checking connection to oracle-9[0m  [32m[2024-04-23 23:03:59] [INFO] TESTER: Connection established successfully in oracle-9[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  004 agent-linux-oracle-9-amd64 any 39627f377d123704bed36c978b8763ef2f9f6b8cef81a8a8e5ee61578d7ffe0b  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  004 agent-linux-oracle-9-amd64 any 39627f377d123704bed36c978b8763ef2f9f6b8cef81a8a8e5ee61578d7ffe0b  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 23:04:21] [INFO] TESTER: Uninstalling Agent in oracle-9[0m  command  yum remove wazuh-agent -y  ret  Dependencies resolved.================================================================================ Package Architecture Version Repository Size================================================================================Removing: wazuh-agent x86_64 4.7.3-1 @System 26 MTransaction Summary================================================================================Remove 1 PackageFreed space: 26 MRunning transaction checkTransaction check succeeded.Running transaction testTransaction test succeeded.Running transaction Preparing : 1/1 Running scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Erasing : wazuh-agent-4.7.3-1.x86_64 1/1 warning: /var/ossec/etc/ossec.conf saved as /var/ossec/etc/ossec.conf.rpmsavewarning: /var/ossec/etc/client.keys saved as /var/ossec/etc/client.keys.rpmsave Running scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Verifying : wazuh-agent-4.7.3-1.x86_64 1/1 Removed: wazuh-agent-4.7.3-1.x86_64 Complete!  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'yum remove wazuh-agent -y']  result.get('success')  True  result.get('output')  Dependencies resolved.================================================================================ Package Architecture Version Repository Size================================================================================Removing: wazuh-agent x86_64 4.7.3-1 @System 26 MTransaction Summary================================================================================Remove 1 PackageFreed space: 26 MRunning transaction checkTransaction check succeeded.Running transaction testTransaction test succeeded.Running transaction Preparing : 1/1 Running scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Erasing : wazuh-agent-4.7.3-1.x86_64 1/1 warning: /var/ossec/etc/ossec.conf saved as /var/ossec/etc/ossec.conf.rpmsavewarning: /var/ossec/etc/client.keys saved as /var/ossec/etc/client.keys.rpmsave Running scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Verifying : wazuh-agent-4.7.3-1.x86_64 1/1 Removed: wazuh-agent-4.7.3-1.x86_64 Complete!  command  rm -rf /var/ossec  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'rm -rf /var/ossec']  result.get('success')  False  result.get('output')  None  command  systemctl disable wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl disable wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl daemon-reload  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl daemon-reload']  result.get('success')  False  result.get('output')  None  commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory commands  test -d /var/ossec && echo "True" || echo "False"  ret  False  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  False  False  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  disconnected  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_processes commands  pgrep wazuh  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0e25020c9e8ca19ce/oracle-9-amd64-key-5832', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ec2-user@ec2-18-233-6-29.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  False  result.get('output')  None  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 5 passed, 2 warnings in 78.79s (0:01:18) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:05:16] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-oracle-9-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:05:16] [INFO] TESTER: Cleaning up [2024-04-23 23:05:16] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:05:16] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=false   path: /tmp/tests  state: absent PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=2  changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:05:28] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-23 23:05:28] [INFO] TESTER: Cleaning up [2024-04-23 23:05:28] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:05:28] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=false   path: /tmp/tests  state: absent PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=2  changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:05:39] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}}  [2024-04-23 23:05:39] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [run-agent-linux-oracle-9-amd64-tests] Finished task in 490.38 seconds. [2024-04-23 23:05:39] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [run-agent-windows-server-2016-amd64-tests] Starting task. [2024-04-23 23:05:39] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Running task "run-agent-windows-server-2016-amd64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml'}", '--tests=install,registration,connection,basic_info,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-23 23:06:28] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Finished task "run-agent-linux-centos-8-amd64-tests" execution with result: [2024-04-23 22:57:32] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 22:57:32] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 22:57:32] [INFO] TESTER: Running tests for ec2-18-208-152-12.compute-1.amazonaws.com [2024-04-23 22:57:32] [INFO] TESTER: Running tests for ec2-54-174-2-110.compute-1.amazonaws.com [2024-04-23 22:57:32] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'wazuh_version': '4.7.3', 'wazuh_revision': '40714', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': True, 'hosts_ip': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-54-174-2-110.compute-1.amazonaws.com'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability', 'current_user': 'fcaffieri'} [2024-04-23 22:57:32] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-23 22:57:32] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:57:32] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-54-174-2-110.compute-1.amazonaws.com']}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-18-208-152-12.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004868'  end: '2024-04-23 22:57:34.905550'  item: ec2-18-208-152-12.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 22:57:34.900682'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  changed: [localhost] => (item=ec2-54-174-2-110.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004794'  end: '2024-04-23 22:57:35.102353'  item: ec2-54-174-2-110.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 22:57:35.097559'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:57:35] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-54-174-2-110.compute-1.amazonaws.com']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:57:35] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:57:35] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:57:35] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test install for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_install.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:52.229921'  end: '2024-04-23 22:59:29.772501'  msg: ''  rc: 0  start: '2024-04-23 22:57:37.542580'  stderr: |-  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  % Total % Received % Xferd Average Speed Time Time Time Current  Dload Upload Total Spent Left Speed  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0100 9247k 100 9247k 0 0 153M 0 --:--:-- --:--:-- --:--:-- 153M  advertencia:wazuh-agent-4.7.3-1.x86_64.rpm: EncabezadoV3 RSA/SHA256 Signature, ID de clave 29111145: NOKEY  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Created symlink /etc/systemd/system/multi-user.target.wants/wazuh-agent.service → /usr/lib/systemd/system/wazuh-agent.service.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Job for wazuh-agent.service failed because the control process exited with error code.  See "systemctl status wazuh-agent.service" and "journalctl -xe" for details.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:57:38] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:57:38] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 2 items    modules/testing/tests/test_agent/test_install.py::test_installation [32m[2024-04-23 22:57:38] [INFO] TESTER: Checking connection to centos-8[0m  [32m[2024-04-23 22:57:39] [INFO] TESTER: Connection established successfully in centos-8[0m  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  [32m[2024-04-23 22:57:46] [INFO] TESTER: Checking connection to ubuntu-22.04[0m  [32m[2024-04-23 22:57:48] [INFO] TESTER: Connection established successfully in ubuntu-22.04[0m  commands  systemctl is-active firewalld  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active firewalld  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  True  result.get('output')  inactive  [32m[2024-04-23 22:57:54] [INFO] TESTER: No Firewall to disable on centos-8[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 22:57:57] [INFO] TESTER: Manager is already installed in ubuntu-22.04[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  os_type  linux  [32m[2024-04-23 22:58:01] [INFO] TESTER: Installing Agent in centos-8[0m  command  curl -o wazuh-agent-4.7.3-1.x86_64.rpm https://packages.wazuh.com/4.x/yum/wazuh-agent-4.7.3-1.x86_64.rpm && sudo WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-linux-centos-8-amd64' rpm -ihv wazuh-agent-4.7.3-1.x86_64.rpm  ret  Verifying... ########################################Preparando... ########################################Actualizando / instalando...wazuh-agent-4.7.3-1 ########################################  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', "curl -o wazuh-agent-4.7.3-1.x86_64.rpm https://packages.wazuh.com/4.x/yum/wazuh-agent-4.7.3-1.x86_64.rpm && sudo WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-linux-centos-8-amd64' rpm -ihv wazuh-agent-4.7.3-1.x86_64.rpm"]  result.get('success')  True  result.get('output')  Verifying... ########################################Preparando... ########################################Actualizando / instalando...wazuh-agent-4.7.3-1 ########################################  command  systemctl daemon-reload  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl daemon-reload']  result.get('success')  False  result.get('output')  None  command  systemctl enable wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl enable wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl start wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl start wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:59:19 UTC; 2s ago Process: 14549 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE)abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: Starting Wazuh agent...abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14557]: 2024/04/24 01:59:19 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14557]: 2024/04/24 01:59:19 wazuh-agentd: ERROR: (1215): No client configured. Exiting.abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14549]: wazuh-agentd: Configuration error. Exitingabr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited status=1abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: Failed to start Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:59:19 UTC; 2s ago Process: 14549 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE)abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: Starting Wazuh agent...abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14557]: 2024/04/24 01:59:19 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14557]: 2024/04/24 01:59:19 wazuh-agentd: ERROR: (1215): No client configured. Exiting.abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14549]: wazuh-agentd: Configuration error. Exitingabr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited status=1abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: Failed to start Wazuh agent.  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  PASSED  modules/testing/tests/test_agent/test_install.py::test_status [32m[2024-04-23 22:59:26] [INFO] TESTER: Getting status of centos-8[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:59:19 UTC; 9s ago Process: 14549 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE)abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: Starting Wazuh agent...abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14557]: 2024/04/24 01:59:19 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14557]: 2024/04/24 01:59:19 wazuh-agentd: ERROR: (1215): No client configured. Exiting.abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14549]: wazuh-agentd: Configuration error. Exitingabr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited status=1abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: Failed to start Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2024-04-24 01:59:19 UTC; 9s ago Process: 14549 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=1/FAILURE)abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: Starting Wazuh agent...abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14557]: 2024/04/24 01:59:19 wazuh-agentd: ERROR: (4112): Invalid server address found: 'MANAGER_IP'abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14557]: 2024/04/24 01:59:19 wazuh-agentd: ERROR: (1215): No client configured. Exiting.abr 24 01:59:19 ip-172-31-82-46.ec2.internal env[14549]: wazuh-agentd: Configuration error. Exitingabr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: wazuh-agent.service: Control process exited, code=exited status=1abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: wazuh-agent.service: Failed with result 'exit-code'.abr 24 01:59:19 ip-172-31-82-46.ec2.internal systemd[1]: Failed to start Wazuh agent.  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ================== 2 passed, 2 warnings in 111.49s (0:01:51) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 22:59:30] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 22:59:30] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 22:59:30] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 22:59:30] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test registration for agent] ********************************************* changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_registration.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:08.676711'  end: '2024-04-23 23:00:40.783900'  msg: ''  rc: 0  start: '2024-04-23 22:59:32.107189'  stderr: |-  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 22:59:32] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 22:59:32] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 4 items    modules/testing/tests/test_agent/test_registration.py::test_status [32m[2024-04-23 22:59:32] [INFO] TESTER: Checking connection to centos-8[0m  [32m[2024-04-23 22:59:34] [INFO] TESTER: Connection established successfully in centos-8[0m  commands  systemctl is-active wazuh-agent  ret  failed  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  failed  failed  commands  systemctl is-active wazuh-agent  ret  failed  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  failed  [32m[2024-04-23 22:59:42] [INFO] TESTER: os_type linux[0m  command  sed -i 's/
MANAGER_IP<\/address>/
172.31.86.48<\/address>/g' /var/ossec/etc/ossec.conf  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', "sed -i 's/
MANAGER_IP<\\/address>/
172.31.86.48<\\/address>/g' /var/ossec/etc/ossec.conf"]  result.get('success')  False  result.get('output')  None  command  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  commands  cat /var/ossec/etc/ossec.conf  ret 
172.31.86.48
1514 tcp
centos, centos8 10 60 yes aes yes agent-linux-centos-8-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
audit /var/log/audit/audit.log syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure   ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/ossec.conf']  result.get('success')  True  result.get('output') 
172.31.86.48
1514 tcp
centos, centos8 10 60 yes aes yes agent-linux-centos-8-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
audit /var/log/audit/audit.log syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure   [32m[2024-04-23 22:59:58] [INFO] TESTER: Getting status of centos-8[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2024-04-24 01:59:54 UTC; 6s ago Process: 14757 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 31 (limit: 23202) Memory: 25.2M CGroup: /system.slice/wazuh-agent.service ├─14785 /var/ossec/bin/wazuh-execd ├─14797 /var/ossec/bin/wazuh-agentd ├─14810 /var/ossec/bin/wazuh-syscheckd ├─14825 /var/ossec/bin/wazuh-logcollector ├─14842 /var/ossec/bin/wazuh-modulesd └─15044 rpm -qa ypbindabr 24 01:59:47 ip-172-31-82-46.ec2.internal systemd[1]: Starting Wazuh agent...abr 24 01:59:47 ip-172-31-82-46.ec2.internal env[14757]: Starting Wazuh v4.7.3...abr 24 01:59:48 ip-172-31-82-46.ec2.internal env[14757]: Started wazuh-execd...abr 24 01:59:49 ip-172-31-82-46.ec2.internal env[14757]: Started wazuh-agentd...abr 24 01:59:50 ip-172-31-82-46.ec2.internal env[14757]: Started wazuh-syscheckd...abr 24 01:59:51 ip-172-31-82-46.ec2.internal env[14757]: Started wazuh-logcollector...abr 24 01:59:52 ip-172-31-82-46.ec2.internal env[14757]: Started wazuh-modulesd...abr 24 01:59:54 ip-172-31-82-46.ec2.internal env[14757]: Completed.abr 24 01:59:54 ip-172-31-82-46.ec2.internal systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2024-04-24 01:59:54 UTC; 6s ago Process: 14757 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 31 (limit: 23202) Memory: 25.2M CGroup: /system.slice/wazuh-agent.service ├─14785 /var/ossec/bin/wazuh-execd ├─14797 /var/ossec/bin/wazuh-agentd ├─14810 /var/ossec/bin/wazuh-syscheckd ├─14825 /var/ossec/bin/wazuh-logcollector ├─14842 /var/ossec/bin/wazuh-modulesd └─15044 rpm -qa ypbindabr 24 01:59:47 ip-172-31-82-46.ec2.internal systemd[1]: Starting Wazuh agent...abr 24 01:59:47 ip-172-31-82-46.ec2.internal env[14757]: Starting Wazuh v4.7.3...abr 24 01:59:48 ip-172-31-82-46.ec2.internal env[14757]: Started wazuh-execd...abr 24 01:59:49 ip-172-31-82-46.ec2.internal env[14757]: Started wazuh-agentd...abr 24 01:59:50 ip-172-31-82-46.ec2.internal env[14757]: Started wazuh-syscheckd...abr 24 01:59:51 ip-172-31-82-46.ec2.internal env[14757]: Started wazuh-logcollector...abr 24 01:59:52 ip-172-31-82-46.ec2.internal env[14757]: Started wazuh-modulesd...abr 24 01:59:54 ip-172-31-82-46.ec2.internal env[14757]: Completed.abr 24 01:59:54 ip-172-31-82-46.ec2.internal systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_registration.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:00:11+00:00", "status_code": 0, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:00:11+00:00", "status_code": 0, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:00:15+00:00", "status_code": 0, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_registration.py::test_connection commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_registration.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 4 passed, 2 warnings in 67.87s (0:01:07) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:00:41] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:00:41] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:00:41] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:00:41] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test connection for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_connection.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:20.602254'  end: '2024-04-23 23:02:03.704313'  msg: ''  rc: 0  start: '2024-04-23 23:00:43.102059'  stderr: |-  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:00:43] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:00:43] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 6 items    modules/testing/tests/test_agent/test_connection.py::test_connection [32m[2024-04-23 23:00:43] [INFO] TESTER: Checking connection to centos-8[0m  [32m[2024-04-23 23:00:45] [INFO] TESTER: Connection established successfully in centos-8[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  005 agent-linux-centos-8-amd64 any 1af9500d49e742b1a3e8a8e8830b941b040465f481df042011c0981671be57a3  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  005 agent-linux-centos-8-amd64 any 1af9500d49e742b1a3e8a8e8830b941b040465f481df042011c0981671be57a3  command  sed -i 's/[^<]*<\/protocol>/tcp<\/protocol>/g' /var/ossec/etc/ossec.conf  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', "sed -i 's/[^<]*<\\/protocol>/tcp<\\/protocol>/g' /var/ossec/etc/ossec.conf"]  result.get('success')  False  result.get('output')  None  command  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  commands  cat /var/ossec/etc/ossec.conf  ret 
172.31.86.48
1514 tcp
centos, centos8 10 60 yes aes yes agent-linux-centos-8-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
audit /var/log/audit/audit.log syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure   ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/ossec.conf']  result.get('success')  True  result.get('output') 
172.31.86.48
1514 tcp
centos, centos8 10 60 yes aes yes agent-linux-centos-8-amd64 etc/authd.pass
no 5000 500 no yes yes yes yes yes yes yes 43200 etc/shared/rootkit_files.txt etc/shared/rootkit_trojans.txt yes yes 1800 1d yes wodles/java wodles/ciscat yes yes /var/log/osquery/osqueryd.results.log /etc/osquery/osquery.conf yes no 1h yes yes yes yes yes yes yes 10 yes yes 12h yes no 43200 yes /etc,/usr/bin,/usr/sbin /bin,/sbin,/boot /etc/mtab /etc/hosts.deny /etc/mail/statistics /etc/random-seed /etc/random.seed /etc/adjtime /etc/httpd/logs /etc/utmpx /etc/wtmpx /etc/cups/certs /etc/dumpdates /etc/svc/volatile .log$|.swp$ /etc/ssl/private.key yes yes yes yes 10 50 yes 5m 10 command df -P 360 full_command netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d netstat listening ports 360 full_command last -n 20 360 no etc/wpk_root.pem yes plain
audit /var/log/audit/audit.log syslog /var/ossec/logs/active-responses.log syslog /var/log/messages syslog /var/log/secure   commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    PASSED  modules/testing/tests/test_agent/test_connection.py::test_status [32m[2024-04-23 23:01:31] [INFO] TESTER: Getting status of centos-8[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2024-04-24 02:01:11 UTC; 22s ago Process: 16531 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) Process: 16604 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 23202) Memory: 16.4M CGroup: /system.slice/wazuh-agent.service ├─16632 /var/ossec/bin/wazuh-execd ├─16644 /var/ossec/bin/wazuh-agentd ├─16658 /var/ossec/bin/wazuh-syscheckd ├─16673 /var/ossec/bin/wazuh-logcollector └─16695 /var/ossec/bin/wazuh-modulesdabr 24 02:01:04 ip-172-31-82-46.ec2.internal systemd[1]: Starting Wazuh agent...abr 24 02:01:04 ip-172-31-82-46.ec2.internal env[16604]: Starting Wazuh v4.7.3...abr 24 02:01:05 ip-172-31-82-46.ec2.internal env[16604]: Started wazuh-execd...abr 24 02:01:06 ip-172-31-82-46.ec2.internal env[16604]: Started wazuh-agentd...abr 24 02:01:07 ip-172-31-82-46.ec2.internal env[16604]: Started wazuh-syscheckd...abr 24 02:01:08 ip-172-31-82-46.ec2.internal env[16604]: Started wazuh-logcollector...abr 24 02:01:08 ip-172-31-82-46.ec2.internal crontab[16762]: (root) LIST (root)abr 24 02:01:09 ip-172-31-82-46.ec2.internal env[16604]: Started wazuh-modulesd...abr 24 02:01:11 ip-172-31-82-46.ec2.internal env[16604]: Completed.abr 24 02:01:11 ip-172-31-82-46.ec2.internal systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2024-04-24 02:01:11 UTC; 22s ago Process: 16531 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) Process: 16604 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 33 (limit: 23202) Memory: 16.4M CGroup: /system.slice/wazuh-agent.service ├─16632 /var/ossec/bin/wazuh-execd ├─16644 /var/ossec/bin/wazuh-agentd ├─16658 /var/ossec/bin/wazuh-syscheckd ├─16673 /var/ossec/bin/wazuh-logcollector └─16695 /var/ossec/bin/wazuh-modulesdabr 24 02:01:04 ip-172-31-82-46.ec2.internal systemd[1]: Starting Wazuh agent...abr 24 02:01:04 ip-172-31-82-46.ec2.internal env[16604]: Starting Wazuh v4.7.3...abr 24 02:01:05 ip-172-31-82-46.ec2.internal env[16604]: Started wazuh-execd...abr 24 02:01:06 ip-172-31-82-46.ec2.internal env[16604]: Started wazuh-agentd...abr 24 02:01:07 ip-172-31-82-46.ec2.internal env[16604]: Started wazuh-syscheckd...abr 24 02:01:08 ip-172-31-82-46.ec2.internal env[16604]: Started wazuh-logcollector...abr 24 02:01:08 ip-172-31-82-46.ec2.internal crontab[16762]: (root) LIST (root)abr 24 02:01:09 ip-172-31-82-46.ec2.internal env[16604]: Started wazuh-modulesd...abr 24 02:01:11 ip-172-31-82-46.ec2.internal env[16604]: Completed.abr 24 02:01:11 ip-172-31-82-46.ec2.internal systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_connection.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:01:53+00:00", "status_code": 0, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:01:53+00:00", "status_code": 0, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:01:45+00:00", "status_code": 0, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_connection.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED  modules/testing/tests/test_agent/test_connection.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret  ESTAB 0 0 172.31.82.46:50116 172.31.86.48:1514  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  True  result.get('output')  ESTAB 0 0 172.31.82.46:50116 172.31.86.48:1514  PASSED  modules/testing/tests/test_agent/test_connection.py::test_processes commands  pgrep wazuh  ret  1663216644166581667316695  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  True  result.get('output')  1663216644166581667316695  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 6 passed, 2 warnings in 79.85s (0:01:19) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:02:03] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:02:03] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:02:03] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:02:03] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test basic_info for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_basic_info.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:37.222047'  end: '2024-04-23 23:02:43.728836'  msg: ''  rc: 0  start: '2024-04-23 23:02:06.506789'  stderr: |-  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:02:07] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:02:07] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version [32m[2024-04-23 23:02:07] [INFO] TESTER: Checking connection to centos-8[0m  [32m[2024-04-23 23:02:08] [INFO] TESTER: Connection established successfully in centos-8[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  005 agent-linux-centos-8-amd64 any 1af9500d49e742b1a3e8a8e8830b941b040465f481df042011c0981671be57a3  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  005 agent-linux-centos-8-amd64 any 1af9500d49e742b1a3e8a8e8830b941b040465f481df042011c0981671be57a3  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:02:34+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:02:33+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:02:34+00:00", "status_code": 0, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:02:25+00:00", "status_code": 0, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version commands  /var/ossec/bin/wazuh-control info -v  ret  v4.7.3  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/wazuh-control info -v']  result.get('success')  True  result.get('output')  v4.7.3  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision commands  /var/ossec/bin/wazuh-control info -r  ret  40714  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/wazuh-control info -r']  result.get('success')  True  result.get('output')  40714  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 2 warnings in 36.47s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:02:43] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:02:43] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:02:43] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:02:43] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test restart for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_restart.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:47.354626'  end: '2024-04-23 23:03:33.393304'  msg: ''  rc: 0  start: '2024-04-23 23:02:46.038678'  stderr: |-  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:02:46] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:02:46] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 7 items    modules/testing/tests/test_agent/test_restart.py::test_restart [32m[2024-04-23 23:02:46] [INFO] TESTER: Checking connection to centos-8[0m  [32m[2024-04-23 23:02:48] [INFO] TESTER: Connection established successfully in centos-8[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  005 agent-linux-centos-8-amd64 any 1af9500d49e742b1a3e8a8e8830b941b040465f481df042011c0981671be57a3  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  005 agent-linux-centos-8-amd64 any 1af9500d49e742b1a3e8a8e8830b941b040465f481df042011c0981671be57a3  [32m[2024-04-23 23:03:01] [INFO] TESTER: Restarting wazuh-agent in centos-8[0m  commands  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_restart.py::test_status [32m[2024-04-23 23:03:12] [INFO] TESTER: Getting status of centos-8[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2024-04-24 02:03:11 UTC; 2s ago Process: 18026 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) Process: 18097 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 37 (limit: 23202) Memory: 83.3M CGroup: /system.slice/wazuh-agent.service ├─18125 /var/ossec/bin/wazuh-execd ├─18137 /var/ossec/bin/wazuh-agentd ├─18151 /var/ossec/bin/wazuh-syscheckd ├─18167 /var/ossec/bin/wazuh-logcollector ├─18187 /var/ossec/bin/wazuh-modulesd ├─18446 /usr/libexec/platform-python /usr/bin/dnf check-update ├─18499 sh -c /bin/ps -p 787 > /dev/null 2>&1 └─18500 sh -c /bin/ps -p 787 > /dev/null 2>&1abr 24 02:03:04 ip-172-31-82-46.ec2.internal systemd[1]: Starting Wazuh agent...abr 24 02:03:04 ip-172-31-82-46.ec2.internal env[18097]: Starting Wazuh v4.7.3...abr 24 02:03:05 ip-172-31-82-46.ec2.internal env[18097]: Started wazuh-execd...abr 24 02:03:06 ip-172-31-82-46.ec2.internal env[18097]: Started wazuh-agentd...abr 24 02:03:07 ip-172-31-82-46.ec2.internal env[18097]: Started wazuh-syscheckd...abr 24 02:03:08 ip-172-31-82-46.ec2.internal env[18097]: Started wazuh-logcollector...abr 24 02:03:09 ip-172-31-82-46.ec2.internal crontab[18255]: (root) LIST (root)abr 24 02:03:09 ip-172-31-82-46.ec2.internal env[18097]: Started wazuh-modulesd...abr 24 02:03:11 ip-172-31-82-46.ec2.internal env[18097]: Completed.abr 24 02:03:11 ip-172-31-82-46.ec2.internal systemd[1]: Started Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2024-04-24 02:03:11 UTC; 2s ago Process: 18026 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) Process: 18097 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS) Tasks: 37 (limit: 23202) Memory: 83.3M CGroup: /system.slice/wazuh-agent.service ├─18125 /var/ossec/bin/wazuh-execd ├─18137 /var/ossec/bin/wazuh-agentd ├─18151 /var/ossec/bin/wazuh-syscheckd ├─18167 /var/ossec/bin/wazuh-logcollector ├─18187 /var/ossec/bin/wazuh-modulesd ├─18446 /usr/libexec/platform-python /usr/bin/dnf check-update ├─18499 sh -c /bin/ps -p 787 > /dev/null 2>&1 └─18500 sh -c /bin/ps -p 787 > /dev/null 2>&1abr 24 02:03:04 ip-172-31-82-46.ec2.internal systemd[1]: Starting Wazuh agent...abr 24 02:03:04 ip-172-31-82-46.ec2.internal env[18097]: Starting Wazuh v4.7.3...abr 24 02:03:05 ip-172-31-82-46.ec2.internal env[18097]: Started wazuh-execd...abr 24 02:03:06 ip-172-31-82-46.ec2.internal env[18097]: Started wazuh-agentd...abr 24 02:03:07 ip-172-31-82-46.ec2.internal env[18097]: Started wazuh-syscheckd...abr 24 02:03:08 ip-172-31-82-46.ec2.internal env[18097]: Started wazuh-logcollector...abr 24 02:03:09 ip-172-31-82-46.ec2.internal crontab[18255]: (root) LIST (root)abr 24 02:03:09 ip-172-31-82-46.ec2.internal env[18097]: Started wazuh-modulesd...abr 24 02:03:11 ip-172-31-82-46.ec2.internal env[18097]: Completed.abr 24 02:03:11 ip-172-31-82-46.ec2.internal systemd[1]: Started Wazuh agent.  PASSED  modules/testing/tests/test_agent/test_restart.py::test_connection commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Active ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Active ID: 005, Name: agent-linux-centos-8-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_restart.py::test_isActive commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  PASSED  modules/testing/tests/test_agent/test_restart.py::test_clientKeys commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  PASSED  modules/testing/tests/test_agent/test_restart.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret  ESTAB 0 0 172.31.82.46:60884 172.31.86.48:1514  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  True  result.get('output')  ESTAB 0 0 172.31.82.46:60884 172.31.86.48:1514  PASSED  modules/testing/tests/test_agent/test_restart.py::test_processes commands  pgrep wazuh  ret  1812518137181511816718187  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  True  result.get('output')  1812518137181511816718187  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 7 passed, 2 warnings in 46.62s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:03:33] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:03:33] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:03:33] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:03:33] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test stop for agent] ***************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_stop.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:51.515034'  end: '2024-04-23 23:04:27.185314'  msg: ''  rc: 0  start: '2024-04-23 23:03:35.670280'  stderr: |-  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:03:36] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:03:36] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_stop.py::test_service [32m[2024-04-23 23:03:36] [INFO] TESTER: Checking connection to centos-8[0m  [32m[2024-04-23 23:03:37] [INFO] TESTER: Connection established successfully in centos-8[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  005 agent-linux-centos-8-amd64 any 1af9500d49e742b1a3e8a8e8830b941b040465f481df042011c0981671be57a3  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  005 agent-linux-centos-8-amd64 any 1af9500d49e742b1a3e8a8e8830b941b040465f481df042011c0981671be57a3  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    [32m[2024-04-23 23:04:03] [INFO] TESTER: Stopping wazuh-agent in centos-8[0m  commands  systemctl stop wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl stop wazuh-agent']  result.get('success')  False  result.get('output')  None  [32m[2024-04-23 23:04:07] [INFO] TESTER: Getting status of centos-8[0m  commands  systemctl status wazuh-agent  ret  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: inactive (dead) since Wed 2024-04-24 02:04:06 UTC; 2s ago Process: 19253 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) Process: 18097 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS)abr 24 02:03:11 ip-172-31-82-46.ec2.internal systemd[1]: Started Wazuh agent.abr 24 02:04:05 ip-172-31-82-46.ec2.internal systemd[1]: Stopping Wazuh agent...abr 24 02:04:05 ip-172-31-82-46.ec2.internal env[19253]: Killing wazuh-modulesd...abr 24 02:04:05 ip-172-31-82-46.ec2.internal env[19253]: Killing wazuh-logcollector...abr 24 02:04:06 ip-172-31-82-46.ec2.internal env[19253]: Killing wazuh-syscheckd...abr 24 02:04:06 ip-172-31-82-46.ec2.internal env[19253]: Killing wazuh-agentd...abr 24 02:04:06 ip-172-31-82-46.ec2.internal env[19253]: Killing wazuh-execd...abr 24 02:04:06 ip-172-31-82-46.ec2.internal env[19253]: Wazuh v4.7.3 Stoppedabr 24 02:04:06 ip-172-31-82-46.ec2.internal systemd[1]: wazuh-agent.service: Succeeded.abr 24 02:04:06 ip-172-31-82-46.ec2.internal systemd[1]: Stopped Wazuh agent.  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl status wazuh-agent']  result.get('success')  True  result.get('output')  ● wazuh-agent.service - Wazuh agent Loaded: loaded (/usr/lib/systemd/system/wazuh-agent.service; enabled; vendor preset: disabled) Active: inactive (dead) since Wed 2024-04-24 02:04:06 UTC; 2s ago Process: 19253 ExecStop=/usr/bin/env /var/ossec/bin/wazuh-control stop (code=exited, status=0/SUCCESS) Process: 18097 ExecStart=/usr/bin/env /var/ossec/bin/wazuh-control start (code=exited, status=0/SUCCESS)abr 24 02:03:11 ip-172-31-82-46.ec2.internal systemd[1]: Started Wazuh agent.abr 24 02:04:05 ip-172-31-82-46.ec2.internal systemd[1]: Stopping Wazuh agent...abr 24 02:04:05 ip-172-31-82-46.ec2.internal env[19253]: Killing wazuh-modulesd...abr 24 02:04:05 ip-172-31-82-46.ec2.internal env[19253]: Killing wazuh-logcollector...abr 24 02:04:06 ip-172-31-82-46.ec2.internal env[19253]: Killing wazuh-syscheckd...abr 24 02:04:06 ip-172-31-82-46.ec2.internal env[19253]: Killing wazuh-agentd...abr 24 02:04:06 ip-172-31-82-46.ec2.internal env[19253]: Killing wazuh-execd...abr 24 02:04:06 ip-172-31-82-46.ec2.internal env[19253]: Wazuh v4.7.3 Stoppedabr 24 02:04:06 ip-172-31-82-46.ec2.internal systemd[1]: wazuh-agent.service: Succeeded.abr 24 02:04:06 ip-172-31-82-46.ec2.internal systemd[1]: Stopped Wazuh agent.  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:08+00:00", "status_code": 0, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:06+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:06+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  disconnected  PASSED  modules/testing/tests/test_agent/test_stop.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_stop.py::test_processes commands  pgrep wazuh  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  False  result.get('output')  None  PASSED[32m[2024-04-23 23:04:17] [INFO] TESTER: Restarting wazuh-agent in centos-8[0m  commands  systemctl restart wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl restart wazuh-agent']  result.get('success')  False  result.get('output')  None      =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 2 warnings in 50.77s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:04:27] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:04:27] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:04:27] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:04:27] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test uninstall for agent] ************************************************ changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_uninstall.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:37.011267'  end: '2024-04-23 23:06:06.562763'  msg: ''  rc: 0  start: '2024-04-23 23:04:29.551496'  stderr: |-  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Removed /etc/systemd/system/multi-user.target.wants/wazuh-agent.service.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-54-174-2-110.compute-1.amazonaws.com]:2200,[54.174.2.110]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:04:30] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:04:30] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 5 items    modules/testing/tests/test_agent/test_uninstall.py::test_uninstall [32m[2024-04-23 23:04:30] [INFO] TESTER: Checking connection to centos-8[0m  [32m[2024-04-23 23:04:31] [INFO] TESTER: Connection established successfully in centos-8[0m  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  [ -f /var/ossec/etc/client.keys ] && echo true || echo false  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', '[ -f /var/ossec/etc/client.keys ] && echo true || echo false']  result.get('success')  True  result.get('output')  true  commands  cat /var/ossec/etc/client.keys  ret  005 agent-linux-centos-8-amd64 any 1af9500d49e742b1a3e8a8e8830b941b040465f481df042011c0981671be57a3  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'cat /var/ossec/etc/client.keys']  result.get('success')  True  result.get('output')  005 agent-linux-centos-8-amd64 any 1af9500d49e742b1a3e8a8e8830b941b040465f481df042011c0981671be57a3  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  active  commands  systemctl is-active wazuh-agent  ret  active  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  active  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 23:04:51] [INFO] TESTER: Uninstalling Agent in centos-8[0m  command  yum remove wazuh-agent -y  ret  Dependencias resueltas.================================================================================ Paquete Arquitectura Versión Repositorio Tam.================================================================================Eliminando: wazuh-agent x86_64 4.7.3-1 @System 26 MResumen de la transacción================================================================================Eliminar 1 PaqueteEspacio liberado: 26 MEjecutando verificación de operaciónVerificación de operación exitosa.Ejecutando prueba de operacionesPrueba de operación exitosa.Ejecutando operación Preparando : 1/1 Ejecutando scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Eliminando : wazuh-agent-4.7.3-1.x86_64 1/1 advertencia:/var/ossec/etc/ossec.conf guardado como /var/ossec/etc/ossec.conf.rpmsaveadvertencia:/var/ossec/etc/client.keys guardado como /var/ossec/etc/client.keys.rpmsave Ejecutando scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Verificando : wazuh-agent-4.7.3-1.x86_64 1/1 Eliminado: wazuh-agent-4.7.3-1.x86_64 ¡Listo!  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'yum remove wazuh-agent -y']  result.get('success')  True  result.get('output')  Dependencias resueltas.================================================================================ Paquete Arquitectura Versión Repositorio Tam.================================================================================Eliminando: wazuh-agent x86_64 4.7.3-1 @System 26 MResumen de la transacción================================================================================Eliminar 1 PaqueteEspacio liberado: 26 MEjecutando verificación de operaciónVerificación de operación exitosa.Ejecutando prueba de operacionesPrueba de operación exitosa.Ejecutando operación Preparando : 1/1 Ejecutando scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Eliminando : wazuh-agent-4.7.3-1.x86_64 1/1 advertencia:/var/ossec/etc/ossec.conf guardado como /var/ossec/etc/ossec.conf.rpmsaveadvertencia:/var/ossec/etc/client.keys guardado como /var/ossec/etc/client.keys.rpmsave Ejecutando scriptlet: wazuh-agent-4.7.3-1.x86_64 1/1 Verificando : wazuh-agent-4.7.3-1.x86_64 1/1 Eliminado: wazuh-agent-4.7.3-1.x86_64 ¡Listo!  command  rm -rf /var/ossec  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'rm -rf /var/ossec']  result.get('success')  False  result.get('output')  None  command  systemctl disable wazuh-agent  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl disable wazuh-agent']  result.get('success')  False  result.get('output')  None  command  systemctl daemon-reload  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl daemon-reload']  result.get('success')  False  result.get('output')  None  commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, DisconnectedList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, DisconnectedList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, DisconnectedList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory commands  test -d /var/ossec && echo "True" || echo "False"  ret  False  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  False  False  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  inactive  commands  systemctl is-active wazuh-agent  ret  inactive  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'systemctl is-active wazuh-agent']  result.get('success')  True  result.get('output')  inactive  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}], "total_affected_items": 6, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  disconnected  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_port os_type  linux  commands  ss -t -a -n | grep ":1514" | grep ESTAB  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'ss -t -a -n | grep ":1514" | grep ESTAB']  result.get('success')  False  result.get('output')  None  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_processes commands  pgrep wazuh  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0f42997e9c5ebfbe8/centos-8-amd64-key-4786', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'cloud-user@ec2-54-174-2-110.compute-1.amazonaws.com', 'sudo', 'pgrep wazuh']  result.get('success')  False  result.get('output')  None  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =================== 5 passed, 2 warnings in 96.24s (0:01:36) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:06:06] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-linux-centos-8-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:06:06] [INFO] TESTER: Cleaning up [2024-04-23 23:06:06] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:06:06] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=false   path: /tmp/tests  state: absent PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=2  changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:06:18] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-23 23:06:18] [INFO] TESTER: Cleaning up [2024-04-23 23:06:18] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:06:18] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-18-208-152-12.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-18-208-152-12.compute-1.amazonaws.com] => changed=false   path: /tmp/tests  state: absent PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=2  changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:06:28] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-18-208-152-12.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}}  [2024-04-23 23:06:28] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [run-agent-linux-centos-8-amd64-tests] Finished task in 537.35 seconds. [2024-04-23 23:06:28] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [run-agent-windows-server-2019-amd64-tests] Starting task. [2024-04-23 23:06:28] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Running task "run-agent-windows-server-2019-amd64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml'}", '--tests=install,registration,connection,basic_info,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-23 23:15:24] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "run-agent-windows-server-2012r2-amd64-tests" execution with result: [2024-04-23 23:04:47] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 23:04:47] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 23:04:48] [INFO] TESTER: Running tests for ec2-18-208-152-12.compute-1.amazonaws.com [2024-04-23 23:04:48] [INFO] TESTER: Running tests for ec2-3-84-16-102.compute-1.amazonaws.com [2024-04-23 23:04:48] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'wazuh_version': '4.7.3', 'wazuh_revision': '40714', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': True, 'hosts_ip': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-84-16-102.compute-1.amazonaws.com'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability', 'current_user': 'fcaffieri'} [2024-04-23 23:04:48] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-23 23:04:48] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:04:48] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-84-16-102.compute-1.amazonaws.com']}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-18-208-152-12.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004108'  end: '2024-04-23 23:04:50.285879'  item: ec2-18-208-152-12.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 23:04:50.281771'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  changed: [localhost] => (item=ec2-3-84-16-102.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004117'  end: '2024-04-23 23:04:50.448292'  item: ec2-3-84-16-102.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 23:04:50.444175'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:04:50] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-84-16-102.compute-1.amazonaws.com']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:04:50] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:04:50] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:04:50] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test install for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_install.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:52.852830'  end: '2024-04-23 23:05:45.602567'  msg: ''  rc: 0  start: '2024-04-23 23:04:52.749737'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:04:53] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:04:53] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 2 items    modules/testing/tests/test_agent/test_install.py::test_installation [32m[2024-04-23 23:04:53] [INFO] TESTER: Checking connection to server-2012r2[0m  [32m[2024-04-23 23:04:55] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], Se  rviceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.  Commands.GetServiceCommand  [32m[2024-04-23 23:04:58] [INFO] TESTER: Checking connection to ubuntu-22.04[0m  [32m[2024-04-23 23:04:59] [INFO] TESTER: Connection established successfully in ubuntu-22.04[0m  command  Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False  result.get('success')  True  result.get('output')    commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 23:05:06] [INFO] TESTER: Manager is already installed in ubuntu-22.04[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  os_type  windows  [32m[2024-04-23 23:05:09] [INFO] TESTER: Installing Agent in server-2012r2[0m  command  Invoke-WebRequest -Uri https://packages.wazuh.com/4.x/windows/wazuh-agent-4.7.3-1.msi -OutFile $env:TEMP\wazuh-agent.msi  result.get('success')  True  result.get('output')    command  msiexec.exe /i $env:TEMP\wazuh-agent.msi /q WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-windows-server-2012r2-amd64' WAZUH_REGISTRATION_SERVER='MANAGER_IP'  result.get('success')  True  result.get('output')    command  NET START WazuhSvc  result.get('success')  False  result.get('output')  The Wazuh service could not be started.    The service did not report an error.    More help is available by typing NET HELPMSG 3534.  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent"  result.get('success')  True  result.get('output')  True  PASSED  modules/testing/tests/test_agent/test_install.py::test_status [32m[2024-04-23 23:05:42] [INFO] TESTER: Getting status of server-2012r2[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Stopped  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_status  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================= 2 passed, 10 warnings in 52.10s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:05:45] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:05:45] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:05:45] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:05:45] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test registration for agent] ********************************************* changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_registration.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:26.029077'  end: '2024-04-23 23:07:13.902319'  msg: ''  rc: 0  start: '2024-04-23 23:05:47.873242'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:05:48] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:05:48] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 4 items    modules/testing/tests/test_agent/test_registration.py::test_status [32m[2024-04-23 23:05:48] [INFO] TESTER: Checking connection to server-2012r2[0m  [32m[2024-04-23 23:05:51] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Stopped WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')    [32m[2024-04-23 23:06:00] [INFO] TESTER: os_type windows[0m  command  (Get-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf" -Raw) -replace "
MANAGER_IP
", "
172.31.86.48
" | Set-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  True  result.get('output')    command  NET START WazuhSvc  result.get('success')  True  result.get('output')  The Wazuh service was started successfully.  commands  Get-Content "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  True  result.get('output')             
172.31.86.48
  1514  tcp 
  windows, windows2012R2, windows-server, windows-server-2012R2  aes  10  60  yes    yes  MANAGER_IP  agent-windows-server-2012r2-amd64   
          no  5000  500          Application  eventchannel        Security  eventchannel  Event/System[EventID != 5145 and EventID != 5156 and EventID != 5447 and  EventID != 4656 and EventID != 4658 and EventID != 4663 and EventID != 4660 and  EventID != 4670 and EventID != 4690 and EventID != 4703 and EventID != 4907 and  EventID != 5152 and EventID != 5157]        System  eventchannel        active-response\active-responses.log  syslog          no  ./shared/win_applications_rcl.txt  ./shared/win_malware_rcl.txt          yes  yes  12h  yes            no      43200      %WINDIR%    %WINDIR%\SysNative  %WINDIR%\SysNative\drivers\etc  %WINDIR%\SysNative\wbem  %WINDIR%\SysNative\WindowsPowerShell\v1.0  %WINDIR%\SysNative      %WINDIR%\System32  %WINDIR%\System32\drivers\etc  %WINDIR%\System32\wbem  %WINDIR%\System32\WindowsPowerShell\v1.0  %WINDIR%\System32    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini    .log$|.htm$|.jpg$|.png$|.chm$|.pnf$|.evtx$      HKEY_LOCAL_MACHINE\Software\Classes\batfile  HKEY_LOCAL_MACHINE\Software\Classes\cmdfile  HKEY_LOCAL_MACHINE\Software\Classes\comfile  HKEY_LOCAL_MACHINE\Software\Classes\exefile  HKEY_LOCAL_MACHINE\Software\Classes\piffile  HKEY_LOCAL_MACHINE\Software\Classes\AllFilesystemObjects  HKEY_LOCAL_MACHINE\Software\Classes\Directory  HKEY_LOCAL_MACHINE\Software\Classes\Folder  HKEY_LOCAL_MACHINE\Software\Classes\Protocols  HKEY_LOCAL_MACHINE\Software\Policies  HKEY_LOCAL_MACHINE\Security  HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\KnownDLLs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\winreg    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\URL  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon    HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components      HKEY_LOCAL_MACHINE\Security\Policy\Secrets  HKEY_LOCAL_MACHINE\Security\SAM\Domains\Account\Users  \Enum$  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\AppCs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\DHCP  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSIn  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSOut  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\RPC-EPMap  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\Teredo  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\PolicyAgent\Parameters\Cache  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\ADOVMPPackage\Final      60      10      50        yes  5m  10            no  1h  yes  yes  yes  yes  yes  yes  yes        10            yes  1800  1d  yes    \\server\jre\bin\java.exe  C:\cis-cat          yes  yes  C:\Program Files\osquery\osqueryd  C:\Program Files\osquery\log\osqueryd.results.log  C:\Program Files\osquery\osquery.conf  yes          no  wpk_root.pem  yes          plain     
      [32m[2024-04-23 23:06:09] [INFO] TESTER: Getting status of server-2012r2[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Running  PASSED  modules/testing/tests/test_agent/test_registration.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"ip": "any", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "not synced", "id": "006", "status_code": 0, "name": "agent-windows-server-2012r2-amd64", "node_name": "unknown", "registerIP": "any", "status": "never_connected"}], "total_affected_items": 7, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  never_connected  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "9600.20778", "major": "6", "minor": "3", "name": "Microsoft Windows Server 2012 R2 Standard", "platform": "windows", "uname": "Microsoft Windows Server 2012 R2 Standard", "version": "6.3.9600.20778"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.87.239", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "synced", "id": "006", "lastKeepAlive": "2024-04-24T02:06:51+00:00", "status_code": 0, "name": "agent-windows-server-2012r2-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 7, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_registration.py::test_connection commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Never connectedList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Never connectedList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Never connectedList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_registration.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_registration.py: 10 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ================== 4 passed, 12 warnings in 85.22s (0:01:25) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:07:14] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:07:14] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:07:14] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:07:14] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test connection for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_connection.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:55.015238'  end: '2024-04-23 23:08:11.230615'  msg: ''  rc: 0  start: '2024-04-23 23:07:16.215377'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:07:16] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:07:16] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 6 items    modules/testing/tests/test_agent/test_connection.py::test_connection [32m[2024-04-23 23:07:16] [INFO] TESTER: Checking connection to server-2012r2[0m  [32m[2024-04-23 23:07:19] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  006 agent-windows-server-2012r2-amd64 any 9c6ec773783463e924d00cc4ae0f7751e676794970f9f235893f8f1e8bd8f711  command  (Get-Content -Path 'C:/Program Files (x86)/ossec-agent/ossec.conf') -replace '[^<]*<\/protocol>', 'tcp' | Set-Content -Path 'C:/Program Files (x86)/ossec-agent/ossec.conf'  result.get('success')  True  result.get('output')    commands  Get-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  True  result.get('output')             
172.31.86.48
  1514  tcp 
  windows, windows2012R2, windows-server, windows-server-2012R2  aes  10  60  yes    yes  MANAGER_IP  agent-windows-server-2012r2-amd64   
          no  5000  500          Application  eventchannel        Security  eventchannel  Event/System[EventID != 5145 and EventID != 5156 and EventID != 5447 and  EventID != 4656 and EventID != 4658 and EventID != 4663 and EventID != 4660 and  EventID != 4670 and EventID != 4690 and EventID != 4703 and EventID != 4907 and  EventID != 5152 and EventID != 5157]        System  eventchannel        active-response\active-responses.log  syslog          no  ./shared/win_applications_rcl.txt  ./shared/win_malware_rcl.txt          yes  yes  12h  yes            no      43200      %WINDIR%    %WINDIR%\SysNative  %WINDIR%\SysNative\drivers\etc  %WINDIR%\SysNative\wbem  %WINDIR%\SysNative\WindowsPowerShell\v1.0  %WINDIR%\SysNative      %WINDIR%\System32  %WINDIR%\System32\drivers\etc  %WINDIR%\System32\wbem  %WINDIR%\System32\WindowsPowerShell\v1.0  %WINDIR%\System32    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini    .log$|.htm$|.jpg$|.png$|.chm$|.pnf$|.evtx$      HKEY_LOCAL_MACHINE\Software\Classes\batfile  HKEY_LOCAL_MACHINE\Software\Classes\cmdfile  HKEY_LOCAL_MACHINE\Software\Classes\comfile  HKEY_LOCAL_MACHINE\Software\Classes\exefile  HKEY_LOCAL_MACHINE\Software\Classes\piffile  HKEY_LOCAL_MACHINE\Software\Classes\AllFilesystemObjects  HKEY_LOCAL_MACHINE\Software\Classes\Directory  HKEY_LOCAL_MACHINE\Software\Classes\Folder  HKEY_LOCAL_MACHINE\Software\Classes\Protocols  HKEY_LOCAL_MACHINE\Software\Policies  HKEY_LOCAL_MACHINE\Security  HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\KnownDLLs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\winreg    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\URL  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon    HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components      HKEY_LOCAL_MACHINE\Security\Policy\Secrets  HKEY_LOCAL_MACHINE\Security\SAM\Domains\Account\Users  \Enum$  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\AppCs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\DHCP  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSIn  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSOut  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\RPC-EPMap  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\Teredo  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\PolicyAgent\Parameters\Cache  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\ADOVMPPackage\Final      60      10      50        yes  5m  10            no  1h  yes  yes  yes  yes  yes  yes  yes        10            yes  1800  1d  yes    \\server\jre\bin\java.exe  C:\cis-cat          yes  yes  C:\Program Files\osquery\osqueryd  C:\Program Files\osquery\log\osqueryd.results.log  C:\Program Files\osquery\osquery.conf  yes          no  wpk_root.pem  yes          plain     
      commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, DisconnectedList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, DisconnectedList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, DisconnectedList of agentless devices:  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    PASSED  modules/testing/tests/test_agent/test_connection.py::test_status [32m[2024-04-23 23:07:46] [INFO] TESTER: Getting status of server-2012r2[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Running  PASSED  modules/testing/tests/test_agent/test_connection.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "9600.20778", "major": "6", "minor": "3", "name": "Microsoft Windows Server 2012 R2 Standard", "platform": "windows", "uname": "Microsoft Windows Server 2012 R2 Standard", "version": "6.3.9600.20778"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.87.239", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "synced", "id": "006", "lastKeepAlive": "2024-04-24T02:08:02+00:00", "status_code": 0, "name": "agent-windows-server-2012r2-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "14393.5648", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2016 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2016 Datacenter", "version": "10.0.14393.5648"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.85.227", "dateAdd": "2024-04-24T02:07:09+00:00", "group_config_status": "synced", "id": "007", "lastKeepAlive": "2024-04-24T02:07:55+00:00", "status_code": 0, "name": "agent-windows-server-2016-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"ip": "any", "dateAdd": "2024-04-24T02:08:02+00:00", "group_config_status": "not synced", "id": "008", "status_code": 0, "name": "agent-windows-server-2019-amd64", "node_name": "unknown", "registerIP": "any", "status": "never_connected"}], "total_affected_items": 9, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_connection.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  PASSED  modules/testing/tests/test_agent/test_connection.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')  TCP 172.31.87.239:49245 172.31.86.48:1514 ESTABLISHED 2756  PASSED  modules/testing/tests/test_agent/test_connection.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  True  result.get('output')  wazuh-agent  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_connection.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================= 6 passed, 13 warnings in 54.30s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:08:11] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:08:11] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:08:11] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:08:11] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test basic_info for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_basic_info.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:32.368245'  end: '2024-04-23 23:08:45.918920'  msg: ''  rc: 0  start: '2024-04-23 23:08:13.550675'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:08:14] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:08:14] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version [32m[2024-04-23 23:08:14] [INFO] TESTER: Checking connection to server-2012r2[0m  [32m[2024-04-23 23:08:17] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  006 agent-windows-server-2012r2-amd64 any 9c6ec773783463e924d00cc4ae0f7751e676794970f9f235893f8f1e8bd8f711  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent"  result.get('success')  True  result.get('output')  True  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "9600.20778", "major": "6", "minor": "3", "name": "Microsoft Windows Server 2012 R2 Standard", "platform": "windows", "uname": "Microsoft Windows Server 2012 R2 Standard", "version": "6.3.9600.20778"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.87.239", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "synced", "id": "006", "lastKeepAlive": "2024-04-24T02:08:31+00:00", "status_code": 0, "name": "agent-windows-server-2012r2-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "14393.5648", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2016 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2016 Datacenter", "version": "10.0.14393.5648"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.85.227", "dateAdd": "2024-04-24T02:07:09+00:00", "group_config_status": "synced", "id": "007", "lastKeepAlive": "2024-04-24T02:08:35+00:00", "status_code": 0, "name": "agent-windows-server-2016-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "17763.5458", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2019 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2019 Datacenter", "version": "10.0.17763.5458"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.156", "dateAdd": "2024-04-24T02:08:02+00:00", "group_config_status": "synced", "id": "008", "lastKeepAlive": "2024-04-24T02:08:35+00:00", "status_code": 0, "name": "agent-windows-server-2019-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 9, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version commands  Get-Content "C:/Program Files (x86)/ossec-agent/VERSION"  result.get('success')  True  result.get('output')  v4.7.3  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision commands  Get-Content "C:/Program Files (x86)/ossec-agent/REVISION"  result.get('success')  True  result.get('output')  40714  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_revision  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 9 warnings in 31.60s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:08:46] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:08:46] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:08:46] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:08:46] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test restart for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_restart.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:34.467446'  end: '2024-04-23 23:09:22.717548'  msg: ''  rc: 0  start: '2024-04-23 23:08:48.250102'  stderr: 'Warning: Permanently added ''[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200'' (ECDSA) to the list of known hosts.'  stderr_lines:   stdout: |-  [37m[2024-04-23 23:08:48] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:08:48] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 7 items    modules/testing/tests/test_agent/test_restart.py::test_restart [32m[2024-04-23 23:08:48] [INFO] TESTER: Checking connection to server-2012r2[0m  [32m[2024-04-23 23:08:51] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  006 agent-windows-server-2012r2-amd64 any 9c6ec773783463e924d00cc4ae0f7751e676794970f9f235893f8f1e8bd8f711  [32m[2024-04-23 23:08:58] [INFO] TESTER: Restarting wazuh-agent in server-2012r2[0m  commands  NET STOP Wazuh  result.get('success')  True  result.get('output')  The Wazuh service was stopped successfully.  commands  NET START Wazuh  result.get('success')  True  result.get('output')  The Wazuh service was started successfully.  PASSED  modules/testing/tests/test_agent/test_restart.py::test_status [32m[2024-04-23 23:09:05] [INFO] TESTER: Getting status of server-2012r2[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Running  PASSED  modules/testing/tests/test_agent/test_restart.py::test_connection commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_restart.py::test_isActive import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  PASSED  modules/testing/tests/test_agent/test_restart.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  PASSED  modules/testing/tests/test_agent/test_restart.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')  TCP 172.31.87.239:49248 172.31.86.48:1514 ESTABLISHED 2648  PASSED  modules/testing/tests/test_agent/test_restart.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  True  result.get('output')  wazuh-agent  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_restart.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================= 7 passed, 13 warnings in 33.74s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:09:22] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:09:22] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:09:22] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:09:22] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test stop for agent] ***************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_stop.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:39.654169'  end: '2024-04-23 23:10:04.715486'  msg: ''  rc: 0  start: '2024-04-23 23:09:25.061317'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:09:25] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:09:25] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_stop.py::test_service [32m[2024-04-23 23:09:25] [INFO] TESTER: Checking connection to server-2012r2[0m  [32m[2024-04-23 23:09:28] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  006 agent-windows-server-2012r2-amd64 any 9c6ec773783463e924d00cc4ae0f7751e676794970f9f235893f8f1e8bd8f711  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    [32m[2024-04-23 23:09:47] [INFO] TESTER: Stopping wazuh-agent in server-2012r2[0m  commands  NET STOP Wazuh  result.get('success')  True  result.get('output')  The Wazuh service was stopped successfully.  [32m[2024-04-23 23:09:51] [INFO] TESTER: Getting status of server-2012r2[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Stopped  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "9600.20778", "major": "6", "minor": "3", "name": "Microsoft Windows Server 2012 R2 Standard", "platform": "windows", "uname": "Microsoft Windows Server 2012 R2 Standard", "version": "6.3.9600.20778"}, "disconnection_time": "2024-04-24T02:09:50+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.87.239", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "synced", "id": "006", "lastKeepAlive": "2024-04-24T02:09:45+00:00", "status_code": 3, "name": "agent-windows-server-2012r2-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "14393.5648", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2016 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2016 Datacenter", "version": "10.0.14393.5648"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.85.227", "dateAdd": "2024-04-24T02:07:09+00:00", "group_config_status": "synced", "id": "007", "lastKeepAlive": "2024-04-24T02:09:45+00:00", "status_code": 0, "name": "agent-windows-server-2016-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "17763.5458", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2019 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2019 Datacenter", "version": "10.0.17763.5458"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.156", "dateAdd": "2024-04-24T02:08:02+00:00", "group_config_status": "synced", "id": "008", "lastKeepAlive": "2024-04-24T02:09:45+00:00", "status_code": 0, "name": "agent-windows-server-2019-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 9, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  disconnected  PASSED  modules/testing/tests/test_agent/test_stop.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    PASSED  modules/testing/tests/test_agent/test_stop.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  False  result.get('output')  Get-Process : Cannot find a process with the name "wazuh-agent". Verify the  process name and call the cmdlet again.  At line:1 char:1  + Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders Pro ...  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (wazuh-agent:String) [Get-Proces  s], ProcessCommandException  + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.  Commands.GetProcessCommand  PASSED[32m[2024-04-23 23:09:59] [INFO] TESTER: Restarting wazuh-agent in server-2012r2[0m  commands  NET STOP Wazuh  result.get('success')  False  result.get('output')  The Wazuh service is not started.    More help is available by typing NET HELPMSG 3521.  commands  NET START Wazuh  result.get('success')  True  result.get('output')  The Wazuh service was started successfully.      =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_stop.py: 10 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================= 3 passed, 12 warnings in 38.90s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:10:04] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:10:04] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:10:04] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:10:04] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test uninstall for agent] ************************************************ fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_uninstall.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:04:55.369887'  end: '2024-04-23 23:15:02.397369'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:10:07.027482'  stderr: |-  ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out  ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out  stderr_lines:   stdout: |-  [37m[2024-04-23 23:10:07] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:10:07] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 5 items    modules/testing/tests/test_agent/test_uninstall.py::test_uninstall [32m[2024-04-23 23:10:07] [INFO] TESTER: Checking connection to server-2012r2[0m  [32m[2024-04-23 23:10:10] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  006 agent-windows-server-2012r2-amd64 any 9c6ec773783463e924d00cc4ae0f7751e676794970f9f235893f8f1e8bd8f711  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent"  result.get('success')  True  result.get('output')  True  [32m[2024-04-23 23:10:26] [INFO] TESTER: Uninstalling Agent in server-2012r2[0m  command  msiexec.exe /x $env:TEMP\wazuh-agent.msi /qn  result.get('success')  True  result.get('output')    commands  /var/ossec/bin/agent_control -l  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  False  result.get('output')  None  None  FAILED  modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/etc"  result.get('success')  True  result.get('output')  False  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_service commands  pwd  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_uninstall.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  False  result.get('output')  Get-Process : Cannot find a process with the name "wazuh-agent". Verify the  process name and call the cmdlet again.  At line:1 char:1  + Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders Pro ...  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (wazuh-agent:String) [Get-Proces  s], ProcessCommandException  + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.  Commands.GetProcessCommand  PASSED    =================================== FAILURES ===================================  ________________________________ test_uninstall ________________________________    wazuh_params = {'agents': {'agent-windows-server-2012r2-amd64': '/tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml'}, 'd...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_uninstall(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  assert GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent'), logger.error(f'{agent_names} is not Active before the installation')    os_type = HostInformation.get_os_type(agent_params)  if os_type == 'linux':  path_to_check = WAZUH_ROOT  elif os_type == 'windows':  path_to_check = WINDOWS_ROOT_DIR    assert HostInformation.dir_exists(agent_params, path_to_check), logger.error(f'The {path_to_check} is not present in the host {agent_names}')    # Agent installation  for agent_names, agent_params in wazuh_params['agents'].items():  #WazuhAgent.perform_uninstall_and_scan_for_agent(agent_params,wazuh_params)  WazuhAgent.uninstall_agent(agent_params, wazuh_params['wazuh_version'], wazuh_params['wazuh_revision'])    # Manager uninstallation status check  for agent_names, agent_params in wazuh_params['agents'].items():  > assert 'Disconnected' in WazuhManager.get_agent_control_info(wazuh_params['master']), logger.error(f'{agent_names} is still connected in the Manager')  E TypeError: argument of type 'NoneType' is not iterable    modules/testing/tests/test_agent/test_uninstall.py:85: TypeError  _________________________________ test_service _________________________________    wazuh_params = {'agents': {'agent-windows-server-2012r2-amd64': '/tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml'}, 'd...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_service(wazuh_params):  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_uninstall.py:99:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  > file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  E TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'    modules/testing/tests/helpers/executor.py:234: TypeError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_uninstall.py: 10 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_uninstall.py::test_uninstall - T...  FAILED modules/testing/tests/test_agent/test_uninstall.py::test_service - Typ...  ============= 2 failed, 3 passed, 12 warnings in 294.60s (0:04:54) =============  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:15:02] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2012r2-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:15:02] [INFO] TESTER: Cleaning up [2024-04-23 23:15:02] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:15:02] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* fatal: [ec2-18-208-152-12.compute-1.amazonaws.com]: UNREACHABLE! => changed=false   msg: 'Failed to connect to the host via ssh: ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  unreachable: true PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=0 changed=0 unreachable=1  failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:15:13] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {}, 'dark': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-23 23:15:13] [INFO] TESTER: Cleaning up [2024-04-23 23:15:13] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:15:13] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* fatal: [ec2-18-208-152-12.compute-1.amazonaws.com]: UNREACHABLE! => changed=false   msg: 'Failed to connect to the host via ssh: ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  unreachable: true PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=0 changed=0 unreachable=1  failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:15:24] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {}, 'dark': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}}  [2024-04-23 23:15:24] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [run-agent-windows-server-2012r2-amd64-tests] Finished task in 637.11 seconds. [2024-04-23 23:15:24] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [run-agent-windows-server-2022-amd64-tests] Starting task. [2024-04-23 23:15:24] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "run-agent-windows-server-2022-amd64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}", '--tests=install,registration,connection,basic_info,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-23 23:18:20] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Finished task "run-agent-windows-server-2016-amd64-tests" execution with result: [2024-04-23 23:05:39] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 23:05:39] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 23:05:39] [INFO] TESTER: Running tests for ec2-18-208-152-12.compute-1.amazonaws.com [2024-04-23 23:05:39] [INFO] TESTER: Running tests for ec2-44-204-84-64.compute-1.amazonaws.com [2024-04-23 23:05:39] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'wazuh_version': '4.7.3', 'wazuh_revision': '40714', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': True, 'hosts_ip': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-44-204-84-64.compute-1.amazonaws.com'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability', 'current_user': 'fcaffieri'} [2024-04-23 23:05:39] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-23 23:05:39] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:05:39] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-44-204-84-64.compute-1.amazonaws.com']}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-18-208-152-12.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004265'  end: '2024-04-23 23:05:41.993939'  item: ec2-18-208-152-12.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 23:05:41.989674'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  changed: [localhost] => (item=ec2-44-204-84-64.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004270'  end: '2024-04-23 23:05:42.155690'  item: ec2-44-204-84-64.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 23:05:42.151420'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:05:42] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-44-204-84-64.compute-1.amazonaws.com']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:05:42] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:05:42] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:05:42] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test install for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_install.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:50.375997'  end: '2024-04-23 23:06:34.824372'  msg: ''  rc: 0  start: '2024-04-23 23:05:44.448375'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:05:44] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:05:44] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 2 items    modules/testing/tests/test_agent/test_install.py::test_installation [32m[2024-04-23 23:05:45] [INFO] TESTER: Checking connection to server-2016[0m  [32m[2024-04-23 23:05:47] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  [32m[2024-04-23 23:05:50] [INFO] TESTER: Checking connection to ubuntu-22.04[0m  [32m[2024-04-23 23:05:52] [INFO] TESTER: Connection established successfully in ubuntu-22.04[0m  command  Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False  result.get('success')  True  result.get('output')    commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 23:05:59] [INFO] TESTER: Manager is already installed in ubuntu-22.04[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  os_type  windows  [32m[2024-04-23 23:06:02] [INFO] TESTER: Installing Agent in server-2016[0m  command  Invoke-WebRequest -Uri https://packages.wazuh.com/4.x/windows/wazuh-agent-4.7.3-1.msi -OutFile $env:TEMP\wazuh-agent.msi  result.get('success')  True  result.get('output')    command  msiexec.exe /i $env:TEMP\wazuh-agent.msi /q WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-windows-server-2016-amd64' WAZUH_REGISTRATION_SERVER='MANAGER_IP'  result.get('success')  True  result.get('output')    command  NET START WazuhSvc  result.get('success')  True  result.get('output')  The Wazuh service was started successfully.  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent"  result.get('success')  True  result.get('output')  True  PASSED  modules/testing/tests/test_agent/test_install.py::test_status [32m[2024-04-23 23:06:31] [INFO] TESTER: Getting status of server-2016[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Stopped  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_status  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================= 2 passed, 10 warnings in 49.63s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:06:35] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:06:35] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:06:35] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:06:35] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test registration for agent] ********************************************* changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_registration.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:28.768400'  end: '2024-04-23 23:08:05.919202'  msg: ''  rc: 0  start: '2024-04-23 23:06:37.150802'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:06:37] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:06:37] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 4 items    modules/testing/tests/test_agent/test_registration.py::test_status [32m[2024-04-23 23:06:37] [INFO] TESTER: Checking connection to server-2016[0m  [32m[2024-04-23 23:06:40] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Stopped WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')    [32m[2024-04-23 23:06:49] [INFO] TESTER: os_type windows[0m  command  (Get-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf" -Raw) -replace "
MANAGER_IP
", "
172.31.86.48
" | Set-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  True  result.get('output')    command  NET START WazuhSvc  result.get('success')  True  result.get('output')  The Wazuh service is starting.  The Wazuh service was started successfully.  commands  Get-Content "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  True  result.get('output')             
172.31.86.48
  1514  tcp 
  windows, windows2016, windows-server, windows-server-2016  aes  10  60  yes    yes  MANAGER_IP  agent-windows-server-2016-amd64   
          no  5000  500          Application  eventchannel        Security  eventchannel  Event/System[EventID != 5145 and EventID != 5156 and EventID != 5447 and  EventID != 4656 and EventID != 4658 and EventID != 4663 and EventID != 4660 and  EventID != 4670 and EventID != 4690 and EventID != 4703 and EventID != 4907 and  EventID != 5152 and EventID != 5157]        System  eventchannel        active-response\active-responses.log  syslog          no  ./shared/win_applications_rcl.txt  ./shared/win_malware_rcl.txt          yes  yes  12h  yes            no      43200      %WINDIR%    %WINDIR%\SysNative  %WINDIR%\SysNative\drivers\etc  %WINDIR%\SysNative\wbem  %WINDIR%\SysNative\WindowsPowerShell\v1.0  %WINDIR%\SysNative      %WINDIR%\System32  %WINDIR%\System32\drivers\etc  %WINDIR%\System32\wbem  %WINDIR%\System32\WindowsPowerShell\v1.0  %WINDIR%\System32    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini    .log$|.htm$|.jpg$|.png$|.chm$|.pnf$|.evtx$      HKEY_LOCAL_MACHINE\Software\Classes\batfile  HKEY_LOCAL_MACHINE\Software\Classes\cmdfile  HKEY_LOCAL_MACHINE\Software\Classes\comfile  HKEY_LOCAL_MACHINE\Software\Classes\exefile  HKEY_LOCAL_MACHINE\Software\Classes\piffile  HKEY_LOCAL_MACHINE\Software\Classes\AllFilesystemObjects  HKEY_LOCAL_MACHINE\Software\Classes\Directory  HKEY_LOCAL_MACHINE\Software\Classes\Folder  HKEY_LOCAL_MACHINE\Software\Classes\Protocols  HKEY_LOCAL_MACHINE\Software\Policies  HKEY_LOCAL_MACHINE\Security  HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\KnownDLLs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\winreg    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\URL  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon    HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components      HKEY_LOCAL_MACHINE\Security\Policy\Secrets  HKEY_LOCAL_MACHINE\Security\SAM\Domains\Account\Users  \Enum$  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\AppCs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\DHCP  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSIn  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSOut  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\RPC-EPMap  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\Teredo  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\PolicyAgent\Parameters\Cache  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\ADOVMPPackage\Final      60      10      50        yes  5m  10            no  1h  yes  yes  yes  yes  yes  yes  yes        10            yes  1800  1d  yes    \\server\jre\bin\java.exe  C:\cis-cat          yes  yes  C:\Program Files\osquery\osqueryd  C:\Program Files\osquery\log\osqueryd.results.log  C:\Program Files\osquery\osquery.conf  yes          no  wpk_root.pem  yes          plain     
      [32m[2024-04-23 23:07:00] [INFO] TESTER: Getting status of server-2016[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Running  PASSED  modules/testing/tests/test_agent/test_registration.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "9600.20778", "major": "6", "minor": "3", "name": "Microsoft Windows Server 2012 R2 Standard", "platform": "windows", "uname": "Microsoft Windows Server 2012 R2 Standard", "version": "6.3.9600.20778"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.87.239", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "synced", "id": "006", "lastKeepAlive": "2024-04-24T02:07:12+00:00", "status_code": 0, "name": "agent-windows-server-2012r2-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"ip": "any", "dateAdd": "2024-04-24T02:07:09+00:00", "group_config_status": "not synced", "id": "007", "status_code": 0, "name": "agent-windows-server-2016-amd64", "node_name": "unknown", "registerIP": "any", "status": "never_connected"}], "total_affected_items": 8, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  never_connected  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "9600.20778", "major": "6", "minor": "3", "name": "Microsoft Windows Server 2012 R2 Standard", "platform": "windows", "uname": "Microsoft Windows Server 2012 R2 Standard", "version": "6.3.9600.20778"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.87.239", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "synced", "id": "006", "lastKeepAlive": "2024-04-24T02:07:42+00:00", "status_code": 0, "name": "agent-windows-server-2012r2-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "14393.5648", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2016 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2016 Datacenter", "version": "10.0.14393.5648"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.85.227", "dateAdd": "2024-04-24T02:07:09+00:00", "group_config_status": "synced", "id": "007", "lastKeepAlive": "2024-04-24T02:07:45+00:00", "status_code": 0, "name": "agent-windows-server-2016-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 8, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_registration.py::test_connection commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_registration.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_registration.py: 10 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ================== 4 passed, 12 warnings in 87.98s (0:01:27) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:08:06] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:08:06] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:08:06] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:08:06] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test connection for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_connection.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:00.530767'  end: '2024-04-23 23:09:08.754680'  msg: ''  rc: 0  start: '2024-04-23 23:08:08.223913'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:08:08] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:08:08] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 6 items    modules/testing/tests/test_agent/test_connection.py::test_connection [32m[2024-04-23 23:08:08] [INFO] TESTER: Checking connection to server-2016[0m  [32m[2024-04-23 23:08:11] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  007 agent-windows-server-2016-amd64 any efe0b1e59a171c480aacca0757debd4bf704fad5ad392df498490dbeee53df32  command  (Get-Content -Path 'C:/Program Files (x86)/ossec-agent/ossec.conf') -replace '[^<]*<\/protocol>', 'tcp' | Set-Content -Path 'C:/Program Files (x86)/ossec-agent/ossec.conf'  result.get('success')  True  result.get('output')    commands  Get-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  True  result.get('output')             
172.31.86.48
  1514  tcp 
  windows, windows2016, windows-server, windows-server-2016  aes  10  60  yes    yes  MANAGER_IP  agent-windows-server-2016-amd64   
          no  5000  500          Application  eventchannel        Security  eventchannel  Event/System[EventID != 5145 and EventID != 5156 and EventID != 5447 and  EventID != 4656 and EventID != 4658 and EventID != 4663 and EventID != 4660 and  EventID != 4670 and EventID != 4690 and EventID != 4703 and EventID != 4907 and  EventID != 5152 and EventID != 5157]        System  eventchannel        active-response\active-responses.log  syslog          no  ./shared/win_applications_rcl.txt  ./shared/win_malware_rcl.txt          yes  yes  12h  yes            no      43200      %WINDIR%    %WINDIR%\SysNative  %WINDIR%\SysNative\drivers\etc  %WINDIR%\SysNative\wbem  %WINDIR%\SysNative\WindowsPowerShell\v1.0  %WINDIR%\SysNative      %WINDIR%\System32  %WINDIR%\System32\drivers\etc  %WINDIR%\System32\wbem  %WINDIR%\System32\WindowsPowerShell\v1.0  %WINDIR%\System32    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini    .log$|.htm$|.jpg$|.png$|.chm$|.pnf$|.evtx$      HKEY_LOCAL_MACHINE\Software\Classes\batfile  HKEY_LOCAL_MACHINE\Software\Classes\cmdfile  HKEY_LOCAL_MACHINE\Software\Classes\comfile  HKEY_LOCAL_MACHINE\Software\Classes\exefile  HKEY_LOCAL_MACHINE\Software\Classes\piffile  HKEY_LOCAL_MACHINE\Software\Classes\AllFilesystemObjects  HKEY_LOCAL_MACHINE\Software\Classes\Directory  HKEY_LOCAL_MACHINE\Software\Classes\Folder  HKEY_LOCAL_MACHINE\Software\Classes\Protocols  HKEY_LOCAL_MACHINE\Software\Policies  HKEY_LOCAL_MACHINE\Security  HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\KnownDLLs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\winreg    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\URL  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon    HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components      HKEY_LOCAL_MACHINE\Security\Policy\Secrets  HKEY_LOCAL_MACHINE\Security\SAM\Domains\Account\Users  \Enum$  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\AppCs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\DHCP  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSIn  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSOut  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\RPC-EPMap  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\Teredo  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\PolicyAgent\Parameters\Cache  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\ADOVMPPackage\Final      60      10      50        yes  5m  10            no  1h  yes  yes  yes  yes  yes  yes  yes        10            yes  1800  1d  yes    \\server\jre\bin\java.exe  C:\cis-cat          yes  yes  C:\Program Files\osquery\osqueryd  C:\Program Files\osquery\log\osqueryd.results.log  C:\Program Files\osquery\osquery.conf  yes          no  wpk_root.pem  yes          plain     
      commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    PASSED  modules/testing/tests/test_agent/test_connection.py::test_status [32m[2024-04-23 23:08:41] [INFO] TESTER: Getting status of server-2016[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Running  PASSED  modules/testing/tests/test_agent/test_connection.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "9600.20778", "major": "6", "minor": "3", "name": "Microsoft Windows Server 2012 R2 Standard", "platform": "windows", "uname": "Microsoft Windows Server 2012 R2 Standard", "version": "6.3.9600.20778"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.87.239", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "synced", "id": "006", "lastKeepAlive": "2024-04-24T02:08:51+00:00", "status_code": 0, "name": "agent-windows-server-2012r2-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "14393.5648", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2016 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2016 Datacenter", "version": "10.0.14393.5648"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.85.227", "dateAdd": "2024-04-24T02:07:09+00:00", "group_config_status": "synced", "id": "007", "lastKeepAlive": "2024-04-24T02:08:55+00:00", "status_code": 0, "name": "agent-windows-server-2016-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "17763.5458", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2019 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2019 Datacenter", "version": "10.0.17763.5458"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.156", "dateAdd": "2024-04-24T02:08:02+00:00", "group_config_status": "synced", "id": "008", "lastKeepAlive": "2024-04-24T02:08:55+00:00", "status_code": 0, "name": "agent-windows-server-2019-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 9, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_connection.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  PASSED  modules/testing/tests/test_agent/test_connection.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')  TCP 172.31.85.227:49724 172.31.86.48:1514 ESTABLISHED 1580  PASSED  modules/testing/tests/test_agent/test_connection.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  True  result.get('output')  wazuh-agent  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_connection.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================= 6 passed, 13 warnings in 59.78s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:09:09] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:09:09] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:09:09] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:09:09] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test basic_info for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_basic_info.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:33.069344'  end: '2024-04-23 23:09:44.144813'  msg: ''  rc: 0  start: '2024-04-23 23:09:11.075469'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:09:11] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:09:11] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version [32m[2024-04-23 23:09:11] [INFO] TESTER: Checking connection to server-2016[0m  [32m[2024-04-23 23:09:13] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  007 agent-windows-server-2016-amd64 any efe0b1e59a171c480aacca0757debd4bf704fad5ad392df498490dbeee53df32  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent"  result.get('success')  True  result.get('output')  True  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "9600.20778", "major": "6", "minor": "3", "name": "Microsoft Windows Server 2012 R2 Standard", "platform": "windows", "uname": "Microsoft Windows Server 2012 R2 Standard", "version": "6.3.9600.20778"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.87.239", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "synced", "id": "006", "lastKeepAlive": "2024-04-24T02:09:35+00:00", "status_code": 0, "name": "agent-windows-server-2012r2-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "14393.5648", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2016 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2016 Datacenter", "version": "10.0.14393.5648"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.85.227", "dateAdd": "2024-04-24T02:07:09+00:00", "group_config_status": "synced", "id": "007", "lastKeepAlive": "2024-04-24T02:09:35+00:00", "status_code": 0, "name": "agent-windows-server-2016-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "17763.5458", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2019 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2019 Datacenter", "version": "10.0.17763.5458"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.156", "dateAdd": "2024-04-24T02:08:02+00:00", "group_config_status": "synced", "id": "008", "lastKeepAlive": "2024-04-24T02:09:35+00:00", "status_code": 0, "name": "agent-windows-server-2019-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 9, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version commands  Get-Content "C:/Program Files (x86)/ossec-agent/VERSION"  result.get('success')  True  result.get('output')  v4.7.3  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision commands  Get-Content "C:/Program Files (x86)/ossec-agent/REVISION"  result.get('success')  True  result.get('output')  40714  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_revision  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================== 3 passed, 9 warnings in 32.33s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:09:44] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:09:44] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:09:44] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:09:44] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test restart for agent] ************************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_restart.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:37.915751'  end: '2024-04-23 23:10:24.540335'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:09:46.624584'  stderr: 'Warning: Permanently added ''[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200'' (ECDSA) to the list of known hosts.'  stderr_lines:   stdout: |-  [37m[2024-04-23 23:09:47] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:09:47] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 7 items    modules/testing/tests/test_agent/test_restart.py::test_restart [32m[2024-04-23 23:09:47] [INFO] TESTER: Checking connection to server-2016[0m  [32m[2024-04-23 23:09:49] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  007 agent-windows-server-2016-amd64 any efe0b1e59a171c480aacca0757debd4bf704fad5ad392df498490dbeee53df32  [32m[2024-04-23 23:09:57] [INFO] TESTER: Restarting wazuh-agent in server-2016[0m  commands  NET STOP Wazuh  result.get('success')  True  result.get('output')  The Wazuh service was stopped successfully.  commands  NET START Wazuh  result.get('success')  True  result.get('output')  The Wazuh service is starting.  The Wazuh service was started successfully.  PASSED  modules/testing/tests/test_agent/test_restart.py::test_status [32m[2024-04-23 23:10:06] [INFO] TESTER: Getting status of server-2016[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Running  PASSED  modules/testing/tests/test_agent/test_restart.py::test_connection commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_restart.py::test_isActive import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  PASSED  modules/testing/tests/test_agent/test_restart.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  PASSED  modules/testing/tests/test_agent/test_restart.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    [31m[2024-04-23 23:10:21] [ERROR] TESTER: Port is closed[0m  FAILED  modules/testing/tests/test_agent/test_restart.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  True  result.get('output')  wazuh-agent  PASSED    =================================== FAILURES ===================================  __________________________________ test_port ___________________________________    wazuh_params = {'agents': {'agent-windows-server-2016-amd64': '/tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_port(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert WazuhAgent.isAgent_port_open(agent_params), logger.error('Port is closed')  E AssertionError: None  E assert False  E + where False = ('/tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml')  E + where = WazuhAgent.isAgent_port_open    modules/testing/tests/test_agent/test_restart.py:92: AssertionError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_restart.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_restart.py::test_port - Assertio...  ================== 1 failed, 6 passed, 13 warnings in 37.19s ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:10:24] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:10:24] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:10:24] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:10:24] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test stop for agent] ***************************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_stop.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:02:36.501347'  end: '2024-04-23 23:13:03.299167'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:10:26.797820'  stderr: 'ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  stderr_lines:   stdout: |-  [37m[2024-04-23 23:10:27] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:10:27] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_stop.py::test_service [32m[2024-04-23 23:10:27] [INFO] TESTER: Checking connection to server-2016[0m  [32m[2024-04-23 23:10:30] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  007 agent-windows-server-2016-amd64 any efe0b1e59a171c480aacca0757debd4bf704fad5ad392df498490dbeee53df32  commands  pwd  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_stop.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    PASSED  modules/testing/tests/test_agent/test_stop.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  True  result.get('output')  wazuh-agent  [31m[2024-04-23 23:12:55] [ERROR] TESTER: Agent processes are still active[0m  FAILED[32m[2024-04-23 23:12:55] [INFO] TESTER: Restarting wazuh-agent in server-2016[0m  commands  NET STOP Wazuh  result.get('success')  True  result.get('output')  The Wazuh service was stopped successfully.  commands  NET START Wazuh  result.get('success')  True  result.get('output')  The Wazuh service is starting.  The Wazuh service was started successfully.      =================================== FAILURES ===================================  _________________________________ test_service _________________________________    wazuh_params = {'agents': {'agent-windows-server-2016-amd64': '/tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_service(wazuh_params):  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_stop.py:69:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  > file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  E TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'    modules/testing/tests/helpers/executor.py:234: TypeError  ________________________________ test_processes ________________________________    wazuh_params = {'agents': {'agent-windows-server-2016-amd64': '/tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_processes(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert not WazuhAgent.areAgent_processes_active(agent_params), logger.error('Agent processes are still active')  E AssertionError: None  E assert not True  E + where True = ('/tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml')  E + where = WazuhAgent.areAgent_processes_active    modules/testing/tests/test_agent/test_stop.py:88: AssertionError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_stop.py::test_service  testing/tests/test_agent/test_stop.py::test_service  testing/tests/test_agent/test_stop.py::test_service  testing/tests/test_agent/test_stop.py::test_service  testing/tests/test_agent/test_stop.py::test_port  testing/tests/test_agent/test_stop.py::test_processes  testing/tests/test_agent/test_stop.py::test_processes  testing/tests/test_agent/test_stop.py::test_processes  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_stop.py::test_service - TypeErro...  FAILED modules/testing/tests/test_agent/test_stop.py::test_processes - Assert...  ============= 2 failed, 1 passed, 10 warnings in 155.69s (0:02:35) =============  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:13:03] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:13:03] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:13:03] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:13:03] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test uninstall for agent] ************************************************ fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_uninstall.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:04:52.829527'  end: '2024-04-23 23:17:58.405272'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:13:05.575745'  stderr: |-  ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out  ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out  stderr_lines:   stdout: |-  [37m[2024-04-23 23:13:06] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:13:06] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 5 items    modules/testing/tests/test_agent/test_uninstall.py::test_uninstall [32m[2024-04-23 23:13:06] [INFO] TESTER: Checking connection to server-2016[0m  [32m[2024-04-23 23:13:08] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  007 agent-windows-server-2016-amd64 any efe0b1e59a171c480aacca0757debd4bf704fad5ad392df498490dbeee53df32  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent"  result.get('success')  True  result.get('output')  True  [32m[2024-04-23 23:13:22] [INFO] TESTER: Uninstalling Agent in server-2016[0m  command  msiexec.exe /x $env:TEMP\wazuh-agent.msi /qn  result.get('success')  True  result.get('output')    commands  /var/ossec/bin/agent_control -l  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  False  result.get('output')  None  None  FAILED  modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/etc"  result.get('success')  True  result.get('output')  False  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_service commands  pwd  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_uninstall.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  False  result.get('output')  Get-Process : Cannot find a process with the name "wazuh-agent". Verify the process name and call the cmdlet again.  At line:1 char:1  + Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders Pro ...  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (wazuh-agent:String) [Get-Process], ProcessCommandException  + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.Commands.GetProcessCommand  PASSED    =================================== FAILURES ===================================  ________________________________ test_uninstall ________________________________    wazuh_params = {'agents': {'agent-windows-server-2016-amd64': '/tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_uninstall(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  assert GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent'), logger.error(f'{agent_names} is not Active before the installation')    os_type = HostInformation.get_os_type(agent_params)  if os_type == 'linux':  path_to_check = WAZUH_ROOT  elif os_type == 'windows':  path_to_check = WINDOWS_ROOT_DIR    assert HostInformation.dir_exists(agent_params, path_to_check), logger.error(f'The {path_to_check} is not present in the host {agent_names}')    # Agent installation  for agent_names, agent_params in wazuh_params['agents'].items():  #WazuhAgent.perform_uninstall_and_scan_for_agent(agent_params,wazuh_params)  WazuhAgent.uninstall_agent(agent_params, wazuh_params['wazuh_version'], wazuh_params['wazuh_revision'])    # Manager uninstallation status check  for agent_names, agent_params in wazuh_params['agents'].items():  > assert 'Disconnected' in WazuhManager.get_agent_control_info(wazuh_params['master']), logger.error(f'{agent_names} is still connected in the Manager')  E TypeError: argument of type 'NoneType' is not iterable    modules/testing/tests/test_agent/test_uninstall.py:85: TypeError  _________________________________ test_service _________________________________    wazuh_params = {'agents': {'agent-windows-server-2016-amd64': '/tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_service(wazuh_params):  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_uninstall.py:99:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  > file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  E TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'    modules/testing/tests/helpers/executor.py:234: TypeError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_uninstall.py: 10 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_uninstall.py::test_uninstall - T...  FAILED modules/testing/tests/test_agent/test_uninstall.py::test_service - Typ...  ============= 2 failed, 3 passed, 12 warnings in 292.09s (0:04:52) =============  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:17:58] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2016-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:17:58] [INFO] TESTER: Cleaning up [2024-04-23 23:17:58] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:17:58] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* fatal: [ec2-18-208-152-12.compute-1.amazonaws.com]: UNREACHABLE! => changed=false   msg: 'Failed to connect to the host via ssh: ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  unreachable: true PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=0 changed=0 unreachable=1  failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:18:09] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {}, 'dark': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-23 23:18:09] [INFO] TESTER: Cleaning up [2024-04-23 23:18:09] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:18:09] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* fatal: [ec2-18-208-152-12.compute-1.amazonaws.com]: UNREACHABLE! => changed=false   msg: 'Failed to connect to the host via ssh: ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  unreachable: true PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=0 changed=0 unreachable=1  failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:18:20] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {}, 'dark': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}}  [2024-04-23 23:18:20] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [run-agent-windows-server-2016-amd64-tests] Finished task in 761.42 seconds. [2024-04-23 23:18:20] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [run-agent-windows-desktop-10-amd64-tests] Starting task. [2024-04-23 23:18:20] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Running task "run-agent-windows-desktop-10-amd64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}", '--tests=install,registration,connection,basic_info,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-23 23:21:14] [DEBUG] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: Finished task "run-agent-windows-server-2019-amd64-tests" execution with result: [2024-04-23 23:06:29] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 23:06:29] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 23:06:29] [INFO] TESTER: Running tests for ec2-18-208-152-12.compute-1.amazonaws.com [2024-04-23 23:06:29] [INFO] TESTER: Running tests for ec2-44-205-255-20.compute-1.amazonaws.com [2024-04-23 23:06:29] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'wazuh_version': '4.7.3', 'wazuh_revision': '40714', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': True, 'hosts_ip': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-44-205-255-20.compute-1.amazonaws.com'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability', 'current_user': 'fcaffieri'} [2024-04-23 23:06:29] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-23 23:06:29] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:06:29] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-44-205-255-20.compute-1.amazonaws.com']}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-18-208-152-12.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.011461'  end: '2024-04-23 23:06:31.556094'  item: ec2-18-208-152-12.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 23:06:31.544633'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  changed: [localhost] => (item=ec2-44-205-255-20.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004174'  end: '2024-04-23 23:06:31.713370'  item: ec2-44-205-255-20.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 23:06:31.709196'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:06:31] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-44-205-255-20.compute-1.amazonaws.com']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:06:31] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:06:31] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:06:31] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test install for agent] ************************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_install.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:53.740979'  end: '2024-04-23 23:07:27.776380'  msg: ''  rc: 0  start: '2024-04-23 23:06:34.035401'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:06:34] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:06:34] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 2 items    modules/testing/tests/test_agent/test_install.py::test_installation [32m[2024-04-23 23:06:34] [INFO] TESTER: Checking connection to server-2019[0m  [32m[2024-04-23 23:06:37] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  [32m[2024-04-23 23:06:41] [INFO] TESTER: Checking connection to ubuntu-22.04[0m  [32m[2024-04-23 23:06:42] [INFO] TESTER: Connection established successfully in ubuntu-22.04[0m  command  Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False  result.get('success')  True  result.get('output')    commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  [32m[2024-04-23 23:06:51] [INFO] TESTER: Manager is already installed in ubuntu-22.04[0m  commands  test -d /var/ossec && echo "True" || echo "False"  ret  True  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  True  result.get('output')  True  True  os_type  windows  [32m[2024-04-23 23:06:54] [INFO] TESTER: Installing Agent in server-2019[0m  command  Invoke-WebRequest -Uri https://packages.wazuh.com/4.x/windows/wazuh-agent-4.7.3-1.msi -OutFile $env:TEMP\wazuh-agent.msi  result.get('success')  True  result.get('output')    command  msiexec.exe /i $env:TEMP\wazuh-agent.msi /q WAZUH_MANAGER='MANAGER_IP' WAZUH_AGENT_NAME='agent-windows-server-2019-amd64' WAZUH_REGISTRATION_SERVER='MANAGER_IP'  result.get('success')  True  result.get('output')    command  NET START WazuhSvc  result.get('success')  True  result.get('output')  The Wazuh service is starting.  The Wazuh service was started successfully.  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent"  result.get('success')  True  result.get('output')  True  PASSED  modules/testing/tests/test_agent/test_install.py::test_status [32m[2024-04-23 23:07:25] [INFO] TESTER: Getting status of server-2019[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Stopped  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_status  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================= 2 passed, 10 warnings in 52.99s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:07:28] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:07:28] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:07:28] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:07:28] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test registration for agent] ********************************************* changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_registration.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:29.092422'  end: '2024-04-23 23:08:59.242279'  msg: ''  rc: 0  start: '2024-04-23 23:07:30.149857'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:07:30] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:07:30] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 4 items    modules/testing/tests/test_agent/test_registration.py::test_status [32m[2024-04-23 23:07:30] [INFO] TESTER: Checking connection to server-2019[0m  [32m[2024-04-23 23:07:33] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Stopped WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')    [32m[2024-04-23 23:07:42] [INFO] TESTER: os_type windows[0m  command  (Get-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf" -Raw) -replace "
MANAGER_IP
", "
172.31.86.48
" | Set-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  True  result.get('output')    command  NET START WazuhSvc  result.get('success')  True  result.get('output')  The Wazuh service is starting.  The Wazuh service was started successfully.  commands  Get-Content "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  True  result.get('output')             
172.31.86.48
  1514  tcp 
  windows, windows2019, windows-server, windows-server-2019  aes  10  60  yes    yes  MANAGER_IP  agent-windows-server-2019-amd64   
          no  5000  500          Application  eventchannel        Security  eventchannel  Event/System[EventID != 5145 and EventID != 5156 and EventID != 5447 and  EventID != 4656 and EventID != 4658 and EventID != 4663 and EventID != 4660 and  EventID != 4670 and EventID != 4690 and EventID != 4703 and EventID != 4907 and  EventID != 5152 and EventID != 5157]        System  eventchannel        active-response\active-responses.log  syslog          no  ./shared/win_applications_rcl.txt  ./shared/win_malware_rcl.txt          yes  yes  12h  yes            no      43200      %WINDIR%    %WINDIR%\SysNative  %WINDIR%\SysNative\drivers\etc  %WINDIR%\SysNative\wbem  %WINDIR%\SysNative\WindowsPowerShell\v1.0  %WINDIR%\SysNative      %WINDIR%\System32  %WINDIR%\System32\drivers\etc  %WINDIR%\System32\wbem  %WINDIR%\System32\WindowsPowerShell\v1.0  %WINDIR%\System32    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini    .log$|.htm$|.jpg$|.png$|.chm$|.pnf$|.evtx$      HKEY_LOCAL_MACHINE\Software\Classes\batfile  HKEY_LOCAL_MACHINE\Software\Classes\cmdfile  HKEY_LOCAL_MACHINE\Software\Classes\comfile  HKEY_LOCAL_MACHINE\Software\Classes\exefile  HKEY_LOCAL_MACHINE\Software\Classes\piffile  HKEY_LOCAL_MACHINE\Software\Classes\AllFilesystemObjects  HKEY_LOCAL_MACHINE\Software\Classes\Directory  HKEY_LOCAL_MACHINE\Software\Classes\Folder  HKEY_LOCAL_MACHINE\Software\Classes\Protocols  HKEY_LOCAL_MACHINE\Software\Policies  HKEY_LOCAL_MACHINE\Security  HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\KnownDLLs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\winreg    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\URL  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon    HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components      HKEY_LOCAL_MACHINE\Security\Policy\Secrets  HKEY_LOCAL_MACHINE\Security\SAM\Domains\Account\Users  \Enum$  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\AppCs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\DHCP  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSIn  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSOut  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\RPC-EPMap  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\Teredo  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\PolicyAgent\Parameters\Cache  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\ADOVMPPackage\Final      60      10      50        yes  5m  10            no  1h  yes  yes  yes  yes  yes  yes  yes        10            yes  1800  1d  yes    \\server\jre\bin\java.exe  C:\cis-cat          yes  yes  C:\Program Files\osquery\osqueryd  C:\Program Files\osquery\log\osqueryd.results.log  C:\Program Files\osquery\osquery.conf  yes          no  wpk_root.pem  yes          plain     
      [32m[2024-04-23 23:07:53] [INFO] TESTER: Getting status of server-2019[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Running  PASSED  modules/testing/tests/test_agent/test_registration.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "9600.20778", "major": "6", "minor": "3", "name": "Microsoft Windows Server 2012 R2 Standard", "platform": "windows", "uname": "Microsoft Windows Server 2012 R2 Standard", "version": "6.3.9600.20778"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.87.239", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "synced", "id": "006", "lastKeepAlive": "2024-04-24T02:08:02+00:00", "status_code": 0, "name": "agent-windows-server-2012r2-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "14393.5648", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2016 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2016 Datacenter", "version": "10.0.14393.5648"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.85.227", "dateAdd": "2024-04-24T02:07:09+00:00", "group_config_status": "synced", "id": "007", "lastKeepAlive": "2024-04-24T02:08:05+00:00", "status_code": 0, "name": "agent-windows-server-2016-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"ip": "any", "dateAdd": "2024-04-24T02:08:02+00:00", "group_config_status": "not synced", "id": "008", "status_code": 0, "name": "agent-windows-server-2019-amd64", "node_name": "unknown", "registerIP": "any", "status": "never_connected"}], "total_affected_items": 9, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  never_connected  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "9600.20778", "major": "6", "minor": "3", "name": "Microsoft Windows Server 2012 R2 Standard", "platform": "windows", "uname": "Microsoft Windows Server 2012 R2 Standard", "version": "6.3.9600.20778"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.87.239", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "synced", "id": "006", "lastKeepAlive": "2024-04-24T02:08:31+00:00", "status_code": 0, "name": "agent-windows-server-2012r2-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "14393.5648", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2016 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2016 Datacenter", "version": "10.0.14393.5648"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.85.227", "dateAdd": "2024-04-24T02:07:09+00:00", "group_config_status": "synced", "id": "007", "lastKeepAlive": "2024-04-24T02:08:35+00:00", "status_code": 0, "name": "agent-windows-server-2016-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "17763.5458", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2019 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2019 Datacenter", "version": "10.0.17763.5458"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.156", "dateAdd": "2024-04-24T02:08:02+00:00", "group_config_status": "synced", "id": "008", "lastKeepAlive": "2024-04-24T02:08:35+00:00", "status_code": 0, "name": "agent-windows-server-2019-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 9, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_registration.py::test_connection commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  PASSED  modules/testing/tests/test_agent/test_registration.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_registration.py: 10 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ================== 4 passed, 12 warnings in 88.32s (0:01:28) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:08:59] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:08:59] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:08:59] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:08:59] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test connection for agent] *********************************************** changed: [localhost] => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_connection.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:01:00.004943'  end: '2024-04-23 23:10:01.550576'  msg: ''  rc: 0  start: '2024-04-23 23:09:01.545633'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  stderr_lines:   stdout: |-  [37m[2024-04-23 23:09:02] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:09:02] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 6 items    modules/testing/tests/test_agent/test_connection.py::test_connection [32m[2024-04-23 23:09:02] [INFO] TESTER: Checking connection to server-2019[0m  [32m[2024-04-23 23:09:05] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  008 agent-windows-server-2019-amd64 any 618472825f359ffa4f5181302919ba527b9f0495f06854ae0dd4051972917d87  command  (Get-Content -Path 'C:/Program Files (x86)/ossec-agent/ossec.conf') -replace '[^<]*<\/protocol>', 'tcp' | Set-Content -Path 'C:/Program Files (x86)/ossec-agent/ossec.conf'  result.get('success')  True  result.get('output')    commands  Get-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  True  result.get('output')             
172.31.86.48
  1514  tcp 
  windows, windows2019, windows-server, windows-server-2019  aes  10  60  yes    yes  MANAGER_IP  agent-windows-server-2019-amd64   
          no  5000  500          Application  eventchannel        Security  eventchannel  Event/System[EventID != 5145 and EventID != 5156 and EventID != 5447 and  EventID != 4656 and EventID != 4658 and EventID != 4663 and EventID != 4660 and  EventID != 4670 and EventID != 4690 and EventID != 4703 and EventID != 4907 and  EventID != 5152 and EventID != 5157]        System  eventchannel        active-response\active-responses.log  syslog          no  ./shared/win_applications_rcl.txt  ./shared/win_malware_rcl.txt          yes  yes  12h  yes            no      43200      %WINDIR%    %WINDIR%\SysNative  %WINDIR%\SysNative\drivers\etc  %WINDIR%\SysNative\wbem  %WINDIR%\SysNative\WindowsPowerShell\v1.0  %WINDIR%\SysNative      %WINDIR%\System32  %WINDIR%\System32\drivers\etc  %WINDIR%\System32\wbem  %WINDIR%\System32\WindowsPowerShell\v1.0  %WINDIR%\System32    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup    %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini    .log$|.htm$|.jpg$|.png$|.chm$|.pnf$|.evtx$      HKEY_LOCAL_MACHINE\Software\Classes\batfile  HKEY_LOCAL_MACHINE\Software\Classes\cmdfile  HKEY_LOCAL_MACHINE\Software\Classes\comfile  HKEY_LOCAL_MACHINE\Software\Classes\exefile  HKEY_LOCAL_MACHINE\Software\Classes\piffile  HKEY_LOCAL_MACHINE\Software\Classes\AllFilesystemObjects  HKEY_LOCAL_MACHINE\Software\Classes\Directory  HKEY_LOCAL_MACHINE\Software\Classes\Folder  HKEY_LOCAL_MACHINE\Software\Classes\Protocols  HKEY_LOCAL_MACHINE\Software\Policies  HKEY_LOCAL_MACHINE\Security  HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\KnownDLLs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\winreg    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\URL  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon    HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components      HKEY_LOCAL_MACHINE\Security\Policy\Secrets  HKEY_LOCAL_MACHINE\Security\SAM\Domains\Account\Users  \Enum$  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\AppCs  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\DHCP  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSIn  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\IPTLSOut  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\RPC-EPMap  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MpsSvc\Parameters\PortKeywords\Teredo  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\PolicyAgent\Parameters\Cache  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx  HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\ADOVMPPackage\Final      60      10      50        yes  5m  10            no  1h  yes  yes  yes  yes  yes  yes  yes        10            yes  1800  1d  yes    \\server\jre\bin\java.exe  C:\cis-cat          yes  yes  C:\Program Files\osquery\osqueryd  C:\Program Files\osquery\log\osqueryd.results.log  C:\Program Files\osquery\osquery.conf  yes          no  wpk_root.pem  yes          plain     
      commands  /var/ossec/bin/agent_control -l  ret  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  True  result.get('output')  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  Wazuh agent_control. List of available agents: ID: 000, Name: ip-172-31-86-48 (server), IP: 127.0.0.1, Active/Local ID: 001, Name: agent-linux-ubuntu-2004-amd64, IP: any, Disconnected ID: 002, Name: agent-linux-debian-12-amd64, IP: any, Disconnected ID: 003, Name: agent-linux-redhat-9-amd64, IP: any, Disconnected ID: 004, Name: agent-linux-oracle-9-amd64, IP: any, Disconnected ID: 005, Name: agent-linux-centos-8-amd64, IP: any, Disconnected ID: 006, Name: agent-windows-server-2012r2-amd64, IP: any, Active ID: 007, Name: agent-windows-server-2016-amd64, IP: any, Active ID: 008, Name: agent-windows-server-2019-amd64, IP: any, ActiveList of agentless devices:  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    PASSED  modules/testing/tests/test_agent/test_connection.py::test_status [32m[2024-04-23 23:09:34] [INFO] TESTER: Getting status of server-2019[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Running  PASSED  modules/testing/tests/test_agent/test_connection.py::test_service commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret  true  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  True  result.get('output')  true  commands  grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'  ret  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', "grep api_password wazuh-install-files/wazuh-passwords.txt | head -n 1 | awk '{print $NF}'"]  result.get('success')  True  result.get('output')  'vn+zSKrpe0O.v2tEMddZt6Gs*p3Lm.vt'    import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  {"data": {"affected_items": [{"os": {"arch": "x86_64", "codename": "Jammy Jellyfish", "major": "22", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-86-48 |5.19.0-1025-aws |#26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 |x86_64", "version": "22.04.2 LTS"}, "version": "Wazuh v4.7.3", "ip": "127.0.0.1", "dateAdd": "2024-04-24T01:33:19+00:00", "group_config_status": "synced", "id": "000", "lastKeepAlive": "9999-12-31T23:59:59+00:00", "status_code": 0, "name": "ip-172-31-86-48", "node_name": "node01", "registerIP": "127.0.0.1", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Focal Fossa", "major": "20", "minor": "04", "name": "Ubuntu", "platform": "ubuntu", "uname": "Linux |ip-172-31-84-160 |5.15.0-1036-aws |#40~20.04.1-Ubuntu SMP Mon Apr 24 00:21:13 UTC 2023 |x86_64", "version": "20.04.6 LTS"}, "disconnection_time": "2024-04-24T01:56:23+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.160", "dateAdd": "2024-04-24T01:50:24+00:00", "group_config_status": "synced", "id": "001", "lastKeepAlive": "2024-04-24T01:56:20+00:00", "status_code": 3, "name": "agent-linux-ubuntu-2004-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "bookworm", "major": "12", "name": "Debian GNU/Linux", "platform": "debian", "uname": "Linux |ip-172-31-91-221 |6.1.0-13-cloud-amd64 |#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) |x86_64", "version": "12"}, "disconnection_time": "2024-04-24T01:56:21+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.91.221", "dateAdd": "2024-04-24T01:50:56+00:00", "group_config_status": "synced", "id": "002", "lastKeepAlive": "2024-04-24T01:56:12+00:00", "status_code": 3, "name": "agent-linux-debian-12-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "codename": "Plow", "major": "9", "minor": "2", "name": "Red Hat Enterprise Linux", "platform": "rhel", "uname": "Linux |ip-172-31-86-52.ec2.internal |5.14.0-284.11.1.el9_2.x86_64 |#1 SMP PREEMPT_DYNAMIC Wed Apr 12 10:45:03 EDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:03:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.86.52", "dateAdd": "2024-04-24T01:58:11+00:00", "group_config_status": "synced", "id": "003", "lastKeepAlive": "2024-04-24T02:03:19+00:00", "status_code": 3, "name": "agent-linux-redhat-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "9", "minor": "2", "name": "Oracle Linux Server", "platform": "ol", "uname": "Linux |ip-172-31-89-92.ec2.internal |5.15.0-101.103.2.1.el9uek.x86_64 |#2 SMP Tue May 2 01:10:45 PDT 2023 |x86_64", "version": "9.2"}, "disconnection_time": "2024-04-24T02:04:25+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.89.92", "dateAdd": "2024-04-24T01:59:15+00:00", "group_config_status": "synced", "id": "004", "lastKeepAlive": "2024-04-24T02:04:18+00:00", "status_code": 3, "name": "agent-linux-oracle-9-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"arch": "x86_64", "major": "8", "name": "CentOS Stream", "platform": "centos", "uname": "Linux |ip-172-31-82-46.ec2.internal |4.18.0-408.el8.x86_64 |#1 SMP Mon Jul 18 17:42:52 UTC 2022 |x86_64", "version": "8"}, "disconnection_time": "2024-04-24T02:04:55+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.82.46", "dateAdd": "2024-04-24T01:59:49+00:00", "group_config_status": "synced", "id": "005", "lastKeepAlive": "2024-04-24T02:04:50+00:00", "status_code": 3, "name": "agent-linux-centos-8-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "9600.20778", "major": "6", "minor": "3", "name": "Microsoft Windows Server 2012 R2 Standard", "platform": "windows", "uname": "Microsoft Windows Server 2012 R2 Standard", "version": "6.3.9600.20778"}, "disconnection_time": "2024-04-24T02:09:50+00:00", "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.87.239", "dateAdd": "2024-04-24T02:06:19+00:00", "group_config_status": "synced", "id": "006", "lastKeepAlive": "2024-04-24T02:09:45+00:00", "status_code": 3, "name": "agent-windows-server-2012r2-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "disconnected", "manager": "ip-172-31-86-48"}, {"os": {"build": "14393.5648", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2016 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2016 Datacenter", "version": "10.0.14393.5648"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.85.227", "dateAdd": "2024-04-24T02:07:09+00:00", "group_config_status": "synced", "id": "007", "lastKeepAlive": "2024-04-24T02:09:45+00:00", "status_code": 0, "name": "agent-windows-server-2016-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}, {"os": {"build": "17763.5458", "major": "10", "minor": "0", "name": "Microsoft Windows Server 2019 Datacenter", "platform": "windows", "uname": "Microsoft Windows Server 2019 Datacenter", "version": "10.0.17763.5458"}, "group": ["default"], "configSum": "ab73af41699f13fdd81903b5f23d8d00", "version": "Wazuh v4.7.3", "ip": "172.31.84.156", "dateAdd": "2024-04-24T02:08:02+00:00", "group_config_status": "synced", "id": "008", "lastKeepAlive": "2024-04-24T02:09:45+00:00", "status_code": 0, "name": "agent-windows-server-2019-amd64", "mergedSum": "4a8724b20dee0124ff9656783c490c4e", "node_name": "node01", "registerIP": "any", "status": "active", "manager": "ip-172-31-86-48"}], "total_affected_items": 9, "total_failed_items": 0, "failed_items": []}, "message": "All selected agents information was returned", "error": 0}  agent.get('status')  active  PASSED  modules/testing/tests/test_agent/test_connection.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  PASSED  modules/testing/tests/test_agent/test_connection.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')  TCP 172.31.84.156:49770 172.31.86.48:1514 ESTABLISHED 3620  PASSED  modules/testing/tests/test_agent/test_connection.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  True  result.get('output')  wazuh-agent  PASSED    =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_connection.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  ======================= 6 passed, 13 warnings in 59.25s ========================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:10:01] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:10:01] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:10:01] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:10:01] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test basic_info for agent] *********************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_basic_info.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:00:23.100783'  end: '2024-04-23 23:10:26.968738'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:10:03.867955'  stderr: |-  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  Warning: Permanently added '[ec2-18-208-152-12.compute-1.amazonaws.com]:2200,[18.208.152.12]:2200' (ECDSA) to the list of known hosts.  System is going down. Unprivileged users are not permitted to log in anymore. For technical details, see pam_nologin(8).    Connection closed by 18.208.152.12 port 2200  stderr_lines:   stdout: |-  [37m[2024-04-23 23:10:04] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:10:04] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version [32m[2024-04-23 23:10:04] [INFO] TESTER: Checking connection to server-2019[0m  [32m[2024-04-23 23:10:07] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  008 agent-windows-server-2019-amd64 any 618472825f359ffa4f5181302919ba527b9f0495f06854ae0dd4051972917d87  commands  pwd  ret  /home/ubuntu  ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  True  result.get('output')  /home/ubuntu  commands  test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -f /home/ubuntu/wazuh-install-files/wazuh-passwords.txt && echo "true" || echo "false"']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version commands  Get-Content "C:/Program Files (x86)/ossec-agent/VERSION"  result.get('success')  True  result.get('output')  v4.7.3  PASSED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision commands  Get-Content "C:/Program Files (x86)/ossec-agent/REVISION"  result.get('success')  True  result.get('output')  40714  PASSED    =================================== FAILURES ===================================  ____________________________ test_wazuh_os_version _____________________________    wazuh_params = {'agents': {'agent-windows-server-2019-amd64': '/tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_wazuh_os_version(wazuh_params):  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_basic_info.py:68:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  result = ConnectionManager.execute_commands(self.inventory_path, f'test -f {file_path} && echo "true" || echo "false"')  > if not 'true' in result.get('output'):  E TypeError: argument of type 'NoneType' is not iterable    modules/testing/tests/helpers/executor.py:236: TypeError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_revision  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  =================== 1 failed, 2 passed, 8 warnings in 22.35s ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:10:27] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:10:27] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:10:27] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:10:27] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test restart for agent] ************************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_restart.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:02:48.095572'  end: '2024-04-23 23:13:17.449502'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:10:29.353930'  stderr: 'ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  stderr_lines:   stdout: |-  [37m[2024-04-23 23:10:29] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:10:29] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 7 items    modules/testing/tests/test_agent/test_restart.py::test_restart [32m[2024-04-23 23:10:30] [INFO] TESTER: Checking connection to server-2019[0m  [32m[2024-04-23 23:10:32] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  008 agent-windows-server-2019-amd64 any 618472825f359ffa4f5181302919ba527b9f0495f06854ae0dd4051972917d87  [32m[2024-04-23 23:10:41] [INFO] TESTER: Restarting wazuh-agent in server-2019[0m  commands  NET STOP Wazuh  result.get('success')  True  result.get('output')  The Wazuh service was stopped successfully.  commands  NET START Wazuh  result.get('success')  True  result.get('output')  The Wazuh service is starting.  The Wazuh service was started successfully.  PASSED  modules/testing/tests/test_agent/test_restart.py::test_status [32m[2024-04-23 23:10:52] [INFO] TESTER: Getting status of server-2019[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  True  result.get('output')  Running  PASSED  modules/testing/tests/test_agent/test_restart.py::test_connection commands  /var/ossec/bin/agent_control -l  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  False  result.get('output')  None  None  FAILED  modules/testing/tests/test_agent/test_restart.py::test_isActive import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  PASSED  modules/testing/tests/test_agent/test_restart.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  PASSED  modules/testing/tests/test_agent/test_restart.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    [31m[2024-04-23 23:13:14] [ERROR] TESTER: Port is closed[0m  FAILED  modules/testing/tests/test_agent/test_restart.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  True  result.get('output')  wazuh-agent  PASSED    =================================== FAILURES ===================================  _______________________________ test_connection ________________________________    wazuh_params = {'agents': {'agent-windows-server-2019-amd64': '/tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_connection(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert agent_names in WazuhManager.get_agent_control_info(wazuh_params['master']), logger.error(f'{agent_names} is not present in agent_control information')  E TypeError: argument of type 'NoneType' is not iterable    modules/testing/tests/test_agent/test_restart.py:77: TypeError  __________________________________ test_port ___________________________________    wazuh_params = {'agents': {'agent-windows-server-2019-amd64': '/tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_port(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert WazuhAgent.isAgent_port_open(agent_params), logger.error('Port is closed')  E AssertionError: None  E assert False  E + where False = ('/tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml')  E + where = WazuhAgent.isAgent_port_open    modules/testing/tests/test_agent/test_restart.py:92: AssertionError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_restart.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_restart.py::test_connection - Ty...  FAILED modules/testing/tests/test_agent/test_restart.py::test_port - Assertio...  ============= 2 failed, 5 passed, 13 warnings in 167.37s (0:02:47) =============  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:13:17] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:13:17] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:13:17] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:13:17] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test stop for agent] ***************************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_stop.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:02:36.238216'  end: '2024-04-23 23:15:55.954566'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:13:19.716350'  stderr: 'ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  stderr_lines:   stdout: |-  [37m[2024-04-23 23:13:20] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:13:20] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_stop.py::test_service [32m[2024-04-23 23:13:20] [INFO] TESTER: Checking connection to server-2019[0m  [32m[2024-04-23 23:13:23] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  008 agent-windows-server-2019-amd64 any 618472825f359ffa4f5181302919ba527b9f0495f06854ae0dd4051972917d87  commands  pwd  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_stop.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    PASSED  modules/testing/tests/test_agent/test_stop.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  True  result.get('output')  wazuh-agent  [31m[2024-04-23 23:15:47] [ERROR] TESTER: Agent processes are still active[0m  FAILED[32m[2024-04-23 23:15:47] [INFO] TESTER: Restarting wazuh-agent in server-2019[0m  commands  NET STOP Wazuh  result.get('success')  True  result.get('output')  The Wazuh service was stopped successfully.  commands  NET START Wazuh  result.get('success')  True  result.get('output')  The Wazuh service is starting.  The Wazuh service was started successfully.      =================================== FAILURES ===================================  _________________________________ test_service _________________________________    wazuh_params = {'agents': {'agent-windows-server-2019-amd64': '/tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_service(wazuh_params):  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_stop.py:69:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  > file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  E TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'    modules/testing/tests/helpers/executor.py:234: TypeError  ________________________________ test_processes ________________________________    wazuh_params = {'agents': {'agent-windows-server-2019-amd64': '/tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_processes(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert not WazuhAgent.areAgent_processes_active(agent_params), logger.error('Agent processes are still active')  E AssertionError: None  E assert not True  E + where True = ('/tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml')  E + where = WazuhAgent.areAgent_processes_active    modules/testing/tests/test_agent/test_stop.py:88: AssertionError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_stop.py::test_service  testing/tests/test_agent/test_stop.py::test_service  testing/tests/test_agent/test_stop.py::test_service  testing/tests/test_agent/test_stop.py::test_service  testing/tests/test_agent/test_stop.py::test_port  testing/tests/test_agent/test_stop.py::test_processes  testing/tests/test_agent/test_stop.py::test_processes  testing/tests/test_agent/test_stop.py::test_processes  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_stop.py::test_service - TypeErro...  FAILED modules/testing/tests/test_agent/test_stop.py::test_processes - Assert...  ============= 2 failed, 1 passed, 10 warnings in 155.48s (0:02:35) =============  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:15:56] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:15:56] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:15:56] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:15:56] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test uninstall for agent] ************************************************ fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_uninstall.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:04:54.476511'  end: '2024-04-23 23:20:52.682631'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:15:58.206120'  stderr: |-  ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out  ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out  stderr_lines:   stdout: |-  [37m[2024-04-23 23:15:58] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:15:58] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 5 items    modules/testing/tests/test_agent/test_uninstall.py::test_uninstall [32m[2024-04-23 23:15:58] [INFO] TESTER: Checking connection to server-2019[0m  [32m[2024-04-23 23:16:02] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  True  commands  Get-Content "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  008 agent-windows-server-2019-amd64 any 618472825f359ffa4f5181302919ba527b9f0495f06854ae0dd4051972917d87  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  True  result.get('output')  Status Name DisplayName  ------ ---- -----------  Running WazuhSvc Wazuh  commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent"  result.get('success')  True  result.get('output')  True  [32m[2024-04-23 23:16:16] [INFO] TESTER: Uninstalling Agent in server-2019[0m  command  msiexec.exe /x $env:TEMP\wazuh-agent.msi /qn  result.get('success')  True  result.get('output')    commands  /var/ossec/bin/agent_control -l  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  False  result.get('output')  None  None  FAILED  modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/etc"  result.get('success')  True  result.get('output')  False  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_service commands  pwd  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_uninstall.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  False  result.get('output')  Get-Process : Cannot find a process with the name "wazuh-agent". Verify the process name and call the cmdlet again.  At line:1 char:1  + Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders Pro ...  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (wazuh-agent:String) [Get-Process], ProcessCommandException  + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.Commands.GetProcessCommand  PASSED    =================================== FAILURES ===================================  ________________________________ test_uninstall ________________________________    wazuh_params = {'agents': {'agent-windows-server-2019-amd64': '/tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_uninstall(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  assert GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent'), logger.error(f'{agent_names} is not Active before the installation')    os_type = HostInformation.get_os_type(agent_params)  if os_type == 'linux':  path_to_check = WAZUH_ROOT  elif os_type == 'windows':  path_to_check = WINDOWS_ROOT_DIR    assert HostInformation.dir_exists(agent_params, path_to_check), logger.error(f'The {path_to_check} is not present in the host {agent_names}')    # Agent installation  for agent_names, agent_params in wazuh_params['agents'].items():  #WazuhAgent.perform_uninstall_and_scan_for_agent(agent_params,wazuh_params)  WazuhAgent.uninstall_agent(agent_params, wazuh_params['wazuh_version'], wazuh_params['wazuh_revision'])    # Manager uninstallation status check  for agent_names, agent_params in wazuh_params['agents'].items():  > assert 'Disconnected' in WazuhManager.get_agent_control_info(wazuh_params['master']), logger.error(f'{agent_names} is still connected in the Manager')  E TypeError: argument of type 'NoneType' is not iterable    modules/testing/tests/test_agent/test_uninstall.py:85: TypeError  _________________________________ test_service _________________________________    wazuh_params = {'agents': {'agent-windows-server-2019-amd64': '/tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_service(wazuh_params):  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_uninstall.py:99:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  > file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  E TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'    modules/testing/tests/helpers/executor.py:234: TypeError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_uninstall.py: 10 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_uninstall.py::test_uninstall - T...  FAILED modules/testing/tests/test_agent/test_uninstall.py::test_service - Typ...  ============= 2 failed, 3 passed, 12 warnings in 293.76s (0:04:53) =============  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:20:52] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2019-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:20:52] [INFO] TESTER: Cleaning up [2024-04-23 23:20:52] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:20:52] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* fatal: [ec2-18-208-152-12.compute-1.amazonaws.com]: UNREACHABLE! => changed=false   msg: 'Failed to connect to the host via ssh: ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  unreachable: true PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=0 changed=0 unreachable=1  failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:21:03] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {}, 'dark': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-23 23:21:03] [INFO] TESTER: Cleaning up [2024-04-23 23:21:03] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:21:03] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* fatal: [ec2-18-208-152-12.compute-1.amazonaws.com]: UNREACHABLE! => changed=false   msg: 'Failed to connect to the host via ssh: ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  unreachable: true PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=0 changed=0 unreachable=1  failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:21:14] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {}, 'dark': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}}  [2024-04-23 23:21:14] [INFO] [275569] [ThreadPoolExecutor-0_2] [workflow_engine]: [run-agent-windows-server-2019-amd64-tests] Finished task in 886.06 seconds. [2024-04-24 00:06:46] [DEBUG] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "run-agent-windows-server-2022-amd64-tests" execution with result: [2024-04-23 23:15:25] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 23:15:25] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 23:15:25] [INFO] TESTER: Running tests for ec2-18-208-152-12.compute-1.amazonaws.com [2024-04-23 23:15:25] [INFO] TESTER: Running tests for ec2-3-87-214-177.compute-1.amazonaws.com [2024-04-23 23:15:25] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'wazuh_version': '4.7.3', 'wazuh_revision': '40714', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': True, 'hosts_ip': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-87-214-177.compute-1.amazonaws.com'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability', 'current_user': 'fcaffieri'} [2024-04-23 23:15:25] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-23 23:15:25] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:15:25] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-87-214-177.compute-1.amazonaws.com']}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-18-208-152-12.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004293'  end: '2024-04-23 23:15:27.439016'  item: ec2-18-208-152-12.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 23:15:27.434723'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  changed: [localhost] => (item=ec2-3-87-214-177.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004093'  end: '2024-04-23 23:15:27.598251'  item: ec2-3-87-214-177.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 23:15:27.594158'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:15:27] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-3-87-214-177.compute-1.amazonaws.com']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:15:27] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:15:27] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:15:27] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test install for agent] ************************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_install.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:33:27.257918'  end: '2024-04-23 23:48:57.143046'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:15:29.885128'  stderr: |-  ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out  ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out  ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out  stderr_lines:   stdout: |-  [37m[2024-04-23 23:15:30] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:15:30] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 2 items    modules/testing/tests/test_agent/test_install.py::test_installation [32m[2024-04-23 23:15:30] [INFO] TESTER: Checking connection to server-2022[0m  [32m[2024-04-23 23:15:33] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  [32m[2024-04-23 23:15:37] [INFO] TESTER: Checking connection to ubuntu-22.04[0m  [33m[2024-04-23 23:17:46] [WARNING] TESTER: Error on attempt 1 of 10: [Errno 110] Connection timed out[0m  [33m[2024-04-23 23:20:25] [WARNING] TESTER: Error on attempt 2 of 10: [Errno 110] Connection timed out[0m  [33m[2024-04-23 23:23:05] [WARNING] TESTER: Error on attempt 3 of 10: [Errno 110] Connection timed out[0m  [33m[2024-04-23 23:25:45] [WARNING] TESTER: Error on attempt 4 of 10: [Errno 110] Connection timed out[0m  [33m[2024-04-23 23:28:25] [WARNING] TESTER: Error on attempt 5 of 10: [Errno 110] Connection timed out[0m  [33m[2024-04-23 23:31:04] [WARNING] TESTER: Error on attempt 6 of 10: [Errno 110] Connection timed out[0m  [33m[2024-04-23 23:33:44] [WARNING] TESTER: Error on attempt 7 of 10: [Errno 110] Connection timed out[0m  [33m[2024-04-23 23:36:24] [WARNING] TESTER: Error on attempt 8 of 10: [Errno 110] Connection timed out[0m  [33m[2024-04-23 23:39:04] [WARNING] TESTER: Error on attempt 9 of 10: [Errno 110] Connection timed out[0m  [33m[2024-04-23 23:41:43] [WARNING] TESTER: Error on attempt 10 of 10: [Errno 110] Connection timed out[0m  [31m[2024-04-23 23:42:13] [ERROR] TESTER: Connection attempts failed after 10 tries. Connection timeout in ubuntu-22.04[0m  command  Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False  result.get('success')  True  result.get('output')    commands  test -d /var/ossec && echo "True" || echo "False"  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'test -d /var/ossec && echo "True" || echo "False"']  result.get('success')  False  result.get('output')  None  None  commands  systemctl is-active firewalld  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  False  result.get('output')  None  None  commands  systemctl is-active firewalld  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'systemctl is-active firewalld']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_install.py::test_status [32m[2024-04-23 23:48:54] [INFO] TESTER: Getting status of server-2022[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  FAILED    =================================== FAILURES ===================================  ______________________________ test_installation _______________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_installation(wazuh_params):  # Checking connection  for manager_name, manager_params in wazuh_params['managers'].items():  Utils.check_inventory_connection(manager_params)    # Certs creation, firewall management and Manager installation  for agent_name, agent_params in wazuh_params['agents'].items():  HostConfiguration.disable_firewall(agent_params)    if HostInformation.dir_exists(wazuh_params['master'], WAZUH_ROOT):  logger.info(f'Manager is already installed in {HostInformation.get_os_name_and_version_from_inventory(wazuh_params["master"])}')  else:  > HostConfiguration.disable_firewall(manager_params)    modules/testing/tests/test_agent/test_install.py:78:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:301: in disable_firewall  if GeneralComponentActions.isComponentActive(inventory_path, 'firewalld'):  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'  host_role = 'firewalld'    @staticmethod  def isComponentActive(inventory_path, host_role) -> bool:  """  Returns the True of False depending if the component is Active    Args:  inventory_path: host's inventory path  host_role: role of the component    Returns:  bool: True/False  """    os_type = HostInformation.get_os_type(inventory_path)    if os_type == 'linux':  print(ConnectionManager.execute_commands(inventory_path, f'systemctl is-active {host_role}').get('output'))  > return 'active' == ConnectionManager.execute_commands(inventory_path, f'systemctl is-active {host_role}').get('output').replace("\n", "")  E AttributeError: 'NoneType' object has no attribute 'replace'    modules/testing/tests/helpers/generic.py:761: AttributeError  _________________________________ test_status __________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_status(wazuh_params):  for agent in wazuh_params['agents'].values():  agent_status = GeneralComponentActions.get_component_status(agent, 'wazuh-agent')  > assert 'loaded' in agent_status or 'Stopped' in agent_status, logger.error(f'The {HostInformation.get_os_name_and_version_from_inventory(agent)} status is not loaded')  E TypeError: argument of type 'NoneType' is not iterable    modules/testing/tests/test_agent/test_install.py:102: TypeError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_installation  testing/tests/test_agent/test_install.py::test_status  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_install.py::test_installation - ...  FAILED modules/testing/tests/test_agent/test_install.py::test_status - TypeEr...  ================== 2 failed, 6 warnings in 2006.53s (0:33:26) ==================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:48:57] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:48:57] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:48:57] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:48:57] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test registration for agent] ********************************************* fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_registration.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:04:39.081197'  end: '2024-04-23 23:53:38.438008'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:48:59.356811'  stderr: |-  ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out  ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out  stderr_lines:   stdout: |-  [37m[2024-04-23 23:48:59] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:48:59] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 4 items    modules/testing/tests/test_agent/test_registration.py::test_status [32m[2024-04-23 23:49:00] [INFO] TESTER: Checking connection to server-2022[0m  [32m[2024-04-23 23:49:02] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  [32m[2024-04-23 23:49:06] [INFO] TESTER: os_type windows[0m  command  (Get-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf" -Raw) -replace "
MANAGER_IP
", "
None
" | Set-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  True  result.get('output')    command  NET START WazuhSvc  result.get('success')  False  result.get('output')  The service name is invalid.    More help is available by typing NET HELPMSG 2185.  commands  Get-Content "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  False  result.get('output')  Get-Content : Cannot find path 'C:\Program Files (x86)\ossec-agent\ossec.conf' because it does not exist.  At line:1 char:1  + Get-Content "C:/Program Files (x86)/ossec-agent/ossec.conf"  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (C:\Program File...gent\ossec.conf:String) [Get-Content], ItemNotFoundEx  ception  + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand  FAILED  modules/testing/tests/test_agent/test_registration.py::test_service commands  pwd  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_registration.py::test_connection commands  pwd  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_registration.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  False  PASSED    =================================== FAILURES ===================================  _________________________________ test_status __________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_status(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > WazuhAgent.register_agent(agent_params, wazuh_params['master'])    modules/testing/tests/test_agent/test_registration.py:69:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'  manager_path = {'ansible_connection': 'ssh', 'ansible_host': 'ec2-18-208-152-12.compute-1.amazonaws.com', 'ansible_port': 2200, 'ansible_ssh_common_args': '-o StrictHostKeyChecking=no', ...}    @staticmethod  def register_agent(inventory_path, manager_path):    with open(manager_path, 'r') as yaml_file:  manager_path = yaml.safe_load(yaml_file)  host = manager_path.get('ansible_host')    internal_ip = HostInformation.get_internal_ip_from_aws_dns(host) if 'amazonaws' in host else host    os_type = HostInformation.get_os_type(inventory_path)  logger.info(f'os_type {os_type}')    if 'linux' in os_type:  commands = [  f"sed -i 's/
MANAGER_IP<\/address>/
{internal_ip}<\/address>/g' {WAZUH_CONF}",  "systemctl restart wazuh-agent"  ]    ConnectionManager.execute_commands(inventory_path, commands)  result = ConnectionManager.execute_commands(inventory_path, f'cat {WAZUH_CONF}')  assert internal_ip in result.get('output'), logger.error(f"""Error configuring the Manager IP ({internal_ip})in: {HostInformation.get_os_name_and_version_from_inventory(inventory_path)} agent""")  elif 'windows' in os_type :  try:  commands = [  f'(Get-Content -Path "{WAZUH_WINDOWS_CONF}" -Raw) -replace "
MANAGER_IP
", "
{internal_ip}
" | Set-Content -Path "{WAZUH_WINDOWS_CONF}"',  "NET START WazuhSvc"  ]    ConnectionManager.execute_commands(inventory_path, commands)  except Exception as e:  raise Exception(f'Error registering agent. Error executing: {commands} with error: {e}')    result = ConnectionManager.execute_commands(inventory_path, f'Get-Content "{WAZUH_WINDOWS_CONF}"')  > assert internal_ip in result.get('output'), logger.error(f'Error configuring the Manager IP ({internal_ip})in: {HostInformation.get_os_name_and_version_from_inventory(inventory_path)} agent')  E TypeError: 'in ' requires string as left operand, not NoneType    modules/testing/tests/helpers/agent.py:128: TypeError  _________________________________ test_service _________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_service(wazuh_params):  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_registration.py:76:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  > file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  E TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'    modules/testing/tests/helpers/executor.py:234: TypeError  _______________________________ test_connection ________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_connection(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_registration.py:85:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  > file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  E TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'    modules/testing/tests/helpers/executor.py:234: TypeError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_registration.py::test_status  testing/tests/test_agent/test_registration.py::test_status  testing/tests/test_agent/test_registration.py::test_status  testing/tests/test_agent/test_registration.py::test_status  testing/tests/test_agent/test_registration.py::test_status  testing/tests/test_agent/test_registration.py::test_clientKeys  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_registration.py::test_status - T...  FAILED modules/testing/tests/test_agent/test_registration.py::test_service - ...  FAILED modules/testing/tests/test_agent/test_registration.py::test_connection  ============= 3 failed, 1 passed, 8 warnings in 278.30s (0:04:38) ==============  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:53:38] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:53:38] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:53:38] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:53:38] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test connection for agent] *********************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_connection.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:02:33.366505'  end: '2024-04-23 23:56:14.462734'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:53:41.096229'  stderr: 'ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  stderr_lines:   stdout: |-  [37m[2024-04-23 23:53:41] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:53:41] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 6 items    modules/testing/tests/test_agent/test_connection.py::test_connection [32m[2024-04-23 23:53:41] [INFO] TESTER: Checking connection to server-2022[0m  [32m[2024-04-23 23:53:44] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  command  (Get-Content -Path 'C:/Program Files (x86)/ossec-agent/ossec.conf') -replace '[^<]*<\/protocol>', 'tcp' | Set-Content -Path 'C:/Program Files (x86)/ossec-agent/ossec.conf'  result.get('success')  True  result.get('output')    commands  Get-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf"  result.get('success')  False  result.get('output')  Get-Content : Cannot find path 'C:\Program Files (x86)\ossec-agent\ossec.conf' because it does not exist.  At line:1 char:1  + Get-Content -Path "C:/Program Files (x86)/ossec-agent/ossec.conf"  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (C:\Program File...gent\ossec.conf:String) [Get-Content], ItemNotFoundEx  ception  + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand  [31m[2024-04-23 23:53:52] [ERROR] TESTER: Error configuring the protocol (tcp) in: server-2022 agent[0m  FAILED  modules/testing/tests/test_agent/test_connection.py::test_status [32m[2024-04-23 23:53:52] [INFO] TESTER: Getting status of server-2022[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  FAILED  modules/testing/tests/test_agent/test_connection.py::test_service commands  pwd  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_connection.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  False  PASSED  modules/testing/tests/test_agent/test_connection.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    [31m[2024-04-23 23:56:11] [ERROR] TESTER: Port is closed[0m  FAILED  modules/testing/tests/test_agent/test_connection.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  False  result.get('output')  Get-Process : Cannot find a process with the name "wazuh-agent". Verify the process name and call the cmdlet again.  At line:1 char:1  + Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders Pro ...  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (wazuh-agent:String) [Get-Process], ProcessCommandException  + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.Commands.GetProcessCommand  [31m[2024-04-23 23:56:14] [ERROR] TESTER: Agent processes are not active[0m  FAILED    =================================== FAILURES ===================================  _______________________________ test_connection ________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_connection(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > WazuhAgent.set_protocol_agent_connection(agent_params, 'tcp')    modules/testing/tests/test_agent/test_connection.py:68:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'  protocol = 'tcp'    @staticmethod  def set_protocol_agent_connection(inventory_path, protocol):  os_type = HostInformation.get_os_type(inventory_path)    if 'linux' in os_type:  commands = [  f"sed -i 's/[^<]*<\/protocol>/{protocol}<\/protocol>/g' {WAZUH_CONF}",  "systemctl restart wazuh-agent"  ]    ConnectionManager.execute_commands(inventory_path, commands)  result = ConnectionManager.execute_commands(inventory_path, f'cat {WAZUH_CONF}')  assert protocol in result.get('output'), logger.error(f'Error configuring the protocol ({protocol}) in: {HostInformation.get_os_name_and_version_from_inventory(inventory_path)} agent')  elif 'windows' in os_type :  commands = [  f"(Get-Content -Path '{WAZUH_WINDOWS_CONF}') -replace '[^<]*<\/protocol>', '{protocol}' | Set-Content -Path '{WAZUH_WINDOWS_CONF}'"  ]    ConnectionManager.execute_commands(inventory_path, commands)  result = ConnectionManager.execute_commands(inventory_path, f'Get-Content -Path "{WAZUH_WINDOWS_CONF}"')  > assert protocol in result.get('output'), logger.error(f'Error configuring the protocol ({protocol}) in: {HostInformation.get_os_name_and_version_from_inventory(inventory_path)} agent')  E AssertionError: None    modules/testing/tests/helpers/agent.py:150: AssertionError  _________________________________ test_status __________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_status(wazuh_params):  for agent in wazuh_params['agents'].values():  status = GeneralComponentActions.get_component_status(agent, 'wazuh-agent')  > assert 'active' in status or 'connected' in status or "Running" in status, logger.error(f'The {HostInformation.get_os_name_and_version_from_inventory(agent)} is not active')  E TypeError: argument of type 'NoneType' is not iterable    modules/testing/tests/test_agent/test_connection.py:77: TypeError  _________________________________ test_service _________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_service(wazuh_params):  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_connection.py:81:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  > file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  E TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'    modules/testing/tests/helpers/executor.py:234: TypeError  __________________________________ test_port ___________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_port(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert WazuhAgent.isAgent_port_open(agent_params), logger.error('Port is closed')  E AssertionError: None  E assert False  E + where False = ('/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml')  E + where = WazuhAgent.isAgent_port_open    modules/testing/tests/test_agent/test_connection.py:96: AssertionError  ________________________________ test_processes ________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_processes(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert WazuhAgent.areAgent_processes_active(agent_params), logger.error('Agent processes are not active')  E AssertionError: None  E assert False  E + where False = ('/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml')  E + where = WazuhAgent.areAgent_processes_active    modules/testing/tests/test_agent/test_connection.py:101: AssertionError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_connection.py::test_connection  testing/tests/test_agent/test_connection.py::test_connection  testing/tests/test_agent/test_connection.py::test_connection  testing/tests/test_agent/test_connection.py::test_connection  testing/tests/test_agent/test_connection.py::test_status  testing/tests/test_agent/test_connection.py::test_clientKeys  testing/tests/test_agent/test_connection.py::test_port  testing/tests/test_agent/test_connection.py::test_processes  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_connection.py::test_connection  FAILED modules/testing/tests/test_agent/test_connection.py::test_status - Typ...  FAILED modules/testing/tests/test_agent/test_connection.py::test_service - Ty...  FAILED modules/testing/tests/test_agent/test_connection.py::test_port - Asser...  FAILED modules/testing/tests/test_agent/test_connection.py::test_processes - ...  ============= 5 failed, 1 passed, 10 warnings in 152.51s (0:02:32) =============  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:56:14] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:56:14] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:56:14] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:56:14] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test basic_info for agent] *********************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_basic_info.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:02:20.489263'  end: '2024-04-23 23:58:37.278461'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:56:16.789198'  stderr: 'ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  stderr_lines:   stdout: |-  [37m[2024-04-23 23:56:17] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:56:17] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version [32m[2024-04-23 23:56:17] [INFO] TESTER: Checking connection to server-2022[0m  [32m[2024-04-23 23:56:19] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  commands  pwd  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version commands  Get-Content "C:/Program Files (x86)/ossec-agent/VERSION"  result.get('success')  False  result.get('output')  Get-Content : Cannot find path 'C:\Program Files (x86)\ossec-agent\VERSION' because it does not exist.  At line:1 char:1  + Get-Content "C:/Program Files (x86)/ossec-agent/VERSION"  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (C:\Program File...c-agent\VERSION:String) [Get-Content], ItemNotFoundEx  ception  + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand  [31m[2024-04-23 23:58:34] [ERROR] TESTER: The version server-2022 is not 4.7.3 by command[0m  FAILED  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision commands  Get-Content "C:/Program Files (x86)/ossec-agent/REVISION"  result.get('success')  False  result.get('output')  Get-Content : Cannot find path 'C:\Program Files (x86)\ossec-agent\REVISION' because it does not exist.  At line:1 char:1  + Get-Content "C:/Program Files (x86)/ossec-agent/REVISION"  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (C:\Program File...-agent\REVISION:String) [Get-Content], ItemNotFoundEx  ception  + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand  [31m[2024-04-23 23:58:37] [ERROR] TESTER: The revision server-2022 is not 40714 by command[0m  FAILED    =================================== FAILURES ===================================  ____________________________ test_wazuh_os_version _____________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_wazuh_os_version(wazuh_params):  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_basic_info.py:68:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  > file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  E TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'    modules/testing/tests/helpers/executor.py:234: TypeError  ______________________________ test_wazuh_version ______________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_wazuh_version(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert wazuh_params['wazuh_version'] in GeneralComponentActions.get_component_version(agent_params), logger.error(f"The version {HostInformation.get_os_name_and_version_from_inventory(agent_params)} is not {wazuh_params['wazuh_version']} by command")  E AssertionError: None  E assert '4.7.3' in 'Get-Content : Cannot find path \'C:\\Program Files (x86)\\ossec-agent\\VERSION\' because it does not exist.\nAt line:1 char:1\n+ Get-Content "C:/Program Files (x86)/ossec-agent/VERSION"\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n + CategoryInfo : ObjectNotFound: (C:\\Program File...c-agent\\VERSION:String) [Get-Content], ItemNotFoundEx \n ception\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand'  E + where 'Get-Content : Cannot find path \'C:\\Program Files (x86)\\ossec-agent\\VERSION\' because it does not exist.\nAt line:1 char:1\n+ Get-Content "C:/Program Files (x86)/ossec-agent/VERSION"\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n + CategoryInfo : ObjectNotFound: (C:\\Program File...c-agent\\VERSION:String) [Get-Content], ItemNotFoundEx \n ception\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand' = ('/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml')  E + where = GeneralComponentActions.get_component_version    modules/testing/tests/test_agent/test_basic_info.py:91: AssertionError  _____________________________ test_wazuh_revision ______________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_wazuh_revision(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert wazuh_params['wazuh_revision'] in GeneralComponentActions.get_component_revision(agent_params), logger.error(f"The revision {HostInformation.get_os_name_and_version_from_inventory(agent_params)} is not {wazuh_params['wazuh_revision']} by command")  E AssertionError: None  E assert '40714' in 'Get-Content : Cannot find path \'C:\\Program Files (x86)\\ossec-agent\\REVISION\' because it does not exist.\nAt line:1 char:1\n+ Get-Content "C:/Program Files (x86)/ossec-agent/REVISION"\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n + CategoryInfo : ObjectNotFound: (C:\\Program File...-agent\\REVISION:String) [Get-Content], ItemNotFoundEx \n ception\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand'  E + where 'Get-Content : Cannot find path \'C:\\Program Files (x86)\\ossec-agent\\REVISION\' because it does not exist.\nAt line:1 char:1\n+ Get-Content "C:/Program Files (x86)/ossec-agent/REVISION"\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n + CategoryInfo : ObjectNotFound: (C:\\Program File...-agent\\REVISION:String) [Get-Content], ItemNotFoundEx \n ception\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand' = ('/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml')  E + where = GeneralComponentActions.get_component_revision    modules/testing/tests/test_agent/test_basic_info.py:96: AssertionError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_version  testing/tests/test_agent/test_basic_info.py::test_wazuh_revision  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  FAILED modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version  FAILED modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision  ================== 3 failed, 6 warnings in 139.65s (0:02:19) ===================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:58:37] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:58:37] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:58:37] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:58:37] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test restart for agent] ************************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_restart.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:02:35.668225'  end: '2024-04-24 00:01:18.167835'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:58:42.499610'  stderr: 'ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  stderr_lines:   stdout: |-  [37m[2024-04-23 23:58:43] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:58:43] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 7 items    modules/testing/tests/test_agent/test_restart.py::test_restart [32m[2024-04-23 23:58:44] [INFO] TESTER: Checking connection to server-2022[0m  [32m[2024-04-23 23:58:46] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  [32m[2024-04-23 23:58:48] [INFO] TESTER: Restarting wazuh-agent in server-2022[0m  commands  NET STOP Wazuh  result.get('success')  False  result.get('output')  The service name is invalid.    More help is available by typing NET HELPMSG 2185.  commands  NET START Wazuh  result.get('success')  False  result.get('output')  The service name is invalid.    More help is available by typing NET HELPMSG 2185.  PASSED  modules/testing/tests/test_agent/test_restart.py::test_status [32m[2024-04-23 23:58:53] [INFO] TESTER: Getting status of server-2022[0m  commands  Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh' | Format-Table -HideTableHeaders Status  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  FAILED  modules/testing/tests/test_agent/test_restart.py::test_connection commands  /var/ossec/bin/agent_control -l  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', '/var/ossec/bin/agent_control -l']  result.get('success')  False  result.get('output')  None  None  FAILED  modules/testing/tests/test_agent/test_restart.py::test_isActive import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  [31m[2024-04-24 00:01:10] [ERROR] TESTER: agent-windows-server-2022-amd64 is not active by command[0m  FAILED  modules/testing/tests/test_agent/test_restart.py::test_clientKeys commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/client.keys"  result.get('success')  True  result.get('output')  False  PASSED  modules/testing/tests/test_agent/test_restart.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    [31m[2024-04-24 00:01:15] [ERROR] TESTER: Port is closed[0m  FAILED  modules/testing/tests/test_agent/test_restart.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  False  result.get('output')  Get-Process : Cannot find a process with the name "wazuh-agent". Verify the process name and call the cmdlet again.  At line:1 char:1  + Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders Pro ...  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (wazuh-agent:String) [Get-Process], ProcessCommandException  + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.Commands.GetProcessCommand  [31m[2024-04-24 00:01:17] [ERROR] TESTER: Agent processes are not active[0m  FAILED    =================================== FAILURES ===================================  _________________________________ test_status __________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_status(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  status = GeneralComponentActions.get_component_status(agent_params, 'wazuh-agent')  > assert 'active' in status or 'Running' in status, logger.error(f'{agent_names} is not active by command')  E TypeError: argument of type 'NoneType' is not iterable    modules/testing/tests/test_agent/test_restart.py:73: TypeError  _______________________________ test_connection ________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_connection(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert agent_names in WazuhManager.get_agent_control_info(wazuh_params['master']), logger.error(f'{agent_names} is not present in agent_control information')  E TypeError: argument of type 'NoneType' is not iterable    modules/testing/tests/test_agent/test_restart.py:77: TypeError  ________________________________ test_isActive _________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_isActive(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent'), logger.error(f'{agent_names} is not active by command')  E AssertionError: None  E assert False  E + where False = ('/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml', 'wazuh-agent')  E + where = GeneralComponentActions.isComponentActive    modules/testing/tests/test_agent/test_restart.py:82: AssertionError  __________________________________ test_port ___________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_port(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert WazuhAgent.isAgent_port_open(agent_params), logger.error('Port is closed')  E AssertionError: None  E assert False  E + where False = ('/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml')  E + where = WazuhAgent.isAgent_port_open    modules/testing/tests/test_agent/test_restart.py:92: AssertionError  ________________________________ test_processes ________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_processes(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert WazuhAgent.areAgent_processes_active(agent_params), logger.error('Agent processes are not active')  E AssertionError: None  E assert False  E + where False = ('/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml')  E + where = WazuhAgent.areAgent_processes_active    modules/testing/tests/test_agent/test_restart.py:97: AssertionError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_restart.py::test_restart  testing/tests/test_agent/test_restart.py::test_restart  testing/tests/test_agent/test_restart.py::test_restart  testing/tests/test_agent/test_restart.py::test_restart  testing/tests/test_agent/test_restart.py::test_status  testing/tests/test_agent/test_restart.py::test_isActive  testing/tests/test_agent/test_restart.py::test_clientKeys  testing/tests/test_agent/test_restart.py::test_port  testing/tests/test_agent/test_restart.py::test_processes  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_restart.py::test_status - TypeEr...  FAILED modules/testing/tests/test_agent/test_restart.py::test_connection - Ty...  FAILED modules/testing/tests/test_agent/test_restart.py::test_isActive - Asse...  FAILED modules/testing/tests/test_agent/test_restart.py::test_port - Assertio...  FAILED modules/testing/tests/test_agent/test_restart.py::test_processes - Ass...  ============= 5 failed, 2 passed, 11 warnings in 153.96s (0:02:33) =============  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-24 00:01:18] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-24 00:01:18] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-24 00:01:18] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-24 00:01:18] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test stop for agent] ***************************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_stop.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:02:26.804382'  end: '2024-04-24 00:03:49.558525'  msg: non-zero return code  rc: 1  start: '2024-04-24 00:01:22.754143'  stderr: 'ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  stderr_lines:   stdout: |-  [37m[2024-04-24 00:01:23] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-24 00:01:23] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_stop.py::test_service [32m[2024-04-24 00:01:24] [INFO] TESTER: Checking connection to server-2022[0m  [32m[2024-04-24 00:01:26] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  commands  pwd  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_stop.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    PASSED  modules/testing/tests/test_agent/test_stop.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  False  result.get('output')  Get-Process : Cannot find a process with the name "wazuh-agent". Verify the process name and call the cmdlet again.  At line:1 char:1  + Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders Pro ...  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (wazuh-agent:String) [Get-Process], ProcessCommandException  + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.Commands.GetProcessCommand  PASSED[32m[2024-04-24 00:03:44] [INFO] TESTER: Restarting wazuh-agent in server-2022[0m  commands  NET STOP Wazuh  result.get('success')  False  result.get('output')  The service name is invalid.    More help is available by typing NET HELPMSG 2185.  commands  NET START Wazuh  result.get('success')  False  result.get('output')  The service name is invalid.    More help is available by typing NET HELPMSG 2185.      =================================== FAILURES ===================================  _________________________________ test_service _________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_service(wazuh_params):  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_stop.py:69:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  > file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  E TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'    modules/testing/tests/helpers/executor.py:234: TypeError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_stop.py::test_service  testing/tests/test_agent/test_stop.py::test_service  testing/tests/test_agent/test_stop.py::test_port  testing/tests/test_agent/test_stop.py::test_processes  testing/tests/test_agent/test_stop.py::test_processes  testing/tests/test_agent/test_stop.py::test_processes  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_stop.py::test_service - TypeErro...  ============= 1 failed, 2 passed, 8 warnings in 145.17s (0:02:25) ==============  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-24 00:03:49] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-24 00:03:49] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-24 00:03:49] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-24 00:03:49] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test uninstall for agent] ************************************************ fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_uninstall.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:02:27.846410'  end: '2024-04-24 00:06:22.027695'  msg: non-zero return code  rc: 1  start: '2024-04-24 00:03:54.181285'  stderr: 'ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  stderr_lines:   stdout: |-  [37m[2024-04-24 00:03:55] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-24 00:03:55] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 5 items    modules/testing/tests/test_agent/test_uninstall.py::test_uninstall [32m[2024-04-24 00:03:55] [INFO] TESTER: Checking connection to server-2022[0m  [32m[2024-04-24 00:03:57] [INFO] TESTER: WinRM connection successful.[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  result.get('success')  False  result.get('output')  Get-Service : Cannot find any service with service name 'Wazuh'.  At line:1 char:1  + Get-Service -Name 'Wazuh'  + ~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (Wazuh:String) [Get-Service], ServiceCommandException  + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand  [31m[2024-04-24 00:04:03] [ERROR] TESTER: agent-windows-server-2022-amd64 is not Active before the installation[0m  FAILED  modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory commands  Test-Path -Path "C:/Program Files (x86)/ossec-agent/etc"  result.get('success')  True  result.get('output')  False  PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_service commands  pwd  ret    ssh_command  ['ssh', '-i', '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-p', '2200', 'ubuntu@ec2-18-208-152-12.compute-1.amazonaws.com', 'sudo', 'pwd']  result.get('success')  False  result.get('output')  None  FAILED  modules/testing/tests/test_agent/test_uninstall.py::test_port os_type  windows  commands  netstat -ano | Select-String -Pattern "TCP" | Select-String -Pattern "ESTABLISHED" | Select-String -Pattern ":1514"  result.get('success')  True  result.get('output')    PASSED  modules/testing/tests/test_agent/test_uninstall.py::test_processes commands  Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders ProcessName  result.get('success')  False  result.get('output')  Get-Process : Cannot find a process with the name "wazuh-agent". Verify the process name and call the cmdlet again.  At line:1 char:1  + Get-Process -Name "wazuh-agent" | Format-Table -HideTableHeaders Pro ...  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  + CategoryInfo : ObjectNotFound: (wazuh-agent:String) [Get-Process], ProcessCommandException  + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.Commands.GetProcessCommand  PASSED    =================================== FAILURES ===================================  ________________________________ test_uninstall ________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_uninstall(wazuh_params):  for agent_names, agent_params in wazuh_params['agents'].items():  > assert GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent'), logger.error(f'{agent_names} is not Active before the installation')  E AssertionError: None  E assert False  E + where False = ('/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml', 'wazuh-agent')  E + where = GeneralComponentActions.isComponentActive    modules/testing/tests/test_agent/test_uninstall.py:68: AssertionError  _________________________________ test_service _________________________________    wazuh_params = {'agents': {'agent-windows-server-2022-amd64': '/tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml'}, 'dashb...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    def test_service(wazuh_params):  > wazuh_api = WazuhAPI(wazuh_params['master'])    modules/testing/tests/test_agent/test_uninstall.py:99:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/executor.py:224: in __init__  self._authenticate()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _authenticate(self):  with open(self.inventory_path, 'r') as yaml_file:  inventory_data = yaml.safe_load(yaml_file)    user = 'wazuh'    #----Patch issue https://github.com/wazuh/wazuh-packages/issues/2883-------------  result = ConnectionManager.execute_commands(self.inventory_path, 'pwd')  > file_path = result.get('output') + '/wazuh-install-files/wazuh-passwords.txt'  E TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'    modules/testing/tests/helpers/executor.py:234: TypeError  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_uninstall.py::test_uninstall  testing/tests/test_agent/test_uninstall.py::test_uninstall  testing/tests/test_agent/test_uninstall.py::test_uninstall  testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory  testing/tests/test_agent/test_uninstall.py::test_port  testing/tests/test_agent/test_uninstall.py::test_processes  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  FAILED modules/testing/tests/test_agent/test_uninstall.py::test_uninstall - A...  FAILED modules/testing/tests/test_agent/test_uninstall.py::test_service - Typ...  ============= 2 failed, 3 passed, 8 warnings in 146.29s (0:02:26) ==============  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-24 00:06:22] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-server-2022-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-24 00:06:22] [INFO] TESTER: Cleaning up [2024-04-24 00:06:22] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-24 00:06:22] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* fatal: [ec2-18-208-152-12.compute-1.amazonaws.com]: UNREACHABLE! => changed=false   msg: 'Failed to connect to the host via ssh: ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  unreachable: true PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=0 changed=0 unreachable=1  failed=0 skipped=0 rescued=0 ignored=0 [2024-04-24 00:06:34] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {}, 'dark': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-24 00:06:34] [INFO] TESTER: Cleaning up [2024-04-24 00:06:34] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-24 00:06:34] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* fatal: [ec2-18-208-152-12.compute-1.amazonaws.com]: UNREACHABLE! => changed=false   msg: 'Failed to connect to the host via ssh: ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  unreachable: true PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=0 changed=0 unreachable=1  failed=0 skipped=0 rescued=0 ignored=0 [2024-04-24 00:06:46] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {}, 'dark': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}}  [2024-04-24 00:06:46] [INFO] [275569] [ThreadPoolExecutor-0_0] [workflow_engine]: [run-agent-windows-server-2022-amd64-tests] Finished task in 3081.75 seconds. [2024-04-24 00:33:34] [DEBUG] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: Finished task "run-agent-windows-desktop-10-amd64-tests" execution with result: [2024-04-23 23:18:21] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi' [2024-04-23 23:18:21] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi' [2024-04-23 23:18:21] [INFO] TESTER: Running tests for ec2-18-208-152-12.compute-1.amazonaws.com [2024-04-23 23:18:21] [INFO] TESTER: Running tests for ec2-54-173-230-126.compute-1.amazonaws.com [2024-04-23 23:18:21] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'wazuh_version': '4.7.3', 'wazuh_revision': '40714', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': True, 'hosts_ip': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-54-173-230-126.compute-1.amazonaws.com'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability', 'current_user': 'fcaffieri'} [2024-04-23 23:18:21] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-23 23:18:21] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:18:21] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-54-173-230-126.compute-1.amazonaws.com']}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-18-208-152-12.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004319'  end: '2024-04-23 23:18:23.374953'  item: ec2-18-208-152-12.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 23:18:23.370634'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  changed: [localhost] => (item=ec2-54-173-230-126.compute-1.amazonaws.com) => changed=true   ansible_loop_var: item  cmd:  - ssh-keygen  - -f  - /home/fcaffieri/.ssh/known_hosts  - -R  - ''  delta: '0:00:00.004257'  end: '2024-04-23 23:18:23.534257'  item: ec2-54-173-230-126.compute-1.amazonaws.com  msg: ''  rc: 0  start: '2024-04-23 23:18:23.530000'  stderr: Host not found in /home/fcaffieri/.ssh/known_hosts  stderr_lines:   stdout: ''  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=2  changed=1  unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-23 23:18:23] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/fcaffieri/.ssh/known_hosts -R ''"}, 'loop': ['ec2-18-208-152-12.compute-1.amazonaws.com', 'ec2-54-173-230-126.compute-1.amazonaws.com']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-23 23:18:23] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:18:23] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:18:23] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test install for agent] ************************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_install.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:10:31.979396'  end: '2024-04-23 23:28:57.818524'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:18:25.839128'  stderr: ''  stderr_lines:   stdout: |-  [37m[2024-04-23 23:18:26] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:18:26] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 2 items    modules/testing/tests/test_agent/test_install.py::test_installation [32m[2024-04-23 23:18:26] [INFO] TESTER: Checking connection to desktop-10[0m  [33m[2024-04-23 23:18:56] [WARNING] TESTER: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:19:56] [WARNING] TESTER: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:20:56] [WARNING] TESTER: Error on attempt 3 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:21:56] [WARNING] TESTER: Error on attempt 4 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:22:56] [WARNING] TESTER: Error on attempt 5 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:23:57] [WARNING] TESTER: Error on attempt 6 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:24:57] [WARNING] TESTER: Error on attempt 7 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:25:57] [WARNING] TESTER: Error on attempt 8 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:26:57] [WARNING] TESTER: Error on attempt 9 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:27:57] [WARNING] TESTER: Error on attempt 10 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [31m[2024-04-23 23:28:27] [ERROR] TESTER: Connection attempts failed after 10 tries. Connection timeout in desktop-10[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  ERROR  modules/testing/tests/test_agent/test_install.py::test_status ERROR    ==================================== ERRORS ====================================  _____________________ ERROR at setup of test_installation ______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])  wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_install.py:57:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ________________________ ERROR at setup of test_status _________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])  wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_install.py:57:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_install.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  ERROR modules/testing/tests/test_agent/test_install.py::test_installation - E...  ERROR modules/testing/tests/test_agent/test_install.py::test_status - Excepti...  ================== 13 warnings, 2 errors in 631.25s (0:10:31) ==================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:28:58] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test install for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_install.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:28:58] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:28:58] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:28:58] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test registration for agent] ********************************************* fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_registration.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:10:32.143791'  end: '2024-04-23 23:39:33.214340'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:29:01.070549'  stderr: ''  stderr_lines:   stdout: |-  [37m[2024-04-23 23:29:01] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:29:01] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 4 items    modules/testing/tests/test_agent/test_registration.py::test_status [32m[2024-04-23 23:29:01] [INFO] TESTER: Checking connection to desktop-10[0m  [33m[2024-04-23 23:29:31] [WARNING] TESTER: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:30:31] [WARNING] TESTER: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:31:31] [WARNING] TESTER: Error on attempt 3 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:32:32] [WARNING] TESTER: Error on attempt 4 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:33:32] [WARNING] TESTER: Error on attempt 5 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:34:32] [WARNING] TESTER: Error on attempt 6 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:35:32] [WARNING] TESTER: Error on attempt 7 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:36:32] [WARNING] TESTER: Error on attempt 8 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:37:32] [WARNING] TESTER: Error on attempt 9 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:38:32] [WARNING] TESTER: Error on attempt 10 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [31m[2024-04-23 23:39:02] [ERROR] TESTER: Connection attempts failed after 10 tries. Connection timeout in desktop-10[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  ERROR  modules/testing/tests/test_agent/test_registration.py::test_service ERROR  modules/testing/tests/test_agent/test_registration.py::test_connection ERROR  modules/testing/tests/test_agent/test_registration.py::test_clientKeys ERROR    ==================================== ERRORS ====================================  ________________________ ERROR at setup of test_status _________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_registration.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ________________________ ERROR at setup of test_service ________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_registration.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ______________________ ERROR at setup of test_connection _______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_registration.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ______________________ ERROR at setup of test_clientKeys _______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_registration.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_registration.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  ERROR modules/testing/tests/test_agent/test_registration.py::test_status - Ex...  ERROR modules/testing/tests/test_agent/test_registration.py::test_service - E...  ERROR modules/testing/tests/test_agent/test_registration.py::test_connection  ERROR modules/testing/tests/test_agent/test_registration.py::test_clientKeys  ================== 13 warnings, 4 errors in 631.41s (0:10:31) ==================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:39:33] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test registration for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_registration.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:39:33] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:39:33] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:39:33] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test connection for agent] *********************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_connection.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:10:32.255764'  end: '2024-04-23 23:50:07.800953'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:39:35.545189'  stderr: ''  stderr_lines:   stdout: |-  [37m[2024-04-23 23:39:36] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:39:36] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 6 items    modules/testing/tests/test_agent/test_connection.py::test_connection [32m[2024-04-23 23:39:36] [INFO] TESTER: Checking connection to desktop-10[0m  [33m[2024-04-23 23:40:06] [WARNING] TESTER: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:41:06] [WARNING] TESTER: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:42:06] [WARNING] TESTER: Error on attempt 3 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:43:06] [WARNING] TESTER: Error on attempt 4 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:44:06] [WARNING] TESTER: Error on attempt 5 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:45:06] [WARNING] TESTER: Error on attempt 6 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:46:06] [WARNING] TESTER: Error on attempt 7 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:47:06] [WARNING] TESTER: Error on attempt 8 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:48:06] [WARNING] TESTER: Error on attempt 9 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:49:06] [WARNING] TESTER: Error on attempt 10 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [31m[2024-04-23 23:49:36] [ERROR] TESTER: Connection attempts failed after 10 tries. Connection timeout in desktop-10[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  ERROR  modules/testing/tests/test_agent/test_connection.py::test_status ERROR  modules/testing/tests/test_agent/test_connection.py::test_service ERROR  modules/testing/tests/test_agent/test_connection.py::test_clientKeys ERROR  modules/testing/tests/test_agent/test_connection.py::test_port ERROR  modules/testing/tests/test_agent/test_connection.py::test_processes ERROR    ==================================== ERRORS ====================================  ______________________ ERROR at setup of test_connection _______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])  wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_connection.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ________________________ ERROR at setup of test_status _________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])  wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_connection.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ________________________ ERROR at setup of test_service ________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])  wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_connection.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ______________________ ERROR at setup of test_clientKeys _______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])  wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_connection.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  _________________________ ERROR at setup of test_port __________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])  wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_connection.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  _______________________ ERROR at setup of test_processes _______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])  wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_connection.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_connection.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  ERROR modules/testing/tests/test_agent/test_connection.py::test_connection - ...  ERROR modules/testing/tests/test_agent/test_connection.py::test_status - Exce...  ERROR modules/testing/tests/test_agent/test_connection.py::test_service - Exc...  ERROR modules/testing/tests/test_agent/test_connection.py::test_clientKeys - ...  ERROR modules/testing/tests/test_agent/test_connection.py::test_port - Except...  ERROR modules/testing/tests/test_agent/test_connection.py::test_processes - E...  ================== 13 warnings, 6 errors in 631.51s (0:10:31) ==================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-23 23:50:08] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test connection for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_connection.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-23 23:50:08] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-23 23:50:08] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-23 23:50:08] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test basic_info for agent] *********************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_basic_info.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:10:32.813152'  end: '2024-04-24 00:00:43.022174'  msg: non-zero return code  rc: 1  start: '2024-04-23 23:50:10.209022'  stderr: ''  stderr_lines:   stdout: |-  [37m[2024-04-23 23:50:10] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-23 23:50:10] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version [32m[2024-04-23 23:50:10] [INFO] TESTER: Checking connection to desktop-10[0m  [33m[2024-04-23 23:50:40] [WARNING] TESTER: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:51:41] [WARNING] TESTER: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:52:41] [WARNING] TESTER: Error on attempt 3 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:53:41] [WARNING] TESTER: Error on attempt 4 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:54:41] [WARNING] TESTER: Error on attempt 5 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:55:41] [WARNING] TESTER: Error on attempt 6 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:56:41] [WARNING] TESTER: Error on attempt 7 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:57:41] [WARNING] TESTER: Error on attempt 8 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:58:41] [WARNING] TESTER: Error on attempt 9 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-23 23:59:41] [WARNING] TESTER: Error on attempt 10 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [31m[2024-04-24 00:00:11] [ERROR] TESTER: Connection attempts failed after 10 tries. Connection timeout in desktop-10[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  ERROR  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version ERROR  modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision ERROR    ==================================== ERRORS ====================================  ___________________ ERROR at setup of test_wazuh_os_version ____________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])  wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_basic_info.py:57:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  _____________________ ERROR at setup of test_wazuh_version _____________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])  wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_basic_info.py:57:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ____________________ ERROR at setup of test_wazuh_revision _____________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])  wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_basic_info.py:57:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_basic_info.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  ERROR modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_os_version  ERROR modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_version  ERROR modules/testing/tests/test_agent/test_basic_info.py::test_wazuh_revision  ================== 13 warnings, 3 errors in 631.95s (0:10:31) ==================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-24 00:00:43] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test basic_info for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_basic_info.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-24 00:00:43] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-24 00:00:43] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-24 00:00:43] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test restart for agent] ************************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_restart.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:10:34.402443'  end: '2024-04-24 00:11:22.328377'  msg: non-zero return code  rc: 1  start: '2024-04-24 00:00:47.925934'  stderr: ''  stderr_lines:   stdout: |-  [37m[2024-04-24 00:00:48] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-24 00:00:48] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 7 items    modules/testing/tests/test_agent/test_restart.py::test_restart [32m[2024-04-24 00:00:49] [INFO] TESTER: Checking connection to desktop-10[0m  [33m[2024-04-24 00:01:19] [WARNING] TESTER: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:02:19] [WARNING] TESTER: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:03:19] [WARNING] TESTER: Error on attempt 3 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:04:19] [WARNING] TESTER: Error on attempt 4 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:05:19] [WARNING] TESTER: Error on attempt 5 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:06:19] [WARNING] TESTER: Error on attempt 6 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:07:19] [WARNING] TESTER: Error on attempt 7 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:08:20] [WARNING] TESTER: Error on attempt 8 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:09:20] [WARNING] TESTER: Error on attempt 9 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:10:20] [WARNING] TESTER: Error on attempt 10 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [31m[2024-04-24 00:10:50] [ERROR] TESTER: Connection attempts failed after 10 tries. Connection timeout in desktop-10[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  ERROR  modules/testing/tests/test_agent/test_restart.py::test_status ERROR  modules/testing/tests/test_agent/test_restart.py::test_connection ERROR  modules/testing/tests/test_agent/test_restart.py::test_isActive ERROR  modules/testing/tests/test_agent/test_restart.py::test_clientKeys ERROR  modules/testing/tests/test_agent/test_restart.py::test_port ERROR  modules/testing/tests/test_agent/test_restart.py::test_processes ERROR    ==================================== ERRORS ====================================  ________________________ ERROR at setup of test_restart ________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_restart.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ________________________ ERROR at setup of test_status _________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_restart.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ______________________ ERROR at setup of test_connection _______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_restart.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  _______________________ ERROR at setup of test_isActive ________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_restart.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ______________________ ERROR at setup of test_clientKeys _______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_restart.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  _________________________ ERROR at setup of test_port __________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_restart.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  _______________________ ERROR at setup of test_processes _______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_restart.py:56:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_restart.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  ERROR modules/testing/tests/test_agent/test_restart.py::test_restart - Except...  ERROR modules/testing/tests/test_agent/test_restart.py::test_status - Excepti...  ERROR modules/testing/tests/test_agent/test_restart.py::test_connection - Exc...  ERROR modules/testing/tests/test_agent/test_restart.py::test_isActive - Excep...  ERROR modules/testing/tests/test_agent/test_restart.py::test_clientKeys - Exc...  ERROR modules/testing/tests/test_agent/test_restart.py::test_port - Exception...  ERROR modules/testing/tests/test_agent/test_restart.py::test_processes - Exce...  ================== 13 warnings, 7 errors in 632.81s (0:10:32) ==================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-24 00:11:22] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test restart for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_restart.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-24 00:11:22] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-24 00:11:22] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-24 00:11:22] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test stop for agent] ***************************************************** fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_stop.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:11:03.767062'  end: '2024-04-24 00:22:31.123547'  msg: non-zero return code  rc: 1  start: '2024-04-24 00:11:27.356485'  stderr: ''  stderr_lines:   stdout: |-  [37m[2024-04-24 00:11:28] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-24 00:11:28] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 3 items    modules/testing/tests/test_agent/test_stop.py::test_service [32m[2024-04-24 00:11:28] [INFO] TESTER: Checking connection to desktop-10[0m  [33m[2024-04-24 00:11:58] [WARNING] TESTER: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:12:58] [WARNING] TESTER: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:13:58] [WARNING] TESTER: Error on attempt 3 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:14:59] [WARNING] TESTER: Error on attempt 4 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:15:59] [WARNING] TESTER: Error on attempt 5 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:16:59] [WARNING] TESTER: Error on attempt 6 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:17:59] [WARNING] TESTER: Error on attempt 7 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:18:59] [WARNING] TESTER: Error on attempt 8 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:19:59] [WARNING] TESTER: Error on attempt 9 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:20:59] [WARNING] TESTER: Error on attempt 10 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [31m[2024-04-24 00:21:29] [ERROR] TESTER: Connection attempts failed after 10 tries. Connection timeout in desktop-10[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  ERROR  modules/testing/tests/test_agent/test_stop.py::test_port ERROR  modules/testing/tests/test_agent/test_stop.py::test_processes ERROR[32m[2024-04-24 00:22:00] [INFO] TESTER: Restarting wazuh-agent in desktop-10[0m  commands  NET STOP Wazuh    modules/testing/tests/test_agent/test_stop.py::test_processes ERROR    ==================================== ERRORS ====================================  ________________________ ERROR at setup of test_service ________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_stop.py:59:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  _________________________ ERROR at setup of test_port __________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_stop.py:59:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  _______________________ ERROR at setup of test_processes _______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_stop.py:59:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  _____________________ ERROR at teardown of test_processes ______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = 'NET STOP Wazuh'    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = 'NET STOP Wazuh'    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = 'NET STOP Wazuh'    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: NET STOP Wazuh with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    request = >    @pytest.fixture(scope="module", autouse=True)  def wazuh_params(request):  wazuh_version = request.config.getoption('--wazuh_version')  wazuh_revision = request.config.getoption('--wazuh_revision')  dependencies = request.config.getoption('--dependencies')  targets = request.config.getoption('--targets')  live = request.config.getoption('--live')    params = {  'wazuh_version': wazuh_version,  'wazuh_revision': wazuh_revision,  'dependencies': dependencies,  'targets': targets,  'live': live  }    yield params    for agent_names, agent_params in params['agents'].items():  > GeneralComponentActions.component_restart(agent_params, 'wazuh-agent')    modules/testing/tests/test_agent/test_stop.py:32:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:656: in component_restart  ConnectionManager.execute_commands(inventory_path, 'NET STOP Wazuh')  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = 'NET STOP Wazuh'    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: NET STOP Wazuh with error: Error executing command: NET STOP Wazuh with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_stop.py: 12 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  ERROR modules/testing/tests/test_agent/test_stop.py::test_service - Exception...  ERROR modules/testing/tests/test_agent/test_stop.py::test_port - Exception: E...  ERROR modules/testing/tests/test_agent/test_stop.py::test_processes - Excepti...  ERROR modules/testing/tests/test_agent/test_stop.py::test_processes - Excepti...  ================== 14 warnings, 4 errors in 662.15s (0:11:02) ==================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-24 00:22:31] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test stop for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_stop.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-24 00:22:31] [DEBUG] TESTER: Rendering template /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-24 00:22:31] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-24 00:22:31] [DEBUG] TESTER: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] Using /etc/ansible/ansible.cfg as config file PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Test uninstall for agent] ************************************************ fatal: [localhost]: FAILED! => changed=true   cmd:  - python3  - -m  - pytest  - modules/testing/tests/test_agent/test_uninstall.py  - -v  - --wazuh_version=4.7.3  - --wazuh_revision=40714  - --component=agent  - --dependencies={}  - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}'  - --live=True  - -s  delta: '0:10:33.917650'  end: '2024-04-24 00:33:10.138312'  msg: non-zero return code  rc: 1  start: '2024-04-24 00:22:36.220662'  stderr: ''  stderr_lines:   stdout: |-  [37m[2024-04-24 00:22:37] [DEBUG] SPNEGO._GSS: Python gssapi not available, cannot use any GSSAPIProxy protocols: No module named 'gssapi'[0m  [37m[2024-04-24 00:22:37] [DEBUG] SPNEGO._GSS: Python gssapi IOV extension not available: No module named 'gssapi'[0m  ============================= test session starts ==============================  platform linux -- Python 3.10.14, pytest-7.4.4, pluggy-1.4.0 -- /home/fcaffieri/wazuh-env/wazuh-qa/.venv/bin/python3  cachedir: .pytest_cache  rootdir: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules  collecting ... collected 5 items    modules/testing/tests/test_agent/test_uninstall.py::test_uninstall [32m[2024-04-24 00:22:37] [INFO] TESTER: Checking connection to desktop-10[0m  [33m[2024-04-24 00:23:07] [WARNING] TESTER: Error on attempt 1 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:24:07] [WARNING] TESTER: Error on attempt 2 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:25:08] [WARNING] TESTER: Error on attempt 3 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:26:08] [WARNING] TESTER: Error on attempt 4 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:27:08] [WARNING] TESTER: Error on attempt 5 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:28:08] [WARNING] TESTER: Error on attempt 6 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:29:08] [WARNING] TESTER: Error on attempt 7 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:30:08] [WARNING] TESTER: Error on attempt 8 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:31:08] [WARNING] TESTER: Error on attempt 9 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [33m[2024-04-24 00:32:08] [WARNING] TESTER: Error on attempt 10 of 10: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))[0m  [31m[2024-04-24 00:32:38] [ERROR] TESTER: Connection attempts failed after 10 tries. Connection timeout in desktop-10[0m  import  por ejecutar  commands  Get-Service -Name 'Wazuh'  ERROR  modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory ERROR  modules/testing/tests/test_agent/test_uninstall.py::test_service ERROR  modules/testing/tests/test_agent/test_uninstall.py::test_port ERROR  modules/testing/tests/test_agent/test_uninstall.py::test_processes ERROR    ==================================== ERRORS ====================================  _______________________ ERROR at setup of test_uninstall _______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_uninstall.py:57:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ______________ ERROR at setup of test_agent_uninstalled_directory ______________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_uninstall.py:57:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  ________________________ ERROR at setup of test_service ________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_uninstall.py:57:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  _________________________ ERROR at setup of test_port __________________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_uninstall.py:57:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))   [0;31m modules/testing/tests/helpers/executor.py:147: Exception  _______________________ ERROR at setup of test_processes _______________________    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  > sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:203:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:85: in create_connection  raise err  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    address = ('ec2-54-173-230-126.compute-1.amazonaws.com', 5986), timeout = 30  source_address = None, socket_options = [(6, 1, 1)]    def create_connection(  address: tuple[str, int],  timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,  source_address: tuple[str, int] | None = None,  socket_options: _TYPE_SOCKET_OPTIONS | None = None,  ) -> socket.socket:  """Connect to *address* and return the socket object.    Convenience function. Connect to *address* (a 2-tuple ``(host,  port)``) and return the socket object. Passing the optional  *timeout* parameter will set the timeout on the socket instance  before attempting to connect. If no *timeout* is supplied, the  global default timeout setting returned by :func:`socket.getdefaulttimeout`  is used. If *source_address* is set it must be a tuple of (host, port)  for the socket to bind as a source address before making the connection.  An host of '' or port 0 tells the OS to use the default.  """    host, port = address  if host.startswith("["):  host = host.strip("[]")  err = None    # Using the value from allowed_gai_family() in the context of getaddrinfo lets  # us select whether to work with IPv4 DNS records, IPv6 records, or both.  # The original create_connection function always returns all records.  family = allowed_gai_family()    try:  host.encode("idna")  except UnicodeError:  raise LocationParseError(f"'{host}', label empty or too long") from None    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):  af, socktype, proto, canonname, sa = res  sock = None  try:  sock = socket.socket(af, socktype, proto)    # If provided, set socket level options before connecting.  _set_socket_options(sock, socket_options)    if timeout is not _DEFAULT_TIMEOUT:  sock.settimeout(timeout)  if source_address:  sock.bind(source_address)  > sock.connect(sa)  E TimeoutError: timed out    ../.venv/lib/python3.10/site-packages/urllib3/util/connection.py:73: TimeoutError    The above exception was the direct cause of the following exception:    self =   method = 'POST', url = '/wsman'  body = b'\n  release_this_conn = release_conn    http_tunnel_required = connection_requires_http_tunnel(  self.proxy, self.proxy_config, destination_scheme  )    # Merge the proxy headers. Only done when not using HTTP CONNECT. We  # have to copy the headers dict so we can safely change it without those  # changes being reflected in anyone else's copy.  if not http_tunnel_required:  headers = headers.copy() # type: ignore[attr-defined]  headers.update(self.proxy_headers) # type: ignore[union-attr]    # Must keep the exception bound to a separate variable or else Python 3  # complains about UnboundLocalError.  err = None    # Keep track of whether we cleanly exited the except block. This  # ensures we do proper cleanup in finally.  clean_exit = False    # Rewind body position, if needed. Record current position  # for future rewinds in the event of a redirect/retry.  body_pos = set_file_position(body, body_pos)    try:  # Request a connection from the queue.  timeout_obj = self._get_timeout(timeout)  conn = self._get_conn(timeout=pool_timeout)    conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment]    # Is this a closed/new connection that requires CONNECT tunnelling?  if self.proxy is not None and http_tunnel_required and conn.is_closed:  try:  self._prepare_proxy(conn)  except (BaseSSLError, OSError, SocketTimeout) as e:  self._raise_timeout(  err=e, url=self.proxy.url, timeout_value=conn.timeout  )  raise    # If we're going to release the connection in ``finally:``, then  # the response doesn't need to know about the connection. Otherwise  # it will also try to release it and we'll have a double-release  # mess.  response_conn = conn if not release_conn else None    # Make the request on the HTTPConnection object  > response = self._make_request(  conn,  method,  url,  timeout=timeout_obj,  body=body,  headers=headers,  chunked=chunked,  retries=retries,  response_conn=response_conn,  preload_content=preload_content,  decode_content=decode_content,  **response_kw,  )    ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:791:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:492: in _make_request  raise new_e  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:468: in _make_request  self._validate_conn(conn)  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:1097: in _validate_conn  conn.connect()  ../.venv/lib/python3.10/site-packages/urllib3/connection.py:611: in connect  self.sock = sock = self._new_conn()  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =     def _new_conn(self) -> socket.socket:  """Establish a socket connection and set nodelay settings on it.    :return: New socket connection.  """  try:  sock = connection.create_connection(  (self._dns_host, self.port),  self.timeout,  source_address=self.source_address,  socket_options=self.socket_options,  )  except socket.gaierror as e:  raise NameResolutionError(self.host, self, e) from e  except SocketTimeout as e:  > raise ConnectTimeoutError(  self,  f"Connection to {self.host} timed out. (connect timeout={self.timeout})",  ) from e  E urllib3.exceptions.ConnectTimeoutError: (, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')    ../.venv/lib/python3.10/site-packages/urllib3/connection.py:212: ConnectTimeoutError    The above exception was the direct cause of the following exception:    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  > resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    ../.venv/lib/python3.10/site-packages/requests/adapters.py:486:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/urllib3/connectionpool.py:845: in urlopen  retries = retries.increment(  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self = Retry(total=0, connect=None, read=False, redirect=None, status=None)  method = 'POST', url = '/wsman', response = None  error = ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)')  _pool =   _stacktrace =     def increment(  self,  method: str | None = None,  url: str | None = None,  response: BaseHTTPResponse | None = None,  error: Exception | None = None,  _pool: ConnectionPool | None = None,  _stacktrace: TracebackType | None = None,  ) -> Retry:  """Return a new Retry object with incremented retry counters.    :param response: A response object, or None, if the server did not  return a response.  :type response: :class:`~urllib3.response.BaseHTTPResponse`  :param Exception error: An error encountered during the request, or  None if the response was received successfully.    :return: A new ``Retry`` object.  """  if self.total is False and error:  # Disabled, indicate to re-raise the error.  raise reraise(type(error), error, _stacktrace)    total = self.total  if total is not None:  total -= 1    connect = self.connect  read = self.read  redirect = self.redirect  status_count = self.status  other = self.other  cause = "unknown"  status = None  redirect_location = None    if error and self._is_connection_error(error):  # Connect retry?  if connect is False:  raise reraise(type(error), error, _stacktrace)  elif connect is not None:  connect -= 1    elif error and self._is_read_error(error):  # Read retry?  if read is False or method is None or not self._is_method_retryable(method):  raise reraise(type(error), error, _stacktrace)  elif read is not None:  read -= 1    elif error:  # Other retry?  if other is not None:  other -= 1    elif response and response.get_redirect_location():  # Redirect retry?  if redirect is not None:  redirect -= 1  cause = "too many redirects"  response_redirect_location = response.get_redirect_location()  if response_redirect_location:  redirect_location = response_redirect_location  status = response.status    else:  # Incrementing because of a server error like a 500 in  # status_forcelist and the given method is in the allowed_methods  cause = ResponseError.GENERIC_ERROR  if response and response.status:  if status_count is not None:  status_count -= 1  cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)  status = response.status    history = self.history + (  RequestHistory(method, url, error, status, redirect_location),  )    new_retry = self.new(  total=total,  connect=connect,  read=read,  redirect=redirect,  status=status_count,  other=other,  history=history,  )    if new_retry.is_exhausted():  reason = error or ResponseError(cause)  > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]  E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError    During handling of the above exception, another exception occurred:    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    > ret = session.run_ps(command)    modules/testing/tests/helpers/executor.py:175:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:52: in run_ps  rs = self.run_cmd('powershell -encodedcommand {0}'.format(encoded_ps))  ../.venv/lib/python3.10/site-packages/winrm/__init__.py:39: in run_cmd  shell_id = self.protocol.open_shell()  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:166: in open_shell  res = self.send_message(xmltodict.unparse(req))  ../.venv/lib/python3.10/site-packages/winrm/protocol.py:243: in send_message  resp = self.transport.send_message(message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:323: in send_message  response = self._send_message_request(prepared_request, message)  ../.venv/lib/python3.10/site-packages/winrm/transport.py:328: in _send_message_request  response = self.session.send(prepared_request, timeout=self.read_timeout_sec)  ../.venv/lib/python3.10/site-packages/requests/sessions.py:703: in send  r = adapter.send(request, **kwargs)  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    self =   request = , stream = False  timeout = Timeout(connect=30, read=30, total=None), verify = False, cert = None  proxies = OrderedDict()    def send(  self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None  ):  """Sends PreparedRequest object. Returns Response object.    :param request: The :class:`PreparedRequest ` being sent.  :param stream: (optional) Whether to stream the request content.  :param timeout: (optional) How long to wait for the server to send  data before giving up, as a float, or a :ref:`(connect timeout,  read timeout) ` tuple.  :type timeout: float or tuple or urllib3 Timeout object  :param verify: (optional) Either a boolean, in which case it controls whether  we verify the server's TLS certificate, or a string, in which case it  must be a path to a CA bundle to use  :param cert: (optional) Any user-provided SSL certificate to be trusted.  :param proxies: (optional) The proxies dictionary to apply to the request.  :rtype: requests.Response  """    try:  conn = self.get_connection(request.url, proxies)  except LocationValueError as e:  raise InvalidURL(e, request=request)    self.cert_verify(conn, request.url, verify, cert)  url = self.request_url(request, proxies)  self.add_headers(  request,  stream=stream,  timeout=timeout,  verify=verify,  cert=cert,  proxies=proxies,  )    chunked = not (request.body is None or "Content-Length" in request.headers)    if isinstance(timeout, tuple):  try:  connect, read = timeout  timeout = TimeoutSauce(connect=connect, read=read)  except ValueError:  raise ValueError(  f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "  f"or a single float to set both timeouts to the same value."  )  elif isinstance(timeout, TimeoutSauce):  pass  else:  timeout = TimeoutSauce(connect=timeout, read=timeout)    try:  resp = conn.urlopen(  method=request.method,  url=url,  body=request.body,  headers=request.headers,  redirect=False,  assert_same_host=False,  preload_content=False,  decode_content=False,  retries=self.max_retries,  timeout=timeout,  chunked=chunked,  )    except (ProtocolError, OSError) as err:  raise ConnectionError(err, request=request)    except MaxRetryError as e:  if isinstance(e.reason, ConnectTimeoutError):  # TODO: Remove this in 3.0.0: see #2811  if not isinstance(e.reason, NewConnectionError):  > raise ConnectTimeout(e, request=request)  E requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    ../.venv/lib/python3.10/site-packages/requests/adapters.py:507: ConnectTimeout    During handling of the above exception, another exception occurred:    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  > result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)    modules/testing/tests/helpers/executor.py:141:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    data = {'host': 'ec2-54-173-230-126.compute-1.amazonaws.com', 'password': 'N6FxfB3wVGg', 'port': 5986, 'private_key_path': None, ...}  command = "Get-Service -Name 'Wazuh'"    @staticmethod  def _execute_command(data: ConectionInventory, command) -> dict:  if data.get('port') == 5986:  protocol = 'https'  else:  protocol = 'http'    endpoint_url = f"{protocol}://{data.get('host')}:{data.get('port')}"    try:  session = winrm.Session(endpoint_url, auth=(data.get('username'), data.get('password')),transport='ntlm', server_cert_validation='ignore')    ret = session.run_ps(command)    if ret.status_code == 0:  return {'success': True, 'output': ret.std_out.decode('utf-8').strip()}  else:  return {'success': False, 'output': ret.std_err.decode('utf-8').strip()}  except Exception as e:  > raise Exception(f'Error executing command: {command} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:182: Exception    During handling of the above exception, another exception occurred:    wazuh_params = {'agents': {'agent-windows-desktop-10-amd64': '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'}, 'dashboa...entory.yaml', 'dependencies': '{}', 'indexers': ['/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml'], ...}    @pytest.fixture(scope="module", autouse=True)  def setup_test_environment(wazuh_params):  targets = wazuh_params['targets']  # Clean the string and split it into key-value pairs  targets = targets.replace(' ', '')  targets = targets.replace(' ', '')  pairs = [pair.strip() for pair in targets.strip('{}').split(',')]  targets_dict = dict(pair.split(':') for pair in pairs)    wazuh_params['master'] = targets_dict.get('wazuh-1')  wazuh_params['workers'] = [value for key, value in targets_dict.items() if key.startswith('wazuh-') and key != 'wazuh-1']  wazuh_params['agents'] = [value for key, value in targets_dict.items() if key.startswith('agent')]  wazuh_params['indexers'] = [value for key, value in targets_dict.items() if key.startswith('node-')]  wazuh_params['dashboard'] = targets_dict.get('dashboard', wazuh_params['master'])    # If there are no indexers, we choose wazuh-1 by default  if not wazuh_params['indexers']:  wazuh_params['indexers'].append(wazuh_params['master'])    wazuh_params['managers'] = {key: value for key, value in targets_dict.items() if key.startswith('wazuh-')}  wazuh_params['agents'] = {key + '-' + re.findall(r'agent-(.*?)/', value)[0].replace('.',''): value for key, value in targets_dict.items() if key.startswith('agent')}    updated_agents = {}  for agent_name, agent_params in wazuh_params['agents'].items():  Utils.check_inventory_connection(agent_params)  > if GeneralComponentActions.isComponentActive(agent_params, 'wazuh-agent') and GeneralComponentActions.hasAgentClientKeys(agent_params):    modules/testing/tests/test_agent/test_uninstall.py:57:  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  modules/testing/tests/helpers/generic.py:766: in isComponentActive  result = ConnectionManager.execute_commands(inventory_path, "Get-Service -Name 'Wazuh'")  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    inventory_path = '/tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml'  commands = "Get-Service -Name 'Wazuh'"    @staticmethod  def execute_commands(inventory_path, commands) -> dict:  executor = ConnectionManager._get_executor(inventory_path)  if isinstance(commands, str):  try:  print("commands")  print(commands)  result = executor._execute_command(ConectionInventory._get_inventory_data(inventory_path), commands)  print("result.get('success')")  print(result.get('success'))  print("result.get('output')")  print(result.get('output'))  except Exception as e:  > raise Exception(f'Error executing command: {commands} with error: {e}')  E Exception: Error executing command: Get-Service -Name 'Wazuh' with error: Error executing command: Get-Service -Name 'Wazuh' with error: HTTPSConnectionPool(host='ec2-54-173-230-126.compute-1.amazonaws.com', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to ec2-54-173-230-126.compute-1.amazonaws.com timed out. (connect timeout=30)'))    modules/testing/tests/helpers/executor.py:147: Exception  =============================== warnings summary ===============================  modules/provision/models.py:36  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('dependencies', pre=True)    modules/provision/models.py:64  /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/  @validator('install', 'uninstall', pre=True)    testing/tests/test_agent/test_uninstall.py: 11 warnings  /home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/winrm/transport.py:349: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()  argspec = set(inspect.getargspec(function).args)    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html  =========================== short test summary info ============================  ERROR modules/testing/tests/test_agent/test_uninstall.py::test_uninstall - Ex...  ERROR modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory  ERROR modules/testing/tests/test_agent/test_uninstall.py::test_service - Exce...  ERROR modules/testing/tests/test_agent/test_uninstall.py::test_port - Excepti...  ERROR modules/testing/tests/test_agent/test_uninstall.py::test_processes - Ex...  ================== 13 warnings, 5 errors in 632.15s (0:10:32) ==================  stdout_lines:  PLAY RECAP ********************************************************************* localhost : ok=1  changed=0 unreachable=0 failed=1  skipped=0 rescued=0 ignored=0 [2024-04-24 00:33:10] [DEBUG] TESTER: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'fcaffieri', 'tasks': [{'name': 'Test uninstall for agent', 'command': "python3 -m pytest modules/testing/tests/test_agent/test_uninstall.py -v --wazuh_version=4.7.3 --wazuh_revision=40714 --component=agent --dependencies='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-windows-desktop-10-amd64/inventory.yaml}' --live=True -s", 'args': {'chdir': '/home/fcaffieri/wazuh-env/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 1}, 'dark': {}, 'failures': {'localhost': 1}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {}} [2024-04-24 00:33:10] [INFO] TESTER: Cleaning up [2024-04-24 00:33:10] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-24 00:33:10] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* fatal: [ec2-18-208-152-12.compute-1.amazonaws.com]: UNREACHABLE! => changed=false   msg: 'Failed to connect to the host via ssh: ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  unreachable: true PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=0 changed=0 unreachable=1  failed=0 skipped=0 rescued=0 ignored=0 [2024-04-24 00:33:22] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {}, 'dark': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-24 00:33:22] [INFO] TESTER: Cleaning up [2024-04-24 00:33:22] [DEBUG] TESTER: Using inventory: {'all': {'hosts': {'ec2-18-208-152-12.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/i-0c11312b037cb398a/ubuntu-22.04-amd64-key-1361'}}}} [2024-04-24 00:33:22] [DEBUG] TESTER: Running playbook: /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml Using /etc/ansible/ansible.cfg as config file PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* fatal: [ec2-18-208-152-12.compute-1.amazonaws.com]: UNREACHABLE! => changed=false   msg: 'Failed to connect to the host via ssh: ssh: connect to host ec2-18-208-152-12.compute-1.amazonaws.com port 2200: Connection timed out'  unreachable: true PLAY RECAP ********************************************************************* ec2-18-208-152-12.compute-1.amazonaws.com : ok=0 changed=0 unreachable=1  failed=0 skipped=0 rescued=0 ignored=0 [2024-04-24 00:33:34] [DEBUG] TESTER: Playbook /home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {}, 'dark': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-18-208-152-12.compute-1.amazonaws.com': 1}, 'changed': {}}  [2024-04-24 00:33:34] [INFO] [275569] [ThreadPoolExecutor-0_1] [workflow_engine]: [run-agent-windows-desktop-10-amd64-tests] Finished task in 4514.29 seconds. [2024-04-24 00:33:34] [INFO] [275569] [MainThread] [workflow_engine]: Executing Reverse DAG tasks. [2024-04-24 00:33:34] [INFO] [275569] [MainThread] [workflow_engine]: Executing tasks in parallel. [2024-04-24 00:33:34] [INFO] [275569] [ThreadPoolExecutor-1_0] [workflow_engine]: [allocate-agent-linux-ubuntu-20.04-amd64] Starting task. [2024-04-24 00:33:34] [DEBUG] [275569] [ThreadPoolExecutor-1_0] [workflow_engine]: Running task "allocate-agent-linux-ubuntu-20.04-amd64" with arguments: ['modules/allocation/main.py', '--action=delete', '--track-output=/tmp/dtt1-poc/agent-linux-ubuntu-20.04-amd64/track.yaml'] [2024-04-24 00:33:34] [INFO] [275569] [ThreadPoolExecutor-1_1] [workflow_engine]: [allocate-agent-linux-debian-12-amd64] Starting task. [2024-04-24 00:33:34] [DEBUG] [275569] [ThreadPoolExecutor-1_1] [workflow_engine]: Running task "allocate-agent-linux-debian-12-amd64" with arguments: ['modules/allocation/main.py', '--action=delete', '--track-output=/tmp/dtt1-poc/agent-linux-debian-12-amd64/track.yaml'] [2024-04-24 00:33:34] [INFO] [275569] [ThreadPoolExecutor-1_2] [workflow_engine]: [allocate-agent-linux-oracle-9-amd64] Starting task. [2024-04-24 00:33:34] [DEBUG] [275569] [ThreadPoolExecutor-1_2] [workflow_engine]: Running task "allocate-agent-linux-oracle-9-amd64" with arguments: ['modules/allocation/main.py', '--action=delete', '--track-output=/tmp/dtt1-poc/agent-linux-oracle-9-amd64/track.yaml'] [2024-04-24 00:33:38] [ERROR] [275569] [ThreadPoolExecutor-1_2] [workflow_engine]: [allocate-agent-linux-oracle-9-amd64] Task failed with error: Error executing process task Traceback (most recent call last): File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/main.py", line 39, in main() File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/main.py", line 35, in main Allocator.run(InputPayload(**vars(parse_arguments()))) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/allocation.py", line 40, in run return cls.__delete(payload) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/allocation.py", line 90, in __delete provider.destroy_instance(models.InstancePayload(**dict(track))) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/generic/provider.py", line 101, in destroy_instance cls._destroy_instance(destroy_parameters) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/aws/provider.py", line 176, in _destroy_instance instance.delete() File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/aws/instance.py", line 63, in delete self._instance.terminate() File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/boto3/resources/factory.py", line 580, in do_action response = action(self, *args, **kwargs) File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/boto3/resources/action.py", line 88, in __call__ response = getattr(parent.meta.client, operation_name)(*args, **params) File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/botocore/client.py", line 535, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/botocore/client.py", line 983, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (InvalidInstanceID.NotFound) when calling the TerminateInstances operation: The instance ID 'i-0e25020c9e8ca19ce' does not exist . [2024-04-24 00:33:38] [WARNING] [275569] [ThreadPoolExecutor-1_2] [workflow_engine]: [allocate-agent-linux-centos-8-amd64] Skipping task due to dependency failure. [2024-04-24 00:33:38] [WARNING] [275569] [ThreadPoolExecutor-1_2] [workflow_engine]: [allocate-agent-linux-redhat-9-amd64] Skipping task due to dependency failure. [2024-04-24 00:33:38] [WARNING] [275569] [ThreadPoolExecutor-1_2] [workflow_engine]: [allocate-agent-windows-desktop-10-amd64] Skipping task due to dependency failure. [2024-04-24 00:33:38] [WARNING] [275569] [ThreadPoolExecutor-1_2] [workflow_engine]: [allocate-agent-windows-server-2012r2-amd64] Skipping task due to dependency failure. [2024-04-24 00:33:38] [WARNING] [275569] [ThreadPoolExecutor-1_2] [workflow_engine]: [allocate-agent-windows-server-2016-amd64] Skipping task due to dependency failure. [2024-04-24 00:33:38] [WARNING] [275569] [ThreadPoolExecutor-1_2] [workflow_engine]: [allocate-agent-windows-server-2019-amd64] Skipping task due to dependency failure. [2024-04-24 00:33:38] [WARNING] [275569] [ThreadPoolExecutor-1_2] [workflow_engine]: [allocate-agent-windows-server-2022-amd64] Skipping task due to dependency failure. [2024-04-24 00:33:38] [ERROR] [275569] [ThreadPoolExecutor-1_1] [workflow_engine]: [allocate-agent-linux-debian-12-amd64] Task failed with error: Error executing process task Traceback (most recent call last): File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/main.py", line 39, in main() File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/main.py", line 35, in main Allocator.run(InputPayload(**vars(parse_arguments()))) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/allocation.py", line 40, in run return cls.__delete(payload) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/allocation.py", line 90, in __delete provider.destroy_instance(models.InstancePayload(**dict(track))) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/generic/provider.py", line 101, in destroy_instance cls._destroy_instance(destroy_parameters) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/aws/provider.py", line 176, in _destroy_instance instance.delete() File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/aws/instance.py", line 63, in delete self._instance.terminate() File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/boto3/resources/factory.py", line 580, in do_action response = action(self, *args, **kwargs) File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/boto3/resources/action.py", line 88, in __call__ response = getattr(parent.meta.client, operation_name)(*args, **params) File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/botocore/client.py", line 535, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/botocore/client.py", line 983, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (InvalidInstanceID.NotFound) when calling the TerminateInstances operation: The instance ID 'i-07299b4ee85290836' does not exist . [2024-04-24 00:33:38] [ERROR] [275569] [ThreadPoolExecutor-1_0] [workflow_engine]: [allocate-agent-linux-ubuntu-20.04-amd64] Task failed with error: Error executing process task Traceback (most recent call last): File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/main.py", line 39, in main() File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/main.py", line 35, in main Allocator.run(InputPayload(**vars(parse_arguments()))) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/allocation.py", line 40, in run return cls.__delete(payload) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/allocation.py", line 90, in __delete provider.destroy_instance(models.InstancePayload(**dict(track))) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/generic/provider.py", line 101, in destroy_instance cls._destroy_instance(destroy_parameters) File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/aws/provider.py", line 176, in _destroy_instance instance.delete() File "/home/fcaffieri/wazuh-env/wazuh-qa/deployability/modules/allocation/aws/instance.py", line 63, in delete self._instance.terminate() File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/boto3/resources/factory.py", line 580, in do_action response = action(self, *args, **kwargs) File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/boto3/resources/action.py", line 88, in __call__ response = getattr(parent.meta.client, operation_name)(*args, **params) File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/botocore/client.py", line 535, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/fcaffieri/wazuh-env/wazuh-qa/.venv/lib/python3.10/site-packages/botocore/client.py", line 983, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (InvalidInstanceID.NotFound) when calling the TerminateInstances operation: The instance ID 'i-0ece015de0adea97b' does not exist . [2024-04-24 00:33:38] [WARNING] [275569] [ThreadPoolExecutor-1_2] [workflow_engine]: [allocate-manager-linux-ubuntu-22.04-amd64] Skipping task due to dependency failure.