Skip to content

Commit

Permalink
Merge pull request #4561 from wazuh/dev-4560-update-migration-tool-sy…
Browse files Browse the repository at this point in the history
…stem-tests-output-directory-structure

Align migration tool tests to new output directory structure
  • Loading branch information
Dwordcito authored Sep 29, 2023
2 parents a628607 + 0c19d2e commit 9c2ac34
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Release report: TBD
- Update _wazuh_db_ schema database version ([#4353](https:/wazuh/wazuh-qa/pull/4353)) \- (Tests)
- Update the JSON schema with the required fields for the output content of the migration tool ([#4375](https:/wazuh/wazuh-qa/pull/4375)) \- (Tests)
- Update framework known flaws file ([#4443](https:/wazuh/wazuh-qa/pull/4443)) \- (Tests)
- Align migration tool system tests to the tool's new output directory structure ([#4561](https:/wazuh/wazuh-qa/pull/4561)) \- (Tests)

## [4.7.1] - TBD

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
DELTA_SCHEMA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'delta_schema.json')
WORKING_DIR = '/var/wazuh'
MIGRATION_TOOL_PATH = f"{WORKING_DIR}/bin/content_migration"
MIGRATION_TOOL_LOG_PATH = f"{WORKING_DIR}/logs/content_migration.log"
GENERATED_FILES_DIR = f"{WORKING_DIR}/incoming"
MIGRATION_TOOL_OUTPUT_PATH = f"{WORKING_DIR}/output"
MIGRATION_TOOL_LOG_PATH = f"{MIGRATION_TOOL_OUTPUT_PATH}/logs/migration.log"
GENERATED_FILES_DIR = f"{MIGRATION_TOOL_OUTPUT_PATH}/migration"
SNAPSHOTS_DIR = f"{GENERATED_FILES_DIR}/snapshots"
DOWNLOADS_DIR = f"{GENERATED_FILES_DIR}/downloads"
UNCOMPRESSED_DIR = f"{GENERATED_FILES_DIR}/uncompressed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def run_content_migration_tool(configuration_file_path, args=''):
error (str): Error output if the execution fails.
"""

truncate_file(migration_tool.MIGRATION_TOOL_LOG_PATH)
if os.path.exists(migration_tool.MIGRATION_TOOL_LOG_PATH):
truncate_file(migration_tool.MIGRATION_TOOL_LOG_PATH)

command = ' '.join([migration_tool.MIGRATION_TOOL_PATH, '-i', str(configuration_file_path), args])
proc = sbp.Popen(command, shell=True, stdout=sbp.PIPE, stderr=sbp.PIPE)
out, error = proc.communicate()
Expand Down

0 comments on commit 9c2ac34

Please sign in to comment.