Skip to content

Wazuh assistant unit and integration test#630

Merged
c-bordon merged 22 commits intomainfrom
enhancement/589-wazuh-passwords-tool-integration-tests
Mar 17, 2026
Merged

Wazuh assistant unit and integration test#630
c-bordon merged 22 commits intomainfrom
enhancement/589-wazuh-passwords-tool-integration-tests

Conversation

@fcaffieri
Copy link
Copy Markdown
Member

@fcaffieri fcaffieri commented Mar 10, 2026

Releated

Tests

Unit: https://github.com/wazuh/wazuh-installation-assistant/actions/runs/23168428281?pr=630

Integration:

RedHat 10 AMD

Devops Integration Tests Results

Summary for PASSWORDS-TOOL

Status: PASS 🟢

Metric Count
Total Tests 14
Passed 4
Failed 0
Warnings 0
Skipped 10

Passed Tests

Assistant

  • Assistant: New password accepted by indexer 🟢

  • Assistant: New password accepted by dashboard 🟢

  • Assistant: Old password rejected 🟢

  • Assistant: Wazuh manager api reachable 🟢

RedHat 10 ARM

Devops Integration Tests Results

Summary for PASSWORDS-TOOL

Status: PASS 🟢

Metric Count
Total Tests 14
Passed 4
Failed 0
Warnings 0
Skipped 10

Passed Tests

Assistant

  • Assistant: New password accepted by indexer 🟢

  • Assistant: New password accepted by dashboard 🟢

  • Assistant: Old password rejected 🟢

  • Assistant: Wazuh manager api reachable 🟢

RedHat 9 AMD

Devops Integration Tests Results

Summary for PASSWORDS-TOOL

Status: PASS 🟢

Metric Count
Total Tests 14
Passed 4
Failed 0
Warnings 0
Skipped 10

Passed Tests

Assistant

  • Assistant: New password accepted by indexer 🟢

  • Assistant: New password accepted by dashboard 🟢

  • Assistant: Old password rejected 🟢

  • Assistant: Wazuh manager api reachable 🟢

RedHat 9 ARM

Devops Integration Tests Results

Summary for PASSWORDS-TOOL

Status: PASS 🟢

Metric Count
Total Tests 14
Passed 4
Failed 0
Warnings 0
Skipped 10

Passed Tests

Assistant

  • Assistant: New password accepted by indexer 🟢

  • Assistant: New password accepted by dashboard 🟢

  • Assistant: Old password rejected 🟢

  • Assistant: Wazuh manager api reachable 🟢

Ubuntu 22 AMD

Devops Integration Tests Results

Summary for PASSWORDS-TOOL

Status: PASS 🟢

Metric Count
Total Tests 14
Passed 4
Failed 0
Warnings 0
Skipped 10

Passed Tests

Assistant

  • Assistant: New password accepted by indexer 🟢

  • Assistant: New password accepted by dashboard 🟢

  • Assistant: Old password rejected 🟢

  • Assistant: Wazuh manager api reachable 🟢

Ubuntu 22 ARM

Devops Integration Tests Results

Summary for PASSWORDS-TOOL

Status: PASS 🟢

Metric Count
Total Tests 14
Passed 4
Failed 0
Warnings 0
Skipped 10

Passed Tests

Assistant

  • Assistant: New password accepted by indexer 🟢

  • Assistant: New password accepted by dashboard 🟢

  • Assistant: Old password rejected 🟢

  • Assistant: Wazuh manager api reachable 🟢

Ubuntu 24 AMD

Devops Integration Tests Results

Summary for PASSWORDS-TOOL

Status: PASS 🟢

Metric Count
Total Tests 14
Passed 4
Failed 0
Warnings 0
Skipped 10

Passed Tests

Assistant

  • Assistant: New password accepted by indexer 🟢

  • Assistant: New password accepted by dashboard 🟢

  • Assistant: Old password rejected 🟢

  • Assistant: Wazuh manager api reachable 🟢

Ubuntu 24 ARM # Devops Integration Tests Results

Summary for PASSWORDS-TOOL

Status: PASS 🟢

Metric Count
Total Tests 14
Passed 4
Failed 0
Warnings 0
Skipped 10

Passed Tests

