wazuh / wazuh-qa

Wazuh - Quality Assurance
GNU General Public License v2.0
61 stars 30 forks source link

DTT1 - Iteration 3 - Test module - Improve Wazuh agent tests #4843

Closed QU3B1M closed 1 month ago

QU3B1M commented 4 months ago

Epic #4495

Description

This issue aims to improve and complete the wazuh-agent tests generated in the first iterations of DTT1

Tasks

QU3B1M commented 4 months ago

Update report

Created a small library to handle WazuhAPI requests and responses with the purpose of simplifying the API testing for current and future tests. The library contains three files and for now is included inside the tests helpers, later, if its approved it could be configured to be an installable library.

Files:

QU3B1M commented 3 months ago

Update report

About check-files on test Install:

In the current approach the provision module is in charge of installing the wazuh-agent, so there is no easy way to take a snapshot of the system files before and after the installation to validate for changes.

If we want to maintain the test "simple" and "modularized" to only do validations, we won't be able to do the check-files, at least with the desired approach.

fcaffieri commented 3 months ago

Review

All test LGTM

The item Test install - Add checkfiles close-word will be analyzed and discussed with @davidjiglesias and then the appropriate implementation since the current implementation is not valid.

pro-akim commented 3 months ago

Update

In the evaluation and development of the best model for performing checkfiles

pro-akim commented 3 months ago

Update

First of all, it was determined in the discussion with the team that the installation and uninstallation tests should consider the installation and uninstallation of components within the test module itself.

On the other hand, we will investigate how to instrument the checkfile.

Steps to follow:


Research about check-files

It is clear that to achieve the check-file, we will have to take a snapshot of the directories and files before and after the 'action'.

Linux/MacOS Options - Directory and files ``` find {directory_path} -type f -o -type d | wc -l ``` - Only directory ``` find {directory_path} -type d | wc -l ``` - Only files ``` find {directory_path} -type f | wc -l ``` - Permissions ``` find {directory_path} -type f -o -type d -exec stat -c '%a' {} \; | sort | uniq -c ```
Windows Options - Only files (only works in cmd) ``` dir /a-d /b /s | findstr /v /c:"\\.$" /c:"\\..$"| find /c ":" ``` - Only files (only works in powershell) ``` (Get-ChildItem -File -Recurse | Where-Object { $_.FullName -notmatch '\\\.$' -and $_.FullName -notmatch '\\\.\.$' }).Count ```

Define tests that will be done and their sequence of action

  1. [install]
  2. [register]
  3. basic_info
  4. repo
  5. connection
  6. stop
  7. restart
  8. [uninstall]

Reference: [] : fixed positions. The rest of the test can change the order.

Install and uninstall should be the start and the end of the sequence.

If the workflow does not require the install and the register, this should be done implicitly by the provision module without the validations of the stages.

In case the install and the register are not required by the user, the test will fail due to a lack of agent installation and registration.


Research actions

Agent:

Install ### Linux - RPM - amd64 ```bash curl -o wazuh-agent-{ wazuh_version }-{ wazuh_revision }.x86_64.rpm https://{ aws s3 }.wazuh.com/{ repository }/yum/wazuh-agent-{ wazuh_version }-{ wazuh_revision }.x86_64.rpm && sudo WAZUH_MANAGER='{ dependency_ip }' rpm -ihv wazuh-agent-4.7.2-1.x86_64.rpm ``` - aarch64 ```bash curl -o wazuh-agent-{ wazuh_version }-{ wazuh_revision }.aarch64.rpm https://{ aws s3 }.wazuh.com/{ repository }/yum/wazuh-agent-{ wazuh_version }-{ wazuh_revision }.aarch64.rpm && sudo WAZUH_MANAGER='{ dependency_ip }' rpm -ihv wazuh-agent-{ wazuh_version }-{ wazuh_revision }.aarch64.rpm ``` - DEB - amd64 ```bash wget https://https://{ aws s3 }.wazuh.com/{ repository }/apt/pool/main/w/wazuh-agent/wazuh-agent_{ wazuh_version }-{ wazuh_revision }_amd64.deb && sudo WAZUH_MANAGER='{ dependency_ip }' dpkg -i ./wazuh-agent_{ wazuh_version }-{ wazuh_revision }_amd64.deb ``` - aarch64 ```bash wget https://https://{ aws s3 }.wazuh.com/{ repository }/apt/pool/main/w/wazuh-agent/wazuh-agent_{ wazuh_version }-{ wazuh_revision }_arm64.deb && sudo WAZUH_MANAGER='{ dependency_ip }' dpkg -i ./wazuh-agent_{ wazuh_version }-{ wazuh_revision }_arm64.deb ``` After install the agent, in all linux OS: ```bash sudo systemctl daemon-reload sudo systemctl enable wazuh-agent sudo systemctl start wazuh-agent ``` ### Windows ```bash Invoke-WebRequest -Uri https://https://{ aws s3 }.wazuh.com/{ repository }/windows/wazuh-agent-{ wazuh_version }-{ wazuh_revision }.msi -OutFile ${env.tmp}\wazuh-agent; msiexec.exe /i ${env.tmp}\wazuh-agent /q WAZUH_MANAGER='{ dependency_ip }' WAZUH_REGISTRATION_SERVER='{ dependency_ip }' ``` After install the agent, in all Windows OS: ```bash NET START WazuhSvc ``` ### MacOS - Intel ```bash curl -so wazuh-agent.pkg https://https://{ aws s3 }.wazuh.com/{ repository }/macos/wazuh-agent-{ wazuh_version }-{ wazuh_revision }.intel64.pkg && echo "WAZUH_MANAGER='{ dependency_ip }'" > /tmp/wazuh_envs && sudo installer -pkg ./wazuh-agent.pkg -target / ``` - Apple Silicon ```bash curl -so wazuh-agent.pkg https://https://{ aws s3 }.wazuh.com/{ repository }/macos/wazuh-agent-{ wazuh_version }-{ wazuh_revision }.arm64.pkg && echo "WAZUH_MANAGER='{ dependency_ip }'" > /tmp/wazuh_envs && sudo installer -pkg ./wazuh-agent.pkg -target / ``` After install the agent, in all MacOS OS: ```bash sudo /Library/Ossec/bin/wazuh-control start ```
Uninstall ### Linux ```bash yum remove wazuh-agent ``` ```bash apt-get remove wazuh-agent apt-get remove --purge wazuh-agent ``` After uninstall the agent, in all linux OS: ```bash systemctl disable wazuh-agent systemctl daemon-reload ``` ### Windows ```bash msiexec.exe /x wazuh-agent-{ wazuh_version }-{ wazuh_revision }.msi /qn ``` ### MacOS ```bash /Library/Ossec/bin/wazuh-control stop /bin/rm -r /Library/Ossec /bin/launchctl unload /Library/LaunchDaemons/com.wazuh.agent.plist /bin/rm -f /Library/LaunchDaemons/com.wazuh.agent.plist /bin/rm -rf /Library/StartupItems/WAZUH /usr/bin/dscl . -delete "/Users/wazuh" /usr/bin/dscl . -delete "/Groups/wazuh" /usr/sbin/pkgutil --forget com.wazuh.pkg.wazuh-agent ```
pro-akim commented 3 months ago

Update

Notes

  1. Without the provision, the agent host does not have pip, pytest, and basic libraries installed.

Note: The main issue with this is that the installation of pytest will have to be handled by external code outside the test file.

This issue was fixed by adding setup steps to playbooks/setup.yml

  1. Installation code could be repetitive due to the amount of OS involved.
  2. Parameters to install should be sent from the command.
  3. Without the provision module working, the manager is not installed as well.

Filecheck

Working with a file and directory counter in a large directory can pose challenges. Other modifications may result in alterations to the count, leading to the possibility of false negatives in the test.

It will be necessary to establish pre and post-installation validation criteria.


After communicating with @fcaffieri , it was defined that the Filecheck should be global.

Doing some research, the following method was found:

