Skip to content

Commit

Permalink
Remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo committed Nov 27, 2023
1 parent 7bb9c4b commit 6f10ea1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
26 changes: 26 additions & 0 deletions src/wazuh_testing/modules/aws/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,29 @@ def path_exist(path: Path) -> bool:
bool: True if exist else False
"""
return path.exists()

# Call the module with the same parameters in and check there were no duplicates
expected_skipped_logs_step_3 = metadata.get('expected_skipped_logs_step_3', 1)
event_monitor.check_non_processed_logs_from_output(
command_output=call_aws_module(*base_parameters, ONLY_LOGS_AFTER_PARAM, '2022-NOV-20'),
bucket_type=bucket_type,
expected_results=expected_skipped_logs_step_3
)

# Call the module with only_logs_after set with an early date than setted previously and check that no logs
# were processed, there were no duplicates
event_monitor.check_non_processed_logs_from_output(
command_output=call_aws_module(*base_parameters, ONLY_LOGS_AFTER_PARAM, '2022-NOV-22'),
bucket_type=bucket_type,
expected_results=expected_skipped_logs_step_3 - 1 if expected_skipped_logs_step_3 > 1 else 1
)

# Upload a log file for the day of the test execution and call the module without only_logs_after and check that
# only the uploaded logs were processed and the last marker is specified in the DB.
last_marker_key = get_last_file_key(bucket_type, bucket_name, datetime.utcnow())
metadata['filename'] = upload_file(bucket_type, bucket_name)

event_monitor.check_marker_from_output(
command_output=call_aws_module(*base_parameters),
file_key=last_marker_key
)
1 change: 0 additions & 1 deletion src/wazuh_testing/utils/db_queries/aws_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

# Local imports
from wazuh_testing.utils.database import get_query_result, get_fetch_one_query_result
from wazuh_testing.constants.aws import SELECT_QUERY_TEMPLATE
from wazuh_testing.constants.paths.aws import S3_CLOUDTRAIL_DB_PATH, AWS_SERVICES_DB_PATH

""" Database data structures """
Expand Down

0 comments on commit 6f10ea1

Please sign in to comment.