Assistant

  • Assistant: New password accepted by indexer 🟢

  • Assistant: New password accepted by dashboard 🟢

  • Assistant: Old password rejected 🟢

  • Assistant: Wazuh manager api reachable 🟢

Amazon Linux 2023 AMD

Failed due to error into password tool:

# sudo bash /tmp/wazuh-passwords-tool.sh -u admin -p 'T3sting-Password'
16/03/2026 21:55:29 INFO: Updating the internal users.
16/03/2026 21:55:33 ERROR: The backup could not be created
Error: Process completed with exit code 1.
Amazon Linux 2023 ARM

Failed due to error into password tool:

# sudo bash /tmp/wazuh-passwords-tool.sh -u admin -p 'T3sting-Password'
16/03/2026 21:47:28 INFO: Updating the internal users.
16/03/2026 21:47:32 ERROR: The backup could not be created
Error: Process completed with exit code 1.

@fcaffieri fcaffieri linked an issue Mar 10, 2026 that may be closed by this pull request
@fcaffieri fcaffieri marked this pull request as ready for review March 10, 2026 14:44
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 10, 2026

🧪 Unit Tests Results

All tests passed!

Summary

📊 Coverage Details

Name                                     Stmts   Miss  Cover   Missing
----------------------------------------------------------------------
tests/unit/conftest.py                      28      1    96%   93
tests/unit/test_cert_functions.py           91      0   100%
tests/unit/test_checks.py                  160      0   100%
tests/unit/test_common.py                   30      0   100%
tests/unit/test_dashboard.py                49      0   100%
tests/unit/test_indexer.py                  51      0   100%
tests/unit/test_install_common.py           62      0   100%
tests/unit/test_manager.py                  46      0   100%
tests/unit/test_passwords_functions.py      63      0   100%
----------------------------------------------------------------------
TOTAL                                      580      1    99%

Copilot AI review requested due to automatic review settings March 16, 2026 19:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new Python/pytest-based unit test suite for the Bash-based Wazuh Installation Assistant tools, while preserving the legacy Bach/Docker tests for reference and updating CI workflows to execute the new test suite and improve integration test execution.

Changes:

  • Add pytest unit tests that execute Bash functions via subprocess with injected mocks.
  • Add pyproject.toml + updated tests/unit/README.md to standardize local/CI test execution via Hatch/pytest.
  • Update GitHub Actions workflows to run unit tests with coverage reporting and to reuse built tool artifacts across integration test OS matrices.

Reviewed changes

Copilot reviewed 14 out of 27 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/unit/conftest.py Adds the shared Bash-function runner and assertion helpers for pytest.
tests/unit/test_*.py Adds unit tests for installer components (checks/common/certs/passwords/indexer/manager/dashboard).
tests/unit/README.md Replaces legacy Docker instructions with pytest/Hatch-based guidance and explains the mocking approach.
tests/unit/legacy/** Preserves the old Bach/Docker unit test harness and suites as “legacy”.
pyproject.toml Adds Hatch + pytest configuration for unit test execution.
.github/workflows/check_unit_tests.yaml Adds a CI workflow to run pytest via Hatch and comment results on PRs.
.github/workflows/check_integration_tools.yaml Refactors integration workflow to build once and test across an OS matrix using uploaded artifacts.
.gitignore Ignores virtualenvs and Python bytecode/coverage artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread tests/unit/conftest.py
Comment thread tests/unit/test_cert_functions.py
Comment thread tests/unit/test_cert_functions.py
Comment thread tests/unit/test_cert_functions.py
Comment thread .github/workflows/check_unit_tests.yaml Outdated
@fcaffieri fcaffieri self-assigned this Mar 16, 2026
@wazuh wazuh deleted a comment from github-actions Bot Mar 16, 2026
@wazuh wazuh deleted a comment from github-actions Bot Mar 16, 2026
@wazuh wazuh deleted a comment from github-actions Bot Mar 16, 2026
@wazuh wazuh deleted a comment from github-actions Bot Mar 16, 2026
@c-bordon c-bordon merged commit 4643810 into main Mar 17, 2026
1 check passed
@c-bordon c-bordon deleted the enhancement/589-wazuh-passwords-tool-integration-tests branch March 17, 2026 16:15
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.

wazuh-passwords-tool integration tests and unit tests

5 participants