Script ``` import os import hashlib def scan_directory(directory): file_list = [] for root, dirs, files in os.walk(directory): for file in files: file_path = os.path.join(root, file) file_list.append((file_path, get_file_hash(file_path))) return file_list def get_file_hash(file_path): hasher = hashlib.md5() if os.path.exists(file_path): try: with open(file_path, 'rb') as f: while chunk := f.read(8192): hasher.update(chunk) except OSError as e: print(f"Failure opening the file {file_path}: {e}") else: print(f"The {file_path} does not exist.") return None return hasher.hexdigest() def compare_directories(old_scan, new_scan): changed_files = [] # Identify modified and added files for new_file, new_hash in new_scan: file_found = False for old_file, old_hash in old_scan: if os.path.relpath(old_file) == os.path.relpath(new_file): file_found = True if old_hash != new_hash: changed_files.append((new_file, old_hash, new_hash)) # If the file is not found in the initial scan, consider it added if not file_found: changed_files.append((new_file, 'Added', new_hash)) # Identify deleted files for old_file, _ in old_scan: if os.path.relpath(old_file) not in (os.path.relpath(new_file) for new_file, _ in new_scan): changed_files.append((old_file, 'Deleted', None)) return changed_files ```
Installation test: ``` Initial scan: [] Failure opening the file /var/ossec/queue/sockets/wmodules: [Errno 6] No such device or address: '/var/ossec/queue/sockets/wmodules' Failure opening the file /var/ossec/queue/sockets/control: [Errno 6] No such device or address: '/var/ossec/queue/sockets/control' Failure opening the file /var/ossec/queue/sockets/com: [Errno 6] No such device or address: '/var/ossec/queue/sockets/com' Failure opening the file /var/ossec/queue/sockets/upgrade: [Errno 6] No such device or address: '/var/ossec/queue/sockets/upgrade' Failure opening the file /var/ossec/queue/sockets/queue: [Errno 6] No such device or address: '/var/ossec/queue/sockets/queue' Failure opening the file /var/ossec/queue/sockets/logcollector: [Errno 6] No such device or address: '/var/ossec/queue/sockets/logcollector' Failure opening the file /var/ossec/queue/sockets/syscheck: [Errno 6] No such device or address: '/var/ossec/queue/sockets/syscheck' Failure opening the file /var/ossec/queue/alerts/cfgaq: [Errno 6] No such device or address: '/var/ossec/queue/alerts/cfgaq' Failure opening the file /var/ossec/queue/alerts/execq: [Errno 6] No such device or address: '/var/ossec/queue/alerts/execq' Post scan: [('/var/ossec/ruleset/sca/cis_ubuntu22-04.yml', '0a340a61595e3b6cfb8a863ed63df4ea'), ('/var/ossec/wodles/utils.py', 'cbbf34017bcf23ae914f313cbba81d2b'), ('/var/ossec/wodles/__init__.py', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/wodles/aws/aws-s3', '003e541daab44ae4b9b22e8bedc0431f'), ('/var/ossec/wodles/azure/orm.py', 'bdcd7e6087d33c2f267153eedc919c56'), ('/var/ossec/wodles/azure/azure-logs', '92065f2e7cc54d27a915d47002b2c796'), ('/var/ossec/wodles/docker/DockerListener', '7141e875ba042b5ee6ca39ee4a69bd0f'), ('/var/ossec/wodles/gcloud/exceptions.py', 'd066fa7028799eea3cf8f58c4f7ac020'), ('/var/ossec/wodles/gcloud/integration.py', 'c9ae089a1b6d28dcd1b1dccacfa5095e'), ('/var/ossec/wodles/gcloud/tools.py', '70d2049b23778b5215d91e49def2799d'), ('/var/ossec/wodles/gcloud/gcloud', '1bed986d1318be9f0d399d8e429fd876'), ('/var/ossec/wodles/gcloud/pubsub/subscriber.py', '8d365d4754764c66235b2af5ca58af7a'), ('/var/ossec/wodles/gcloud/buckets/bucket.py', 'a4d2fbd2412d90112c9a0302c3f53f3c'), ('/var/ossec/wodles/gcloud/buckets/access_logs.py', 'cee4cc3b83f42efcdcde8f6298799fd7'), ('/var/ossec/var/run/wazuh-logcollector-101612.pid', '34e2e0e98ced664e5a7e0d9f7d8106af'), ('/var/ossec/var/run/wazuh-agentd.state', '5cbb71ebd4a652478fc76b93f98e9dfb'), ('/var/ossec/var/run/wazuh-agentd-101586.pid', 'a4b65f1ffd176ecbb5cb4d5f5e3dd258'), ('/var/ossec/var/run/wazuh-modulesd-101629.pid', 'd15ce02be4d86a0467f02be97eb6ff05'), ('/var/ossec/var/run/wazuh-syscheckd-101599.pid', 'c6b40711dd20f6477df192c73a206cff'), ('/var/ossec/var/run/wazuh-execd-101575.pid', 'ea32f2821522ec391a789d9086f1f35a'), ('/var/ossec/var/selinux/wazuh.pp', '61a28e46f03851cfdbc073f0c1e35819'), ('/var/ossec/agentless/register_host.sh', '08081346dc3fd761459b8bc9623e10da'), ('/var/ossec/agentless/ssh_integrity_check_linux', '7b0a58db243828e33f8cec11d382ab55'), ('/var/ossec/agentless/ssh_asa-fwsmconfig_diff', '168da17a073de01628ebdce9362c363c'), ('/var/ossec/agentless/sshlogin.exp', '8282404ed50ea7ad514ed1dc3bf05c17'), ('/var/ossec/agentless/ssh_foundry_diff', '32bb3e1ffb32a85288c9a18d7f24c555'), ('/var/ossec/agentless/ssh_generic_diff', '2869159008062183940a4cbf655a7b12'), ('/var/ossec/agentless/main.exp', 'dae474002ee16b821fa7716a4c2e306b'), ('/var/ossec/agentless/su.exp', '050fd94bee6780f951e477ca4e7875d6'), ('/var/ossec/agentless/ssh.exp', '2cf3022d233e5c434069654871bf22c5'), ('/var/ossec/agentless/ssh_pixconfig_diff', 'c31d904b727eb3fb683c9327aee68d10'), ('/var/ossec/agentless/ssh_nopass.exp', '2680a87d230c0f1fce2bec4546f0c1c7'), ('/var/ossec/agentless/ssh_integrity_check_bsd', '464b39d3a34b050af5e6c0de23e74b50'), ('/var/ossec/bin/wazuh-control', '17ab4d1f4d07e138fc44279b371362ce'), ('/var/ossec/bin/agent-auth', 'fc2b4be54ddf207d267777fa2b9ea4e5'), ('/var/ossec/bin/wazuh-agentd', '5335a40690ae96f5fb35b04760bd1408'), ('/var/ossec/bin/wazuh-logcollector', '4387241256aafb643eb239b2e5bb83e7'), ('/var/ossec/bin/wazuh-modulesd', '0ff739f142d4fe55aaa1793a2c9d9830'), ('/var/ossec/bin/manage_agents', '0f83e5799269ecb2a7496f399ba884bc'), ('/var/ossec/bin/wazuh-syscheckd', '270e2fb8a30db5edd62987be4691bc01'), ('/var/ossec/bin/wazuh-execd', '38b4ca78d0dc4a97e52ec697d8830352'), ('/var/ossec/lib/libsysinfo.so', '0e3f0be4e9c336be798266803939c648'), ('/var/ossec/lib/libstdc++.so.6', '45cacd641807d3ae8b0652edaa4a3d05'), ('/var/ossec/lib/libwazuhshared.so', 'a04f564d52af96ee22de2126982ce2bd'), ('/var/ossec/lib/libfimdb.so', 'bfedab21253c88257020d4fa45de3ba5'), ('/var/ossec/lib/libsyscollector.so', 'ac7bec3a13951d9a02516d95304b1347'), ('/var/ossec/lib/librsync.so', '9b5aedc37feef205f42587d6d1ae6ce6'), ('/var/ossec/lib/libwazuhext.so', 'b1af037c67307d72caa959346e0c4bce'), ('/var/ossec/lib/libgcc_s.so.1', '2dc0d65eb50278e2eae1519d17a7b764'), ('/var/ossec/lib/libdbsync.so', '7dc8363c9f41e566f5509ffc4d1c5ca9'), ('/var/ossec/etc/client.keys', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/etc/localtime', '38bb24ba4d742dd6f50c1cba29cd966a'), ('/var/ossec/etc/wpk_root.pem', '62a376c2059a97b26415040cf51ffed9'), ('/var/ossec/etc/local_internal_options.conf', '02d970a0df2e22fd0c6cca597d3eff97'), ('/var/ossec/etc/internal_options.conf', '0e4bc89fe0dc133908ada6f3e4078fed'), ('/var/ossec/etc/ossec.conf', 'e8eb1ae42aa07fcbecb77cffa7583eb3'), ('/var/ossec/etc/shared/rootkit_trojans.txt', '0f4ccc3a78b7989644d0d85b2a888a6b'), ('/var/ossec/etc/shared/cis_win2012r2_memberL2_rcl.txt', '39fec042d6f9f68ae6ed6837dd9d36ce'), ('/var/ossec/etc/shared/win_audit_rcl.txt', '7081a34961d9d0244a0238d4000b9821'), ('/var/ossec/etc/shared/cis_rhel_linux_rcl.txt', '287276a269d9d412229e06e6aae19aa3'), ('/var/ossec/etc/shared/cis_mysql5-6_community_rcl.txt', '23f48bac6361e28e3cfe9dae65d9cdb7'), ('/var/ossec/etc/shared/win_malware_rcl.txt', 'dce0fd97a51f6a03ee2529c9a7c78fc0'), ('/var/ossec/etc/shared/cis_sles11_linux_rcl.txt', 'b774694648d06196c62f18b65c6ae362'), ('/var/ossec/etc/shared/cis_win2012r2_domainL2_rcl.txt', '5cc644ed02a62341960fd46d50e30399'), ('/var/ossec/etc/shared/cis_mysql5-6_enterprise_rcl.txt', '732e1cc44433ecd8c13be1b6967eaabc'), ('/var/ossec/etc/shared/cis_rhel5_linux_rcl.txt', '80c48eb8d9fc25a2bf19f1538d4dc11a'), ('/var/ossec/etc/shared/system_audit_ssh.txt', 'd6384ddcd72864a14bc73e433e3aaf17'), ('/var/ossec/etc/shared/cis_sles12_linux_rcl.txt', 'fdc029f8b838b55395ca317cc4e2bb16'), ('/var/ossec/etc/shared/cis_apache2224_rcl.txt', '8b74055e0b72ad5e06dc0468f4e992ef'), ('/var/ossec/etc/shared/cis_rhel7_linux_rcl.txt', '7331ea6f235ad8cee69441df3a0a94d1'), ('/var/ossec/etc/shared/win_applications_rcl.txt', 'ea5686ce6eafe5268bdba42ea367ec17'), ('/var/ossec/etc/shared/system_audit_rcl.txt', 'cf63d35a9e7ffdf943c41894f0598f0f'), ('/var/ossec/etc/shared/cis_win2012r2_domainL1_rcl.txt', '7621888a614065f8a80d3e243f6dd0b2'), ('/var/ossec/etc/shared/cis_debian_linux_rcl.txt', '52bca6f514fede26c4edaf3112614447'), ('/var/ossec/etc/shared/cis_rhel6_linux_rcl.txt', 'e823532eaa108671cbcb0bf4c687dd8b'), ('/var/ossec/etc/shared/cis_win2012r2_memberL1_rcl.txt', '21580a5bd6fa4362deba1070613032d1'), ('/var/ossec/etc/shared/rootkit_files.txt', '6943964a87d768d8434fffbaceda89f2'), ('/var/ossec/active-response/bin/firewall-drop', '7c0416b8851db343e6238055b49f49d7'), ('/var/ossec/active-response/bin/kaspersky.py', '0c32c5d717983a7f03b32b0d4c6d6e43'), ('/var/ossec/active-response/bin/route-null', 'a89fd52f702955e40babb75ff3ef35b8'), ('/var/ossec/active-response/bin/restart-wazuh', 'abbc5ba7dc7c562bcebd7472f5962404'), ('/var/ossec/active-response/bin/ip-customblock', '920d56367df65c4f1aeede8519a8d070'), ('/var/ossec/active-response/bin/firewalld-drop', '2bfc1e923124f06478a3e4ddd39587fb'), ('/var/ossec/active-response/bin/default-firewall-drop', '7c0416b8851db343e6238055b49f49d7'), ('/var/ossec/active-response/bin/pf', '416b5f7e00a4da47e9253aa7d8b768d9'), ('/var/ossec/active-response/bin/restart.sh', '238d4466f70e8140d7dfdf741a84e5ac'), ('/var/ossec/active-response/bin/host-deny', '2662a6a926679aba40aa544da1d39cad'), ('/var/ossec/active-response/bin/ipfw', 'b668b777a52e33485811faae0f02a394'), ('/var/ossec/active-response/bin/disable-account', 'b6e09410d2fbc3f2e1c16d0c0ce973e4'), ('/var/ossec/active-response/bin/wazuh-slack', 'ce42ff5cd35b731db96a3a3f286e52eb'), ('/var/ossec/active-response/bin/npf', '49435a5d10fa00de55d3e7540a48bf1e'), ('/var/ossec/active-response/bin/kaspersky', 'f613e4a90a6230cb6f8916d518fad2f0'), ('/var/ossec/logs/active-responses.log', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/logs/ossec.log', 'f82592b11e40d7393d1b17cf9d233f5b'), ('/var/ossec/queue/syscollector/norm_config.json', 'd619e8d5dfab6cbec9c7751bf59254a3'), ('/var/ossec/queue/syscollector/db/local.db-journal', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/syscollector/db/local.db', '7e3805d829ee3b94fade901520fe05d9'), ('/var/ossec/queue/fim/db/fim.db', '6fe93763addfdfe6e5c22c3efe60b66f'), ('/var/ossec/queue/fim/db/fim.db-journal', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/wmodules', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/control', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/com', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/.wait', '2db95e8e1a9267b7a1188556b2013b33'), ('/var/ossec/queue/sockets/upgrade', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/queue', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/logcollector', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/syscheck', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/alerts/cfgaq', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/alerts/execq', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/logcollector/file_status.json', '590f644afb9d25e3507a00b2a2902e20')] Detected changes: [('/var/ossec/ruleset/sca/cis_ubuntu22-04.yml', 'Added', '0a340a61595e3b6cfb8a863ed63df4ea'), ('/var/ossec/wodles/utils.py', 'Added', 'cbbf34017bcf23ae914f313cbba81d2b'), ('/var/ossec/wodles/__init__.py', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/wodles/aws/aws-s3', 'Added', '003e541daab44ae4b9b22e8bedc0431f'), ('/var/ossec/wodles/azure/orm.py', 'Added', 'bdcd7e6087d33c2f267153eedc919c56'), ('/var/ossec/wodles/azure/azure-logs', 'Added', '92065f2e7cc54d27a915d47002b2c796'), ('/var/ossec/wodles/docker/DockerListener', 'Added', '7141e875ba042b5ee6ca39ee4a69bd0f'), ('/var/ossec/wodles/gcloud/exceptions.py', 'Added', 'd066fa7028799eea3cf8f58c4f7ac020'), ('/var/ossec/wodles/gcloud/integration.py', 'Added', 'c9ae089a1b6d28dcd1b1dccacfa5095e'), ('/var/ossec/wodles/gcloud/tools.py', 'Added', '70d2049b23778b5215d91e49def2799d'), ('/var/ossec/wodles/gcloud/gcloud', 'Added', '1bed986d1318be9f0d399d8e429fd876'), ('/var/ossec/wodles/gcloud/pubsub/subscriber.py', 'Added', '8d365d4754764c66235b2af5ca58af7a'), ('/var/ossec/wodles/gcloud/buckets/bucket.py', 'Added', 'a4d2fbd2412d90112c9a0302c3f53f3c'), ('/var/ossec/wodles/gcloud/buckets/access_logs.py', 'Added', 'cee4cc3b83f42efcdcde8f6298799fd7'), ('/var/ossec/var/run/wazuh-logcollector-101612.pid', 'Added', '34e2e0e98ced664e5a7e0d9f7d8106af'), ('/var/ossec/var/run/wazuh-agentd.state', 'Added', '5cbb71ebd4a652478fc76b93f98e9dfb'), ('/var/ossec/var/run/wazuh-agentd-101586.pid', 'Added', 'a4b65f1ffd176ecbb5cb4d5f5e3dd258'), ('/var/ossec/var/run/wazuh-modulesd-101629.pid', 'Added', 'd15ce02be4d86a0467f02be97eb6ff05'), ('/var/ossec/var/run/wazuh-syscheckd-101599.pid', 'Added', 'c6b40711dd20f6477df192c73a206cff'), ('/var/ossec/var/run/wazuh-execd-101575.pid', 'Added', 'ea32f2821522ec391a789d9086f1f35a'), ('/var/ossec/var/selinux/wazuh.pp', 'Added', '61a28e46f03851cfdbc073f0c1e35819'), ('/var/ossec/agentless/register_host.sh', 'Added', '08081346dc3fd761459b8bc9623e10da'), ('/var/ossec/agentless/ssh_integrity_check_linux', 'Added', '7b0a58db243828e33f8cec11d382ab55'), ('/var/ossec/agentless/ssh_asa-fwsmconfig_diff', 'Added', '168da17a073de01628ebdce9362c363c'), ('/var/ossec/agentless/sshlogin.exp', 'Added', '8282404ed50ea7ad514ed1dc3bf05c17'), ('/var/ossec/agentless/ssh_foundry_diff', 'Added', '32bb3e1ffb32a85288c9a18d7f24c555'), ('/var/ossec/agentless/ssh_generic_diff', 'Added', '2869159008062183940a4cbf655a7b12'), ('/var/ossec/agentless/main.exp', 'Added', 'dae474002ee16b821fa7716a4c2e306b'), ('/var/ossec/agentless/su.exp', 'Added', '050fd94bee6780f951e477ca4e7875d6'), ('/var/ossec/agentless/ssh.exp', 'Added', '2cf3022d233e5c434069654871bf22c5'), ('/var/ossec/agentless/ssh_pixconfig_diff', 'Added', 'c31d904b727eb3fb683c9327aee68d10'), ('/var/ossec/agentless/ssh_nopass.exp', 'Added', '2680a87d230c0f1fce2bec4546f0c1c7'), ('/var/ossec/agentless/ssh_integrity_check_bsd', 'Added', '464b39d3a34b050af5e6c0de23e74b50'), ('/var/ossec/bin/wazuh-control', 'Added', '17ab4d1f4d07e138fc44279b371362ce'), ('/var/ossec/bin/agent-auth', 'Added', 'fc2b4be54ddf207d267777fa2b9ea4e5'), ('/var/ossec/bin/wazuh-agentd', 'Added', '5335a40690ae96f5fb35b04760bd1408'), ('/var/ossec/bin/wazuh-logcollector', 'Added', '4387241256aafb643eb239b2e5bb83e7'), ('/var/ossec/bin/wazuh-modulesd', 'Added', '0ff739f142d4fe55aaa1793a2c9d9830'), ('/var/ossec/bin/manage_agents', 'Added', '0f83e5799269ecb2a7496f399ba884bc'), ('/var/ossec/bin/wazuh-syscheckd', 'Added', '270e2fb8a30db5edd62987be4691bc01'), ('/var/ossec/bin/wazuh-execd', 'Added', '38b4ca78d0dc4a97e52ec697d8830352'), ('/var/ossec/lib/libsysinfo.so', 'Added', '0e3f0be4e9c336be798266803939c648'), ('/var/ossec/lib/libstdc++.so.6', 'Added', '45cacd641807d3ae8b0652edaa4a3d05'), ('/var/ossec/lib/libwazuhshared.so', 'Added', 'a04f564d52af96ee22de2126982ce2bd'), ('/var/ossec/lib/libfimdb.so', 'Added', 'bfedab21253c88257020d4fa45de3ba5'), ('/var/ossec/lib/libsyscollector.so', 'Added', 'ac7bec3a13951d9a02516d95304b1347'), ('/var/ossec/lib/librsync.so', 'Added', '9b5aedc37feef205f42587d6d1ae6ce6'), ('/var/ossec/lib/libwazuhext.so', 'Added', 'b1af037c67307d72caa959346e0c4bce'), ('/var/ossec/lib/libgcc_s.so.1', 'Added', '2dc0d65eb50278e2eae1519d17a7b764'), ('/var/ossec/lib/libdbsync.so', 'Added', '7dc8363c9f41e566f5509ffc4d1c5ca9'), ('/var/ossec/etc/client.keys', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/etc/localtime', 'Added', '38bb24ba4d742dd6f50c1cba29cd966a'), ('/var/ossec/etc/wpk_root.pem', 'Added', '62a376c2059a97b26415040cf51ffed9'), ('/var/ossec/etc/local_internal_options.conf', 'Added', '02d970a0df2e22fd0c6cca597d3eff97'), ('/var/ossec/etc/internal_options.conf', 'Added', '0e4bc89fe0dc133908ada6f3e4078fed'), ('/var/ossec/etc/ossec.conf', 'Added', 'e8eb1ae42aa07fcbecb77cffa7583eb3'), ('/var/ossec/etc/shared/rootkit_trojans.txt', 'Added', '0f4ccc3a78b7989644d0d85b2a888a6b'), ('/var/ossec/etc/shared/cis_win2012r2_memberL2_rcl.txt', 'Added', '39fec042d6f9f68ae6ed6837dd9d36ce'), ('/var/ossec/etc/shared/win_audit_rcl.txt', 'Added', '7081a34961d9d0244a0238d4000b9821'), ('/var/ossec/etc/shared/cis_rhel_linux_rcl.txt', 'Added', '287276a269d9d412229e06e6aae19aa3'), ('/var/ossec/etc/shared/cis_mysql5-6_community_rcl.txt', 'Added', '23f48bac6361e28e3cfe9dae65d9cdb7'), ('/var/ossec/etc/shared/win_malware_rcl.txt', 'Added', 'dce0fd97a51f6a03ee2529c9a7c78fc0'), ('/var/ossec/etc/shared/cis_sles11_linux_rcl.txt', 'Added', 'b774694648d06196c62f18b65c6ae362'), ('/var/ossec/etc/shared/cis_win2012r2_domainL2_rcl.txt', 'Added', '5cc644ed02a62341960fd46d50e30399'), ('/var/ossec/etc/shared/cis_mysql5-6_enterprise_rcl.txt', 'Added', '732e1cc44433ecd8c13be1b6967eaabc'), ('/var/ossec/etc/shared/cis_rhel5_linux_rcl.txt', 'Added', '80c48eb8d9fc25a2bf19f1538d4dc11a'), ('/var/ossec/etc/shared/system_audit_ssh.txt', 'Added', 'd6384ddcd72864a14bc73e433e3aaf17'), ('/var/ossec/etc/shared/cis_sles12_linux_rcl.txt', 'Added', 'fdc029f8b838b55395ca317cc4e2bb16'), ('/var/ossec/etc/shared/cis_apache2224_rcl.txt', 'Added', '8b74055e0b72ad5e06dc0468f4e992ef'), ('/var/ossec/etc/shared/cis_rhel7_linux_rcl.txt', 'Added', '7331ea6f235ad8cee69441df3a0a94d1'), ('/var/ossec/etc/shared/win_applications_rcl.txt', 'Added', 'ea5686ce6eafe5268bdba42ea367ec17'), ('/var/ossec/etc/shared/system_audit_rcl.txt', 'Added', 'cf63d35a9e7ffdf943c41894f0598f0f'), ('/var/ossec/etc/shared/cis_win2012r2_domainL1_rcl.txt', 'Added', '7621888a614065f8a80d3e243f6dd0b2'), ('/var/ossec/etc/shared/cis_debian_linux_rcl.txt', 'Added', '52bca6f514fede26c4edaf3112614447'), ('/var/ossec/etc/shared/cis_rhel6_linux_rcl.txt', 'Added', 'e823532eaa108671cbcb0bf4c687dd8b'), ('/var/ossec/etc/shared/cis_win2012r2_memberL1_rcl.txt', 'Added', '21580a5bd6fa4362deba1070613032d1'), ('/var/ossec/etc/shared/rootkit_files.txt', 'Added', '6943964a87d768d8434fffbaceda89f2'), ('/var/ossec/active-response/bin/firewall-drop', 'Added', '7c0416b8851db343e6238055b49f49d7'), ('/var/ossec/active-response/bin/kaspersky.py', 'Added', '0c32c5d717983a7f03b32b0d4c6d6e43'), ('/var/ossec/active-response/bin/route-null', 'Added', 'a89fd52f702955e40babb75ff3ef35b8'), ('/var/ossec/active-response/bin/restart-wazuh', 'Added', 'abbc5ba7dc7c562bcebd7472f5962404'), ('/var/ossec/active-response/bin/ip-customblock', 'Added', '920d56367df65c4f1aeede8519a8d070'), ('/var/ossec/active-response/bin/firewalld-drop', 'Added', '2bfc1e923124f06478a3e4ddd39587fb'), ('/var/ossec/active-response/bin/default-firewall-drop', 'Added', '7c0416b8851db343e6238055b49f49d7'), ('/var/ossec/active-response/bin/pf', 'Added', '416b5f7e00a4da47e9253aa7d8b768d9'), ('/var/ossec/active-response/bin/restart.sh', 'Added', '238d4466f70e8140d7dfdf741a84e5ac'), ('/var/ossec/active-response/bin/host-deny', 'Added', '2662a6a926679aba40aa544da1d39cad'), ('/var/ossec/active-response/bin/ipfw', 'Added', 'b668b777a52e33485811faae0f02a394'), ('/var/ossec/active-response/bin/disable-account', 'Added', 'b6e09410d2fbc3f2e1c16d0c0ce973e4'), ('/var/ossec/active-response/bin/wazuh-slack', 'Added', 'ce42ff5cd35b731db96a3a3f286e52eb'), ('/var/ossec/active-response/bin/npf', 'Added', '49435a5d10fa00de55d3e7540a48bf1e'), ('/var/ossec/active-response/bin/kaspersky', 'Added', 'f613e4a90a6230cb6f8916d518fad2f0'), ('/var/ossec/logs/active-responses.log', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/logs/ossec.log', 'Added', 'f82592b11e40d7393d1b17cf9d233f5b'), ('/var/ossec/queue/syscollector/norm_config.json', 'Added', 'd619e8d5dfab6cbec9c7751bf59254a3'), ('/var/ossec/queue/syscollector/db/local.db-journal', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/syscollector/db/local.db', 'Added', '7e3805d829ee3b94fade901520fe05d9'), ('/var/ossec/queue/fim/db/fim.db', 'Added', '6fe93763addfdfe6e5c22c3efe60b66f'), ('/var/ossec/queue/fim/db/fim.db-journal', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/wmodules', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/control', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/com', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/.wait', 'Added', '2db95e8e1a9267b7a1188556b2013b33'), ('/var/ossec/queue/sockets/upgrade', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/queue', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/logcollector', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/syscheck', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/alerts/cfgaq', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/alerts/execq', 'Added', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/logcollector/file_status.json', 'Added', '590f644afb9d25e3507a00b2a2902e20')] ```
Uninstall ``` Initial scan: [('/var/ossec/ruleset/sca/cis_ubuntu22-04.yml', '0a340a61595e3b6cfb8a863ed63df4ea'), ('/var/ossec/wodles/utils.py', 'cbbf34017bcf23ae914f313cbba81d2b'), ('/var/ossec/wodles/__init__.py', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/wodles/aws/aws-s3', '003e541daab44ae4b9b22e8bedc0431f'), ('/var/ossec/wodles/azure/orm.py', 'bdcd7e6087d33c2f267153eedc919c56'), ('/var/ossec/wodles/azure/azure-logs', '92065f2e7cc54d27a915d47002b2c796'), ('/var/ossec/wodles/docker/DockerListener', '7141e875ba042b5ee6ca39ee4a69bd0f'), ('/var/ossec/wodles/gcloud/exceptions.py', 'd066fa7028799eea3cf8f58c4f7ac020'), ('/var/ossec/wodles/gcloud/integration.py', 'c9ae089a1b6d28dcd1b1dccacfa5095e'), ('/var/ossec/wodles/gcloud/tools.py', '70d2049b23778b5215d91e49def2799d'), ('/var/ossec/wodles/gcloud/gcloud', '1bed986d1318be9f0d399d8e429fd876'), ('/var/ossec/wodles/gcloud/pubsub/subscriber.py', '8d365d4754764c66235b2af5ca58af7a'), ('/var/ossec/wodles/gcloud/buckets/bucket.py', 'a4d2fbd2412d90112c9a0302c3f53f3c'), ('/var/ossec/wodles/gcloud/buckets/access_logs.py', 'cee4cc3b83f42efcdcde8f6298799fd7'), ('/var/ossec/var/run/wazuh-agentd.state', '5cbb71ebd4a652478fc76b93f98e9dfb'), ('/var/ossec/var/run/wazuh-agentd-96953.pid', '43cf03e4c854a6469a761932d5066cea'), ('/var/ossec/var/run/wazuh-execd-96942.pid', 'dec95386b257d04ddfcd8ec6c94cff44'), ('/var/ossec/var/run/wazuh-modulesd-96996.pid', 'fd79ccd01d8888e0a7f089f2b6f238ba'), ('/var/ossec/var/run/wazuh-syscheckd-96966.pid', '859b2f0b00429f54769a817503d08157'), ('/var/ossec/var/run/wazuh-logcollector-96979.pid', '28c848a4761da0fcc600b9786f10341e'), ('/var/ossec/var/run/wazuh-logcollector.state', '402adf3eb133fb411210d0d43eb18df1'), ('/var/ossec/var/selinux/wazuh.pp', '61a28e46f03851cfdbc073f0c1e35819'), ('/var/ossec/agentless/register_host.sh', '08081346dc3fd761459b8bc9623e10da'), ('/var/ossec/agentless/ssh_integrity_check_linux', '7b0a58db243828e33f8cec11d382ab55'), ('/var/ossec/agentless/ssh_asa-fwsmconfig_diff', '168da17a073de01628ebdce9362c363c'), ('/var/ossec/agentless/sshlogin.exp', '8282404ed50ea7ad514ed1dc3bf05c17'), ('/var/ossec/agentless/ssh_foundry_diff', '32bb3e1ffb32a85288c9a18d7f24c555'), ('/var/ossec/agentless/ssh_generic_diff', '2869159008062183940a4cbf655a7b12'), ('/var/ossec/agentless/main.exp', 'dae474002ee16b821fa7716a4c2e306b'), ('/var/ossec/agentless/su.exp', '050fd94bee6780f951e477ca4e7875d6'), ('/var/ossec/agentless/ssh.exp', '2cf3022d233e5c434069654871bf22c5'), ('/var/ossec/agentless/ssh_pixconfig_diff', 'c31d904b727eb3fb683c9327aee68d10'), ('/var/ossec/agentless/ssh_nopass.exp', '2680a87d230c0f1fce2bec4546f0c1c7'), ('/var/ossec/agentless/ssh_integrity_check_bsd', '464b39d3a34b050af5e6c0de23e74b50'), ('/var/ossec/bin/wazuh-control', '17ab4d1f4d07e138fc44279b371362ce'), ('/var/ossec/bin/agent-auth', 'fc2b4be54ddf207d267777fa2b9ea4e5'), ('/var/ossec/bin/wazuh-agentd', '5335a40690ae96f5fb35b04760bd1408'), ('/var/ossec/bin/wazuh-logcollector', '4387241256aafb643eb239b2e5bb83e7'), ('/var/ossec/bin/wazuh-modulesd', '0ff739f142d4fe55aaa1793a2c9d9830'), ('/var/ossec/bin/manage_agents', '0f83e5799269ecb2a7496f399ba884bc'), ('/var/ossec/bin/wazuh-syscheckd', '270e2fb8a30db5edd62987be4691bc01'), ('/var/ossec/bin/wazuh-execd', '38b4ca78d0dc4a97e52ec697d8830352'), ('/var/ossec/lib/libsysinfo.so', '0e3f0be4e9c336be798266803939c648'), ('/var/ossec/lib/libstdc++.so.6', '45cacd641807d3ae8b0652edaa4a3d05'), ('/var/ossec/lib/libwazuhshared.so', 'a04f564d52af96ee22de2126982ce2bd'), ('/var/ossec/lib/libfimdb.so', 'bfedab21253c88257020d4fa45de3ba5'), ('/var/ossec/lib/libsyscollector.so', 'ac7bec3a13951d9a02516d95304b1347'), ('/var/ossec/lib/librsync.so', '9b5aedc37feef205f42587d6d1ae6ce6'), ('/var/ossec/lib/libwazuhext.so', 'b1af037c67307d72caa959346e0c4bce'), ('/var/ossec/lib/libgcc_s.so.1', '2dc0d65eb50278e2eae1519d17a7b764'), ('/var/ossec/lib/libdbsync.so', '7dc8363c9f41e566f5509ffc4d1c5ca9'), ('/var/ossec/etc/client.keys', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/etc/localtime', '38bb24ba4d742dd6f50c1cba29cd966a'), ('/var/ossec/etc/wpk_root.pem', '62a376c2059a97b26415040cf51ffed9'), ('/var/ossec/etc/local_internal_options.conf', '02d970a0df2e22fd0c6cca597d3eff97'), ('/var/ossec/etc/internal_options.conf', '0e4bc89fe0dc133908ada6f3e4078fed'), ('/var/ossec/etc/ossec.conf', 'e8eb1ae42aa07fcbecb77cffa7583eb3'), ('/var/ossec/etc/shared/rootkit_trojans.txt', '0f4ccc3a78b7989644d0d85b2a888a6b'), ('/var/ossec/etc/shared/cis_win2012r2_memberL2_rcl.txt', '39fec042d6f9f68ae6ed6837dd9d36ce'), ('/var/ossec/etc/shared/win_audit_rcl.txt', '7081a34961d9d0244a0238d4000b9821'), ('/var/ossec/etc/shared/cis_rhel_linux_rcl.txt', '287276a269d9d412229e06e6aae19aa3'), ('/var/ossec/etc/shared/cis_mysql5-6_community_rcl.txt', '23f48bac6361e28e3cfe9dae65d9cdb7'), ('/var/ossec/etc/shared/win_malware_rcl.txt', 'dce0fd97a51f6a03ee2529c9a7c78fc0'), ('/var/ossec/etc/shared/cis_sles11_linux_rcl.txt', 'b774694648d06196c62f18b65c6ae362'), ('/var/ossec/etc/shared/cis_win2012r2_domainL2_rcl.txt', '5cc644ed02a62341960fd46d50e30399'), ('/var/ossec/etc/shared/cis_mysql5-6_enterprise_rcl.txt', '732e1cc44433ecd8c13be1b6967eaabc'), ('/var/ossec/etc/shared/cis_rhel5_linux_rcl.txt', '80c48eb8d9fc25a2bf19f1538d4dc11a'), ('/var/ossec/etc/shared/system_audit_ssh.txt', 'd6384ddcd72864a14bc73e433e3aaf17'), ('/var/ossec/etc/shared/cis_sles12_linux_rcl.txt', 'fdc029f8b838b55395ca317cc4e2bb16'), ('/var/ossec/etc/shared/cis_apache2224_rcl.txt', '8b74055e0b72ad5e06dc0468f4e992ef'), ('/var/ossec/etc/shared/cis_rhel7_linux_rcl.txt', '7331ea6f235ad8cee69441df3a0a94d1'), ('/var/ossec/etc/shared/win_applications_rcl.txt', 'ea5686ce6eafe5268bdba42ea367ec17'), ('/var/ossec/etc/shared/system_audit_rcl.txt', 'cf63d35a9e7ffdf943c41894f0598f0f'), ('/var/ossec/etc/shared/cis_win2012r2_domainL1_rcl.txt', '7621888a614065f8a80d3e243f6dd0b2'), ('/var/ossec/etc/shared/cis_debian_linux_rcl.txt', '52bca6f514fede26c4edaf3112614447'), ('/var/ossec/etc/shared/cis_rhel6_linux_rcl.txt', 'e823532eaa108671cbcb0bf4c687dd8b'), ('/var/ossec/etc/shared/cis_win2012r2_memberL1_rcl.txt', '21580a5bd6fa4362deba1070613032d1'), ('/var/ossec/etc/shared/rootkit_files.txt', '6943964a87d768d8434fffbaceda89f2'), ('/var/ossec/active-response/bin/firewall-drop', '7c0416b8851db343e6238055b49f49d7'), ('/var/ossec/active-response/bin/kaspersky.py', '0c32c5d717983a7f03b32b0d4c6d6e43'), ('/var/ossec/active-response/bin/route-null', 'a89fd52f702955e40babb75ff3ef35b8'), ('/var/ossec/active-response/bin/restart-wazuh', 'abbc5ba7dc7c562bcebd7472f5962404'), ('/var/ossec/active-response/bin/ip-customblock', '920d56367df65c4f1aeede8519a8d070'), ('/var/ossec/active-response/bin/firewalld-drop', '2bfc1e923124f06478a3e4ddd39587fb'), ('/var/ossec/active-response/bin/default-firewall-drop', '7c0416b8851db343e6238055b49f49d7'), ('/var/ossec/active-response/bin/pf', '416b5f7e00a4da47e9253aa7d8b768d9'), ('/var/ossec/active-response/bin/restart.sh', '238d4466f70e8140d7dfdf741a84e5ac'), ('/var/ossec/active-response/bin/host-deny', '2662a6a926679aba40aa544da1d39cad'), ('/var/ossec/active-response/bin/ipfw', 'b668b777a52e33485811faae0f02a394'), ('/var/ossec/active-response/bin/disable-account', 'b6e09410d2fbc3f2e1c16d0c0ce973e4'), ('/var/ossec/active-response/bin/wazuh-slack', 'ce42ff5cd35b731db96a3a3f286e52eb'), ('/var/ossec/active-response/bin/npf', '49435a5d10fa00de55d3e7540a48bf1e'), ('/var/ossec/active-response/bin/kaspersky', 'f613e4a90a6230cb6f8916d518fad2f0'), ('/var/ossec/logs/active-responses.log', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/logs/ossec.log', '311a955b3202512fc5160c454fee1082'), ('/var/ossec/queue/syscollector/norm_config.json', 'd619e8d5dfab6cbec9c7751bf59254a3'), ('/var/ossec/queue/syscollector/db/local.db-journal', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/syscollector/db/local.db', '8af8b9368ba8b6b79604673168066193'), ('/var/ossec/queue/fim/db/fim.db', '6fe93763addfdfe6e5c22c3efe60b66f'), ('/var/ossec/queue/fim/db/fim.db-journal', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/wmodules', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/control', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/com', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/.wait', '2db95e8e1a9267b7a1188556b2013b33'), ('/var/ossec/queue/sockets/upgrade', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/queue', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/logcollector', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/sockets/syscheck', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/alerts/cfgaq', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/alerts/execq', 'd41d8cd98f00b204e9800998ecf8427e'), ('/var/ossec/queue/logcollector/file_status.json', 'a72ac32d686252b63c01aa98f8fd2321')]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 80 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 ... 83377 files and directories currently installed.) Removing wazuh-agent (4.7.2-1) ... 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 80 not upgraded. After this operation, 0 B of additional disk space will be used. (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 ... 83013 files and directories currently installed.) Purging configuration files for wazuh-agent (4.7.2-1) ... dpkg: warning: while removing wazuh-agent, directory '/usr/lib/systemd/system' not empty so not removed sudo apt-get remove -y wazuh-agent sudo apt-get remove -y --purge wazuh-agent Post scan: [] Detected changes: [('/var/ossec/ruleset/sca/cis_ubuntu22-04.yml', 'Deleted', None), ('/var/ossec/wodles/utils.py', 'Deleted', None), ('/var/ossec/wodles/__init__.py', 'Deleted', None), ('/var/ossec/wodles/aws/aws-s3', 'Deleted', None), ('/var/ossec/wodles/azure/orm.py', 'Deleted', None), ('/var/ossec/wodles/azure/azure-logs', 'Deleted', None), ('/var/ossec/wodles/docker/DockerListener', 'Deleted', None), ('/var/ossec/wodles/gcloud/exceptions.py', 'Deleted', None), ('/var/ossec/wodles/gcloud/integration.py', 'Deleted', None), ('/var/ossec/wodles/gcloud/tools.py', 'Deleted', None), ('/var/ossec/wodles/gcloud/gcloud', 'Deleted', None), ('/var/ossec/wodles/gcloud/pubsub/subscriber.py', 'Deleted', None), ('/var/ossec/wodles/gcloud/buckets/bucket.py', 'Deleted', None), ('/var/ossec/wodles/gcloud/buckets/access_logs.py', 'Deleted', None), ('/var/ossec/var/run/wazuh-agentd.state', 'Deleted', None), ('/var/ossec/var/run/wazuh-agentd-96953.pid', 'Deleted', None), ('/var/ossec/var/run/wazuh-execd-96942.pid', 'Deleted', None), ('/var/ossec/var/run/wazuh-modulesd-96996.pid', 'Deleted', None), ('/var/ossec/var/run/wazuh-syscheckd-96966.pid', 'Deleted', None), ('/var/ossec/var/run/wazuh-logcollector-96979.pid', 'Deleted', None), ('/var/ossec/var/run/wazuh-logcollector.state', 'Deleted', None), ('/var/ossec/var/selinux/wazuh.pp', 'Deleted', None), ('/var/ossec/agentless/register_host.sh', 'Deleted', None), ('/var/ossec/agentless/ssh_integrity_check_linux', 'Deleted', None), ('/var/ossec/agentless/ssh_asa-fwsmconfig_diff', 'Deleted', None), ('/var/ossec/agentless/sshlogin.exp', 'Deleted', None), ('/var/ossec/agentless/ssh_foundry_diff', 'Deleted', None), ('/var/ossec/agentless/ssh_generic_diff', 'Deleted', None), ('/var/ossec/agentless/main.exp', 'Deleted', None), ('/var/ossec/agentless/su.exp', 'Deleted', None), ('/var/ossec/agentless/ssh.exp', 'Deleted', None), ('/var/ossec/agentless/ssh_pixconfig_diff', 'Deleted', None), ('/var/ossec/agentless/ssh_nopass.exp', 'Deleted', None), ('/var/ossec/agentless/ssh_integrity_check_bsd', 'Deleted', None), ('/var/ossec/bin/wazuh-control', 'Deleted', None), ('/var/ossec/bin/agent-auth', 'Deleted', None), ('/var/ossec/bin/wazuh-agentd', 'Deleted', None), ('/var/ossec/bin/wazuh-logcollector', 'Deleted', None), ('/var/ossec/bin/wazuh-modulesd', 'Deleted', None), ('/var/ossec/bin/manage_agents', 'Deleted', None), ('/var/ossec/bin/wazuh-syscheckd', 'Deleted', None), ('/var/ossec/bin/wazuh-execd', 'Deleted', None), ('/var/ossec/lib/libsysinfo.so', 'Deleted', None), ('/var/ossec/lib/libstdc++.so.6', 'Deleted', None), ('/var/ossec/lib/libwazuhshared.so', 'Deleted', None), ('/var/ossec/lib/libfimdb.so', 'Deleted', None), ('/var/ossec/lib/libsyscollector.so', 'Deleted', None), ('/var/ossec/lib/librsync.so', 'Deleted', None), ('/var/ossec/lib/libwazuhext.so', 'Deleted', None), ('/var/ossec/lib/libgcc_s.so.1', 'Deleted', None), ('/var/ossec/lib/libdbsync.so', 'Deleted', None), ('/var/ossec/etc/client.keys', 'Deleted', None), ('/var/ossec/etc/localtime', 'Deleted', None), ('/var/ossec/etc/wpk_root.pem', 'Deleted', None), ('/var/ossec/etc/local_internal_options.conf', 'Deleted', None), ('/var/ossec/etc/internal_options.conf', 'Deleted', None), ('/var/ossec/etc/ossec.conf', 'Deleted', None), ('/var/ossec/etc/shared/rootkit_trojans.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_win2012r2_memberL2_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/win_audit_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_rhel_linux_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_mysql5-6_community_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/win_malware_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_sles11_linux_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_win2012r2_domainL2_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_mysql5-6_enterprise_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_rhel5_linux_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/system_audit_ssh.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_sles12_linux_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_apache2224_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_rhel7_linux_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/win_applications_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/system_audit_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_win2012r2_domainL1_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_debian_linux_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_rhel6_linux_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/cis_win2012r2_memberL1_rcl.txt', 'Deleted', None), ('/var/ossec/etc/shared/rootkit_files.txt', 'Deleted', None), ('/var/ossec/active-response/bin/firewall-drop', 'Deleted', None), ('/var/ossec/active-response/bin/kaspersky.py', 'Deleted', None), ('/var/ossec/active-response/bin/route-null', 'Deleted', None), ('/var/ossec/active-response/bin/restart-wazuh', 'Deleted', None), ('/var/ossec/active-response/bin/ip-customblock', 'Deleted', None), ('/var/ossec/active-response/bin/firewalld-drop', 'Deleted', None), ('/var/ossec/active-response/bin/default-firewall-drop', 'Deleted', None), ('/var/ossec/active-response/bin/pf', 'Deleted', None), ('/var/ossec/active-response/bin/restart.sh', 'Deleted', None), ('/var/ossec/active-response/bin/host-deny', 'Deleted', None), ('/var/ossec/active-response/bin/ipfw', 'Deleted', None), ('/var/ossec/active-response/bin/disable-account', 'Deleted', None), ('/var/ossec/active-response/bin/wazuh-slack', 'Deleted', None), ('/var/ossec/active-response/bin/npf', 'Deleted', None), ('/var/ossec/active-response/bin/kaspersky', 'Deleted', None), ('/var/ossec/logs/active-responses.log', 'Deleted', None), ('/var/ossec/logs/ossec.log', 'Deleted', None), ('/var/ossec/queue/syscollector/norm_config.json', 'Deleted', None), ('/var/ossec/queue/syscollector/db/local.db-journal', 'Deleted', None), ('/var/ossec/queue/syscollector/db/local.db', 'Deleted', None), ('/var/ossec/queue/fim/db/fim.db', 'Deleted', None), ('/var/ossec/queue/fim/db/fim.db-journal', 'Deleted', None), ('/var/ossec/queue/sockets/wmodules', 'Deleted', None), ('/var/ossec/queue/sockets/control', 'Deleted', None), ('/var/ossec/queue/sockets/com', 'Deleted', None), ('/var/ossec/queue/sockets/.wait', 'Deleted', None), ('/var/ossec/queue/sockets/upgrade', 'Deleted', None), ('/var/ossec/queue/sockets/queue', 'Deleted', None), ('/var/ossec/queue/sockets/logcollector', 'Deleted', None), ('/var/ossec/queue/sockets/syscheck', 'Deleted', None), ('/var/ossec/queue/alerts/cfgaq', 'Deleted', None), ('/var/ossec/queue/alerts/execq', 'Deleted', None), ('/var/ossec/queue/logcollector/file_status.json', 'Deleted', None)] ```

