wazuh / wazuh-qa

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

DTT1 - Test Module - Implement macOS tests #5229

Closed fcaffieri closed 3 weeks ago

fcaffieri commented 1 month ago

Description

The objective of the issue is to make the necessary adaptations to perform agent tests on macOS systems.

Tasks

pro-akim commented 1 month ago

Update

Note :warning: The manager is installed in AWS and macos Agents in Vagrant (this is because if I have the manager in a VM in my local Vagrant, the MACMINI Agent is not being able to be connect to the Manager)

VENTURA :green_circle:

YAML ``` version: 0.1 description: Test agent restart with provisioning agents' with provision module variables: agent-os: - macos-ventura-13.4.1-arm64 manager-os: linux-ubuntu-18.04-amd64 infra-provider: aws working-dir: /tmp/dtt1-poc tasks: - task: "allocate-manager-{manager-os}" description: "Allocate resources for the manager." do: this: process with: path: python3 args: - modules/allocation/main.py - action: create - provider: "aws" - size: large - composite-name: "{manager-os}" - inventory-output: "{working-dir}/manager-{manager-os}/inventory.yaml" - track-output: "{working-dir}/manager-{manager-os}/track.yaml" - label-termination-date: "1d" - label-team: "qa" - ssh-key: "/home/akim/Desktop/personal/Ephemeral" on-error: "abort-all" # Generic agent test task - task: "run-agent-{agent}-tests" description: "Run tests install for the agent {agent}." do: this: process with: path: python3 args: - modules/testing/main.py - targets: - wazuh-1: "{working-dir}/manager-{manager-os}/inventory.yaml" - agent: "{working-dir}/agent-{agent}/inventory.yaml" - tests: "install,registration,restart,stop,uninstall" - component: "agent" - wazuh-version: "4.7.3" - wazuh-revision: "40714" - live: "True" foreach: - variable: agent-os as: agent ```
ventura ``` (deplo_test) akim@akim-PC:~/Desktop/wazuh-qa/deployability$ python3 -m workflow_engine modules/workflow_engine/examples/agent/vagrant/test.yaml --log-level=DEBUG [2024-04-18 13:35:26] [DEBUG] [1451944] [MainThread] [workflow_engine]: Validating input file: modules/workflow_engine/examples/agent/vagrant/test.yaml [2024-04-18 13:35:26] [DEBUG] [1451944] [MainThread] [workflow_engine]: Loading schema file: /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/workflow_engine/schemas/schema_v1.json [2024-04-18 13:35:26] [DEBUG] [1451944] [MainThread] [workflow_engine]: Loading yaml file: modules/workflow_engine/examples/agent/vagrant/test.yaml [2024-04-18 13:35:26] [DEBUG] [1451944] [MainThread] [workflow_engine]: Loading workflow file: modules/workflow_engine/examples/agent/vagrant/test.yaml [2024-04-18 13:35:26] [DEBUG] [1451944] [MainThread] [workflow_engine]: Process workflow. [2024-04-18 13:35:26] [INFO] [1451944] [MainThread] [workflow_engine]: Executing DAG tasks. [2024-04-18 13:35:26] [INFO] [1451944] [MainThread] [workflow_engine]: Executing tasks in parallel. [2024-04-18 13:35:26] [INFO] [1451944] [ThreadPoolExecutor-0_0] [workflow_engine]: [run-agent-macos-ventura-13.4.1-arm64-tests] Starting task. [2024-04-18 13:35:26] [DEBUG] [1451944] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "run-agent-macos-ventura-13.4.1-arm64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml'}", '--tests=install,registration,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-18 13:41:35] [DEBUG] [1451944] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "run-agent-macos-ventura-13.4.1-arm64-tests" execution with result: [2024-04-18 13:35:26] [INFO] TESTER: Running tests for ec2-107-20-3-115.compute-1.amazonaws.com [2024-04-18 13:35:26] [INFO] TESTER: Running tests for 10.10.0.250 [2024-04-18 13:35:26] [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-107-20-3-115.compute-1.amazonaws.com', '10.10.0.250'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/akim/Desktop/wazuh-qa/deployability', 'current_user': 'akim'} [2024-04-18 13:35:26] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-18 13:35:26] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:35:26] [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-107-20-3-115.compute-1.amazonaws.com', '10.10.0.250']}]}] No config file found; using defaults PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-107-20-3-115.compute-1.amazonaws.com) => changed=true ansible_loop_var: item cmd: - ssh-keygen - -f - /home/akim/.ssh/known_hosts - -R - '' delta: '0:00:00.010451' end: '2024-04-18 13:35:32.125075' item: ec2-107-20-3-115.compute-1.amazonaws.com msg: '' rc: 0 start: '2024-04-18 13:35:32.114624' stderr: Host not found in /home/akim/.ssh/known_hosts stderr_lines: stdout: '' stdout_lines: changed: [localhost] => (item=10.10.0.250) => changed=true ansible_loop_var: item cmd: - ssh-keygen - -f - /home/akim/.ssh/known_hosts - -R - '' delta: '0:00:00.010378' end: '2024-04-18 13:35:32.282720' item: 10.10.0.250 msg: '' rc: 0 start: '2024-04-18 13:35:32.272342' 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-04-18 13:35:32] [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-107-20-3-115.compute-1.amazonaws.com', '10.10.0.250']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-18 13:35:32] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-18 13:35:32] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:35:32] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' --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={} - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' - --live=True - -s delta: '0:01:19.895166' end: '2024-04-18 13:36:55.207076' msg: '' rc: 0 start: '2024-04-18 13:35:35.311910' 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-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.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 [2024-04-18 13:35:35,875] [INFO] [Testing]: Checking connection to ventura-13.4.1 [2024-04-18 13:35:39,011] [INFO] [Testing]: Connection established successfully in ventura-13.4.1 [2024-04-18 13:35:42,021] [INFO] [Testing]: Checking connection to ubuntu-18.04 [2024-04-18 13:35:42,763] [INFO] [Testing]: Connection established successfully in ubuntu-18.04 [2024-04-18 13:35:42,763] [INFO] [Testing]: Firewall disabled on ventura-13.4.1 [2024-04-18 13:35:47,415] [INFO] [Testing]: Manager is already installed in ubuntu-18.04 [2024-04-18 13:35:49,734] [INFO] [Testing]: Generating Snapshot for Checkfile in ventura-13.4.1 [2024-04-18 13:36:11,710] [INFO] [Testing]: Installing Agent in ventura-13.4.1 [2024-04-18 13:36:25,024] [INFO] [Testing]: Generating Snapshot for Checkfile in ventura-13.4.1 [2024-04-18 13:36:43,942] [INFO] [Testing]: Applying filters in checkfiles in ventura-13.4.1 [2024-04-18 13:36:43,943] [INFO] [Testing]: Pre and post install checkfile comparison in ventura-13.4.1: {'/usr/bin': {'added': [], 'removed': [], 'modified': []}, '/usr/sbin': {'added': [], 'removed': [], 'modified': []}} PASSED modules/testing/tests/test_agent/test_install.py::test_status [2024-04-18 13:36:46,529] [INFO] [Testing]: Getting status of ventura-13.4.1 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:36 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('dependencies', pre=True) modules/provision/models.py:64 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('install', 'uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =================== 4 passed, 2 warnings in 79.34s (0:01:19) =================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:36:55] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' --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-04-18 13:36:55] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-18 13:36:55] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:36:55] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' --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={} - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' - --live=True - -s delta: '0:00:57.792408' end: '2024-04-18 13:37:58.783646' msg: '' rc: 0 start: '2024-04-18 13:37:00.991238' 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-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.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 [2024-04-18 13:37:01,552] [INFO] [Testing]: Checking connection to ventura-13.4.1 [2024-04-18 13:37:03,792] [INFO] [Testing]: Connection established successfully in ventura-13.4.1 PASSED modules/testing/tests/test_agent/test_registration.py::test_status [2024-04-18 13:37:29,853] [INFO] [Testing]: Getting status of ventura-13.4.1 [2024-04-18 13:37:32,684] [INFO] [Testing]: Getting status of ventura-13.4.1 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:36 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('dependencies', pre=True) modules/provision/models.py:64 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('install', 'uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 5 passed, 2 warnings in 57.24s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:37:59] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' --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-04-18 13:37:59] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-18 13:37:59] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:37:59] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' --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={} - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' - --live=True - -s delta: '0:00:48.107950' end: '2024-04-18 13:38:52.564389' msg: '' rc: 0 start: '2024-04-18 13:38:04.456439' 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-107-20-3-115.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 [2024-04-18 13:38:05,024] [INFO] [Testing]: Checking connection to ventura-13.4.1 [2024-04-18 13:38:07,397] [INFO] [Testing]: Connection established successfully in ventura-13.4.1 [2024-04-18 13:38:18,457] [INFO] [Testing]: Restarting wazuh-agent in ventura-13.4.1 PASSED modules/testing/tests/test_agent/test_restart.py::test_status [2024-04-18 13:38:39,206] [INFO] [Testing]: Getting status of ventura-13.4.1 [2024-04-18 13:38:41,833] [INFO] [Testing]: Getting status of ventura-13.4.1 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:36 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('dependencies', pre=True) modules/provision/models.py:64 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('install', 'uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 5 passed, 2 warnings in 47.55s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:38:52] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' --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-04-18 13:38:52] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-18 13:38:52] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:38:52] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' --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={} - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' - --live=True - -s delta: '0:00:42.617516' end: '2024-04-18 13:39:40.862585' msg: '' rc: 0 start: '2024-04-18 13:38:58.245069' 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-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.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 [2024-04-18 13:38:58,811] [INFO] [Testing]: Checking connection to ventura-13.4.1 [2024-04-18 13:39:00,940] [INFO] [Testing]: Connection established successfully in ventura-13.4.1 [2024-04-18 13:39:20,102] [INFO] [Testing]: Stopping wazuh-agent in ventura-13.4.1 [2024-04-18 13:39:23,686] [INFO] [Testing]: Getting status of ventura-13.4.1 [2024-04-18 13:39:26,394] [INFO] [Testing]: Getting status of ventura-13.4.1 PASSED[2024-04-18 13:39:29,730] [INFO] [Testing]: Restarting wazuh-agent in ventura-13.4.1 =============================== warnings summary =============================== modules/provision/models.py:36 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('dependencies', pre=True) modules/provision/models.py:64 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('install', 'uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 1 passed, 2 warnings in 42.06s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:39:41] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' --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-04-18 13:39:41] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-18 13:39:41] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:39:41] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' --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={} - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' - --live=True - -s delta: '0:01:32.406372' end: '2024-04-18 13:41:19.307819' msg: '' rc: 0 start: '2024-04-18 13:39:46.901447' 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-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.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 [2024-04-18 13:39:47,517] [INFO] [Testing]: Checking connection to ventura-13.4.1 [2024-04-18 13:39:49,798] [INFO] [Testing]: Connection established successfully in ventura-13.4.1 [2024-04-18 13:40:04,033] [INFO] [Testing]: Generating Snapshot for Checkfile in ventura-13.4.1 [2024-04-18 13:40:22,363] [INFO] [Testing]: Uninstalling Agent in ventura-13.4.1 [2024-04-18 13:40:45,713] [INFO] [Testing]: Generating Snapshot for Checkfile in ventura-13.4.1 [2024-04-18 13:41:03,714] [INFO] [Testing]: Applying filters in checkfiles in ventura-13.4.1 [2024-04-18 13:41:03,715] [INFO] [Testing]: Pre and post uninstall checkfile comparison in ventura-13.4.1: {'/usr/bin': {'added': [], 'removed': [], 'modified': []}, '/usr/sbin': {'added': [], 'removed': [], 'modified': []}} 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:36 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('dependencies', pre=True) modules/provision/models.py:64 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('install', 'uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =================== 3 passed, 2 warnings in 91.79s (0:01:31) =================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:41:19] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-ventura-13.4.1-arm64/inventory.yaml}' --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-04-18 13:41:19] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:41:19] [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-107-20-3-115.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-107-20-3-115.compute-1.amazonaws.com] => changed=false path: /tmp/tests state: absent PLAY RECAP ********************************************************************* ec2-107-20-3-115.compute-1.amazonaws.com : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:41:28] [DEBUG] ANSIBLE: Playbook /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-107-20-3-115.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-107-20-3-115.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-18 13:41:28] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:41:28] [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-107-20-3-115.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-107-20-3-115.compute-1.amazonaws.com] => changed=false path: /tmp/tests state: absent PLAY RECAP ********************************************************************* ec2-107-20-3-115.compute-1.amazonaws.com : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:41:35] [DEBUG] ANSIBLE: Playbook /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-107-20-3-115.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-107-20-3-115.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-18 13:41:35] [INFO] [1451944] [ThreadPoolExecutor-0_0] [workflow_engine]: [run-agent-macos-ventura-13.4.1-arm64-tests] Finished task in 369.17 seconds. [2024-04-18 13:41:35] [INFO] [1451944] [MainThread] [workflow_engine]: Executing Reverse DAG tasks. [2024-04-18 13:41:35] [INFO] [1451944] [MainThread] [workflow_engine]: Executing tasks in parallel. ```

