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

Fix bug when running for first time. #4106

Closed
wants to merge 4 commits into from
Closed
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file.

## [4.6.0] - Development (unreleased)

Wazuh commit: TBD \
Release report: TBD

### Changed
- Update schema database version([#3879](https:/wazuh/wazuh-qa/pull/3879)) \- (Tests)

## [4.5.0] - Development (unreleased)

Wazuh commit: TBD \
Expand Down Expand Up @@ -34,6 +42,7 @@ Release report: TBD

### Fixed

- Fix a bug in on Migration tool's library ([#4106](https:/wazuh/wazuh-qa/pull/4106)) \- (Framework)
- Fix imports and add windows support for test_report_changes_and_diff IT ([#3548](https:/wazuh/wazuh-qa/issues/3548)) \- (Framework + Tests)
- Fix a regex error in the FIM integration tests ([#3061](https:/wazuh/wazuh-qa/issues/3061)) \- (Framework + Tests)
- Fix an error in the cluster performance tests related to CSV parser ([#2999](https:/wazuh/wazuh-qa/pull/2999)) \- (Framework + Tests)
Expand Down
2 changes: 1 addition & 1 deletion deps/wazuh_testing/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_files_from_directory(directory):

setup(
name='wazuh_testing',
version='4.5.0',
version='4.6.0',
description='Wazuh testing utilities to help programmers automate tests',
url='https:/wazuh',
author='Wazuh',
Expand Down
10 changes: 6 additions & 4 deletions deps/wazuh_testing/wazuh_testing/tools/migration_tool/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@
import glob
import json
import os
import subprocess as sbp

import mysql.connector
import subprocess as sbp
from jsonschema import validate
from jsonschema.exceptions import ValidationError
from mysql.connector import errorcode

from wazuh_testing.tools.migration_tool import MIGRATION_TOOL_PATH, CVE5_SCHEMA_PATH, DELTA_SCHEMA_PATH, \
ERROR_MESSAGES, SNAPSHOTS_DIR, DOWNLOADS_DIR, MIGRATION_TOOL_LOG_PATH, \
MYSQL_CREDENTIALS, UNCOMPRESSED_DIR
from wazuh_testing.tools.file import delete_all_files_in_folder, read_json_file, truncate_file
from wazuh_testing.tools.logging import Logging


logger = Logging('migration_tool')
vendors = ('alas', 'arch', 'almalinux', 'canonical', 'cve', 'debian', 'nvd', 'redhat', 'suse')


def run_content_migration_tool(args='', config_files=None):
Expand Down Expand Up @@ -174,9 +176,9 @@ def clean_migration_tool_output_files():
'''Remove all files generated by Content Migration Tool.
'''
output_folders = [SNAPSHOTS_DIR, DOWNLOADS_DIR, UNCOMPRESSED_DIR]
vendors_folders = os.listdir(SNAPSHOTS_DIR)

for output_folder in output_folders:
for folder in vendors_folders:
for folder in vendors:
folder = os.path.join(output_folder, folder)
if os.path.exists(folder):
delete_all_files_in_folder(folder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
pytestmark = [TIER0, LINUX, SERVER]

# Variables
expected_database_version = '10'
expected_database_version = '11'


# Fixtures
Expand All @@ -34,7 +34,7 @@ def test_agent_database_version(restart_wazuh_daemon, remove_agents):
- Check that the manager database version is the expected one.
- Check that the agent database version is the expected one.

wazuh_min_version: 4.4.0
wazuh_min_version: 4.6.0

parameters:
- restart_wazuh_daemon:
Expand All @@ -45,7 +45,7 @@ def test_agent_database_version(restart_wazuh_daemon, remove_agents):
- Verify that database version is the expected one.

expected_output:
- Database version: 10
- Database version: 11

tags:
- wazuh_db
Expand Down