Still some issues around file reading happened, however, the method is detecting the changes in a specific directory

pro-akim commented 3 months ago

Update

Some changes have been done in the check-file comparison function:

Install scenario:

  1. /var snapshot_pre
  2. Wazuh Agent installation
  3. /var snapshot_post
  4. comparison between snapshot_pre and snapshot_post
postinstall =  {'changed_files': ['/var/log/dpkg.log', '/var/log/auth.log', '/var/log/syslog', '/var/log/journal/ea8d563452674de897687e4c554abfba/system.journal', '/var/lib/dpkg/status', '/var/cache/apt/pkgcache.bin'], 'added_files': ['/var/lib/dpkg/info/wazuh-agent.postinst', '/var/lib/dpkg/info/wazuh-agent.conffiles', '/var/lib/dpkg/info/wazuh-agent.preinst', '/var/lib/dpkg/info/wazuh-agent.postrm', '/var/lib/dpkg/info/wazuh-agent.templates', '/var/lib/dpkg/info/wazuh-agent.prerm', '/var/lib/dpkg/info/wazuh-agent.shlibs', '/var/lib/dpkg/info/wazuh-agent.list', '/var/lib/dpkg/info/wazuh-agent.md5sums', '/var/ossec/ruleset/sca/cis_ubuntu22-04.yml', '/var/ossec/wodles/utils.py', '/var/ossec/wodles/__init__.py', '/var/ossec/wodles/aws/aws-s3', '/var/ossec/wodles/azure/orm.py', '/var/ossec/wodles/azure/azure-logs', '/var/ossec/wodles/docker/DockerListener', '/var/ossec/wodles/gcloud/exceptions.py', '/var/ossec/wodles/gcloud/integration.py', '/var/ossec/wodles/gcloud/tools.py', '/var/ossec/wodles/gcloud/gcloud', '/var/ossec/wodles/gcloud/pubsub/subscriber.py', '/var/ossec/wodles/gcloud/buckets/bucket.py', '/var/ossec/wodles/gcloud/buckets/access_logs.py', '/var/ossec/var/run/wazuh-syscheckd-120670.pid', '/var/ossec/var/run/wazuh-agentd.state', '/var/ossec/var/run/wazuh-agentd-120657.pid', '/var/ossec/var/run/wazuh-execd-120646.pid', '/var/ossec/var/run/wazuh-modulesd-120700.pid', '/var/ossec/var/run/wazuh-logcollector-120683.pid', '/var/ossec/var/selinux/wazuh.pp', '/var/ossec/agentless/register_host.sh', '/var/ossec/agentless/ssh_integrity_check_linux', '/var/ossec/agentless/ssh_asa-fwsmconfig_diff', '/var/ossec/agentless/sshlogin.exp', '/var/ossec/agentless/ssh_foundry_diff', '/var/ossec/agentless/ssh_generic_diff', '/var/ossec/agentless/main.exp', '/var/ossec/agentless/su.exp', '/var/ossec/agentless/ssh.exp', '/var/ossec/agentless/ssh_pixconfig_diff', '/var/ossec/agentless/ssh_nopass.exp', '/var/ossec/agentless/ssh_integrity_check_bsd', '/var/ossec/bin/wazuh-control', '/var/ossec/bin/agent-auth', '/var/ossec/bin/wazuh-agentd', '/var/ossec/bin/wazuh-logcollector', '/var/ossec/bin/wazuh-modulesd', '/var/ossec/bin/manage_agents', '/var/ossec/bin/wazuh-syscheckd', '/var/ossec/bin/wazuh-execd', '/var/ossec/lib/libsysinfo.so', '/var/ossec/lib/libstdc++.so.6', '/var/ossec/lib/libwazuhshared.so', '/var/ossec/lib/libfimdb.so', '/var/ossec/lib/libsyscollector.so', '/var/ossec/lib/librsync.so', '/var/ossec/lib/libwazuhext.so', '/var/ossec/lib/libgcc_s.so.1', '/var/ossec/lib/libdbsync.so', '/var/ossec/etc/client.keys', '/var/ossec/etc/localtime', '/var/ossec/etc/wpk_root.pem', '/var/ossec/etc/local_internal_options.conf', '/var/ossec/etc/internal_options.conf', '/var/ossec/etc/ossec.conf', '/var/ossec/etc/shared/rootkit_trojans.txt', '/var/ossec/etc/shared/cis_win2012r2_memberL2_rcl.txt', '/var/ossec/etc/shared/win_audit_rcl.txt', '/var/ossec/etc/shared/cis_rhel_linux_rcl.txt', '/var/ossec/etc/shared/cis_mysql5-6_community_rcl.txt', '/var/ossec/etc/shared/win_malware_rcl.txt', '/var/ossec/etc/shared/cis_sles11_linux_rcl.txt', '/var/ossec/etc/shared/cis_win2012r2_domainL2_rcl.txt', '/var/ossec/etc/shared/cis_mysql5-6_enterprise_rcl.txt', '/var/ossec/etc/shared/cis_rhel5_linux_rcl.txt', '/var/ossec/etc/shared/system_audit_ssh.txt', '/var/ossec/etc/shared/cis_sles12_linux_rcl.txt', '/var/ossec/etc/shared/cis_apache2224_rcl.txt', '/var/ossec/etc/shared/cis_rhel7_linux_rcl.txt', '/var/ossec/etc/shared/win_applications_rcl.txt', '/var/ossec/etc/shared/system_audit_rcl.txt', '/var/ossec/etc/shared/cis_win2012r2_domainL1_rcl.txt', '/var/ossec/etc/shared/cis_debian_linux_rcl.txt', '/var/ossec/etc/shared/cis_rhel6_linux_rcl.txt', '/var/ossec/etc/shared/cis_win2012r2_memberL1_rcl.txt', '/var/ossec/etc/shared/rootkit_files.txt', '/var/ossec/active-response/bin/firewall-drop', '/var/ossec/active-response/bin/kaspersky.py', '/var/ossec/active-response/bin/route-null', '/var/ossec/active-response/bin/restart-wazuh', '/var/ossec/active-response/bin/ip-customblock', '/var/ossec/active-response/bin/firewalld-drop', '/var/ossec/active-response/bin/default-firewall-drop', '/var/ossec/active-response/bin/pf', '/var/ossec/active-response/bin/restart.sh', '/var/ossec/active-response/bin/host-deny', '/var/ossec/active-response/bin/ipfw', '/var/ossec/active-response/bin/disable-account', '/var/ossec/active-response/bin/wazuh-slack', '/var/ossec/active-response/bin/npf', '/var/ossec/active-response/bin/kaspersky', '/var/ossec/logs/active-responses.log', '/var/ossec/logs/ossec.log', '/var/ossec/queue/syscollector/norm_config.json', '/var/ossec/queue/syscollector/db/local.db-journal', '/var/ossec/queue/syscollector/db/local.db', '/var/ossec/queue/fim/db/fim.db', '/var/ossec/queue/fim/db/fim.db-journal', '/var/ossec/queue/sockets/wmodules', '/var/ossec/queue/sockets/control', '/var/ossec/queue/sockets/com', '/var/ossec/queue/sockets/.wait', '/var/ossec/queue/sockets/upgrade', '/var/ossec/queue/sockets/queue', '/var/ossec/queue/sockets/logcollector', '/var/ossec/queue/sockets/syscheck', '/var/ossec/queue/alerts/cfgaq', '/var/ossec/queue/alerts/execq', '/var/ossec/queue/logcollector/file_status.json'], 'deleted_files': []}

Number of files added:

print(len(postinstall['added_files']))

Print results

119

Uninstall scenario:

  1. /var snapshot_pre
  2. Wazuh Agent uninstall
  3. /var snapshot_post
  4. comparison between snapshot_pre and snapshot_post
postdelete =  {'changed_files': ['/var/log/dpkg.log', '/var/log/auth.log', '/var/log/syslog', '/var/log/apt/history.log', '/var/log/apt/term.log', '/var/log/journal/ea8d563452674de897687e4c554abfba/system.journal', '/var/lib/dpkg/status', '/var/cache/apt/pkgcache.bin'], 'added_files': [], 'deleted_files': ['/var/lib/dpkg/info/wazuh-agent.postinst', '/var/lib/dpkg/info/wazuh-agent.conffiles', '/var/lib/dpkg/info/wazuh-agent.preinst', '/var/lib/dpkg/info/wazuh-agent.postrm', '/var/lib/dpkg/info/wazuh-agent.templates', '/var/lib/dpkg/info/wazuh-agent.prerm', '/var/lib/dpkg/info/wazuh-agent.shlibs', '/var/lib/dpkg/info/wazuh-agent.list', '/var/lib/dpkg/info/wazuh-agent.md5sums', '/var/ossec/ruleset/sca/cis_ubuntu22-04.yml', '/var/ossec/wodles/utils.py', '/var/ossec/wodles/__init__.py', '/var/ossec/wodles/aws/aws-s3', '/var/ossec/wodles/azure/orm.py', '/var/ossec/wodles/azure/azure-logs', '/var/ossec/wodles/docker/DockerListener', '/var/ossec/wodles/gcloud/exceptions.py', '/var/ossec/wodles/gcloud/integration.py', '/var/ossec/wodles/gcloud/tools.py', '/var/ossec/wodles/gcloud/gcloud', '/var/ossec/wodles/gcloud/pubsub/subscriber.py', '/var/ossec/wodles/gcloud/buckets/bucket.py', '/var/ossec/wodles/gcloud/buckets/access_logs.py', '/var/ossec/var/run/wazuh-syscheckd-120670.pid', '/var/ossec/var/run/wazuh-agentd.state', '/var/ossec/var/run/wazuh-agentd-120657.pid', '/var/ossec/var/run/wazuh-execd-120646.pid', '/var/ossec/var/run/wazuh-modulesd-120700.pid', '/var/ossec/var/run/wazuh-logcollector-120683.pid', '/var/ossec/var/run/wazuh-logcollector.state', '/var/ossec/var/selinux/wazuh.pp', '/var/ossec/agentless/register_host.sh', '/var/ossec/agentless/ssh_integrity_check_linux', '/var/ossec/agentless/ssh_asa-fwsmconfig_diff', '/var/ossec/agentless/sshlogin.exp', '/var/ossec/agentless/ssh_foundry_diff', '/var/ossec/agentless/ssh_generic_diff', '/var/ossec/agentless/main.exp', '/var/ossec/agentless/su.exp', '/var/ossec/agentless/ssh.exp', '/var/ossec/agentless/ssh_pixconfig_diff', '/var/ossec/agentless/ssh_nopass.exp', '/var/ossec/agentless/ssh_integrity_check_bsd', '/var/ossec/bin/wazuh-control', '/var/ossec/bin/agent-auth', '/var/ossec/bin/wazuh-agentd', '/var/ossec/bin/wazuh-logcollector', '/var/ossec/bin/wazuh-modulesd', '/var/ossec/bin/manage_agents', '/var/ossec/bin/wazuh-syscheckd', '/var/ossec/bin/wazuh-execd', '/var/ossec/lib/libsysinfo.so', '/var/ossec/lib/libstdc++.so.6', '/var/ossec/lib/libwazuhshared.so', '/var/ossec/lib/libfimdb.so', '/var/ossec/lib/libsyscollector.so', '/var/ossec/lib/librsync.so', '/var/ossec/lib/libwazuhext.so', '/var/ossec/lib/libgcc_s.so.1', '/var/ossec/lib/libdbsync.so', '/var/ossec/etc/client.keys', '/var/ossec/etc/localtime', '/var/ossec/etc/wpk_root.pem', '/var/ossec/etc/local_internal_options.conf', '/var/ossec/etc/internal_options.conf', '/var/ossec/etc/ossec.conf', '/var/ossec/etc/shared/rootkit_trojans.txt', '/var/ossec/etc/shared/cis_win2012r2_memberL2_rcl.txt', '/var/ossec/etc/shared/win_audit_rcl.txt', '/var/ossec/etc/shared/cis_rhel_linux_rcl.txt', '/var/ossec/etc/shared/cis_mysql5-6_community_rcl.txt', '/var/ossec/etc/shared/win_malware_rcl.txt', '/var/ossec/etc/shared/cis_sles11_linux_rcl.txt', '/var/ossec/etc/shared/cis_win2012r2_domainL2_rcl.txt', '/var/ossec/etc/shared/cis_mysql5-6_enterprise_rcl.txt', '/var/ossec/etc/shared/cis_rhel5_linux_rcl.txt', '/var/ossec/etc/shared/system_audit_ssh.txt', '/var/ossec/etc/shared/cis_sles12_linux_rcl.txt', '/var/ossec/etc/shared/cis_apache2224_rcl.txt', '/var/ossec/etc/shared/cis_rhel7_linux_rcl.txt', '/var/ossec/etc/shared/win_applications_rcl.txt', '/var/ossec/etc/shared/system_audit_rcl.txt', '/var/ossec/etc/shared/cis_win2012r2_domainL1_rcl.txt', '/var/ossec/etc/shared/cis_debian_linux_rcl.txt', '/var/ossec/etc/shared/cis_rhel6_linux_rcl.txt', '/var/ossec/etc/shared/cis_win2012r2_memberL1_rcl.txt', '/var/ossec/etc/shared/rootkit_files.txt', '/var/ossec/active-response/bin/firewall-drop', '/var/ossec/active-response/bin/kaspersky.py', '/var/ossec/active-response/bin/route-null', '/var/ossec/active-response/bin/restart-wazuh', '/var/ossec/active-response/bin/ip-customblock', '/var/ossec/active-response/bin/firewalld-drop', '/var/ossec/active-response/bin/default-firewall-drop', '/var/ossec/active-response/bin/pf', '/var/ossec/active-response/bin/restart.sh', '/var/ossec/active-response/bin/host-deny', '/var/ossec/active-response/bin/ipfw', '/var/ossec/active-response/bin/disable-account', '/var/ossec/active-response/bin/wazuh-slack', '/var/ossec/active-response/bin/npf', '/var/ossec/active-response/bin/kaspersky', '/var/ossec/logs/active-responses.log', '/var/ossec/logs/ossec.log', '/var/ossec/queue/syscollector/norm_config.json', '/var/ossec/queue/syscollector/db/local.db-journal', '/var/ossec/queue/syscollector/db/local.db', '/var/ossec/queue/fim/db/fim.db', '/var/ossec/queue/fim/db/fim.db-journal', '/var/ossec/queue/sockets/wmodules', '/var/ossec/queue/sockets/control', '/var/ossec/queue/sockets/com', '/var/ossec/queue/sockets/.wait', '/var/ossec/queue/sockets/upgrade', '/var/ossec/queue/sockets/queue', '/var/ossec/queue/sockets/logcollector', '/var/ossec/queue/sockets/syscheck', '/var/ossec/queue/alerts/cfgaq', '/var/ossec/queue/alerts/execq', '/var/ossec/queue/logcollector/file_status.json']}

Number of files deleted:

