Skip to content

Commit

Permalink
refactor(3369): adapt to multi_group tests according to new updates
Browse files Browse the repository at this point in the history
  • Loading branch information
QU3B1M authored Jan 19, 2023
1 parent 3b8eb63 commit 640f7fe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Release report: TBD
- Add `monitord.rotate_log` to `local_internal_options` file for `test_macos_format_query` ([#3602](https://github.com/wazuh/wazuh-qa/pull/3602)) \- (Tests)
- Adapt analysisd integration tests for EPS ([#3559](https://github.com/wazuh/wazuh-qa/issues/3559)) \- (Tests)
- Improve `test_remove_audit` FIM test to retry install and remove command ([#3562](https://github.com/wazuh/wazuh-qa/pull/3562)) \- (Tests)
- Update pattern and expected condition for multi_groups tests ([#3565](https://github.com/wazuh/wazuh-qa/pull/3565)) \- (Tests)
- Skip unstable integration tests for gcloud ([#3531](https://github.com/wazuh/wazuh-qa/pull/3531)) \- (Tests)
- Skip unstable integration test for agentd ([#3538](https://github.com/wazuh/wazuh-qa/pull/3538))
- Update wazuhdb_getconfig and EPS limit integration tests ([#3146](https://github.com/wazuh/wazuh-qa/pull/3146)) \- (Tests)
Expand Down
4 changes: 2 additions & 2 deletions deps/wazuh_testing/wazuh_testing/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def wait_to_remoted_update_groups(wazuh_log_monitor):
# The log is truncated to ensure that the information has been loaded after the agent has been registered.
truncate_file(LOG_FILE_PATH)

callback_pattern = '.*c_files().*End updating shared files sums.'
callback_pattern = '.*c_files().*End updating shared files.'
error_message = 'Could not find the groups reload log'

check_remoted_log_event(wazuh_log_monitor, callback_pattern, error_message, timeout=SYNC_FILES_TIMEOUT)
Expand Down Expand Up @@ -684,7 +684,7 @@ def keep_alive_until_group_configuration_sent(sender, interval=1, timeout=20):
args=(sender,))
keep_alive_agent.start()

log_callback = make_callback(pattern=".*End sending file '.+' to agent '\d+'\.", prefix='.*wazuh-remoted.*')
log_callback = make_callback(pattern=r".*End sending file '.+' to agent '\d+'\.", prefix=r'.*wazuh-remoted.*')
log_monitor = FileMonitor(LOG_FILE_PATH)
log_monitor.start(timeout=REMOTED_GLOBAL_TIMEOUT, callback=log_callback,
error_message="New shared configuration was not sent")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def test_merged_mg_file_content(metadata, configure_local_internal_options_modul
else:
raise FileNotFoundError(f"The file: {merged_mg_file} was not created.")

expected_conditions = [True, [expected_line + '\n']] if action == 'create' else [False, []]
expected_conditions = [False, [expected_line + '\n']] if action == 'create' else [False, []]
assert file_exists == expected_conditions[0], f"The file was not {action}d in the multigroups directory.\n"
if action == 'created':
assert match_expected_line in expected_conditions[1], f"The file is not in {merged_mg_file}."
Expand Down

0 comments on commit 640f7fe

Please sign in to comment.