Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding basic_info and connection validations #5268

Merged
merged 9 commits into from
Apr 19, 2024

Conversation

pro-akim
Copy link
Member

Adding granularity to tests

It was included:

  • basic_info
  • connection

Some additional validation in arch, installation os version, port and processes were added

@pro-akim
Copy link
Member Author

Update

TEST

YAML file
version: 0.1
description: This workflow is used to test agents' deployment for DDT1 PoC
variables:
  agent-os:
    - linux-oracle-9-amd64
    - linux-centos-7-amd64
    - linux-centos-8-amd64
    - linux-redhat-7-amd64
    - linux-redhat-8-amd64
    - linux-redhat-9-amd64
    - linux-amazon-2-amd64
  manager-os: linux-ubuntu-22.04-amd64
  infra-provider: vagrant
  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"
    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.3
              live: True
    depends-on:
      - "allocate-manager-{manager-os}"


  # 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.3"
          - wazuh-revision: "40714"
          - live: "True"
    foreach:
      - variable: agent-os
        as: agent
    depends-on:
      - "allocate-agent-{agent}"

Results

In CentOS connection and restart testing

[2024-04-16 15:09:36,184] [ERROR] [Testing]: Port is closed
[2024-04-16 15:10:12,461] [ERROR] [Testing]: Port is closed

In redhat7,8 and 9 basic_info

[2024-04-16 15:14:15,710] [ERROR] [Testing]: There is a mismatch between the OS version and the OS version of the installed agent
[2024-04-16 15:18:41,710] [ERROR] [Testing]: There is a mismatch between the OS version and the OS version of the installed agent
[2024-04-16 15:22:32,676] [ERROR] [Testing]: There is a mismatch between the OS version and the OS version of the installed agent


Centos-7 is not showing its port status correctly => Centos7 in vagrant does not have lsof. it was replaced by ss
redhat-7,8 and 9 seems to unmatch the obtained os name => fixed, validations required remove empty spaces in the naming

@pro-akim pro-akim requested a review from fcaffieri April 19, 2024 12:15
@rauldpm rauldpm merged commit a5866f5 into 4495-dtt1-release Apr 19, 2024
@rauldpm rauldpm deleted the fix/5215-Adding-granularity-in-agent-test branch April 19, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DTT1 - Iteration 3 - Test module - Adding granularity to test validations
3 participants