wazuh / wazuh-qa

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

Windows and macOS tests integration #5310

Closed pro-akim closed 2 weeks ago

pro-akim commented 2 weeks ago

Description

Tests for macOS and Windows Os were integrated into this issue.

Executor was integrated by using ConnectionManager

Tests for macOS, Windows, and Linux were executed successfully.

pro-akim commented 2 weeks ago

Update

Windows 11, 2022 and ubuntu result :green_circle:

workflow.log

Sonoma Vagrant :green_circle:

workflow.log

mhamra commented 2 weeks ago

UPDATE

I've run the following workflow file:

test-agent-windows-complete.yaml ``` version: 0.1 description: This workflow is used to test agents' deployment for DDT1 PoC variables: agent-os: - linux-ubuntu-20.04-amd64 - linux-debian-12-amd64 - linux-oracle-9-amd64 - linux-centos-8-amd64 - linux-redhat-9-amd64 - windows-desktop-10-amd64 - windows-server-2012r2-amd64 - windows-server-2016-amd64 - windows-server-2019-amd64 - windows-server-2022-amd64 manager-os: linux-ubuntu-22.04-amd64 infra-provider: aws working-dir: /tmp/dtt1-poc tasks: # Unique manager allocate task - 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: "{infra-provider}" - 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" on-error: "abort-all" cleanup: this: process with: path: python3 args: - modules/allocation/main.py - action: delete - track-output: "{working-dir}/manager-{manager-os}/track.yaml" # Unique agent allocate task - task: "allocate-agent-{agent}" description: "Allocate resources for the agent." do: this: process with: path: python3 args: - modules/allocation/main.py - action: create - provider: "{infra-provider}" - size: medium - composite-name: "{agent}" - inventory-output: "{working-dir}/agent-{agent}/inventory.yaml" - track-output: "{working-dir}/agent-{agent}/track.yaml" - label-termination-date: "1d" - label-team: "qa" on-error: "abort-all" foreach: - variable: agent-os as: agent cleanup: this: process with: path: python3 args: - modules/allocation/main.py - action: delete - track-output: "{working-dir}/agent-{agent}/track.yaml" # Unique manager provision task - task: "provision-manager-{manager-os}" description: "Provision the manager." do: this: process with: path: python3 args: - modules/provision/main.py - inventory: "{working-dir}/manager-{manager-os}/inventory.yaml" - install: - component: wazuh-manager type: assistant version: 4.7.3 live: True depends-on: - "allocate-manager-{manager-os}" 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,connection,basic_info,restart,stop,uninstall" - component: "agent" - wazuh-version: "4.7.4" - wazuh-revision: "40717" - live: "True" foreach: - variable: agent-os as: agent depends-on: - "allocate-agent-{agent}" - "provision-manager-{manager-os}" ```

Obtaining the following workflow.log file.

The log contains 4 failed tests. I've observed that these failures are related to checkfiles.

@pro-akim, Please review and confirm.

pro-akim commented 2 weeks ago

Update

As @mhamra has mentioned, the errors pointed out here are due to Checkfiles.

mhamra commented 2 weeks ago

UPDATE

MacOs tests

I've run this workflow twice with failures.

test-agent-windows-complete.yaml ``` version: 0.1 description: This workflow is used to test agents' deployment for DDT1 PoC variables: agent-os: # Run one at a time as there are limitations on the number of hosts (Inform @dev-devops-team about your usage, dedicated hosts) - macos-sonoma-14.3-arm64 #- macos-ventura-13.6.4-arm64 #- macos-sonoma-14.3-amd64 #- macos-ventura-13.6.4-amd64 manager-os: linux-ubuntu-22.04-amd64 infra-provider: aws working-dir: /tmp/dtt1-poc tasks: # Unique manager allocate task - 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: "{infra-provider}" - 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" on-error: "abort-all" cleanup: this: process with: path: python3 args: - modules/allocation/main.py - action: delete - track-output: "{working-dir}/manager-{manager-os}/track.yaml" # Unique agent allocate task - task: "allocate-agent-{agent}" description: "Allocate resources for the agent." do: this: process with: path: python3 args: - modules/allocation/main.py - action: create - provider: "{infra-provider}" - size: small - composite-name: "{agent}" - inventory-output: "{working-dir}/agent-{agent}/inventory.yaml" - track-output: "{working-dir}/agent-{agent}/track.yaml" - label-termination-date: "1d" - label-team: "qa" on-error: "abort-all" foreach: - variable: agent-os as: agent cleanup: this: process with: path: python3 args: - modules/allocation/main.py - action: delete - track-output: "{working-dir}/agent-{agent}/track.yaml" depends-on: - "provision-manager-{manager-os}" # Unique manager provision task - task: "provision-manager-{manager-os}" description: "Provision the manager." do: this: process with: path: python3 args: - modules/provision/main.py - inventory: "{working-dir}/manager-{manager-os}/inventory.yaml" - install: - component: wazuh-manager type: assistant version: 4.7.4 live: True depends-on: - "allocate-manager-{manager-os}" 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,basic_info,connection,restart,stop,uninstall" - component: "agent" - wazuh-version: "4.7.4" - wazuh-revision: "40717" - live: "True" foreach: - variable: agent-os as: agent depends-on: - "allocate-agent-{agent}" - "provision-manager-{manager-os}" ```

I see SSH connection problems; please check if there is something wrong or a problem with the macOS environment.

workflow-macos-1.log workflow-macos-2.log

pro-akim commented 2 weeks ago

Update

In relation to macOS tests run in https://github.com/wazuh/wazuh-qa/pull/5310#issuecomment-2091827696

It seems that the credentials generated from macOS are not correct so the connection is not being able to be made.


Reviewing the logs, the macOS tests was done with AWS EC2 instances. The connection has failed due to AWS EC2 instances works with private_key_path instead of password. Fixes were done.