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

Changes in the system testing container #4686

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file.

### Fixed

- Deprecate source installation in System Tests ([#4686](https://github.com/wazuh/wazuh-qa/pull/4686)) \- (Framework)
- Update default vacuum settings in IT ([#4671](https://github.com/wazuh/wazuh-qa/pull/4671)) \- (Tests)
- Fix registry wildcards path ([#4400](https://github.com/wazuh/wazuh-qa/pull/4400)) \- (Tests)
- Fix warnings in the rids tests([#4151](https://github.com/wazuh/wazuh-qa/pull/4151)) \- (Framework + Tests)
Expand Down
12 changes: 5 additions & 7 deletions tests/system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,15 @@ in `system/provisioning/<specified_cluster_environment>` path:
ansible-playbook -i inventory.yml playbook.yml
```

If you want to specify a particular branch of the Wazuh repository, you will need to include:
```shell script
ansible-playbook -i inventory.yml playbook.yml --extra-vars='{"wazuh_branch":"v4.3.0-rc1"}'
```
You can also specify a package instead using the `package_repository`, `repository`, `package_version`, `package_revision` parameters:
You can specify a package as `package_repository`, `repository`, `package_version`, `package_revision` parameters:
```shell script
ansible-playbook -i inventory.yml playbook.yml --extra-vars='{"package_repository":"packages", "repository": "4.x", "package_version": "4.4.0", "package_revision": "1"}'
```
In the **basic cluster**, you also have to specify a branch from the Wazuh QA repository.

In the basic cluster, you also have to specify a branch from the Wazuh QA repository.

```shell script
ansible-playbook -i inventory.yml playbook.yml --extra-vars='{"wazuh_branch":"v4.3.0-rc1", "wazuh_qa_branch":"master"}'
ansible-playbook -i inventory.yml playbook.yml --extra-vars='{"package_repository":"packages", "repository": "4.x", "package_version": "4.4.0", "package_revision": "1", "wazuh_qa_branch":"v4.3.0-rc1"}'
```

We use [pytest](https://docs.pytest.org/en/latest/contents.html) to run our cluster system tests. Pytest will
Expand Down
46 changes: 0 additions & 46 deletions tests/system/provisioning/Docker/Dockerfile

This file was deleted.

18 changes: 1 addition & 17 deletions tests/system/provisioning/agentless_cluster/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
- name: Create System Test Docker image
hosts: localhost
vars_files:
- ./vars/configurations.yml
tasks:
- name: Warn about source installation
debug:
msg: "Please consider using package installation instead of building from source to expedite the deployment process. For more detailed information, refer to the 'Pytest' section in the Readme"
when: wazuh_branch is defined

- name: Create docker image for system tests
docker_image:
build:
path: "../Docker/"
name: "{{ image }}"
source: build

---
- name: Create our container (Master)
hosts: localhost
vars_files:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
- name: "Clone wazuh repository"
git:
repo: "https://github.com/wazuh/wazuh"
dest: /wazuh
version: "{{ wazuh_branch }}"
when: wazuh_branch is defined

- name: Install master
args:
chdir: /wazuh
creates: /var/ossec
environment:
USER_LANGUAGE: "en"
USER_NO_STOP: "y"
USER_INSTALL_TYPE: "server"
USER_DIR: "/var/ossec"
USER_ENABLE_EMAIL: "n"
USER_ENABLE_SYSCHECK: "n"
USER_ENABLE_ROOTCHECK: "n"
USER_ENABLE_OPENSCAP: "n"
USER_WHITE_LIST: "n"
USER_ENABLE_SYSLOG: "y"
USER_ENABLE_AUTHD: "y"
USER_AUTO_START: "y"
USER_UPDATE: "n"
shell: "./install.sh"
when: wazuh_branch is defined
---
- name: "Check and update debian repositories"
shell:
cmd: apt-get update --allow-releaseinfo-change

- name: "Installing dependencies using apt"
apt:
pkg:
- git
- gcc
- make
- cmake
- libc6-dev
- curl
- policycoreutils
- automake
- autoconf
- libtool
- libssl-dev
force_apt_get: yes
state: present
update_cache: yes
cache_valid_time: 3600

- name: "Get manager package"
ansible.builtin.get_url:
url: "https://{{package_repository}}.wazuh.com/{{repository}}/apt/pool/main/w/wazuh-manager/wazuh-manager_{{package_version}}-{{package_revision}}_amd64.deb"
dest: /tmp/wazuh-manager.deb
when: wazuh_branch is not defined

- name: "Install manager package"
ansible.builtin.apt:
deb: /tmp/wazuh-manager.deb
when: wazuh_branch is not defined

- name: Copy ossec.conf file
copy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
- name: "Clone wazuh repository"
git:
repo: "https://github.com/wazuh/wazuh"
dest: /wazuh
version: "{{ wazuh_branch }}"
when: wazuh_branch is defined
---
- name: "Check and update debian repositories"
shell:
cmd: apt-get update --allow-releaseinfo-change

- name: Install worker
args:
chdir: /wazuh
creates: /var/ossec
environment:
USER_LANGUAGE: "en"
USER_NO_STOP: "y"
USER_INSTALL_TYPE: "server"
USER_DIR: "/var/ossec"
USER_ENABLE_EMAIL: "n"
USER_ENABLE_SYSCHECK: "y"
USER_ENABLE_ROOTCHECK: "y"
USER_ENABLE_OPENSCAP: "y"
USER_WHITE_LIST: "n"
USER_ENABLE_SYSLOG: "y"
USER_ENABLE_AUTHD: "y"
USER_AUTO_START: "y"
USER_UPDATE: "n"
shell: "./install.sh"
when: wazuh_branch is defined
- name: "Installing dependencies using apt"
apt:
pkg:
- git
- gcc
- make
- cmake
- libc6-dev
- curl
- policycoreutils
- automake
- autoconf
- libtool
- libssl-dev
force_apt_get: yes
state: present
update_cache: yes
cache_valid_time: 3600

- name: "Get manager package"
ansible.builtin.get_url:
url: "https://{{package_repository}}.wazuh.com/{{repository}}/apt/pool/main/w/wazuh-manager/wazuh-manager_{{package_version}}-{{package_revision}}_amd64.deb"
dest: /tmp/wazuh-manager.deb
when: wazuh_branch is not defined

- name: "Install manager package"
ansible.builtin.apt:
deb: /tmp/wazuh-manager.deb
when: wazuh_branch is not defined

- name: Copy ossec.conf file
copy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ worker2_hostname: "wazuh-worker2"

docker_network: "agentless_cluster_net"

image: "wazuh/ubuntu_jammy_system_tests:1"
image: "dontpanicat/debian:buster"
2 changes: 1 addition & 1 deletion tests/system/provisioning/basic_cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ The base environment defined for Docker provisioning is
For running the docker provisioning we must execute the following command:

```shell script
ansible-playbook -i inventory.yml playbook.yml --extra-vars='{"wazuh_branch": "PUT YOUT wazuh/wazuh BRANCH HERE"}'
ansible-playbook -i inventory.yml playbook.yml --extra-vars='{"package_repository":"packages", "repository": "4.x", "package_version": "4.4.0", "package_revision": "1", "wazuh_qa_branch":"v4.3.0-rc1"}'
```

To destroy it, the command is:
Expand Down
18 changes: 1 addition & 17 deletions tests/system/provisioning/basic_cluster/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
- name: Create System Test Docker image
hosts: localhost
vars_files:
- ./vars/configurations.yml
tasks:
- name: Warn about source installation
debug:
msg: "Please consider using package installation instead of building from source to expedite the deployment process. For more detailed information, refer to the 'Pytest' section in the Readme"
when: wazuh_branch is defined

- name: Create docker image for system tests
docker_image:
build:
path: "../Docker/"
name: "{{ image }}"
source: build

---
- name: Create our container (Master)
hosts: localhost
vars_files:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,35 @@
- name: "Clone wazuh repository"
git:
repo: "https://github.com/wazuh/wazuh"
dest: /wazuh
version: "{{ wazuh_branch }}"
when: wazuh_branch is defined
---
- name: "Check and update debian repositories"
shell:
cmd: apt-get update --allow-releaseinfo-change

- name: Install agent
args:
chdir: /wazuh
creates: /var/ossec
environment:
USER_LANGUAGE: "en"
USER_NO_STOP: "y"
USER_INSTALL_TYPE: "agent"
USER_DIR: "/var/ossec"
USER_ENABLE_EMAIL: "n"
USER_ENABLE_SYSCHECK: "y"
USER_ENABLE_ROOTCHECK: "y"
USER_ENABLE_OPENSCAP: "y"
USER_WHITE_LIST: "n"
USER_ENABLE_SYSLOG: "y"
USER_ENABLE_AUTHD: "y"
USER_AUTO_START: "y"
shell: "./install.sh"
when: wazuh_branch is defined
- name: "Installing dependencies using apt"
apt:
pkg:
- git
- gcc
- make
- cmake
- libc6-dev
- curl
- policycoreutils
- automake
- autoconf
- libtool
- libssl-dev
force_apt_get: yes
state: present
update_cache: yes
cache_valid_time: 3600

- name: "Get agent package"
ansible.builtin.get_url:
url: "https://{{package_repository}}.wazuh.com/{{repository}}/apt/pool/main/w/wazuh-agent/wazuh-agent_{{package_version}}-{{package_revision}}_amd64.deb"
dest: /tmp/wazuh-agent.deb
when: wazuh_branch is not defined

- name: "Install agent package"
ansible.builtin.apt:
deb: /tmp/wazuh-agent.deb
when: wazuh_branch is not defined

- name: Copy ossec.conf file
copy:
Expand Down
Loading