Skip to content

Commit

Permalink
[Integ-tests] Use right permission to operate on log files
Browse files Browse the repository at this point in the history
In many of the operating systems ParallelCluster supported, `root` user could bypass any files permissions. However, with RHEL9 and Rocky9, `root` user could not bypass files permissions by default. Therefore, this commit improves integration tests to operate on files with the owner users of the files

Signed-off-by: Hanwen <[email protected]>
  • Loading branch information
hanwen-cluster committed Nov 11, 2024
1 parent 138b5e4 commit 0c99c43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/integration-tests/tests/basic/log_rotation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ def _test_logs_uploaded_to_cloudwatch(
# write a log message to log file after log rotation in case log is empty
for log in logs:
if log.get("existence"):
log_path = log.get("log_path")
log_file_user = remote_command_executor.get_user_to_operate_on_file(log_path)
_run_command_on_node(
remote_command_executor,
f"echo '{after_log_rotation_message}' | sudo tee --append {log.get('log_path')}",
f"echo '{after_log_rotation_message}' | sudo -u {log_file_user} tee --append {log_path}",
compute_private_ip,
)
# assert both logs are in the cloudwatch logs
Expand Down

0 comments on commit 0c99c43

Please sign in to comment.