print(len(postdelete['deleted_files'])

Print results

120

This would make us understand that using the number of files is not a good idea. The criteria to be used must be defined.

pro-akim commented 3 months ago

Update

Moving to an issue with higher priority.

pro-akim commented 2 months ago

Update

Considering the highlighted point in https://github.com/wazuh/wazuh-qa/issues/4843#issuecomment-1941938284, depending on the test, the provision should receive variables from installing only the manager, only the dependencies and libraries or those tasks should be handled by the test module as well. This point should be discussed with the team.


Another problem is that the test module commands are executed in the agent. In case I want to install the manager from the test module, I will need to refactor the structure of the module


After some discussion with the team. The manager will be installed by the provision. The agent by the Test module. In case the test module does not include the install test, the provision module should be added in the Yaml fixture to have the agent provision.

pro-akim commented 2 months ago

Update

Created install and uninstall + file verification system.

Regarding the check-file, some changes were applied:

  1. Hashing: The hashing methods have failed. Some files used were too unstable to hash the file.
  2. As the method is install (create new files) and uninstall (delete created files), I was able to find a common pattern of those files. This pattern is that they have wazuh or ossec in the path or file name. This point will be used as validation.
  3. All methods were tested and applied.

It only remains to add the new parameters required for the installation and uninstallation methods


Some rules to keep in mind:

  1. If the test module includes test_install, the agent provisioning module should not be added
  2. If the test module does not include test_install, the agent provisioning module must be included
  3. The test_uninstall should always go in the last position of the tests executed on the fixture

       - tests: "...,uninstall"
  4. The manager's supply must go in all cases
  5. The tests within test_uninstall that checked the opening of ports and the state of systemctl agent status have been removed since both assertions depended on the permanence of the installed agent (which in this case is initially removed)
  6. If you set live: True, keep in mind that the version and revision must exist in the path where is {packages} and {number_of_repository.x}

    The tests work correctly Correcting and improving script quality Running tests from workflow_engine


After having a meeting with @fcaffieri and @QU3B1M, we were able to conclude that the dependencies should be provisioned by the agent's provisioner, so the agent provisioning should always be executed. It will be worked on at https://github.com/wazuh/wazuh-qa/issues/4859 In the meantime, there will be a patch in deployability/playbooks/tests/setup.yml where it will be provisioned so that the tests developed in this issue can be tested.


Results:

Triggered by workflow ``` (deplo_test) akim@akim-PC:~/Desktop/wazuh-qa/deployability$ python3 -m workflow_engine /home/akim/Desktop/wazuh-qa/deployability/modules/workflow_engine/examples/dtt1-agents-poc.yaml [2024-02-21 15:41:07] [INFO] [1002459] [MainThread] [workflow_engine]: Starting workflow execution. [2024-02-21 15:41:07] [INFO] [1002459] [ThreadPoolExecutor-0_0] [workflow_engine]: Initiating execution of task "run-agent-tests-linux-ubuntu-22.04-amd64". [2024-02-21 15:42:38] [INFO] [1002459] [ThreadPoolExecutor-0_0] [workflow_engine]: Task "run-agent-tests-linux-ubuntu-22.04-amd64" completed succesfully in 90.13 seconds. [2024-02-21 15:42:38] [INFO] [1002459] [MainThread] [workflow_engine]: Executing cleanup tasks. ```
Only test module triggered over provisioned infrastructure ``` (deplo_test) akim@akim-PC:~/Desktop/wazuh-qa/deployability$ python3 modules/testing/main.py --inventory "/tmp/dtt1-poc/agent-linux-ubuntu-22.04-amd64/inventory.yaml" --component "agent" --wazuh-version "4.7.2" --wazuh-revision "1" --tests install --dependencies '{"manager":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml"}' --live False [2024-02-21 15:55:06] [INFO] TESTER: Running tests for 127.0.0.1 [2024-02-21 15:55:06] [DEBUG] TESTER: Dependencies found. Parsing... [2024-02-21 15:55:06] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'dependencies': ["{'manager': '127.0.0.1'}"], 'wazuh_version': '4.7.2', 'wazuh_revision': '1', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': False} [2024-02-21 15:55:06] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'127.0.0.1': {'ansible_port': 2200, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-FB77643E-9F6E-470E-80F6-13EDE4D93A5F/instance_key'}}}} [2024-02-21 15:55:06] [DEBUG] ANSIBLE: Running playbook: /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/setup.yml No config file found; using defaults PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [127.0.0.1] TASK [Update package lists] **************************************************** changed: [127.0.0.1] => changed=true cmd: - apt-get - update delta: '0:00:01.824711' end: '2024-02-21 14:55:09.254129' msg: '' rc: 0 start: '2024-02-21 14:55:07.429418' stderr: '' stderr_lines: stdout: |- Hit:1 https://mirrors.edge.kernel.org/ubuntu jammy InRelease Hit:2 https://mirrors.edge.kernel.org/ubuntu jammy-updates InRelease Hit:3 https://mirrors.edge.kernel.org/ubuntu jammy-backports InRelease Hit:4 https://mirrors.edge.kernel.org/ubuntu jammy-security InRelease Reading package lists... stdout_lines: TASK [Install pip] ************************************************************* changed: [127.0.0.1] => changed=true cmd: - apt-get - install - python3-pip - -y delta: '0:00:00.583040' end: '2024-02-21 14:55:10.115021' msg: '' rc: 0 start: '2024-02-21 14:55:09.531981' stderr: '' stderr_lines: stdout: |- Reading package lists... Building dependency tree... Reading state information... python3-pip is already the newest version (22.0.2+dfsg-1ubuntu0.4). 0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded. stdout_lines: TASK [Create test directory] *************************************************** changed: [127.0.0.1] => changed=true gid: 0 group: root mode: '0755' owner: root path: /tmp/tests size: 4096 state: directory uid: 0 TASK [Copy files to endpoints] ************************************************* changed: [127.0.0.1] => changed=true dest: /tmp/tests/ src: /home/akim/Desktop/wazuh-qa/deployability/modules/testing/tests/ TASK [Copy deps requirements] ************************************************** changed: [127.0.0.1] => changed=true checksum: a3d8a0778e4f99a36383f606467b126a00dad073 dest: /tmp/tests/remote_requirements.txt gid: 0 group: root md5sum: 4843eb6e974efb995a4943f137039976 mode: '0644' owner: root size: 88 src: /home/vagrant/.ansible/tmp/ansible-tmp-1708527320.9133325-1006903-266755794752175/source state: file uid: 0 TASK [Install dependencies using pip3] ***************************************** changed: [127.0.0.1] => changed=true cmd: - pip3 - install - -r - /tmp/tests/remote_requirements.txt delta: '0:00:00.719347' end: '2024-02-21 14:55:21.473974' msg: '' rc: 0 start: '2024-02-21 14:55:20.754627' stderr: 'WARNING: Running pip as the ''root'' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv' stderr_lines: stdout: |- Requirement already satisfied: pytest<8.0.0,>=7.4.2 in /usr/local/lib/python3.10/dist-packages (from -r /tmp/tests/remote_requirements.txt (line 2)) (7.4.4) Requirement already satisfied: chardet==5.2.0 in /usr/local/lib/python3.10/dist-packages (from -r /tmp/tests/remote_requirements.txt (line 3)) (5.2.0) Requirement already satisfied: pytest-tinybird==0.2.0 in /usr/local/lib/python3.10/dist-packages (from -r /tmp/tests/remote_requirements.txt (line 5)) (0.2.0) Requirement already satisfied: requests>=2.28.1 in /usr/local/lib/python3.10/dist-packages (from pytest-tinybird==0.2.0->-r /tmp/tests/remote_requirements.txt (line 5)) (2.31.0) Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /usr/local/lib/python3.10/dist-packages (from pytest<8.0.0,>=7.4.2->-r /tmp/tests/remote_requirements.txt (line 2)) (1.2.0) Requirement already satisfied: iniconfig in /usr/local/lib/python3.10/dist-packages (from pytest<8.0.0,>=7.4.2->-r /tmp/tests/remote_requirements.txt (line 2)) (2.0.0) Requirement already satisfied: pluggy<2.0,>=0.12 in /usr/local/lib/python3.10/dist-packages (from pytest<8.0.0,>=7.4.2->-r /tmp/tests/remote_requirements.txt (line 2)) (1.4.0) Requirement already satisfied: tomli>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from pytest<8.0.0,>=7.4.2->-r /tmp/tests/remote_requirements.txt (line 2)) (2.0.1) Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from pytest<8.0.0,>=7.4.2->-r /tmp/tests/remote_requirements.txt (line 2)) (23.2) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.28.1->pytest-tinybird==0.2.0->-r /tmp/tests/remote_requirements.txt (line 5)) (2024.2.2) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.28.1->pytest-tinybird==0.2.0->-r /tmp/tests/remote_requirements.txt (line 5)) (2.2.1) Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests>=2.28.1->pytest-tinybird==0.2.0->-r /tmp/tests/remote_requirements.txt (line 5)) (3.3) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.28.1->pytest-tinybird==0.2.0->-r /tmp/tests/remote_requirements.txt (line 5)) (3.3.2) stdout_lines: PLAY RECAP ********************************************************************* 127.0.0.1 : ok=7 changed=6 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-02-21 15:55:22] [DEBUG] ANSIBLE: Playbook /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/setup.yml finished with status {'skipped': {}, 'ok': {'127.0.0.1': 7}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'127.0.0.1': 1}, 'changed': {'127.0.0.1': 6}} [2024-02-21 15:55:22] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-02-21 15:55:22] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'127.0.0.1': {'ansible_port': 2200, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-FB77643E-9F6E-470E-80F6-13EDE4D93A5F/instance_key'}}}} [2024-02-21 15:55:22] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'all', 'become': True, 'tasks': [{'name': 'Test install for agent', 'command': "pytest test_agent/test_install.py -v --wazuh_version=4.7.2 --wazuh_revision=1 --component=agent --dependencies='{'manager': '127.0.0.1'}' --live=False -s", 'args': {'chdir': '/tmp/tests'}}]}] No config file found; using defaults PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [127.0.0.1] TASK [Test install for agent] ************************************************** changed: [127.0.0.1] => changed=true cmd: - pytest - test_agent/test_install.py - -v - --wazuh_version=4.7.2 - --wazuh_revision=1 - --component=agent - '--dependencies={manager: 127.0.0.1}' - --live=False - -s delta: '0:00:26.602826' end: '2024-02-21 14:55:50.528501' msg: '' rc: 0 start: '2024-02-21 14:55:23.925675' stderr: |- --2024-02-21 14:55:24-- https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.7.2-1_amd64.deb Resolving packages.wazuh.com (packages.wazuh.com)... 18.172.213.107, 18.172.213.18, 18.172.213.36, ... Connecting to packages.wazuh.com (packages.wazuh.com)|18.172.213.107|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 9378542 (8.9M) [binary/octet-stream] Saving to: ‘wazuh-agent_4.7.2-1_x86_64.deb’ 0K .......... .......... .......... .......... .......... 0% 4.23M 2s 50K .......... .......... .......... .......... .......... 1% 10.5M 1s 100K .......... .......... .......... .......... .......... 1% 7.64M 1s 150K .......... .......... .......... .......... .......... 2% 17.7M 1s 200K .......... .......... .......... .......... .......... 2% 24.4M 1s 250K .......... .......... .......... .......... .......... 3% 19.8M 1s 300K .......... .......... .......... .......... .......... 3% 26.4M 1s 350K .......... .......... .......... .......... .......... 4% 16.0M 1s 400K .......... .......... .......... .......... .......... 4% 9.72M 1s 450K .......... .......... .......... .......... .......... 5% 43.3M 1s 500K .......... .......... .......... .......... .......... 6% 26.2M 1s 550K .......... .......... .......... .......... .......... 6% 7.76M 1s 600K .......... .......... .......... .......... .......... 7% 51.2M 1s 650K .......... .......... .......... .......... .......... 7% 43.1M 1s 700K .......... .......... .......... .......... .......... 8% 37.4M 1s 750K .......... .......... .......... .......... .......... 8% 20.2M 1s 800K .......... .......... .......... .......... .......... 9% 48.2M 1s 850K .......... .......... .......... .......... .......... 9% 265M 1s 900K .......... .......... .......... .......... .......... 10% 12.3M 1s 950K .......... .......... .......... .......... .......... 10% 41.1M 0s 1000K .......... .......... .......... .......... .......... 11% 52.1M 0s 1050K .......... .......... .......... .......... .......... 12% 290M 0s 1100K .......... .......... .......... .......... .......... 12% 26.8M 0s 1150K .......... .......... .......... .......... .......... 13% 11.9M 0s 1200K .......... .......... .......... .......... .......... 13% 26.1M 0s 1250K .......... .......... .......... .......... .......... 14% 11.1M 0s 1300K .......... .......... .......... .......... .......... 14% 40.4M 0s 1350K .......... .......... .......... .......... .......... 15% 40.7M 0s 1400K .......... .......... .......... .......... .......... 15% 76.0M 0s 1450K .......... .......... .......... .......... .......... 16% 54.4M 0s 1500K .......... .......... .......... .......... .......... 16% 30.7M 0s 1550K .......... .......... .......... .......... .......... 17% 31.1M 0s 1600K .......... .......... .......... .......... .......... 18% 40.1M 0s 1650K .......... .......... .......... .......... .......... 18% 30.4M 0s 1700K .......... .......... .......... .......... .......... 19% 18.2M 0s 1750K .......... .......... .......... .......... .......... 19% 18.3M 0s 1800K .......... .......... .......... .......... .......... 20% 26.1M 0s 1850K .......... .......... .......... .......... .......... 20% 39.4M 0s 1900K .......... .......... .......... .......... .......... 21% 18.6M 0s 1950K .......... .......... .......... .......... .......... 21% 23.4M 0s 2000K .......... .......... .......... .......... .......... 22% 46.5M 0s 2050K .......... .......... .......... .......... .......... 22% 6.81M 0s 2100K .......... .......... .......... .......... .......... 23% 63.2M 0s 2150K .......... .......... .......... .......... .......... 24% 232M 0s 2200K .......... .......... .......... .......... .......... 24% 251M 0s 2250K .......... .......... .......... .......... .......... 25% 14.8M 0s 2300K .......... .......... .......... .......... .......... 25% 40.1M 0s 2350K .......... .......... .......... .......... .......... 26% 16.5M 0s 2400K .......... .......... .......... .......... .......... 26% 21.3M 0s 2450K .......... .......... .......... .......... .......... 27% 27.4M 0s 2500K .......... .......... .......... .......... .......... 27% 27.2M 0s 2550K .......... .......... .......... .......... .......... 28% 27.9M 0s 2600K .......... .......... .......... .......... .......... 28% 46.7M 0s 2650K .......... .......... .......... .......... .......... 29% 9.17M 0s 2700K .......... .......... .......... .......... .......... 30% 59.2M 0s 2750K .......... .......... .......... .......... .......... 30% 9.41M 0s 2800K .......... .......... .......... .......... .......... 31% 246M 0s 2850K .......... .......... .......... .......... .......... 31% 24.8M 0s 2900K .......... .......... .......... .......... .......... 32% 26.5M 0s 2950K .......... .......... .......... .......... .......... 32% 21.5M 0s 3000K .......... .......... .......... .......... .......... 33% 28.9M 0s 3050K .......... .......... .......... .......... .......... 33% 24.6M 0s 3100K .......... .......... .......... .......... .......... 34% 30.9M 0s 3150K .......... .......... .......... .......... .......... 34% 29.1M 0s 3200K .......... .......... .......... .......... .......... 35% 15.8M 0s 3250K .......... .......... .......... .......... .......... 36% 26.6M 0s 3300K .......... .......... .......... .......... .......... 36% 17.1M 0s 3350K .......... .......... .......... .......... .......... 37% 39.2M 0s 3400K .......... .......... .......... .......... .......... 37% 20.8M 0s 3450K .......... .......... .......... .......... .......... 38% 25.5M 0s 3500K .......... .......... .......... .......... .......... 38% 38.9M 0s 3550K .......... .......... .......... .......... .......... 39% 31.8M 0s 3600K .......... .......... .......... .......... .......... 39% 28.5M 0s 3650K .......... .......... .......... .......... .......... 40% 14.0M 0s 3700K .......... .......... .......... .......... .......... 40% 37.6M 0s 3750K .......... .......... .......... .......... .......... 41% 27.3M 0s 3800K .......... .......... .......... .......... .......... 42% 18.3M 0s 3850K .......... .......... .......... .......... .......... 42% 33.1M 0s 3900K .......... .......... .......... .......... .......... 43% 35.8M 0s 3950K .......... .......... .......... .......... .......... 43% 21.1M 0s 4000K .......... .......... .......... .......... .......... 44% 29.7M 0s 4050K .......... .......... .......... .......... .......... 44% 34.2M 0s 4100K .......... .......... .......... .......... .......... 45% 30.2M 0s 4150K .......... .......... .......... .......... .......... 45% 11.1M 0s 4200K .......... .......... .......... .......... .......... 46% 30.4M 0s 4250K .......... .......... .......... .......... .......... 46% 25.6M 0s 4300K .......... .......... .......... .......... .......... 47% 29.2M 0s 4350K .......... .......... .......... .......... .......... 48% 32.9M 0s 4400K .......... .......... .......... .......... .......... 48% 29.7M 0s 4450K .......... .......... .......... .......... .......... 49% 20.3M 0s 4500K .......... .......... .......... .......... .......... 49% 33.7M 0s 4550K .......... .......... .......... .......... .......... 50% 13.1M 0s 4600K .......... .......... .......... .......... .......... 50% 23.6M 0s 4650K .......... .......... .......... .......... .......... 51% 61.9M 0s 4700K .......... .......... .......... .......... .......... 51% 18.9M 0s 4750K .......... .......... .......... .......... .......... 52% 29.1M 0s 4800K .......... .......... .......... .......... .......... 52% 36.7M 0s 4850K .......... .......... .......... .......... .......... 53% 14.0M 0s 4900K .......... .......... .......... .......... .......... 54% 31.7M 0s 4950K .......... .......... .......... .......... .......... 54% 36.5M 0s 5000K .......... .......... .......... .......... .......... 55% 34.5M 0s 5050K .......... .......... .......... .......... .......... 55% 9.91M 0s 5100K .......... .......... .......... .......... .......... 56% 30.0M 0s 5150K .......... .......... .......... .......... .......... 56% 35.7M 0s 5200K .......... .......... .......... .......... .......... 57% 15.0M 0s 5250K .......... .......... .......... .......... .......... 57% 36.9M 0s 5300K .......... .......... .......... .......... .......... 58% 42.4M 0s 5350K .......... .......... .......... .......... .......... 58% 12.0M 0s 5400K .......... .......... .......... .......... .......... 59% 38.8M 0s 5450K .......... .......... .......... .......... .......... 60% 10.1M 0s 5500K .......... .......... .......... .......... .......... 60% 7.87M 0s 5550K .......... .......... .......... .......... .......... 61% 33.1M 0s 5600K .......... .......... .......... .......... .......... 61% 28.3M 0s 5650K .......... .......... .......... .......... .......... 62% 23.0M 0s 5700K .......... .......... .......... .......... .......... 62% 12.5M 0s 5750K .......... .......... .......... .......... .......... 63% 127M 0s 5800K .......... .......... .......... .......... .......... 63% 12.9M 0s 5850K .......... .......... .......... .......... .......... 64% 141M 0s 5900K .......... .......... .......... .......... .......... 64% 33.8M 0s 5950K .......... .......... .......... .......... .......... 65% 23.9M 0s 6000K .......... .......... .......... .......... .......... 66% 13.0M 0s 6050K .......... .......... .......... .......... .......... 66% 27.2M 0s 6100K .......... .......... .......... .......... .......... 67% 31.8M 0s 6150K .......... .......... .......... .......... .......... 67% 12.7M 0s 6200K .......... .......... .......... .......... .......... 68% 32.1M 0s 6250K .......... .......... .......... .......... .......... 68% 31.2M 0s 6300K .......... .......... .......... .......... .......... 69% 19.3M 0s 6350K .......... .......... .......... .......... .......... 69% 31.4M 0s 6400K .......... .......... .......... .......... .......... 70% 34.5M 0s 6450K .......... .......... .......... .......... .......... 70% 22.1M 0s 6500K .......... .......... .......... .......... .......... 71% 9.50M 0s 6550K .......... .......... .......... .......... .......... 72% 33.6M 0s 6600K .......... .......... .......... .......... .......... 72% 34.7M 0s 6650K .......... .......... .......... .......... .......... 73% 24.8M 0s 6700K .......... .......... .......... .......... .......... 73% 21.5M 0s 6750K .......... .......... .......... .......... .......... 74% 9.64M 0s 6800K .......... .......... .......... .......... .......... 74% 38.6M 0s 6850K .......... .......... .......... .......... .......... 75% 22.7M 0s 6900K .......... .......... .......... .......... .......... 75% 38.9M 0s 6950K .......... .......... .......... .......... .......... 76% 27.4M 0s 7000K .......... .......... .......... .......... .......... 76% 37.0M 0s 7050K .......... .......... .......... .......... .......... 77% 9.01M 0s 7100K .......... .......... .......... .......... .......... 78% 33.6M 0s 7150K .......... .......... .......... .......... .......... 78% 48.1M 0s 7200K .......... .......... .......... .......... .......... 79% 19.9M 0s 7250K .......... .......... .......... .......... .......... 79% 29.2M 0s 7300K .......... .......... .......... .......... .......... 80% 34.2M 0s 7350K .......... .......... .......... .......... .......... 80% 29.3M 0s 7400K .......... .......... .......... .......... .......... 81% 21.6M 0s 7450K .......... .......... .......... .......... .......... 81% 31.2M 0s 7500K .......... .......... .......... .......... .......... 82% 29.8M 0s 7550K .......... .......... .......... .......... .......... 82% 33.2M 0s 7600K .......... .......... .......... .......... .......... 83% 18.8M 0s 7650K .......... .......... .......... .......... .......... 84% 34.6M 0s 7700K .......... .......... .......... .......... .......... 84% 26.2M 0s 7750K .......... .......... .......... .......... .......... 85% 24.3M 0s 7800K .......... .......... .......... .......... .......... 85% 45.2M 0s 7850K .......... .......... .......... .......... .......... 86% 24.1M 0s 7900K .......... .......... .......... .......... .......... 86% 16.4M 0s 7950K .......... .......... .......... .......... .......... 87% 15.8M 0s 8000K .......... .......... .......... .......... .......... 87% 49.6M 0s 8050K .......... .......... .......... .......... .......... 88% 14.3M 0s 8100K .......... .......... .......... .......... .......... 88% 39.7M 0s 8150K .......... .......... .......... .......... .......... 89% 23.3M 0s 8200K .......... .......... .......... .......... .......... 90% 39.0M 0s 8250K .......... .......... .......... .......... .......... 90% 12.6M 0s 8300K .......... .......... .......... .......... .......... 91% 31.4M 0s 8350K .......... .......... .......... .......... .......... 91% 10.6M 0s 8400K .......... .......... .......... .......... .......... 92% 33.6M 0s 8450K .......... .......... .......... .......... .......... 92% 30.8M 0s 8500K .......... .......... .......... .......... .......... 93% 13.9M 0s 8550K .......... .......... .......... .......... .......... 93% 21.8M 0s 8600K .......... .......... .......... .......... .......... 94% 83.3M 0s 8650K .......... .......... .......... .......... .......... 94% 8.74M 0s 8700K .......... .......... .......... .......... .......... 95% 6.17M 0s 8750K .......... .......... .......... .......... .......... 96% 13.7M 0s 8800K .......... .......... .......... .......... .......... 96% 52.7M 0s 8850K .......... .......... .......... .......... .......... 97% 97.8M 0s 8900K .......... .......... .......... .......... .......... 97% 52.7M 0s 8950K .......... .......... .......... .......... .......... 98% 58.9M 0s 9000K .......... .......... .......... .......... .......... 98% 121M 0s 9050K .......... .......... .......... .......... .......... 99% 18.8M 0s 9100K .......... .......... .......... .......... .......... 99% 24.6M 0s 9150K ........ 100% 30.7M=0.4s 2024-02-21 14:55:24 (21.9 MB/s) - ‘wazuh-agent_4.7.2-1_x86_64.deb’ saved [9378542/9378542] Created symlink /etc/systemd/system/multi-user.target.wants/wazuh-agent.service → /lib/systemd/system/wazuh-agent.service. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.4.0 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /tmp/tests plugins: tinybird-0.2.0 collecting ... collected 7 items test_agent/test_install.py::test_installation Selecting previously unselected package wazuh-agent. (Reading database ... 82989 files and directories currently installed.) Preparing to unpack .../wazuh-agent_4.7.2-1_x86_64.deb ... Unpacking wazuh-agent (4.7.2-1) ... Setting up wazuh-agent (4.7.2-1) ... PASSED test_agent/test_install.py::test_wazuh_user PASSED test_agent/test_install.py::test_wazuh_group PASSED test_agent/test_install.py::test_wazuh_configuration PASSED test_agent/test_install.py::test_wazuh_control PASSED test_agent/test_install.py::test_wazuh_service PASSED test_agent/test_install.py::test_wazuh_daemons PASSED ============================== 7 passed in 26.30s ============================== stdout_lines: PLAY RECAP ********************************************************************* 127.0.0.1 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-02-21 15:55:51] [DEBUG] ANSIBLE: Playbook [{'hosts': 'all', 'become': True, 'tasks': [{'name': 'Test install for agent', 'command': "pytest test_agent/test_install.py -v --wazuh_version=4.7.2 --wazuh_revision=1 --component=agent --dependencies='{'manager': '127.0.0.1'}' --live=False -s", 'args': {'chdir': '/tmp/tests'}}]}] finished with status {'skipped': {}, 'ok': {'127.0.0.1': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'127.0.0.1': 1}, 'changed': {'127.0.0.1': 1}} [2024-02-21 15:55:51] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'127.0.0.1': {'ansible_port': 2200, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-FB77643E-9F6E-470E-80F6-13EDE4D93A5F/instance_key'}}}} [2024-02-21 15:55:51] [DEBUG] ANSIBLE: Running playbook: /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml No config file found; using defaults PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [127.0.0.1] TASK [Clean test directory] **************************************************** changed: [127.0.0.1] => changed=true path: /tmp/tests state: absent PLAY RECAP ********************************************************************* 127.0.0.1 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-02-21 15:55:54] [DEBUG] ANSIBLE: Playbook /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'127.0.0.1': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'127.0.0.1': 1}, 'changed': {'127.0.0.1': 1}} ``` ``` (deplo_test) akim@akim-PC:~/Desktop/wazuh-qa/deployability$ python3 modules/testing/main.py --inventory "/tmp/dtt1-poc/agent-linux-ubuntu-22.04-amd64/inventory.yaml" --component "agent" --wazuh-version "4.7.2" --wazuh-revision "1" --tests uninstall --dependencies '{"manager":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml"}' --live False [2024-02-21 16:41:54] [INFO] TESTER: Running tests for 127.0.0.1 [2024-02-21 16:41:54] [DEBUG] TESTER: Dependencies found. Parsing... [2024-02-21 16:41:54] [DEBUG] TESTER: Using extra vars: {'component': 'agent', 'dependencies': ["{'manager': '127.0.0.1'}"], 'wazuh_version': '4.7.2', 'wazuh_revision': '1', 'wazuh_branch': None, 'working_dir': '/tmp/tests', 'live': False} [2024-02-21 16:41:54] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'127.0.0.1': {'ansible_port': 2200, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-6B25C4E8-39B0-4FB6-9F49-801436F8A6AC/instance_key'}}}} [2024-02-21 16:41:54] [DEBUG] ANSIBLE: Running playbook: /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/setup.yml No config file found; using defaults PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [127.0.0.1] TASK [Update package lists] **************************************************** changed: [127.0.0.1] => changed=true cmd: - apt-get - update delta: '0:00:02.543456' end: '2024-02-21 15:41:57.234080' msg: '' rc: 0 start: '2024-02-21 15:41:54.690624' stderr: '' stderr_lines: stdout: |- Hit:1 https://mirrors.edge.kernel.org/ubuntu jammy InRelease Hit:2 https://mirrors.edge.kernel.org/ubuntu jammy-updates InRelease Hit:3 https://mirrors.edge.kernel.org/ubuntu jammy-backports InRelease Hit:4 https://mirrors.edge.kernel.org/ubuntu jammy-security InRelease Reading package lists... stdout_lines: TASK [Install pip] ************************************************************* changed: [127.0.0.1] => changed=true cmd: - apt-get - install - python3-pip - -y delta: '0:00:00.592380' end: '2024-02-21 15:41:58.098208' msg: '' rc: 0 start: '2024-02-21 15:41:57.505828' stderr: '' stderr_lines: stdout: |- Reading package lists... Building dependency tree... Reading state information... python3-pip is already the newest version (22.0.2+dfsg-1ubuntu0.4). 0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded. stdout_lines: TASK [Create test directory] *************************************************** changed: [127.0.0.1] => changed=true gid: 0 group: root mode: '0755' owner: root path: /tmp/tests size: 4096 state: directory uid: 0 TASK [Copy files to endpoints] ************************************************* changed: [127.0.0.1] => changed=true dest: /tmp/tests/ src: /home/akim/Desktop/wazuh-qa/deployability/modules/testing/tests/ TASK [Copy deps requirements] ************************************************** changed: [127.0.0.1] => changed=true checksum: 1c2344b831e364ab2065f9a6b2be2e664b2d22b5 dest: /tmp/tests/remote_requirements.txt gid: 0 group: root md5sum: 26ff33365676ad30ed83856afe65d623 mode: '0644' owner: root size: 118 src: /home/vagrant/.ansible/tmp/ansible-tmp-1708530130.4731636-1066953-28105309688869/source state: file uid: 0 TASK [Install dependencies using pip3] ***************************************** changed: [127.0.0.1] => changed=true cmd: - pip3 - install - -r - /tmp/tests/remote_requirements.txt delta: '0:00:00.762885' end: '2024-02-21 15:42:09.786331' msg: '' rc: 0 start: '2024-02-21 15:42:09.023446' stderr: 'WARNING: Running pip as the ''root'' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv' stderr_lines: stdout: |- Requirement already satisfied: pytest<8.0.0,>=7.4.2 in /usr/local/lib/python3.10/dist-packages (from -r /tmp/tests/remote_requirements.txt (line 2)) (7.4.4) Requirement already satisfied: chardet==5.2.0 in /usr/local/lib/python3.10/dist-packages (from -r /tmp/tests/remote_requirements.txt (line 3)) (5.2.0) Requirement already satisfied: pytest-tinybird==0.2.0 in /usr/local/lib/python3.10/dist-packages (from -r /tmp/tests/remote_requirements.txt (line 5)) (0.2.0) Requirement already satisfied: requests>=2.31.0 in /usr/local/lib/python3.10/dist-packages (from -r /tmp/tests/remote_requirements.txt (line 6)) (2.31.0) Requirement already satisfied: psutil>=5.8.0 in /usr/local/lib/python3.10/dist-packages (from -r /tmp/tests/remote_requirements.txt (line 7)) (5.9.8) Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from pytest<8.0.0,>=7.4.2->-r /tmp/tests/remote_requirements.txt (line 2)) (23.2) Requirement already satisfied: tomli>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from pytest<8.0.0,>=7.4.2->-r /tmp/tests/remote_requirements.txt (line 2)) (2.0.1) Requirement already satisfied: pluggy<2.0,>=0.12 in /usr/local/lib/python3.10/dist-packages (from pytest<8.0.0,>=7.4.2->-r /tmp/tests/remote_requirements.txt (line 2)) (1.4.0) Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /usr/local/lib/python3.10/dist-packages (from pytest<8.0.0,>=7.4.2->-r /tmp/tests/remote_requirements.txt (line 2)) (1.2.0) Requirement already satisfied: iniconfig in /usr/local/lib/python3.10/dist-packages (from pytest<8.0.0,>=7.4.2->-r /tmp/tests/remote_requirements.txt (line 2)) (2.0.0) Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests>=2.31.0->-r /tmp/tests/remote_requirements.txt (line 6)) (3.3) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.31.0->-r /tmp/tests/remote_requirements.txt (line 6)) (2.2.1) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.31.0->-r /tmp/tests/remote_requirements.txt (line 6)) (3.3.2) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.31.0->-r /tmp/tests/remote_requirements.txt (line 6)) (2024.2.2) stdout_lines: PLAY RECAP ********************************************************************* 127.0.0.1 : ok=7 changed=6 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-02-21 16:42:12] [DEBUG] ANSIBLE: Playbook /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/setup.yml finished with status {'skipped': {}, 'ok': {'127.0.0.1': 7}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'127.0.0.1': 1}, 'changed': {'127.0.0.1': 6}} [2024-02-21 16:42:12] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-02-21 16:42:12] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'127.0.0.1': {'ansible_port': 2200, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-6B25C4E8-39B0-4FB6-9F49-801436F8A6AC/instance_key'}}}} [2024-02-21 16:42:12] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'all', 'become': True, 'tasks': [{'name': 'Test uninstall for agent', 'command': "pytest test_agent/test_uninstall.py -v --wazuh_version=4.7.2 --wazuh_revision=1 --component=agent --dependencies='{'manager': '127.0.0.1'}' --live=False -s", 'args': {'chdir': '/tmp/tests'}}]}] No config file found; using defaults PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [127.0.0.1] TASK [Test uninstall for agent] ************************************************ changed: [127.0.0.1] => changed=true cmd: - pytest - test_agent/test_uninstall.py - -v - --wazuh_version=4.7.2 - --wazuh_revision=1 - --component=agent - '--dependencies={manager: 127.0.0.1}' - --live=False - -s delta: '0:00:05.899036' end: '2024-02-21 15:42:18.096315' msg: '' rc: 0 start: '2024-02-21 15:42:12.197279' stderr: Removed /etc/systemd/system/multi-user.target.wants/wazuh-agent.service. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.4.0 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /tmp/tests plugins: tinybird-0.2.0 collecting ... collected 5 items test_agent/test_uninstall.py::test_uninstallation 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 85 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 ... 83369 files and directories currently installed.) Removing wazuh-agent (4.7.2-1) ... 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 85 not upgraded. After this operation, 0 B of additional disk space will be used. (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 ... 83005 files and directories currently installed.) Purging configuration files for wazuh-agent (4.7.2-1) ... dpkg: warning: while removing wazuh-agent, directory '/usr/lib/systemd/system' not empty so not removed PASSED test_agent/test_uninstall.py::test_wazuh_user PASSED test_agent/test_uninstall.py::test_wazuh_group PASSED test_agent/test_uninstall.py::test_process_not_running PASSED test_agent/test_uninstall.py::test_config_is_not_maintained PASSED ============================== 5 passed in 5.61s =============================== stdout_lines: PLAY RECAP ********************************************************************* 127.0.0.1 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-02-21 16:42:20] [DEBUG] ANSIBLE: Playbook [{'hosts': 'all', 'become': True, 'tasks': [{'name': 'Test uninstall for agent', 'command': "pytest test_agent/test_uninstall.py -v --wazuh_version=4.7.2 --wazuh_revision=1 --component=agent --dependencies='{'manager': '127.0.0.1'}' --live=False -s", 'args': {'chdir': '/tmp/tests'}}]}] finished with status {'skipped': {}, 'ok': {'127.0.0.1': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'127.0.0.1': 1}, 'changed': {'127.0.0.1': 1}} [2024-02-21 16:42:20] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'127.0.0.1': {'ansible_port': 2200, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-6B25C4E8-39B0-4FB6-9F49-801436F8A6AC/instance_key'}}}} [2024-02-21 16:42:20] [DEBUG] ANSIBLE: Running playbook: /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml No config file found; using defaults PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [127.0.0.1] TASK [Clean test directory] **************************************************** changed: [127.0.0.1] => changed=true path: /tmp/tests state: absent PLAY RECAP ********************************************************************* 127.0.0.1 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-02-21 16:42:23] [DEBUG] ANSIBLE: Playbook /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'127.0.0.1': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'127.0.0.1': 1}, 'changed': {'127.0.0.1': 1}} ```
pro-akim commented 2 months ago

Update

Changes done

pro-akim commented 2 months ago

Update

The merge between the old and new branches remained pending

pro-akim commented 2 months ago

Update

Testing Merge

Many tests are failing :red_circle:


After discussing with @QU3B1M, we've gained insights into some issues related to API functions. Consequently, certain changes are necessary regarding the parameters passed to the test. (Many of them are failing due to the change from dependency_ip to dependencies)

On another note:

  1. The "install" process will now include a one-line installation option where the manager_ip will be automatically added. If the parameter is set to false, the installation will proceed with MANAGER_IP instead of the actual IP.
  2. The "Register" test will incorporate a validation step for the current_ip. If the IP is set to MANAGER_IP, it will be replaced with the current IP. If a real IP is provided, the test will only trigger a restart.

connection was merged to registration

install :green_circle: stop :green_circle: uninstall :green_circle: basic_info :red_circle: restart :red_circle: registration :construction:

Failures

utils.get_client_keys() and api requests

pro-akim commented 2 months ago

Update

Installation of the agent is done, however the manager is not detecting the installation Even running it manually evidence

For that reason, clientkeys are empy and api is failing getting the agent_id

Even using the installation by repository is not working.

Naming of the agent was the problem

evidence2


install :green_circle: ``` python3 modules/testing/main.py --inventory "/tmp/dtt1-poc/agent-linux-ubuntu-22.04-amd64/inventory.yaml" --component "agent" --wazuh-version "4.7.2" --wazuh-revision "1" --tests install --dependencies '{"manager":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml"}' --live False --one_line True ``` ``` TASK [Test install for agent] ************************************************** changed: [192.168.57.3] => changed=true cmd: - pytest - test_agent/test_install.py - -v - --wazuh_version=4.7.2 - --wazuh_revision=1 - --component=agent - '--dependencies={manager: 192.168.57.2}' - --live=False - --one_line=True - -s delta: '0:00:10.754516' end: '2024-02-23 11:19:50.957135' msg: '' rc: 0 start: '2024-02-23 11:19:40.202619' stderr: |- --2024-02-23 11:19:40-- https://packages-dev.wazuh.com/pre-release/apt/pool/main/w/wazuh-agent/wazuh-agent_4.7.2-1_amd64.deb Resolving packages-dev.wazuh.com (packages-dev.wazuh.com)... 52.84.66.126, 52.84.66.16, 52.84.66.65, ... Connecting to packages-dev.wazuh.com (packages-dev.wazuh.com)|52.84.66.126|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 9378542 (8.9M) [binary/octet-stream] Saving to: ‘wazuh-agent_4.7.2-1_x86_64.deb’ 0K .......... .......... .......... .......... .......... 0% 3.74M 2s 50K .......... .......... .......... .......... .......... 1% 3.18M 3s 100K .......... .......... .......... .......... .......... 1% 4.53M 2s 150K .......... .......... .......... .......... .......... 2% 7.96M 2s 200K .......... .......... .......... .......... .......... 2% 6.17M 2s 250K .......... .......... .......... .......... .......... 3% 9.72M 2s 300K .......... .......... .......... .......... .......... 3% 14.6M 2s 350K .......... .......... .......... .......... .......... 4% 18.8M 1s 400K .......... .......... .......... .......... .......... 4% 38.6M 1s 450K .......... .......... .......... .......... .......... 5% 12.6M 1s 500K .......... .......... .......... .......... .......... 6% 28.4M 1s 550K .......... .......... .......... .......... .......... 6% 8.98M 1s 600K .......... .......... .......... .......... .......... 7% 34.3M 1s 650K .......... .......... .......... .......... .......... 7% 140M 1s 700K .......... .......... .......... .......... .......... 8% 10.3M 1s 750K .......... .......... .......... .......... .......... 8% 44.8M 1s 800K .......... .......... .......... .......... .......... 9% 217M 1s 850K .......... .......... .......... .......... .......... 9% 26.5M 1s 900K .......... .......... .......... .......... .......... 10% 38.1M 1s 950K .......... .......... .......... .......... .......... 10% 43.2M 1s 1000K .......... .......... .......... .......... .......... 11% 225M 1s 1050K .......... .......... .......... .......... .......... 12% 20.4M 1s 1100K .......... .......... .......... .......... .......... 12% 2.69M 1s 1150K .......... .......... .......... .......... .......... 13% 26.4M 1s 1200K .......... .......... .......... .......... .......... 13% 88.0M 1s 1250K .......... .......... .......... .......... .......... 14% 23.5M 1s 1300K .......... .......... .......... .......... .......... 14% 25.1M 1s 1350K .......... .......... .......... .......... .......... 15% 291M 1s 1400K .......... .......... .......... .......... .......... 15% 32.7M 1s 1450K .......... .......... .......... .......... .......... 16% 35.3M 1s 1500K .......... .......... .......... .......... .......... 16% 28.5M 1s 1550K .......... .......... .......... .......... .......... 17% 15.2M 1s 1600K .......... .......... .......... .......... .......... 18% 141M 1s 1650K .......... .......... .......... .......... .......... 18% 25.6M 1s 1700K .......... .......... .......... .......... .......... 19% 18.3M 1s 1750K .......... .......... .......... .......... .......... 19% 90.2M 1s 1800K .......... .......... .......... .......... .......... 20% 28.4M 1s 1850K .......... .......... .......... .......... .......... 20% 92.5M 1s 1900K .......... .......... .......... .......... .......... 21% 57.3M 0s 1950K .......... .......... .......... .......... .......... 21% 30.4M 0s 2000K .......... .......... .......... .......... .......... 22% 2.58M 1s 2050K .......... .......... .......... .......... .......... 22% 8.66M 1s 2100K .......... .......... .......... .......... .......... 23% 15.8M 1s 2150K .......... .......... .......... .......... .......... 24% 141M 1s 2200K .......... .......... .......... .......... .......... 24% 139M 0s 2250K .......... .......... .......... .......... .......... 25% 62.9M 0s 2300K .......... .......... .......... .......... .......... 25% 37.2M 0s 2350K .......... .......... .......... .......... .......... 26% 63.0M 0s 2400K .......... .......... .......... .......... .......... 26% 64.5M 0s 2450K .......... .......... .......... .......... .......... 27% 60.4M 0s 2500K .......... .......... .......... .......... .......... 27% 56.2M 0s 2550K .......... .......... .......... .......... .......... 28% 63.1M 0s 2600K .......... .......... .......... .......... .......... 28% 63.8M 0s 2650K .......... .......... .......... .......... .......... 29% 35.3M 0s 2700K .......... .......... .......... .......... .......... 30% 38.0M 0s 2750K .......... .......... .......... .......... .......... 30% 141M 0s 2800K .......... .......... .......... .......... .......... 31% 195M 0s 2850K .......... .......... .......... .......... .......... 31% 28.9M 0s 2900K .......... .......... .......... .......... .......... 32% 60.5M 0s 2950K .......... .......... .......... .......... .......... 32% 36.7M 0s 3000K .......... .......... .......... .......... .......... 33% 60.9M 0s 3050K .......... .......... .......... .......... .......... 33% 9.99M 0s 3100K .......... .......... .......... .......... .......... 34% 59.4M 0s 3150K .......... .......... .......... .......... .......... 34% 103M 0s 3200K .......... .......... .......... .......... .......... 35% 20.6M 0s 3250K .......... .......... .......... .......... .......... 36% 315M 0s 3300K .......... .......... .......... .......... .......... 36% 4.30M 0s 3350K .......... .......... .......... .......... .......... 37% 43.3M 0s 3400K .......... .......... .......... .......... .......... 37% 95.1M 0s 3450K .......... .......... .......... .......... .......... 38% 23.9M 0s 3500K .......... .......... .......... .......... .......... 38% 56.0M 0s 3550K .......... .......... .......... .......... .......... 39% 8.90M 0s 3600K .......... .......... .......... .......... .......... 39% 100M 0s 3650K .......... .......... .......... .......... .......... 40% 36.5M 0s 3700K .......... .......... .......... .......... .......... 40% 792K 0s 3750K .......... .......... .......... .......... .......... 41% 15.4M 0s 3800K .......... .......... .......... .......... .......... 42% 16.5M 0s 3850K .......... .......... .......... .......... .......... 42% 6.69M 0s 3900K .......... .......... .......... .......... .......... 43% 7.08M 0s 3950K .......... .......... .......... .......... .......... 43% 13.5M 0s 4000K .......... .......... .......... .......... .......... 44% 69.4M 0s 4050K .......... .......... .......... .......... .......... 44% 82.3M 0s 4100K .......... .......... .......... .......... .......... 45% 73.7M 0s 4150K .......... .......... .......... .......... .......... 45% 39.2M 0s 4200K .......... .......... .......... .......... .......... 46% 62.3M 0s 4250K .......... .......... .......... .......... .......... 46% 29.3M 0s 4300K .......... .......... .......... .......... .......... 47% 22.7M 0s 4350K .......... .......... .......... .......... .......... 48% 3.60M 0s 4400K .......... .......... .......... .......... .......... 48% 42.5M 0s 4450K .......... .......... .......... .......... .......... 49% 24.5M 0s 4500K .......... .......... .......... .......... .......... 49% 41.4M 0s 4550K .......... .......... .......... .......... .......... 50% 34.3M 0s 4600K .......... .......... .......... .......... .......... 50% 23.5M 0s 4650K .......... .......... .......... .......... .......... 51% 29.3M 0s 4700K .......... .......... .......... .......... .......... 51% 28.1M 0s 4750K .......... .......... .......... .......... .......... 52% 29.5M 0s 4800K .......... .......... .......... .......... .......... 52% 55.8M 0s 4850K .......... .......... .......... .......... .......... 53% 45.6M 0s 4900K .......... .......... .......... .......... .......... 54% 37.6M 0s 4950K .......... .......... .......... .......... .......... 54% 34.6M 0s 5000K .......... .......... .......... .......... .......... 55% 134M 0s 5050K .......... .......... .......... .......... .......... 55% 283M 0s 5100K .......... .......... .......... .......... .......... 56% 288M 0s 5150K .......... .......... .......... .......... .......... 56% 202M 0s 5200K .......... .......... .......... .......... .......... 57% 256M 0s 5250K .......... .......... .......... .......... .......... 57% 276M 0s 5300K .......... .......... .......... .......... .......... 58% 233M 0s 5350K .......... .......... .......... .......... .......... 58% 9.22M 0s 5400K .......... .......... .......... .......... .......... 59% 48.4M 0s 5450K .......... .......... .......... .......... .......... 60% 36.2M 0s 5500K .......... .......... .......... .......... .......... 60% 59.7M 0s 5550K .......... .......... .......... .......... .......... 61% 19.1M 0s 5600K .......... .......... .......... .......... .......... 61% 39.0M 0s 5650K .......... .......... .......... .......... .......... 62% 257M 0s 5700K .......... .......... .......... .......... .......... 62% 26.1M 0s 5750K .......... .......... .......... .......... .......... 63% 8.72M 0s 5800K .......... .......... .......... .......... .......... 63% 24.1M 0s 5850K .......... .......... .......... .......... .......... 64% 92.6M 0s 5900K .......... .......... .......... .......... .......... 64% 189M 0s 5950K .......... .......... .......... .......... .......... 65% 66.7M 0s 6000K .......... .......... .......... .......... .......... 66% 188M 0s 6050K .......... .......... .......... .......... .......... 66% 174M 0s 6100K .......... .......... .......... .......... .......... 67% 20.4M 0s 6150K .......... .......... .......... .......... .......... 67% 32.9M 0s 6200K .......... .......... .......... .......... .......... 68% 51.0M 0s 6250K .......... .......... .......... .......... .......... 68% 42.0M 0s 6300K .......... .......... .......... .......... .......... 69% 59.6M 0s 6350K .......... .......... .......... .......... .......... 69% 31.8M 0s 6400K .......... .......... .......... .......... .......... 70% 61.7M 0s 6450K .......... .......... .......... .......... .......... 70% 28.7M 0s 6500K .......... .......... .......... .......... .......... 71% 57.3M 0s 6550K .......... .......... .......... .......... .......... 72% 51.6M 0s 6600K .......... .......... .......... .......... .......... 72% 12.9M 0s 6650K .......... .......... .......... .......... .......... 73% 4.05M 0s 6700K .......... .......... .......... .......... .......... 73% 57.9M 0s 6750K .......... .......... .......... .......... .......... 74% 16.7M 0s 6800K .......... .......... .......... .......... .......... 74% 55.6M 0s 6850K .......... .......... .......... .......... .......... 75% 32.9M 0s 6900K .......... .......... .......... .......... .......... 75% 21.0M 0s 6950K .......... .......... .......... .......... .......... 76% 40.2M 0s 7000K .......... .......... .......... .......... .......... 76% 175M 0s 7050K .......... .......... .......... .......... .......... 77% 19.3M 0s 7100K .......... .......... .......... .......... .......... 78% 24.5M 0s 7150K .......... .......... .......... .......... .......... 78% 33.3M 0s 7200K .......... .......... .......... .......... .......... 79% 19.2M 0s 7250K .......... .......... .......... .......... .......... 79% 51.9M 0s 7300K .......... .......... .......... .......... .......... 80% 64.0M 0s 7350K .......... .......... .......... .......... .......... 80% 28.7M 0s 7400K .......... .......... .......... .......... .......... 81% 37.5M 0s 7450K .......... .......... .......... .......... .......... 81% 27.8M 0s 7500K .......... .......... .......... .......... .......... 82% 58.1M 0s 7550K .......... .......... .......... .......... .......... 82% 39.9M 0s 7600K .......... .......... .......... .......... .......... 83% 30.7M 0s 7650K .......... .......... .......... .......... .......... 84% 101M 0s 7700K .......... .......... .......... .......... .......... 84% 22.8M 0s 7750K .......... .......... .......... .......... .......... 85% 33.7M 0s 7800K .......... .......... .......... .......... .......... 85% 226M 0s 7850K .......... .......... .......... .......... .......... 86% 21.9M 0s 7900K .......... .......... .......... .......... .......... 86% 30.4M 0s 7950K .......... .......... .......... .......... .......... 87% 97.5M 0s 8000K .......... .......... .......... .......... .......... 87% 40.1M 0s 8050K .......... .......... .......... .......... .......... 88% 33.0M 0s 8100K .......... .......... .......... .......... .......... 88% 226M 0s 8150K .......... .......... .......... .......... .......... 89% 21.0M 0s 8200K .......... .......... .......... .......... .......... 90% 43.6M 0s 8250K .......... .......... .......... .......... .......... 90% 299M 0s 8300K .......... .......... .......... .......... .......... 91% 19.7M 0s 8350K .......... .......... .......... .......... .......... 91% 33.3M 0s 8400K .......... .......... .......... .......... .......... 92% 36.0M 0s 8450K .......... .......... .......... .......... .......... 92% 101M 0s 8500K .......... .......... .......... .......... .......... 93% 10.3M 0s 8550K .......... .......... .......... .......... .......... 93% 188M 0s 8600K .......... .......... .......... .......... .......... 94% 121M 0s 8650K .......... .......... .......... .......... .......... 94% 31.8M 0s 8700K .......... .......... .......... .......... .......... 95% 3.12M 0s 8750K .......... .......... .......... .......... .......... 96% 39.1M 0s 8800K .......... .......... .......... .......... .......... 96% 17.5M 0s 8850K .......... .......... .......... .......... .......... 97% 31.4M 0s 8900K .......... .......... .......... .......... .......... 97% 59.8M 0s 8950K .......... .......... .......... .......... .......... 98% 21.5M 0s 9000K .......... .......... .......... .......... .......... 98% 71.1M 0s 9050K .......... .......... .......... .......... .......... 99% 28.6M 0s 9100K .......... .......... .......... .......... .......... 99% 131M 0s 9150K ........ 100% 148M=0.5s 2024-02-23 11:19:41 (18.9 MB/s) - ‘wazuh-agent_4.7.2-1_x86_64.deb’ saved [9378542/9378542] Created symlink /etc/systemd/system/multi-user.target.wants/wazuh-agent.service → /lib/systemd/system/wazuh-agent.service. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.4.0 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /tmp/tests plugins: tinybird-0.2.0 collecting ... collected 7 items test_agent/test_install.py::test_installation Selecting previously unselected package wazuh-agent. (Reading database ... 70792 files and directories currently installed.) Preparing to unpack .../wazuh-agent_4.7.2-1_x86_64.deb ... Unpacking wazuh-agent (4.7.2-1) ... Setting up wazuh-agent (4.7.2-1) ... PASSED test_agent/test_install.py::test_wazuh_user PASSED test_agent/test_install.py::test_wazuh_group PASSED test_agent/test_install.py::test_wazuh_configuration PASSED test_agent/test_install.py::test_wazuh_control PASSED test_agent/test_install.py::test_wazuh_service PASSED test_agent/test_install.py::test_wazuh_daemons PASSED ============================== 7 passed in 10.47s ============================== stdout_lines: ```
registration :green_circle: ``` python3 modules/testing/main.py --inventory "/tmp/dtt1-poc/agent-linux-ubuntu-22.04-amd64/inventory.yaml" --component "agent" --wazuh-version "4.7.2" --wazuh-revision "1" --tests registration --dependencies '{"manager":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml"}' --live False --one_line True ``` ``` TASK [Test registration for agent] ********************************************* changed: [192.168.57.3] => changed=true cmd: - pytest - test_agent/test_registration.py - -v - --wazuh_version=4.7.2 - --wazuh_revision=1 - --component=agent - '--dependencies={manager: 192.168.57.2}' - --live=False - --one_line=False - -s delta: '0:00:09.568529' end: '2024-02-23 11:33:21.949480' msg: '' rc: 0 start: '2024-02-23 11:33:12.380951' stderr: '' stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.4.0 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /tmp/tests plugins: tinybird-0.2.0 collecting ... collected 6 items test_agent/test_registration.py::test_register PASSED test_agent/test_registration.py::test_client_keys_file PASSED test_agent/test_registration.py::test_client_id_local PASSED test_agent/test_registration.py::test_local_connection_status PASSED =============================== warnings summary =============================== test_agent/test_registration.py:25 test_agent/test_registration.py:25 /tmp/tests/test_agent/test_registration.py:25: DeprecationWarning: invalid escape sequence '\/' command = f"sed -i 's/
MANAGER_IP<\/address>/
{manager_ip}<\/address>/g' /var/ossec/etc/ossec.conf" -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 6 passed, 2 warnings in 9.15s ========================= stdout_lines: ```
basic_info :green_circle: ``` python3 modules/testing/main.py --inventory "/tmp/dtt1-poc/agent-linux-ubuntu-22.04-amd64/inventory.yaml" --component "agent" --wazuh-version "4.7.2" --wazuh-revision "1" --tests basic_info --dependencies '{"manager":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml"}' --live False --one_line True ``` ``` ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.4.0 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /tmp/tests plugins: tinybird-0.2.0 collecting ... collected 4 items test_agent/test_basic_info.py::test_agent_version ['wazuh', 'wazuh', '192.168.57.2'] PASSED test_agent/test_basic_info.py::test_agent_system PASSED test_agent/test_basic_info.py::test_agent_architecture PASSED test_agent/test_basic_info.py::test_agent_os_version PASSED ============================== 4 passed in 0.65s =============================== stdout_lines: ```
restart :green_circle: ``` python3 modules/testing/main.py --inventory "/tmp/dtt1-poc/agent-linux-ubuntu-22.04-amd64/inventory.yaml" --component "agent" --wazuh-version "4.7.2" --wazuh-revision "1" --tests restart --dependencies '{"manager":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml"}' --live False --one_line False ``` ``` TASK [Test restart for agent] ************************************************** changed: [192.168.57.3] => changed=true cmd: - pytest - test_agent/test_restart.py - -v - --wazuh_version=4.7.2 - --wazuh_revision=1 - --component=agent - '--dependencies={manager: 192.168.57.2}' - --live=False - --one_line=False - -s delta: '0:00:10.906995' end: '2024-02-23 11:17:43.388030' msg: '' rc: 0 start: '2024-02-23 11:17:32.481035' stderr: '' stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.4.0 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /tmp/tests plugins: tinybird-0.2.0 collecting ... collected 3 items test_agent/test_restart.py::test_service_started PASSED test_agent/test_restart.py::test_local_connection_status PASSED test_agent/test_restart.py::test_server_connection_status ['wazuh', 'wazuh', '192.168.57.2'] PASSED ============================== 3 passed in 10.62s ============================== stdout_lines: ```
stop :green_circle: ``` python3 modules/testing/main.py --inventory "/tmp/dtt1-poc/agent-linux-ubuntu-22.04-amd64/inventory.yaml" --component "agent" --wazuh-version "4.7.2" --wazuh-revision "1" --tests basic_info --dependencies '{"manager":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml"}' --live False --one_line True ``` ``` TASK [Test stop for agent] ***************************************************** changed: [192.168.57.3] => changed=true cmd: - pytest - test_agent/test_stop.py - -v - --wazuh_version=4.7.2 - --wazuh_revision=1 - --component=agent - '--dependencies={manager: 192.168.57.2}' - --live=False - --one_line=False - -s delta: '0:00:00.958216' end: '2024-02-23 11:22:23.198855' msg: '' rc: 0 start: '2024-02-23 11:22:22.240639' stderr: '' stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.4.0 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /tmp/tests plugins: tinybird-0.2.0 collecting ... collected 3 items test_agent/test_stop.py::test_process_not_running PASSED test_agent/test_stop.py::test_service_stopped PASSED test_agent/test_stop.py::test_ports_not_listening PASSED ============================== 3 passed in 0.66s =============================== stdout_lines: ```
uninstall :green_circle: ``` python3 modules/testing/main.py --inventory "/tmp/dtt1-poc/agent-linux-ubuntu-22.04-amd64/inventory.yaml" --component "agent" --wazuh-version "4.7.2" --wazuh-revision "1" --tests uninstall --dependencies '{"manager":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yaml"}' --live False --one_line False ``` ``` TASK [Test uninstall for agent] ************************************************ changed: [192.168.57.3] => changed=true cmd: - pytest - test_agent/test_uninstall.py - -v - --wazuh_version=4.7.2 - --wazuh_revision=1 - --component=agent - '--dependencies={manager: 192.168.57.2}' - --live=False - --one_line=False - -s delta: '0:00:07.896484' end: '2024-02-23 11:18:48.213011' msg: '' rc: 0 start: '2024-02-23 11:18:40.316527' stderr: Removed /etc/systemd/system/multi-user.target.wants/wazuh-agent.service. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.4.0 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /tmp/tests plugins: tinybird-0.2.0 collecting ... collected 5 items test_agent/test_uninstall.py::test_uninstallation 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 23 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 ... 71172 files and directories currently installed.) Removing wazuh-agent (4.7.2-1) ... 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 23 not upgraded. After this operation, 0 B of additional disk space will be used. (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 ... 70809 files and directories currently installed.) Purging configuration files for wazuh-agent (4.7.2-1) ... dpkg: warning: while removing wazuh-agent, directory '/usr/lib/systemd/system' not empty so not removed PASSED test_agent/test_uninstall.py::test_wazuh_user PASSED test_agent/test_uninstall.py::test_wazuh_group PASSED test_agent/test_uninstall.py::test_process_not_running PASSED test_agent/test_uninstall.py::test_config_is_not_maintained PASSED ============================== 5 passed in 7.57s =============================== stdout_lines: ```

Tests are all working, however, testing: Installation + Register => some tests in register are failing.

This failures are related to the time that the agent is changing its status and clientkey.

Some dynamic waits should be added.


Dynamic wait added, all tests are running ok

pro-akim commented 2 months ago

Summary

Some points to keep in mind:

  1. Install installs, register registers and uninstall uninstalls so there is an order to follow

If the list of tests does not include install, the agent must be provisioned from provisioning

Otherwise, if it is installed, it will need to go first.

  1. Register registers the agent, if one_line = False, the register will change the MANAGER_IP to the corresponding ip and restart. In case of one_line = True, only the system will be rebooted

  2. Uninstall should go last in case it is executed since it uninstalls the system.

  3. Stop does stop, but a restart has been added at the end of the test

  4. If a test series was run and the manager contains the agent information. If you execute register on that manager with the agent registration, it may fail, since the agent must be deleted from the manager. Otherwise the clientkey may take time (by product design) to replace the dead agent with the new one with the same name and the same ip

  5. Once https://github.com/wazuh/wazuh-qa/issues/4859 is completed, where the provisioning of the agent includes the installation of the dependencies, the modules/testing/setup.yml file must be restored

pro-akim commented 2 months ago

Update

Requested fixes done and tested

QU3B1M commented 2 months ago

LGTM!

pro-akim commented 2 months ago

Update

Some error handling test will be done

pro-akim commented 2 months ago

Update

Testing Error logs:

N Error Log Status
1 Wrong inventory pydantic_core._pydantic_core.ValidationError: 1 validation error for InputPayload :green_circle:
2 Wrong component main.py: error: argument --component: invalid choice: 'agento' (choose from 'manager', 'agent') :green_circle:
3 Wrong dependencies entry FileNotFoundError: File "/tmp/dtt1-poc/no_manager-linux-ubuntu-22.04-amd64/inventory.yaml" not found. :green_circle:
4 Wrong live pydantic_core._pydantic_core.ValidationError: 1 validation error for InputPayload live :green_circle:
5 Wrong one_line pydantic_core._pydantic_core.ValidationError: 1 validation error for InputPayload one_line :green_circle:
6 Wrong test Wazuh-version/revision Error is present, but not correctly handled :red_circle:
7 Wrong test name stderr: 'ERROR: file or directory not found: test_agent/test_instal.py' :green_circle:

Adding Error handling and logs to installer, uninstaller and host information

Fixes N Error Log Status
6 Wrong Wazuh-version/revision ERROR Testing:installer.py:55 Error running 'wget' or 'install' command: Command 'wget https://packages-dev.wazuh.com/pre-release/apt/pool/main/w/wazuh-agent/wazuh-agent_4.7.2-1123213_amd64.deb :green_circle:

Logs were added in the Testing engine and they are handling the errors correctly

image

pro-akim commented 2 months ago

Update

Install

After obtaining all the files generated in var and comparing them with the pre install files, we could see that (except for those that contained ossec or wazuh in their path)

Rhel7 ``` ['/var/lib/rpm/__db.001', '/var/cache/yum/x86_64/7Server/epel/metalink.xml', '/var/cache/yum/x86_64/7Server', '/var/cache/yum/x86_64/7Server/epel/228b14c6993c17f29d685c24f81902ab92cb1d3eb1b219fd2db396c5db656751-updateinfo.xml.bz2', '/var/cache/yum/x86_64/7Server/epel/645d6e0f00f5e7cdebd5d547c1a11506048edf6505cf30c01554e4255b2456ad-comps-Everything.x86_64.xml.gz', '/var/cache/yum/x86_64', '/var/cache/yum/x86_64/7Server/epel/packages', '/var/log/yum.log', '/var/cache/yum/x86_64/7Server/timedhosts', '/var/lib/rpm/__db.002', '/var/cache/yum/x86_64/7Server/epel/cachecookie', '/var/cache/yum/x86_64/7Server/epel/repomd.xml', '/var/cache/yum/x86_64/7Server/epel', '/var/cache/yum/x86_64/7Server/epel/686ce8ed6fe8321eec6c42a4cf164265e2ffc78268818d131813b142b860ee0f-primary.sqlite.bz2', '/var/cache/yum/x86_64/7Server/epel/gen', '/var/cache/yum/x86_64/7Server/epel/gen/primary_db.sqlite', '/var/lib/rpm/__db.003'] ```
Ubuntu18.04 ``` ['/var/lib/lxcfs/cgroup/pids/user.slice/user-1000.slice/session-55.scope/cgroup.clone_children', '/var/lib/lxcfs/cgroup/pids/user.slice/user-1000.slice/session-55.scope/pids.current', '/var/lib/lxcfs/cgroup/pids/user.slice/user-1000.slice/session-55.scope/cgroup.procs', '/var/lib/lxcfs/cgroup/name=systemd/user.slice/user-1000.slice/session-55.scope/cgroup.clone_children', '/var/lib/lxcfs/cgroup/name=systemd/user.slice/user-1000.slice/session-55.scope/tasks', '/var/lib/lxcfs/cgroup/name=systemd/user.slice/user-1000.slice/session-55.scope/cgroup.procs', '/var/lib/lxcfs/cgroup/pids/user.slice/user-1000.slice/session-55.scope', '/var/lib/lxcfs/cgroup/pids/user.slice/user-1000.slice/session-55.scope/pids.max', '/var/lib/lxcfs/cgroup/pids/user.slice/user-1000.slice/session-55.scope/notify_on_release', '/var/lib/lxcfs/cgroup/pids/user.slice/user-1000.slice/session-55.scope/pids.events', '/var/lib/lxcfs/cgroup/name=systemd/user.slice/user-1000.slice/session-55.scope', '/var/lib/lxcfs/cgroup/name=systemd/user.slice/user-1000.slice/session-55.scope/notify_on_release', '/var/lib/lxcfs/cgroup/pids/user.slice/user-1000.slice/session-55.scope/tasks'] ```
Debian12 ``` ['/var/log/dpkg.log'] ```
Oracle9 ``` ['/var/lib/selinux/targeted/active/modules/disabled', '/var/log/dnf.log', '/var/cache/dnf/ol9_developer_EPEL-31156a4a0bdc10c2/tmpdir.8Hy41i/repodata/59bd9acc641d81ca06a9cda14adba6a2e02ab1ac-filelists.xml.gz', '/var/cache/dnf/ol9_developer_EPEL-31156a4a0bdc10c2/tmpdir.8Hy41i/repodata/2aec878d4765a214e29bb7b62b54470ce281110f-primary.xml.gz', '/var/cache/dnf/ol9_developer_EPEL-31156a4a0bdc10c2/tmpdir.8Hy41i/repodata/53816cf5147400235d31ae75d3467935d1ced86e-updateinfo.xml.gz', '/var/cache/dnf/ol9_developer_EPEL-31156a4a0bdc10c2/tmpdir.8Hy41i', '/var/cache/dnf/ol9_developer_EPEL-31156a4a0bdc10c2/tmpdir.8Hy41i/repodata', '/var/cache/dnf/metadata_lock.pid', '/var/lib/selinux/targeted/active/modules/400', '/var/cache/dnf/ol9_developer_EPEL-31156a4a0bdc10c2/tmpdir.8Hy41i/repodata/repomd.xml'] ```
Amazonlinux2 ``` [] ```
SUSE15 ``` [] ```
Fedora38 ``` [] ```
Centos7 ``` ['/var/cache/yum/x86_64/7/base/packages', '/var/cache/yum/x86_64/7/base/cachecookie', '/var/cache/yum/x86_64/7/updates/9c12a6244db35e0d9ba3110b417fc06e8a28196a9bdd43d5e22c48d99b39e619-primary.sqlite.bz2', '/var/cache/yum/x86_64/7/updates/repomd.xml', '/var/lib/rpm/__db.001', '/var/cache/yum/x86_64/7/extras/cachecookie', '/var/cache/yum/x86_64/7/timedhosts.txt', '/var/cache/yum/x86_64', '/var/cache/yum/x86_64/7/base/gen', '/var/log/yum.log', '/var/cache/yum/x86_64/7/timedhosts', '/var/cache/yum/x86_64/7/base/repomd.xml', '/var/lib/yum/repos/x86_64/7/updates', '/var/cache/yum/x86_64/7/base/mirrorlist.txt', '/var/cache/yum/x86_64/7/base', '/var/cache/yum/x86_64/7/base/gen/primary_db.sqlite', '/var/cache/yum/x86_64/7/updates/gen', '/var/cache/yum/x86_64/7', '/var/lib/rpm/__db.003', '/var/cache/yum/x86_64/7/updates', '/var/cache/yum/x86_64/7/updates/mirrorlist.txt', '/var/cache/yum/x86_64/7/extras/packages', '/var/lib/yum/repos/x86_64/7/base', '/var/cache/yum/x86_64/7/updates/cachecookie', '/var/cache/yum/x86_64/7/extras/0a5413843d4b238fd3894be760ed384be82139b517ce77a3a71a7b3c6a774a8b-primary.sqlite.bz2', '/var/cache/yum/x86_64/7/base/6d0c3a488c282fe537794b5946b01e28c7f44db79097bb06826e1c0c88bad5ef-primary.sqlite.bz2', '/var/cache/yum/x86_64/7/extras/repomd.xml', '/var/cache/yum/x86_64/7/extras/mirrorlist.txt', '/var/cache/yum/x86_64/7/extras', '/var/lib/yum/repos/x86_64/7/extras', '/var/cache/yum/x86_64/7/base/a4e2b46586aa556c3b6f814dad5b16db5a669984d66b68e873586cd7c7253301-c7-x86_64-comps.xml.gz', '/var/lib/rpm/__db.002', '/var/cache/yum/x86_64/7/updates/packages', '/var/cache/yum/x86_64/7/extras/gen'] ```
Rocky9 ``` [] ```

Same additional filters will be added to https://github.com/wazuh/wazuh-qa/issues/4844#issuecomment-1983070759

pro-akim commented 2 months ago

Update

New changes are required due to the new requirements.

pro-akim commented 2 months ago

Update

  1. Tests were created

  2. During testing, some additional filters for checkfiles were required in uninstall process.

Those filters were in /boot directory

filter_data = {'/boot': {'added': ['grub2', 'loader', 'vmlinuz', 'System.map', 'config-', 'initramfs'], 'removed': [], 'modified': ['grubenv']}, '/usr/bin': {'added': ['filebeat'], 'removed': [], 'modified': []}, '/root': {'added': ['trustdb.gpg'], 'removed': [], 'modified': []}, '/usr/sbin': {'added': [], 'removed': [], 'modified': []}}
  1. Some additional tests were required in order to make filter adjustments
pro-akim commented 2 months ago

Update

Tests results Vagrant

Os Result Adjustments
ubuntu 16.04 :green_circle: -
ubuntu 18.04 :green_circle: -
ubuntu 20.04 :green_circle: -
ubuntu 22.04 :green_circle: -
debian 9 :green_circle: -
debian 10 :green_circle: -
debian 11 :green_circle: -
debian 12 :green_circle: -
centos 7 :green_circle: -
centos 8 :green_circle: -
redhat 7 :green_circle: -
redhat 8 :green_circle: -
redhat 9 :green_circle: -
oracle 9 :green_circle: Filters added
amazon2 :green_circle: -
amazon2023 :white_circle: No vagrant image
opensuse 15 :green_circle: zyp uninstallation added
suse 15 :white_circle: No vagrant image

Multiple agents and 1 master connected :green_circle:

pro-akim commented 1 month ago

Update

Testing in AWS

Some issues doing ssh to EC2 instances

![image](https://github.com/wazuh/wazuh-qa/assets/125690423/4ffc5948-f318-43a5-9098-2719f37bdfec) ```bash akim@akim-PC:/tmp$ cat dtt1-poc/manager-linux-centos-7-amd64/inventory.yaml ansible_host: ec2-52-203-194-48.compute-1.amazonaws.com ansible_port: 22 ansible_ssh_private_key_file: /tmp/wazuh-qa/i-03b0310c873ba50f6/wazuh-qa-51251710922782 ansible_user: ec2-user akim@akim-PC:/tmp$ ssh -i "/tmp/wazuh-qa/i-03b0310c873ba50f6/wazuh-qa-51251710922782" ec2-user@ec2-52-203-194-48.compute-1.amazonaws.com ssh: connect to host ec2-52-203-194-48.compute-1.amazonaws.com port 22: Connection timed out akim@akim-PC:/tmp$ cat /tmp/wazuh-qa/i-03b0310c873ba50f6/wazuh-qa-51251710922782 -----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAm/JzBA7e9yYjvrXYCDLFcErlLEZShkBGdU9PSs26uQWhaX1l 9DvAeIhECUu7B4WgJlnFacC15ScaWsuhxeMTX/fs93hTCXul1Yrq1iVjHkgBN+AV . . . ``` It seems that there are some issues with the EC2 which host is not event possible to ping. The ssh doesn't work. On the other side: ```bash akim@akim-PC:/tmp$ ping ec2-52-203-194-48.compute-1.amazonaws.com PING ec2-52-203-194-48.compute-1.amazonaws.com (52.203.194.48) 56(84) bytes of data. ^C --- ec2-52-203-194-48.compute-1.amazonaws.com ping statistics --- 423 packets transmitted, 0 received, 100% packet loss, time 432128ms ```

This point will be discussed with @fcaffieri @QU3B1M and @wazuh/devel-devops team

rauldpm commented 1 month ago

Meet defined: Sync allocation module - Wednesday, March 20⋅8:00 – 8:30pm ESP Changed status to Blocked for third-party

pro-akim commented 1 month ago

Update

Testing in AWS

  1. Port added in the command, the AWS instance has worked in 2200 instead of 22 due to https://github.com/wazuh/wazuh-qa/pull/5027
  2. socket.gethostbyname() was used where IP instead of DNS is required
  3. Private IP was required to register the agent to the manager. boto3 methods was used.
Result AWS :green_circle: ```bash (deplo_test) akim@akim-PC:~/Desktop/wazuh-qa/deployability$ python3 modules/testing/main.py --wazuh-revision '40714' --wazuh-version '4.7.3' --component 'agent' --tests 'install,registration,stop,restart,uninstall' --targets '{"wazuh-1":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml"}' --targets '{"agent-1":"/tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml"}' --dependencies '{"wazuh-1":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml"}' --live 'True' component='agent' wazuh_version='4.7.3' wazuh_revision='40714' wazuh_branch=None working_dir='/tmp/tests' live=True tests=['install', 'registration', 'stop', 'restart', 'uninstall'] targets=['{"wazuh-1":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml"}', '{"agent-1":"/tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml"}'] dependencies=['{"wazuh-1":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml"}'] cleanup=True [2024-03-21 12:55:30] [INFO] TESTER: Running tests for ec2-54-162-7-172.compute-1.amazonaws.com [2024-03-21 12:55:30] [INFO] TESTER: Running tests for ec2-54-144-42-190.compute-1.amazonaws.com [2024-03-21 12:55:30] [INFO] TESTER: Dependencies ec2-54-162-7-172.compute-1.amazonaws.com [2024-03-21 12:55:30] [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-54-162-7-172.compute-1.amazonaws.com', 'ec2-54-144-42-190.compute-1.amazonaws.com'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}', 'dependencies': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}', 'local_host_path': '/home/akim/Desktop/wazuh-qa/deployability', 'current_user': 'akim'} [2024-03-21 12:55:30] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-03-21 12:55:30] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-54-162-7-172.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-03-21 12:55:30] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/akim/.ssh/known_hosts -R ''"}, 'loop': ['ec2-54-162-7-172.compute-1.amazonaws.com', 'ec2-54-144-42-190.compute-1.amazonaws.com']}]}] No config file found; using defaults PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-54-162-7-172.compute-1.amazonaws.com) => changed=true ansible_loop_var: item cmd: - ssh-keygen - -f - /home/akim/.ssh/known_hosts - -R - '' delta: '0:00:00.009056' end: '2024-03-21 12:55:35.643749' item: ec2-54-162-7-172.compute-1.amazonaws.com msg: '' rc: 0 start: '2024-03-21 12:55:35.634693' stderr: Host not found in /home/akim/.ssh/known_hosts stderr_lines: stdout: '' stdout_lines: changed: [localhost] => (item=ec2-54-144-42-190.compute-1.amazonaws.com) => changed=true ansible_loop_var: item cmd: - ssh-keygen - -f - /home/akim/.ssh/known_hosts - -R - '' delta: '0:00:00.009188' end: '2024-03-21 12:55:35.807755' item: ec2-54-144-42-190.compute-1.amazonaws.com msg: '' rc: 0 start: '2024-03-21 12:55:35.798567' stderr: Host not found in /home/akim/.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-03-21 12:55:36] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/akim/.ssh/known_hosts -R ''"}, 'loop': ['ec2-54-162-7-172.compute-1.amazonaws.com', 'ec2-54-144-42-190.compute-1.amazonaws.com']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 12:55:36] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-03-21 12:55:36] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-54-162-7-172.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-03-21 12:55:36] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] No config file found; using defaults 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={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' - --live=True - -s delta: '0:02:36.220494' end: '2024-03-21 12:58:15.132643' msg: '' rc: 0 start: '2024-03-21 12:55:38.912149' stderr: |- /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/_testinfra_renamed.py:5: DeprecationWarning: testinfra package has been renamed to pytest-testinfra. Please `pip install pytest-testinfra` and `pip uninstall testinfra` and update your package requirements to avoid this message warnings.warn(( Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Failed to stop firewalld.service: Unit firewalld.service not loaded. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Failed to disable unit: Unit file firewalld.service does not exist. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Failed to stop firewalld.service: Unit firewalld.service not loaded. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Failed to disable unit: Unit file firewalld.service does not exist. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. --2024-03-21 11:57:45-- https://packages-dev.wazuh.com/pre-release/apt/pool/main/w/wazuh-agent/wazuh-agent_4.7.3-1_amd64.deb Resolving packages-dev.wazuh.com (packages-dev.wazuh.com)... 18.160.41.126, 18.160.41.28, 18.160.41.76, ... Connecting to packages-dev.wazuh.com (packages-dev.wazuh.com)|18.160.41.126|: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% 819K 11s 50K .......... .......... .......... .......... .......... 1% 812K 11s 100K .......... .......... .......... .......... .......... 1% 830K 11s 150K .......... .......... .......... .......... .......... 2% 125M 8s 200K .......... .......... .......... .......... .......... 2% 120M 7s 250K .......... .......... .......... .......... .......... 3% 159M 5s 300K .......... .......... .......... .......... .......... 3% 822K 6s 350K .......... .......... .......... .......... .......... 4% 31.5M 5s 400K .......... .......... .......... .......... .......... 4% 271M 5s 450K .......... .......... .......... .......... .......... 5% 202M 4s 500K .......... .......... .......... .......... .......... 6% 226M 4s 550K .......... .......... .......... .......... .......... 6% 235M 4s 600K .......... .......... .......... .......... .......... 7% 863K 4s 650K .......... .......... .......... .......... .......... 7% 111M 4s 700K .......... .......... .......... .......... .......... 8% 90.9M 3s 750K .......... .......... .......... .......... .......... 8% 127M 3s 800K .......... .......... .......... .......... .......... 9% 230M 3s 850K .......... .......... .......... .......... .......... 9% 200M 3s 900K .......... .......... .......... .......... .......... 10% 212M 3s 950K .......... .......... .......... .......... .......... 10% 230M 3s 1000K .......... .......... .......... .......... .......... 11% 197M 2s 1050K .......... .......... .......... .......... .......... 12% 178M 2s 1100K .......... .......... .......... .......... .......... 12% 222M 2s 1150K .......... .......... .......... .......... .......... 13% 195M 2s 1200K .......... .......... .......... .......... .......... 13% 250M 2s 1250K .......... .......... .......... .......... .......... 14% 232M 2s 1300K .......... .......... .......... .......... .......... 14% 862K 2s 1350K .......... .......... .......... .......... .......... 15% 134M 2s 1400K .......... .......... .......... .......... .......... 15% 267M 2s 1450K .......... .......... .......... .......... .......... 16% 238M 2s 1500K .......... .......... .......... .......... .......... 16% 158M 2s 1550K .......... .......... .......... .......... .......... 17% 235M 2s 1600K .......... .......... .......... .......... .......... 18% 207M 2s 1650K .......... .......... .......... .......... .......... 18% 219M 2s 1700K .......... .......... .......... .......... .......... 19% 206M 2s 1750K .......... .......... .......... .......... .......... 19% 197M 2s 1800K .......... .......... .......... .......... .......... 20% 254M 1s 1850K .......... .......... .......... .......... .......... 20% 234M 1s 1900K .......... .......... .......... .......... .......... 21% 194M 1s 1950K .......... .......... .......... .......... .......... 21% 242M 1s 2000K .......... .......... .......... .......... .......... 22% 182M 1s 2050K .......... .......... .......... .......... .......... 22% 240M 1s 2100K .......... .......... .......... .......... .......... 23% 213M 1s 2150K .......... .......... .......... .......... .......... 24% 225M 1s 2200K .......... .......... .......... .......... .......... 24% 232M 1s 2250K .......... .......... .......... .......... .......... 25% 193M 1s 2300K .......... .......... .......... .......... .......... 25% 45.9M 1s 2350K .......... .......... .......... .......... .......... 26% 40.4M 1s 2400K .......... .......... .......... .......... .......... 26% 192M 1s 2450K .......... .......... .......... .......... .......... 27% 230M 1s 2500K .......... .......... .......... .......... .......... 27% 236M 1s 2550K .......... .......... .......... .......... .......... 28% 236M 1s 2600K .......... .......... .......... .......... .......... 28% 244M 1s 2650K .......... .......... .......... .......... .......... 29% 946K 1s 2700K .......... .......... .......... .......... .......... 30% 241M 1s 2750K .......... .......... .......... .......... .......... 30% 180M 1s 2800K .......... .......... .......... .......... .......... 31% 172M 1s 2850K .......... .......... .......... .......... .......... 31% 231M 1s 2900K .......... .......... .......... .......... .......... 32% 173M 1s 2950K .......... .......... .......... .......... .......... 32% 202M 1s 3000K .......... .......... .......... .......... .......... 33% 211M 1s 3050K .......... .......... .......... .......... .......... 33% 237M 1s 3100K .......... .......... .......... .......... .......... 34% 88.3M 1s 3150K .......... .......... .......... .......... .......... 34% 237M 1s 3200K .......... .......... .......... .......... .......... 35% 229M 1s 3250K .......... .......... .......... .......... .......... 36% 224M 1s 3300K .......... .......... .......... .......... .......... 36% 206M 1s 3350K .......... .......... .......... .......... .......... 37% 242M 1s 3400K .......... .......... .......... .......... .......... 37% 235M 1s 3450K .......... .......... .......... .......... .......... 38% 207M 1s 3500K .......... .......... .......... .......... .......... 38% 214M 1s 3550K .......... .......... .......... .......... .......... 39% 231M 1s 3600K .......... .......... .......... .......... .......... 39% 232M 1s 3650K .......... .......... .......... .......... .......... 40% 215M 1s 3700K .......... .......... .......... .......... .......... 41% 240M 1s 3750K .......... .......... .......... .......... .......... 41% 208M 1s 3800K .......... .......... .......... .......... .......... 42% 208M 1s 3850K .......... .......... .......... .......... .......... 42% 237M 1s 3900K .......... .......... .......... .......... .......... 43% 209M 1s 3950K .......... .......... .......... .......... .......... 43% 227M 1s 4000K .......... .......... .......... .......... .......... 44% 222M 1s 4050K .......... .......... .......... .......... .......... 44% 208M 1s 4100K .......... .......... .......... .......... .......... 45% 199M 1s 4150K .......... .......... .......... .......... .......... 45% 211M 1s 4200K .......... .......... .......... .......... .......... 46% 216M 1s 4250K .......... .......... .......... .......... .......... 47% 229M 0s 4300K .......... .......... .......... .......... .......... 47% 235M 0s 4350K .......... .......... .......... .......... .......... 48% 231M 0s 4400K .......... .......... .......... .......... .......... 48% 272M 0s 4450K .......... .......... .......... .......... .......... 49% 217M 0s 4500K .......... .......... .......... .......... .......... 49% 191M 0s 4550K .......... .......... .......... .......... .......... 50% 259M 0s 4600K .......... .......... .......... .......... .......... 50% 218M 0s 4650K .......... .......... .......... .......... .......... 51% 207M 0s 4700K .......... .......... .......... .......... .......... 51% 217M 0s 4750K .......... .......... .......... .......... .......... 52% 206M 0s 4800K .......... .......... .......... .......... .......... 53% 268M 0s 4850K .......... .......... .......... .......... .......... 53% 203M 0s 4900K .......... .......... .......... .......... .......... 54% 209M 0s 4950K .......... .......... .......... .......... .......... 54% 238M 0s 5000K .......... .......... .......... .......... .......... 55% 201M 0s 5050K .......... .......... .......... .......... .......... 55% 213M 0s 5100K .......... .......... .......... .......... .......... 56% 211M 0s 5150K .......... .......... .......... .......... .......... 56% 231M 0s 5200K .......... .......... .......... .......... .......... 57% 239M 0s 5250K .......... .......... .......... .......... .......... 57% 234M 0s 5300K .......... .......... .......... .......... .......... 58% 1014K 0s 5350K .......... .......... .......... .......... .......... 59% 218M 0s 5400K .......... .......... .......... .......... .......... 59% 57.9M 0s 5450K .......... .......... .......... .......... .......... 60% 234M 0s 5500K .......... .......... .......... .......... .......... 60% 231M 0s 5550K .......... .......... .......... .......... .......... 61% 216M 0s 5600K .......... .......... .......... .......... .......... 61% 246M 0s 5650K .......... .......... .......... .......... .......... 62% 190M 0s 5700K .......... .......... .......... .......... .......... 62% 205M 0s 5750K .......... .......... .......... .......... .......... 63% 231M 0s 5800K .......... .......... .......... .......... .......... 63% 256M 0s 5850K .......... .......... .......... .......... .......... 64% 198M 0s 5900K .......... .......... .......... .......... .......... 65% 209M 0s 5950K .......... .......... .......... .......... .......... 65% 237M 0s 6000K .......... .......... .......... .......... .......... 66% 223M 0s 6050K .......... .......... .......... .......... .......... 66% 201M 0s 6100K .......... .......... .......... .......... .......... 67% 198M 0s 6150K .......... .......... .......... .......... .......... 67% 190M 0s 6200K .......... .......... .......... .......... .......... 68% 249M 0s 6250K .......... .......... .......... .......... .......... 68% 204M 0s 6300K .......... .......... .......... .......... .......... 69% 212M 0s 6350K .......... .......... .......... .......... .......... 69% 230M 0s 6400K .......... .......... .......... .......... .......... 70% 195M 0s 6450K .......... .......... .......... .......... .......... 71% 213M 0s 6500K .......... .......... .......... .......... .......... 71% 210M 0s 6550K .......... .......... .......... .......... .......... 72% 238M 0s 6600K .......... .......... .......... .......... .......... 72% 233M 0s 6650K .......... .......... .......... .......... .......... 73% 194M 0s 6700K .......... .......... .......... .......... .......... 73% 198M 0s 6750K .......... .......... .......... .......... .......... 74% 183M 0s 6800K .......... .......... .......... .......... .......... 74% 228M 0s 6850K .......... .......... .......... .......... .......... 75% 224M 0s 6900K .......... .......... .......... .......... .......... 76% 247M 0s 6950K .......... .......... .......... .......... .......... 76% 220M 0s 7000K .......... .......... .......... .......... .......... 77% 219M 0s 7050K .......... .......... .......... .......... .......... 77% 234M 0s 7100K .......... .......... .......... .......... .......... 78% 206M 0s 7150K .......... .......... .......... .......... .......... 78% 212M 0s 7200K .......... .......... .......... .......... .......... 79% 245M 0s 7250K .......... .......... .......... .......... .......... 79% 208M 0s 7300K .......... .......... .......... .......... .......... 80% 207M 0s 7350K .......... .......... .......... .......... .......... 80% 208M 0s 7400K .......... .......... .......... .......... .......... 81% 233M 0s 7450K .......... .......... .......... .......... .......... 82% 226M 0s 7500K .......... .......... .......... .......... .......... 82% 224M 0s 7550K .......... .......... .......... .......... .......... 83% 193M 0s 7600K .......... .......... .......... .......... .......... 83% 204M 0s 7650K .......... .......... .......... .......... .......... 84% 211M 0s 7700K .......... .......... .......... .......... .......... 84% 199M 0s 7750K .......... .......... .......... .......... .......... 85% 232M 0s 7800K .......... .......... .......... .......... .......... 85% 221M 0s 7850K .......... .......... .......... .......... .......... 86% 211M 0s 7900K .......... .......... .......... .......... .......... 86% 212M 0s 7950K .......... .......... .......... .......... .......... 87% 212M 0s 8000K .......... .......... .......... .......... .......... 88% 223M 0s 8050K .......... .......... .......... .......... .......... 88% 222M 0s 8100K .......... .......... .......... .......... .......... 89% 193M 0s 8150K .......... .......... .......... .......... .......... 89% 202M 0s 8200K .......... .......... .......... .......... .......... 90% 231M 0s 8250K .......... .......... .......... .......... .......... 90% 211M 0s 8300K .......... .......... .......... .......... .......... 91% 218M 0s 8350K .......... .......... .......... .......... .......... 91% 237M 0s 8400K .......... .......... .......... .......... .......... 92% 233M 0s 8450K .......... .......... .......... .......... .......... 92% 217M 0s 8500K .......... .......... .......... .......... .......... 93% 195M 0s 8550K .......... .......... .......... .......... .......... 94% 238M 0s 8600K .......... .......... .......... .......... .......... 94% 243M 0s 8650K .......... .......... .......... .......... .......... 95% 213M 0s 8700K .......... .......... .......... .......... .......... 95% 236M 0s 8750K .......... .......... .......... .......... .......... 96% 212M 0s 8800K .......... .......... .......... .......... .......... 96% 250M 0s 8850K .......... .......... .......... .......... .......... 97% 234M 0s 8900K .......... .......... .......... .......... .......... 97% 177M 0s 8950K .......... .......... .......... .......... .......... 98% 247M 0s 9000K .......... .......... .......... .......... .......... 98% 263M 0s 9050K .......... .......... .......... .......... .......... 99% 210M 0s 9100K .......... .......... .......... .......... ... 100% 241M=0.5s 2024-03-21 11:57:46 (17.6 MB/s) - 'wazuh-agent_4.7.3-1_amd64.deb' saved [9362524/9362524] Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) 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-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) 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-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-8.1.0, pluggy-1.4.0 -- /home/akim/Desktop/venvs/deplo_test/bin/python3 cachedir: .pytest_cache rootdir: /home/akim/Desktop/wazuh-qa/deployability/modules plugins: testinfra-6.0.0, testinfra-10.1.0 collecting ... collected 4 items modules/testing/tests/test_agent/test_install.py::test_installation PASSED modules/testing/tests/test_agent/test_install.py::test_status PASSED modules/testing/tests/test_agent/test_install.py::test_version PASSED modules/testing/tests/test_agent/test_install.py::test_revision PASSED =============================== warnings summary =============================== modules/provision/models.py:65 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:65: 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', pre=True) modules/provision/models.py:73 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:73: 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('uninstall', pre=True) modules/testing/tests/helpers/agent.py:57 /home/akim/Desktop/wazuh-qa/deployability/modules/testing/tests/helpers/agent.py:57: DeprecationWarning: invalid escape sequence '\w' "-OutFile ${env.tmp}\wazuh-agent;" modules/testing/tests/helpers/agent.py:58 /home/akim/Desktop/wazuh-qa/deployability/modules/testing/tests/helpers/agent.py:58: DeprecationWarning: invalid escape sequence '\w' "msiexec.exe /i ${env.tmp}\wazuh-agent /q" modules/testing/tests/helpers/agent.py:99 modules/testing/tests/helpers/agent.py:99 /home/akim/Desktop/wazuh-qa/deployability/modules/testing/tests/helpers/agent.py:99: DeprecationWarning: invalid escape sequence '\/' f"sed -i 's/
MANAGER_IP<\/address>/
{internal_ip}<\/address>/g' {WAZUH_CONF}", -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ================== 4 passed, 6 warnings in 155.64s (0:02:35) =================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 12:58:15] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 12:58:15] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-03-21 12:58:15] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-54-162-7-172.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-03-21 12:58:15] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] No config file found; using defaults 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={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' - --live=True - -s delta: '0:00:39.202172' end: '2024-03-21 12:59:00.255563' msg: '' rc: 0 start: '2024-03-21 12:58:21.053391' stderr: |- /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/_testinfra_renamed.py:5: DeprecationWarning: testinfra package has been renamed to pytest-testinfra. Please `pip install pytest-testinfra` and `pip uninstall testinfra` and update your package requirements to avoid this message warnings.warn(( Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-8.1.0, pluggy-1.4.0 -- /home/akim/Desktop/venvs/deplo_test/bin/python3 cachedir: .pytest_cache rootdir: /home/akim/Desktop/wazuh-qa/deployability/modules plugins: testinfra-6.0.0, testinfra-10.1.0 collecting ... collected 5 items modules/testing/tests/test_agent/test_registration.py::test_registration PASSED modules/testing/tests/test_agent/test_registration.py::test_status PASSED modules/testing/tests/test_agent/test_registration.py::test_connection PASSED modules/testing/tests/test_agent/test_registration.py::test_isActive PASSED modules/testing/tests/test_agent/test_registration.py::test_clientKeys PASSED =============================== warnings summary =============================== modules/provision/models.py:65 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:65: 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', pre=True) modules/provision/models.py:73 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:73: 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('uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 5 passed, 2 warnings in 38.55s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 12:59:00] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 12:59:00] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-03-21 12:59:00] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-54-162-7-172.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-03-21 12:59:00] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] No config file found; using defaults 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={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' - --live=True - -s delta: '0:00:25.825662' end: '2024-03-21 12:59:31.850510' msg: '' rc: 0 start: '2024-03-21 12:59:06.024848' stderr: |- /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/_testinfra_renamed.py:5: DeprecationWarning: testinfra package has been renamed to pytest-testinfra. Please `pip install pytest-testinfra` and `pip uninstall testinfra` and update your package requirements to avoid this message warnings.warn(( Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-8.1.0, pluggy-1.4.0 -- /home/akim/Desktop/venvs/deplo_test/bin/python3 cachedir: .pytest_cache rootdir: /home/akim/Desktop/wazuh-qa/deployability/modules plugins: testinfra-6.0.0, testinfra-10.1.0 collecting ... collected 1 item modules/testing/tests/test_agent/test_stop.py::test_stop PASSED =============================== warnings summary =============================== modules/provision/models.py:65 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:65: 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', pre=True) modules/provision/models.py:73 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:73: 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('uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 1 passed, 2 warnings in 25.26s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 12:59:32] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 12:59:32] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-03-21 12:59:32] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-54-162-7-172.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-03-21 12:59:32] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] No config file found; using defaults 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={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' - --live=True - -s delta: '0:00:19.139802' end: '2024-03-21 12:59:56.825163' msg: '' rc: 0 start: '2024-03-21 12:59:37.685361' stderr: |- /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/_testinfra_renamed.py:5: DeprecationWarning: testinfra package has been renamed to pytest-testinfra. Please `pip install pytest-testinfra` and `pip uninstall testinfra` and update your package requirements to avoid this message warnings.warn(( Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-8.1.0, pluggy-1.4.0 -- /home/akim/Desktop/venvs/deplo_test/bin/python3 cachedir: .pytest_cache rootdir: /home/akim/Desktop/wazuh-qa/deployability/modules plugins: testinfra-6.0.0, testinfra-10.1.0 collecting ... collected 5 items modules/testing/tests/test_agent/test_restart.py::test_restart PASSED modules/testing/tests/test_agent/test_restart.py::test_status PASSED modules/testing/tests/test_agent/test_restart.py::test_connection PASSED modules/testing/tests/test_agent/test_restart.py::test_isActive PASSED modules/testing/tests/test_agent/test_restart.py::test_clientKeys PASSED =============================== warnings summary =============================== modules/provision/models.py:65 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:65: 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', pre=True) modules/provision/models.py:73 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:73: 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('uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 5 passed, 2 warnings in 18.56s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 12:59:57] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 12:59:57] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-03-21 12:59:57] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-54-162-7-172.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-03-21 12:59:57] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] No config file found; using defaults 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={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' - --live=True - -s delta: '0:00:53.683342' end: '2024-03-21 13:00:56.404533' msg: '' rc: 0 start: '2024-03-21 13:00:02.721191' stderr: |- /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/_testinfra_renamed.py:5: DeprecationWarning: testinfra package has been renamed to pytest-testinfra. Please `pip install pytest-testinfra` and `pip uninstall testinfra` and update your package requirements to avoid this message warnings.warn(( Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_TIME = "es_ES.UTF-8", LC_MONETARY = "es_ES.UTF-8", LC_ADDRESS = "es_ES.UTF-8", LC_TELEPHONE = "es_ES.UTF-8", LC_NAME = "es_ES.UTF-8", LC_MEASUREMENT = "es_ES.UTF-8", LC_IDENTIFICATION = "es_ES.UTF-8", LC_NUMERIC = "es_ES.UTF-8", LC_PAPER = "es_ES.UTF-8", LANG = "C.UTF-8" are supported and installed on your system. perl: warning: Falling back to a fallback locale ("C.UTF-8"). locale: Cannot set LC_ALL to default locale: No such file or directory Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Removed /etc/systemd/system/multi-user.target.wants/wazuh-agent.service. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-162-7-172.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-54-144-42-190.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-8.1.0, pluggy-1.4.0 -- /home/akim/Desktop/venvs/deplo_test/bin/python3 cachedir: .pytest_cache rootdir: /home/akim/Desktop/wazuh-qa/deployability/modules plugins: testinfra-6.0.0, testinfra-10.1.0 collecting ... collected 3 items modules/testing/tests/test_agent/test_uninstall.py::test_uninstall PASSED modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory PASSED modules/testing/tests/test_agent/test_uninstall.py::test_isActive PASSED =============================== warnings summary =============================== modules/provision/models.py:65 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:65: 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', pre=True) modules/provision/models.py:73 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:73: 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('uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 3 passed, 2 warnings in 53.11s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 13:00:56] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 13:00:56] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-54-162-7-172.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-03-21 13:00:56] [DEBUG] ANSIBLE: Running playbook: /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml No config file found; using defaults PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-54-162-7-172.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-54-162-7-172.compute-1.amazonaws.com] => changed=false path: /tmp/tests state: absent PLAY RECAP ********************************************************************* ec2-54-162-7-172.compute-1.amazonaws.com : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 13:01:09] [DEBUG] ANSIBLE: Playbook /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-54-162-7-172.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-54-162-7-172.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-03-21 13:01:09] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-54-162-7-172.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-03-21 13:01:09] [DEBUG] ANSIBLE: Running playbook: /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml No config file found; using defaults PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [ec2-54-162-7-172.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-54-162-7-172.compute-1.amazonaws.com] => changed=false path: /tmp/tests state: absent PLAY RECAP ********************************************************************* ec2-54-162-7-172.compute-1.amazonaws.com : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 13:01:19] [DEBUG] ANSIBLE: Playbook /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-54-162-7-172.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-54-162-7-172.compute-1.amazonaws.com': 1}, 'changed': {}} ```
Result Vagrant post changes :green_circle: ```bash (deplo_test) akim@akim-PC:~/Desktop/wazuh-qa/deployability$ python3 modules/testing/main.py --wazuh-revision '40714' --wazuh-version '4.7.3' --component 'agent' --tests 'install,registration,stop,restart,uninstall' --targets '{"wazuh-1":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml"}' --targets '{"agent-1":"/tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml"}' --dependencies '{"wazuh-1":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml"}' --live 'True' component='agent' wazuh_version='4.7.3' wazuh_revision='40714' wazuh_branch=None working_dir='/tmp/tests' live=True tests=['install', 'registration', 'stop', 'restart', 'uninstall'] targets=['{"wazuh-1":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml"}', '{"agent-1":"/tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml"}'] dependencies=['{"wazuh-1":"/tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml"}'] cleanup=True [2024-03-21 13:05:45] [INFO] TESTER: Running tests for 192.168.57.4 [2024-03-21 13:05:45] [INFO] TESTER: Running tests for 192.168.57.3 [2024-03-21 13:05:45] [INFO] TESTER: Dependencies 192.168.57.4 [2024-03-21 13:05:45] [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': ['192.168.57.4', '192.168.57.3'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}', 'dependencies': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}', 'local_host_path': '/home/akim/Desktop/wazuh-qa/deployability', 'current_user': 'akim'} [2024-03-21 13:05:45] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-03-21 13:05:45] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'192.168.57.4': {'ansible_port': 22, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-62300D3C-6FC0-4235-B915-ED792442BAB0/instance_key'}}}} [2024-03-21 13:05:45] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/akim/.ssh/known_hosts -R ''"}, 'loop': ['192.168.57.4', '192.168.57.3']}]}] No config file found; using defaults PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=192.168.57.4) => changed=true ansible_loop_var: item cmd: - ssh-keygen - -f - /home/akim/.ssh/known_hosts - -R - '' delta: '0:00:00.009034' end: '2024-03-21 13:05:51.484108' item: 192.168.57.4 msg: '' rc: 0 start: '2024-03-21 13:05:51.475074' stderr: Host not found in /home/akim/.ssh/known_hosts stderr_lines: stdout: '' stdout_lines: changed: [localhost] => (item=192.168.57.3) => changed=true ansible_loop_var: item cmd: - ssh-keygen - -f - /home/akim/.ssh/known_hosts - -R - '' delta: '0:00:00.009338' end: '2024-03-21 13:05:51.651691' item: 192.168.57.3 msg: '' rc: 0 start: '2024-03-21 13:05:51.642353' stderr: Host not found in /home/akim/.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-03-21 13:05:51] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', 'tasks': [{'name': 'Cleaning old key ssh-keygen registries', 'ansible.builtin.command': {'cmd': "ssh-keygen -f /home/akim/.ssh/known_hosts -R ''"}, 'loop': ['192.168.57.4', '192.168.57.3']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 13:05:51] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-03-21 13:05:51] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'192.168.57.4': {'ansible_port': 22, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-62300D3C-6FC0-4235-B915-ED792442BAB0/instance_key'}}}} [2024-03-21 13:05:51] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] No config file found; using defaults 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={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' - --live=True - -s delta: '0:03:28.983975' end: '2024-03-21 13:09:23.685112' msg: '' rc: 0 start: '2024-03-21 13:05:54.701137' stderr: |- /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/_testinfra_renamed.py:5: DeprecationWarning: testinfra package has been renamed to pytest-testinfra. Please `pip install pytest-testinfra` and `pip uninstall testinfra` and update your package requirements to avoid this message warnings.warn(( Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Failed to stop firewalld.service: Unit firewalld.service not loaded. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Failed to disable unit: Unit file firewalld.service does not exist. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Failed to stop firewalld.service: Unit firewalld.service not loaded. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Failed to disable unit: Unit file firewalld.service does not exist. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. --2024-03-21 12:09:07-- https://packages-dev.wazuh.com/pre-release/apt/pool/main/w/wazuh-agent/wazuh-agent_4.7.3-1_amd64.deb Resolving packages-dev.wazuh.com (packages-dev.wazuh.com)... 52.84.66.65, 52.84.66.16, 52.84.66.126, ... Connecting to packages-dev.wazuh.com (packages-dev.wazuh.com)|52.84.66.65|: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% 293K 31s 50K .......... .......... .......... .......... .......... 1% 127K 51s 100K .......... .......... .......... .......... .......... 1% 36.9M 34s 150K .......... .......... .......... .......... .......... 2% 1.87M 27s 200K .......... .......... .......... .......... .......... 2% 3.00M 22s 250K .......... .......... .......... .......... .......... 3% 4.81M 18s 300K .......... .......... .......... .......... .......... 3% 2.47M 16s 350K .......... .......... .......... .......... .......... 4% 3.75M 14s 400K .......... .......... .......... .......... .......... 4% 1.42M 13s 450K .......... .......... .......... .......... .......... 5% 3.29M 12s 500K .......... .......... .......... .......... .......... 6% 22.0M 11s 550K .......... .......... .......... .......... .......... 6% 2.85M 10s 600K .......... .......... .......... .......... .......... 7% 1.04M 10s 650K .......... .......... .......... .......... .......... 7% 1.14M 10s 700K .......... .......... .......... .......... .......... 8% 4.43M 9s 750K .......... .......... .......... .......... .......... 8% 17.0M 9s 800K .......... .......... .......... .......... .......... 9% 1.61M 8s 850K .......... .......... .......... .......... .......... 9% 3.41M 8s 900K .......... .......... .......... .......... .......... 10% 60.0M 8s 950K .......... .......... .......... .......... .......... 10% 2.20M 7s 1000K .......... .......... .......... .......... .......... 11% 2.23M 7s 1050K .......... .......... .......... .......... .......... 12% 6.33M 7s 1100K .......... .......... .......... .......... .......... 12% 4.07M 6s 1150K .......... .......... .......... .......... .......... 13% 3.19M 6s 1200K .......... .......... .......... .......... .......... 13% 4.19M 6s 1250K .......... .......... .......... .......... .......... 14% 5.61M 6s 1300K .......... .......... .......... .......... .......... 14% 2.76M 6s 1350K .......... .......... .......... .......... .......... 15% 3.12M 6s 1400K .......... .......... .......... .......... .......... 15% 6.89M 5s 1450K .......... .......... .......... .......... .......... 16% 3.89M 5s 1500K .......... .......... .......... .......... .......... 16% 3.12M 5s 1550K .......... .......... .......... .......... .......... 17% 4.37M 5s 1600K .......... .......... .......... .......... .......... 18% 2.78M 5s 1650K .......... .......... .......... .......... .......... 18% 8.66M 5s 1700K .......... .......... .......... .......... .......... 19% 2.46M 5s 1750K .......... .......... .......... .......... .......... 19% 113M 4s 1800K .......... .......... .......... .......... .......... 20% 2.39M 4s 1850K .......... .......... .......... .......... .......... 20% 17.9M 4s 1900K .......... .......... .......... .......... .......... 21% 2.22M 4s 1950K .......... .......... .......... .......... .......... 21% 13.9M 4s 2000K .......... .......... .......... .......... .......... 22% 2.06M 4s 2050K .......... .......... .......... .......... .......... 22% 9.00M 4s 2100K .......... .......... .......... .......... .......... 23% 1.70M 4s 2150K .......... .......... .......... .......... .......... 24% 8.34M 4s 2200K .......... .......... .......... .......... .......... 24% 4.10M 4s 2250K .......... .......... .......... .......... .......... 25% 45.8M 4s 2300K .......... .......... .......... .......... .......... 25% 2.98M 4s 2350K .......... .......... .......... .......... .......... 26% 3.38M 4s 2400K .......... .......... .......... .......... .......... 26% 7.20M 3s 2450K .......... .......... .......... .......... .......... 27% 2.54M 3s 2500K .......... .......... .......... .......... .......... 27% 8.38M 3s 2550K .......... .......... .......... .......... .......... 28% 5.87M 3s 2600K .......... .......... .......... .......... .......... 28% 2.14M 3s 2650K .......... .......... .......... .......... .......... 29% 12.3M 3s 2700K .......... .......... .......... .......... .......... 30% 24.4M 3s 2750K .......... .......... .......... .......... .......... 30% 2.94M 3s 2800K .......... .......... .......... .......... .......... 31% 12.8M 3s 2850K .......... .......... .......... .......... .......... 31% 5.06M 3s 2900K .......... .......... .......... .......... .......... 32% 2.42M 3s 2950K .......... .......... .......... .......... .......... 32% 13.1M 3s 3000K .......... .......... .......... .......... .......... 33% 3.27M 3s 3050K .......... .......... .......... .......... .......... 33% 3.71M 3s 3100K .......... .......... .......... .......... .......... 34% 15.2M 3s 3150K .......... .......... .......... .......... .......... 34% 4.29M 3s 3200K .......... .......... .......... .......... .......... 35% 9.36M 3s 3250K .......... .......... .......... .......... .......... 36% 3.20M 3s 3300K .......... .......... .......... .......... .......... 36% 15.3M 2s 3350K .......... .......... .......... .......... .......... 37% 2.41M 2s 3400K .......... .......... .......... .......... .......... 37% 15.4M 2s 3450K .......... .......... .......... .......... .......... 38% 3.38M 2s 3500K .......... .......... .......... .......... .......... 38% 29.8M 2s 3550K .......... .......... .......... .......... .......... 39% 10.7M 2s 3600K .......... .......... .......... .......... .......... 39% 2.44M 2s 3650K .......... .......... .......... .......... .......... 40% 29.3M 2s 3700K .......... .......... .......... .......... .......... 41% 3.30M 2s 3750K .......... .......... .......... .......... .......... 41% 3.92M 2s 3800K .......... .......... .......... .......... .......... 42% 11.2M 2s 3850K .......... .......... .......... .......... .......... 42% 13.7M 2s 3900K .......... .......... .......... .......... .......... 43% 19.1M 2s 3950K .......... .......... .......... .......... .......... 43% 4.71M 2s 4000K .......... .......... .......... .......... .......... 44% 2.80M 2s 4050K .......... .......... .......... .......... .......... 44% 1.36M 2s 4100K .......... .......... .......... .......... .......... 45% 59.3M 2s 4150K .......... .......... .......... .......... .......... 45% 3.47M 2s 4200K .......... .......... .......... .......... .......... 46% 16.5M 2s 4250K .......... .......... .......... .......... .......... 47% 47.9M 2s 4300K .......... .......... .......... .......... .......... 47% 4.96M 2s 4350K .......... .......... .......... .......... .......... 48% 49.7M 2s 4400K .......... .......... .......... .......... .......... 48% 4.45M 2s 4450K .......... .......... .......... .......... .......... 49% 52.2M 2s 4500K .......... .......... .......... .......... .......... 49% 4.53M 2s 4550K .......... .......... .......... .......... .......... 50% 10.4M 2s 4600K .......... .......... .......... .......... .......... 50% 5.20M 2s 4650K .......... .......... .......... .......... .......... 51% 9.25M 2s 4700K .......... .......... .......... .......... .......... 51% 15.2M 2s 4750K .......... .......... .......... .......... .......... 52% 20.6M 2s 4800K .......... .......... .......... .......... .......... 53% 5.30M 1s 4850K .......... .......... .......... .......... .......... 53% 3.42M 1s 4900K .......... .......... .......... .......... .......... 54% 8.37M 1s 4950K .......... .......... .......... .......... .......... 54% 5.50M 1s 5000K .......... .......... .......... .......... .......... 55% 29.6M 1s 5050K .......... .......... .......... .......... .......... 55% 6.88M 1s 5100K .......... .......... .......... .......... .......... 56% 6.10M 1s 5150K .......... .......... .......... .......... .......... 56% 2.54M 1s 5200K .......... .......... .......... .......... .......... 57% 22.9M 1s 5250K .......... .......... .......... .......... .......... 57% 4.34M 1s 5300K .......... .......... .......... .......... .......... 58% 25.2M 1s 5350K .......... .......... .......... .......... .......... 59% 11.3M 1s 5400K .......... .......... .......... .......... .......... 59% 9.64M 1s 5450K .......... .......... .......... .......... .......... 60% 4.76M 1s 5500K .......... .......... .......... .......... .......... 60% 3.62M 1s 5550K .......... .......... .......... .......... .......... 61% 1.94M 1s 5600K .......... .......... .......... .......... .......... 61% 118M 1s 5650K .......... .......... .......... .......... .......... 62% 245M 1s 5700K .......... .......... .......... .......... .......... 62% 5.28M 1s 5750K .......... .......... .......... .......... .......... 63% 9.54M 1s 5800K .......... .......... .......... .......... .......... 63% 4.48M 1s 5850K .......... .......... .......... .......... .......... 64% 4.36M 1s 5900K .......... .......... .......... .......... .......... 65% 90.2M 1s 5950K .......... .......... .......... .......... .......... 65% 25.0M 1s 6000K .......... .......... .......... .......... .......... 66% 6.70M 1s 6050K .......... .......... .......... .......... .......... 66% 5.09M 1s 6100K .......... .......... .......... .......... .......... 67% 5.74M 1s 6150K .......... .......... .......... .......... .......... 67% 18.0M 1s 6200K .......... .......... .......... .......... .......... 68% 2.96M 1s 6250K .......... .......... .......... .......... .......... 68% 5.93M 1s 6300K .......... .......... .......... .......... .......... 69% 8.73M 1s 6350K .......... .......... .......... .......... .......... 69% 4.05M 1s 6400K .......... .......... .......... .......... .......... 70% 23.5M 1s 6450K .......... .......... .......... .......... .......... 71% 2.68M 1s 6500K .......... .......... .......... .......... .......... 71% 2.16M 1s 6550K .......... .......... .......... .......... .......... 72% 12.3M 1s 6600K .......... .......... .......... .......... .......... 72% 24.0M 1s 6650K .......... .......... .......... .......... .......... 73% 29.4M 1s 6700K .......... .......... .......... .......... .......... 73% 22.0M 1s 6750K .......... .......... .......... .......... .......... 74% 10.4M 1s 6800K .......... .......... .......... .......... .......... 74% 33.2M 1s 6850K .......... .......... .......... .......... .......... 75% 26.3M 1s 6900K .......... .......... .......... .......... .......... 76% 2.84M 1s 6950K .......... .......... .......... .......... .......... 76% 20.1M 1s 7000K .......... .......... .......... .......... .......... 77% 14.1M 1s 7050K .......... .......... .......... .......... .......... 77% 5.47M 1s 7100K .......... .......... .......... .......... .......... 78% 24.9M 1s 7150K .......... .......... .......... .......... .......... 78% 13.4M 1s 7200K .......... .......... .......... .......... .......... 79% 20.8M 1s 7250K .......... .......... .......... .......... .......... 79% 8.71M 1s 7300K .......... .......... .......... .......... .......... 80% 6.86M 1s 7350K .......... .......... .......... .......... .......... 80% 4.18M 0s 7400K .......... .......... .......... .......... .......... 81% 8.50M 0s 7450K .......... .......... .......... .......... .......... 82% 1.63M 0s 7500K .......... .......... .......... .......... .......... 82% 6.61M 0s 7550K .......... .......... .......... .......... .......... 83% 1.71M 0s 7600K .......... .......... .......... .......... .......... 83% 26.5M 0s 7650K .......... .......... .......... .......... .......... 84% 13.9M 0s 7700K .......... .......... .......... .......... .......... 84% 7.00M 0s 7750K .......... .......... .......... .......... .......... 85% 7.90M 0s 7800K .......... .......... .......... .......... .......... 85% 1.78M 0s 7850K .......... .......... .......... .......... .......... 86% 3.05M 0s 7900K .......... .......... .......... .......... .......... 86% 21.1M 0s 7950K .......... .......... .......... .......... .......... 87% 22.9M 0s 8000K .......... .......... .......... .......... .......... 88% 3.78M 0s 8050K .......... .......... .......... .......... .......... 88% 11.4M 0s 8100K .......... .......... .......... .......... .......... 89% 5.44M 0s 8150K .......... .......... .......... .......... .......... 89% 5.52M 0s 8200K .......... .......... .......... .......... .......... 90% 4.06M 0s 8250K .......... .......... .......... .......... .......... 90% 4.98M 0s 8300K .......... .......... .......... .......... .......... 91% 27.0M 0s 8350K .......... .......... .......... .......... .......... 91% 6.65M 0s 8400K .......... .......... .......... .......... .......... 92% 15.4M 0s 8450K .......... .......... .......... .......... .......... 92% 21.7M 0s 8500K .......... .......... .......... .......... .......... 93% 13.0M 0s 8550K .......... .......... .......... .......... .......... 94% 5.57M 0s 8600K .......... .......... .......... .......... .......... 94% 3.10M 0s 8650K .......... .......... .......... .......... .......... 95% 6.72M 0s 8700K .......... .......... .......... .......... .......... 95% 17.5M 0s 8750K .......... .......... .......... .......... .......... 96% 4.34M 0s 8800K .......... .......... .......... .......... .......... 96% 11.6M 0s 8850K .......... .......... .......... .......... .......... 97% 30.3M 0s 8900K .......... .......... .......... .......... .......... 97% 8.27M 0s 8950K .......... .......... .......... .......... .......... 98% 12.1M 0s 9000K .......... .......... .......... .......... .......... 98% 4.16M 0s 9050K .......... .......... .......... .......... .......... 99% 18.7M 0s 9100K .......... .......... .......... .......... ... 100% 23.5M=2.4s 2024-03-21 12:09:10 (3.79 MB/s) - 'wazuh-agent_4.7.3-1_amd64.deb' saved [9362524/9362524] Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) 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 '192.168.57.3' (ED25519) 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 '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-8.1.0, pluggy-1.4.0 -- /home/akim/Desktop/venvs/deplo_test/bin/python3 cachedir: .pytest_cache rootdir: /home/akim/Desktop/wazuh-qa/deployability/modules plugins: testinfra-6.0.0, testinfra-10.1.0 collecting ... collected 4 items modules/testing/tests/test_agent/test_install.py::test_installation PASSED modules/testing/tests/test_agent/test_install.py::test_status PASSED modules/testing/tests/test_agent/test_install.py::test_version PASSED modules/testing/tests/test_agent/test_install.py::test_revision PASSED =============================== warnings summary =============================== modules/provision/models.py:65 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:65: 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', pre=True) modules/provision/models.py:73 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:73: 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('uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ================== 4 passed, 2 warnings in 208.41s (0:03:28) =================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 13:09:23] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 13:09:24] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-03-21 13:09:24] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'192.168.57.4': {'ansible_port': 22, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-62300D3C-6FC0-4235-B915-ED792442BAB0/instance_key'}}}} [2024-03-21 13:09:24] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] No config file found; using defaults 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={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' - --live=True - -s delta: '0:00:33.676485' end: '2024-03-21 13:10:03.431430' msg: '' rc: 0 start: '2024-03-21 13:09:29.754945' stderr: |- /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/_testinfra_renamed.py:5: DeprecationWarning: testinfra package has been renamed to pytest-testinfra. Please `pip install pytest-testinfra` and `pip uninstall testinfra` and update your package requirements to avoid this message warnings.warn(( Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-8.1.0, pluggy-1.4.0 -- /home/akim/Desktop/venvs/deplo_test/bin/python3 cachedir: .pytest_cache rootdir: /home/akim/Desktop/wazuh-qa/deployability/modules plugins: testinfra-6.0.0, testinfra-10.1.0 collecting ... collected 5 items modules/testing/tests/test_agent/test_registration.py::test_registration PASSED modules/testing/tests/test_agent/test_registration.py::test_status PASSED modules/testing/tests/test_agent/test_registration.py::test_connection PASSED modules/testing/tests/test_agent/test_registration.py::test_isActive PASSED modules/testing/tests/test_agent/test_registration.py::test_clientKeys PASSED =============================== warnings summary =============================== modules/provision/models.py:65 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:65: 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', pre=True) modules/provision/models.py:73 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:73: 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('uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 5 passed, 2 warnings in 33.07s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 13:10:03] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 13:10:03] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-03-21 13:10:03] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'192.168.57.4': {'ansible_port': 22, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-62300D3C-6FC0-4235-B915-ED792442BAB0/instance_key'}}}} [2024-03-21 13:10:03] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] No config file found; using defaults 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={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' - --live=True - -s delta: '0:00:12.902437' end: '2024-03-21 13:10:22.396558' msg: '' rc: 0 start: '2024-03-21 13:10:09.494121' stderr: |- /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/_testinfra_renamed.py:5: DeprecationWarning: testinfra package has been renamed to pytest-testinfra. Please `pip install pytest-testinfra` and `pip uninstall testinfra` and update your package requirements to avoid this message warnings.warn(( Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-8.1.0, pluggy-1.4.0 -- /home/akim/Desktop/venvs/deplo_test/bin/python3 cachedir: .pytest_cache rootdir: /home/akim/Desktop/wazuh-qa/deployability/modules plugins: testinfra-6.0.0, testinfra-10.1.0 collecting ... collected 1 item modules/testing/tests/test_agent/test_stop.py::test_stop PASSED =============================== warnings summary =============================== modules/provision/models.py:65 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:65: 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', pre=True) modules/provision/models.py:73 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:73: 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('uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 1 passed, 2 warnings in 12.29s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 13:10:22] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 13:10:22] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-03-21 13:10:22] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'192.168.57.4': {'ansible_port': 22, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-62300D3C-6FC0-4235-B915-ED792442BAB0/instance_key'}}}} [2024-03-21 13:10:22] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] No config file found; using defaults 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={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' - --live=True - -s delta: '0:00:11.527947' end: '2024-03-21 13:10:42.197323' msg: '' rc: 0 start: '2024-03-21 13:10:30.669376' stderr: |- /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/_testinfra_renamed.py:5: DeprecationWarning: testinfra package has been renamed to pytest-testinfra. Please `pip install pytest-testinfra` and `pip uninstall testinfra` and update your package requirements to avoid this message warnings.warn(( Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-8.1.0, pluggy-1.4.0 -- /home/akim/Desktop/venvs/deplo_test/bin/python3 cachedir: .pytest_cache rootdir: /home/akim/Desktop/wazuh-qa/deployability/modules plugins: testinfra-6.0.0, testinfra-10.1.0 collecting ... collected 5 items modules/testing/tests/test_agent/test_restart.py::test_restart PASSED modules/testing/tests/test_agent/test_restart.py::test_status PASSED modules/testing/tests/test_agent/test_restart.py::test_connection PASSED modules/testing/tests/test_agent/test_restart.py::test_isActive PASSED modules/testing/tests/test_agent/test_restart.py::test_clientKeys PASSED =============================== warnings summary =============================== modules/provision/models.py:65 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:65: 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', pre=True) modules/provision/models.py:73 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:73: 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('uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 5 passed, 2 warnings in 10.93s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 13:10:42] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 13:10:42] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-03-21 13:10:42] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'192.168.57.4': {'ansible_port': 22, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-62300D3C-6FC0-4235-B915-ED792442BAB0/instance_key'}}}} [2024-03-21 13:10:42] [DEBUG] ANSIBLE: Running playbook: [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] No config file found; using defaults 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={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' - --live=True - -s delta: '0:00:16.904793' end: '2024-03-21 13:11:02.412994' msg: '' rc: 0 start: '2024-03-21 13:10:45.508201' stderr: |- /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/_testinfra_renamed.py:5: DeprecationWarning: testinfra package has been renamed to pytest-testinfra. Please `pip install pytest-testinfra` and `pip uninstall testinfra` and update your package requirements to avoid this message warnings.warn(( Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_TIME = "es_ES.UTF-8", LC_MONETARY = "es_ES.UTF-8", LC_ADDRESS = "es_ES.UTF-8", LC_TELEPHONE = "es_ES.UTF-8", LC_NAME = "es_ES.UTF-8", LC_MEASUREMENT = "es_ES.UTF-8", LC_IDENTIFICATION = "es_ES.UTF-8", LC_NUMERIC = "es_ES.UTF-8", LC_PAPER = "es_ES.UTF-8", LANG = "C.UTF-8" are supported and installed on your system. perl: warning: Falling back to a fallback locale ("C.UTF-8"). locale: Cannot set LC_ALL to default locale: No such file or directory Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Removed /etc/systemd/system/multi-user.target.wants/wazuh-agent.service. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.4' (ED25519) to the list of known hosts. Warning: Permanently added '192.168.57.3' (ED25519) to the list of known hosts. stderr_lines: stdout: |- ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-8.1.0, pluggy-1.4.0 -- /home/akim/Desktop/venvs/deplo_test/bin/python3 cachedir: .pytest_cache rootdir: /home/akim/Desktop/wazuh-qa/deployability/modules plugins: testinfra-6.0.0, testinfra-10.1.0 collecting ... collected 3 items modules/testing/tests/test_agent/test_uninstall.py::test_uninstall PASSED modules/testing/tests/test_agent/test_uninstall.py::test_agent_uninstalled_directory PASSED modules/testing/tests/test_agent/test_uninstall.py::test_isActive PASSED =============================== warnings summary =============================== modules/provision/models.py:65 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:65: 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', pre=True) modules/provision/models.py:73 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:73: 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('uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 3 passed, 2 warnings in 16.32s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 13:11:02] [DEBUG] ANSIBLE: Playbook [{'hosts': 'localhost', 'become': True, 'become_user': 'akim', '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='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-22.04-amd64/inventory.yml, agent-1: /tmp/dtt1-poc/manager-linux-ubuntu-20.04-amd64/inventory.yml}' --live=True -s", 'args': {'chdir': '/home/akim/Desktop/wazuh-qa/deployability'}}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-03-21 13:11:02] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'192.168.57.4': {'ansible_port': 22, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-62300D3C-6FC0-4235-B915-ED792442BAB0/instance_key'}}}} [2024-03-21 13:11:02] [DEBUG] ANSIBLE: Running playbook: /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml No config file found; using defaults PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [192.168.57.4] TASK [Clean test directory] **************************************************** ok: [192.168.57.4] => changed=false path: /tmp/tests state: absent PLAY RECAP ********************************************************************* 192.168.57.4 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 13:11:05] [DEBUG] ANSIBLE: Playbook /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'192.168.57.4': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'192.168.57.4': 1}, 'changed': {}} [2024-03-21 13:11:05] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'192.168.57.4': {'ansible_port': 22, 'ansible_user': 'vagrant', 'ansible_ssh_private_key_file': '/tmp/wazuh-qa/VAGRANT-62300D3C-6FC0-4235-B915-ED792442BAB0/instance_key'}}}} [2024-03-21 13:11:05] [DEBUG] ANSIBLE: Running playbook: /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml No config file found; using defaults PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [192.168.57.4] TASK [Clean test directory] **************************************************** ok: [192.168.57.4] => changed=false path: /tmp/tests state: absent PLAY RECAP ********************************************************************* 192.168.57.4 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-03-21 13:11:08] [DEBUG] ANSIBLE: Playbook /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'192.168.57.4': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'192.168.57.4': 1}, 'changed': {}} ```
rauldpm commented 1 month ago

Meet resume

pro-akim commented 1 month ago

Update

Tests results in AWS

OS Test result Additional data
redhat9 :green_circle:
redhat7 :red_circle: AMI failure
redhat8 :green_circle:
centos7 :green_circle:
centos8 :green_circle:
debian10 :green_circle:
debian11 :green_circle:
debian12 :green_circle:
ubuntu20.04 :green_circle:
ubuntu22.04 :green_circle:
oracle9 :green_circle:
amazon2 :green_circle:
amazon2023 :green_circle:
opensuse :red_circle: AMI failure
suse15 :green_circle:
redhat7 ```bash [2024-03-21 15:41:06] [ERROR] [282453] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-manager-linux-redhat-7-amd64] Task failed with error: Error executing process task Traceback (most recent call last): File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/main.py", line 34, in main() File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/main.py", line 30, in main Allocator.run(InputPayload(**vars(parse_arguments()))) File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/allocation.py", line 31, in run return cls.__create(payload) File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/allocation.py", line 50, in __create instance = provider.create_instance( File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/generic/provider.py", line 66, in create_instance return cls._create_instance(base_dir, params, config, ssh_key) File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/aws/provider.py", line 115, in _create_instance instance_id = cls.__create_ec2_instance(config) File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/aws/provider.py", line 215, in __create_ec2_instance instance = client.create_instances(**params)[0] File "/home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/boto3/resources/factory.py", line 580, in do_action response = action(self, *args, **kwargs) File "/home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/boto3/resources/action.py", line 88, in __call__ response = getattr(parent.meta.client, operation_name)(*args, **params) File "/home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/botocore/client.py", line 535, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/akim/Desktop/venvs/deplo_test/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 (OptInRequired) when calling the RunInstances operation: In order to use this AWS Marketplace product you need to accept terms and subscribe. To do so please visit https://aws.amazon.com/marketplace/pp?sku=3jdidj7kpc10apzarpkkyoe3t ```
opensuse ```bash [2024-03-21 13:48:22] [INFO] [257840] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-manager-linux-opensuse-15-amd64] Starting task. [2024-03-21 13:48:24] [ERROR] [257840] [ThreadPoolExecutor-0_0] [workflow_engine]: [allocate-manager-linux-opensuse-15-amd64] Task failed with error: Error executing process task Traceback (most recent call last): File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/main.py", line 34, in main() File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/main.py", line 30, in main Allocator.run(InputPayload(**vars(parse_arguments()))) File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/allocation.py", line 31, in run return cls.__create(payload) File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/allocation.py", line 50, in __create instance = provider.create_instance( File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/generic/provider.py", line 66, in create_instance return cls._create_instance(base_dir, params, config, ssh_key) File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/aws/provider.py", line 115, in _create_instance instance_id = cls.__create_ec2_instance(config) File "/home/akim/Desktop/test/wazuh-qa/deployability/modules/allocation/aws/provider.py", line 215, in __create_ec2_instance instance = client.create_instances(**params)[0] File "/home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/boto3/resources/factory.py", line 580, in do_action response = action(self, *args, **kwargs) File "/home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/boto3/resources/action.py", line 88, in __call__ response = getattr(parent.meta.client, operation_name)(*args, **params) File "/home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/botocore/client.py", line 535, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/akim/Desktop/venvs/deplo_test/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 (OptInRequired) when calling the RunInstances operation: In order to use this AWS Marketplace product you need to accept terms and subscribe. To do so please visit https://aws.amazon.com/marketplace/pp?sku=147aomaaws9zx4er41jp3mozy ```
pro-akim commented 1 month ago

Update

Changes done. Moved to pending review

fcaffieri commented 1 month ago

LGTM