SONOMA :green_circle:

YAML ``` version: 0.1 description: Test agent restart with provisioning agents' with provision module variables: agent-os: - macos-sonoma-14.0-arm64 manager-os: linux-ubuntu-18.04-amd64 infra-provider: aws working-dir: /tmp/dtt1-poc tasks: - task: "allocate-manager-{manager-os}" description: "Allocate resources for the manager." do: this: process with: path: python3 args: - modules/allocation/main.py - action: create - provider: "aws" - size: large - composite-name: "{manager-os}" - inventory-output: "{working-dir}/manager-{manager-os}/inventory.yaml" - track-output: "{working-dir}/manager-{manager-os}/track.yaml" - label-termination-date: "1d" - label-team: "qa" - ssh-key: "/home/akim/Desktop/personal/Ephemeral" on-error: "abort-all" # Generic agent test task - task: "run-agent-{agent}-tests" description: "Run tests install for the agent {agent}." do: this: process with: path: python3 args: - modules/testing/main.py - targets: - wazuh-1: "{working-dir}/manager-{manager-os}/inventory.yaml" - agent: "{working-dir}/agent-{agent}/inventory.yaml" - tests: "install,registration,restart,stop,uninstall" - component: "agent" - wazuh-version: "4.7.3" - wazuh-revision: "40714" - live: "True" foreach: - variable: agent-os as: agent ```
sonoma ``` (deplo_test) akim@akim-PC:~/Desktop/wazuh-qa/deployability$ python3 -m workflow_engine modules/workflow_engine/examples/agent/vagrant/test.yaml --log-level=DEBUG [2024-04-18 13:21:44] [DEBUG] [1448223] [MainThread] [workflow_engine]: Validating input file: modules/workflow_engine/examples/agent/vagrant/test.yaml [2024-04-18 13:21:44] [DEBUG] [1448223] [MainThread] [workflow_engine]: Loading schema file: /home/akim/Desktop/venvs/deplo_test/lib/python3.10/site-packages/workflow_engine/schemas/schema_v1.json [2024-04-18 13:21:44] [DEBUG] [1448223] [MainThread] [workflow_engine]: Loading yaml file: modules/workflow_engine/examples/agent/vagrant/test.yaml [2024-04-18 13:21:44] [DEBUG] [1448223] [MainThread] [workflow_engine]: Loading workflow file: modules/workflow_engine/examples/agent/vagrant/test.yaml [2024-04-18 13:21:44] [DEBUG] [1448223] [MainThread] [workflow_engine]: Process workflow. [2024-04-18 13:21:44] [INFO] [1448223] [MainThread] [workflow_engine]: Executing DAG tasks. [2024-04-18 13:21:44] [INFO] [1448223] [MainThread] [workflow_engine]: Executing tasks in parallel. [2024-04-18 13:21:44] [INFO] [1448223] [ThreadPoolExecutor-0_0] [workflow_engine]: [run-agent-macos-sonoma-14.0-arm64-tests] Starting task. [2024-04-18 13:21:44] [DEBUG] [1448223] [ThreadPoolExecutor-0_0] [workflow_engine]: Running task "run-agent-macos-sonoma-14.0-arm64-tests" with arguments: ['modules/testing/main.py', "--targets={'wazuh-1': '/tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml'}", "--targets={'agent': '/tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml'}", '--tests=install,registration,restart,stop,uninstall', '--component=agent', '--wazuh-version=4.7.3', '--wazuh-revision=40714', '--live=True'] [2024-04-18 13:28:02] [DEBUG] [1448223] [ThreadPoolExecutor-0_0] [workflow_engine]: Finished task "run-agent-macos-sonoma-14.0-arm64-tests" execution with result: [2024-04-18 13:21:44] [INFO] TESTER: Running tests for ec2-107-20-3-115.compute-1.amazonaws.com [2024-04-18 13:21:44] [INFO] TESTER: Running tests for 10.10.0.250 [2024-04-18 13:21:44] [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-107-20-3-115.compute-1.amazonaws.com', '10.10.0.250'], 'targets': '{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}', 'dependencies': '{}', 'local_host_path': '/home/akim/Desktop/wazuh-qa/deployability', 'current_user': 'akim'} [2024-04-18 13:21:44] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/setup.yml [2024-04-18 13:21:44] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:21:44] [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-107-20-3-115.compute-1.amazonaws.com', '10.10.0.250']}]}] No config file found; using defaults PLAY [localhost] *************************************************************** TASK [Gathering Facts] ********************************************************* ok: [localhost] TASK [Cleaning old key ssh-keygen registries] ********************************** changed: [localhost] => (item=ec2-107-20-3-115.compute-1.amazonaws.com) => changed=true ansible_loop_var: item cmd: - ssh-keygen - -f - /home/akim/.ssh/known_hosts - -R - '' delta: '0:00:00.010530' end: '2024-04-18 13:21:50.391846' item: ec2-107-20-3-115.compute-1.amazonaws.com msg: '' rc: 0 start: '2024-04-18 13:21:50.381316' stderr: Host not found in /home/akim/.ssh/known_hosts stderr_lines: stdout: '' stdout_lines: changed: [localhost] => (item=10.10.0.250) => changed=true ansible_loop_var: item cmd: - ssh-keygen - -f - /home/akim/.ssh/known_hosts - -R - '' delta: '0:00:00.010568' end: '2024-04-18 13:21:50.561728' item: 10.10.0.250 msg: '' rc: 0 start: '2024-04-18 13:21:50.551160' 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-04-18 13:21:50] [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-107-20-3-115.compute-1.amazonaws.com', '10.10.0.250']}]}] finished with status {'skipped': {}, 'ok': {'localhost': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'localhost': 1}, 'changed': {'localhost': 1}} [2024-04-18 13:21:50] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-18 13:21:50] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:21:50] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' --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={} - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' - --live=True - -s delta: '0:01:22.808073' end: '2024-04-18 13:23:16.534088' msg: '' rc: 0 start: '2024-04-18 13:21:53.726015' 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-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.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 [2024-04-18 13:21:54,342] [INFO] [Testing]: Checking connection to sonoma-14.0 [2024-04-18 13:21:56,742] [INFO] [Testing]: Connection established successfully in sonoma-14.0 [2024-04-18 13:21:59,512] [INFO] [Testing]: Checking connection to ubuntu-18.04 [2024-04-18 13:22:00,633] [INFO] [Testing]: Connection established successfully in ubuntu-18.04 [2024-04-18 13:22:00,633] [INFO] [Testing]: Firewall disabled on sonoma-14.0 [2024-04-18 13:22:05,549] [INFO] [Testing]: Manager is already installed in ubuntu-18.04 [2024-04-18 13:22:07,808] [INFO] [Testing]: Generating Snapshot for Checkfile in sonoma-14.0 [2024-04-18 13:22:31,353] [INFO] [Testing]: Installing Agent in sonoma-14.0 [2024-04-18 13:22:44,470] [INFO] [Testing]: Generating Snapshot for Checkfile in sonoma-14.0 [2024-04-18 13:23:05,381] [INFO] [Testing]: Applying filters in checkfiles in sonoma-14.0 [2024-04-18 13:23:05,381] [INFO] [Testing]: Pre and post install checkfile comparison in sonoma-14.0: {'/usr/bin': {'added': [], 'removed': [], 'modified': []}, '/usr/sbin': {'added': [], 'removed': [], 'modified': []}} PASSED modules/testing/tests/test_agent/test_install.py::test_status [2024-04-18 13:23:08,527] [INFO] [Testing]: Getting status of sonoma-14.0 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:36 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('dependencies', pre=True) modules/provision/models.py:64 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('install', 'uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =================== 4 passed, 2 warnings in 82.20s (0:01:22) =================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:23:16] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' --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-04-18 13:23:16] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-18 13:23:16] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:23:16] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' --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={} - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' - --live=True - -s delta: '0:00:57.064487' end: '2024-04-18 13:24:19.691851' msg: '' rc: 0 start: '2024-04-18 13:23:22.627364' 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-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.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 [2024-04-18 13:23:23,216] [INFO] [Testing]: Checking connection to sonoma-14.0 [2024-04-18 13:23:25,422] [INFO] [Testing]: Connection established successfully in sonoma-14.0 PASSED modules/testing/tests/test_agent/test_registration.py::test_status [2024-04-18 13:23:51,132] [INFO] [Testing]: Getting status of sonoma-14.0 [2024-04-18 13:23:53,757] [INFO] [Testing]: Getting status of sonoma-14.0 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:36 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('dependencies', pre=True) modules/provision/models.py:64 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('install', 'uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 5 passed, 2 warnings in 56.48s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:24:19] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' --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-04-18 13:24:19] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-18 13:24:19] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:24:19] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' --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={} - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' - --live=True - -s delta: '0:00:38.753670' end: '2024-04-18 13:25:04.326406' msg: '' rc: 0 start: '2024-04-18 13:24:25.572736' 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-107-20-3-115.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 [2024-04-18 13:24:26,174] [INFO] [Testing]: Checking connection to sonoma-14.0 [2024-04-18 13:24:28,317] [INFO] [Testing]: Connection established successfully in sonoma-14.0 [2024-04-18 13:24:39,335] [INFO] [Testing]: Restarting wazuh-agent in sonoma-14.0 PASSED modules/testing/tests/test_agent/test_restart.py::test_status [2024-04-18 13:24:51,131] [INFO] [Testing]: Getting status of sonoma-14.0 [2024-04-18 13:24:54,047] [INFO] [Testing]: Getting status of sonoma-14.0 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:36 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('dependencies', pre=True) modules/provision/models.py:64 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('install', 'uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 5 passed, 2 warnings in 38.18s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:25:04] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' --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-04-18 13:25:04] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-18 13:25:04] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:25:04] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' --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={} - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' - --live=True - -s delta: '0:00:42.152713' end: '2024-04-18 13:25:52.368677' msg: '' rc: 0 start: '2024-04-18 13:25:10.215964' 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-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.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 [2024-04-18 13:25:10,806] [INFO] [Testing]: Checking connection to sonoma-14.0 [2024-04-18 13:25:13,063] [INFO] [Testing]: Connection established successfully in sonoma-14.0 [2024-04-18 13:25:30,248] [INFO] [Testing]: Stopping wazuh-agent in sonoma-14.0 [2024-04-18 13:25:34,631] [INFO] [Testing]: Getting status of sonoma-14.0 [2024-04-18 13:25:37,429] [INFO] [Testing]: Getting status of sonoma-14.0 PASSED[2024-04-18 13:25:41,003] [INFO] [Testing]: Restarting wazuh-agent in sonoma-14.0 =============================== warnings summary =============================== modules/provision/models.py:36 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('dependencies', pre=True) modules/provision/models.py:64 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('install', 'uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================== 1 passed, 2 warnings in 41.56s ======================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:25:52] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' --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-04-18 13:25:52] [DEBUG] ANSIBLE: Rendering template /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/test.yml [2024-04-18 13:25:52] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:25:52] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' --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={} - '--targets={wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' - --live=True - -s delta: '0:01:46.218878' end: '2024-04-18 13:27:44.698903' msg: '' rc: 0 start: '2024-04-18 13:25:58.480025' 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-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.compute-1.amazonaws.com]:2200' (ED25519) to the list of known hosts. Warning: Permanently added '[ec2-107-20-3-115.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 [2024-04-18 13:25:59,087] [INFO] [Testing]: Checking connection to sonoma-14.0 [2024-04-18 13:26:01,478] [INFO] [Testing]: Connection established successfully in sonoma-14.0 [2024-04-18 13:26:15,710] [INFO] [Testing]: Generating Snapshot for Checkfile in sonoma-14.0 [2024-04-18 13:26:44,985] [INFO] [Testing]: Uninstalling Agent in sonoma-14.0 [2024-04-18 13:27:08,449] [INFO] [Testing]: Generating Snapshot for Checkfile in sonoma-14.0 [2024-04-18 13:27:29,340] [INFO] [Testing]: Applying filters in checkfiles in sonoma-14.0 [2024-04-18 13:27:29,340] [INFO] [Testing]: Pre and post uninstall checkfile comparison in sonoma-14.0: {'/usr/bin': {'added': [], 'removed': [], 'modified': []}, '/usr/sbin': {'added': [], 'removed': [], 'modified': []}} 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:36 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:36: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('dependencies', pre=True) modules/provision/models.py:64 /home/akim/Desktop/wazuh-qa/deployability/modules/provision/models.py:64: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.5/migration/ @validator('install', 'uninstall', pre=True) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ================== 3 passed, 2 warnings in 105.62s (0:01:45) =================== stdout_lines: PLAY RECAP ********************************************************************* localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:27:44] [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='{}' --targets='{wazuh-1: /tmp/dtt1-poc/manager-linux-ubuntu-18.04-amd64/inventory.yaml, agent: /tmp/dtt1-poc/agent-macos-sonoma-14.0-arm64/inventory.yaml}' --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-04-18 13:27:44] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:27:44] [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-107-20-3-115.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-107-20-3-115.compute-1.amazonaws.com] => changed=false path: /tmp/tests state: absent PLAY RECAP ********************************************************************* ec2-107-20-3-115.compute-1.amazonaws.com : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [2024-04-18 13:27:54] [DEBUG] ANSIBLE: Playbook /home/akim/Desktop/wazuh-qa/deployability/modules/testing/playbooks/cleanup.yml finished with status {'skipped': {}, 'ok': {'ec2-107-20-3-115.compute-1.amazonaws.com': 2}, 'dark': {}, 'failures': {}, 'ignored': {}, 'rescued': {}, 'processed': {'ec2-107-20-3-115.compute-1.amazonaws.com': 1}, 'changed': {}} [2024-04-18 13:27:54] [DEBUG] ANSIBLE: Using inventory: {'all': {'hosts': {'ec2-107-20-3-115.compute-1.amazonaws.com': {'ansible_port': 2200, 'ansible_user': 'ubuntu', 'ansible_ssh_private_key_file': '/home/akim/Desktop/personal/Ephemeral'}}}} [2024-04-18 13:27:54] [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-107-20-3-115.compute-1.amazonaws.com] TASK [Clean test directory] **************************************************** ok: [ec2-107-20-3-115.compute-1.amazonaws.com] => changed=false path: /tmp/tests state: absent ```
pro-akim commented 1 month ago

Update

Waiting the merge of https://github.com/wazuh/wazuh-qa/issues/5215 to make more adaptations for basic_info and connection tests.

pro-akim commented 4 weeks ago

Update

Fixes of the logger. Some fixes around client_keys validation for Linux were done.

Waiting for the merge of https://github.com/wazuh/wazuh-qa/pull/5260/files to do some mixed OS tests

Waiting for the merge of https://github.com/wazuh/wazuh-qa/issues/5215 to work in basic_info and connection tests

pro-akim commented 3 weeks ago

Update

Performing last tests in AWS and Vagrant.

Wazuh API informs that the name of the os is macos (it is not specific). Validations were fixed.

pro-akim commented 3 weeks ago

Update

Tests

VAGRANT

AWS

pro-akim commented 3 weeks ago

Update

Comments done in review

rauldpm commented 3 weeks ago

LGTM