Skip to content

Commit

Permalink
Ensure newline at the end of the file
Browse files Browse the repository at this point in the history
Ensure newline at the end of the file because
process_file_with_macros strips it off. This leads to unexpected
scenarios fails if files copied are concatenated together, for
example:
linux_os/guide/auditing/auditd_configure_rules/audit_file_modification/audit_rules_unsuccessful_file_modification_open_rule_order/tests/ordered_by_filter.pass.sh
  • Loading branch information
jan-cerny committed Jan 22, 2025
1 parent cdef6e5 commit 3d99d2a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/ssg_test_suite/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ def write_rule_test_content_to_dir(rule_dir, test_content):
file_path = os.path.join(rule_dir, rel_file_path)
with open(file_path, "w") as f:
f.write(file_content)
# Ensure newline at the end of the file because
# process_file_with_macros strips it off
f.write("\n")


def create_tarball(test_content_by_rule_id):
Expand Down

0 comments on commit 3d99d2a

Please sign in to comment.