Skip to content

Commit

Permalink
fixup! zeek-archiver: Respect umask setting
Browse files Browse the repository at this point in the history
Try ls for making this test work on FreeBSD/MacOS, too.
  • Loading branch information
awelzel committed Aug 27, 2024
1 parent 2a247ee commit ce012f8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions testing/zeek-archiver/umask.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ log_out=test.09:43:10-09:43:10.log
echo hello > "$(queue_dir)/${log_in}"
zeek-archiver -1 -v "$(queue_dir)" "$(archive_dir)"

dir_perms=$(stat -c "%a" $(archive_date_dir))
file_perms=$(stat -c "%a" $(archive_date_dir)/${log_out}.gz)
dir_perms=$(ls -ld $(archive_date_dir) | cut -d ' ' -f 1)
file_perms=$(ls -l $(archive_date_dir)/${log_out}.gz | cut -d ' ' -f 1)

test "${dir_perms}" == "775" || exit 1
test "${file_perms}" == "664" || exit 1
test "${dir_perms}" == "drwxrwxr-x" || exit 1
test "${file_perms}" == "-rw-rw-r--" || exit 1

# @TEST-START-NEXT

Expand All @@ -29,8 +29,8 @@ log_out=test.09:43:10-09:43:10.log
echo hello > "$(queue_dir)/${log_in}"
zeek-archiver -1 -v "$(queue_dir)" "$(archive_dir)"

dir_perms=$(stat -c "%a" $(archive_date_dir))
file_perms=$(stat -c "%a" $(archive_date_dir)/${log_out}.gz)
dir_perms=$(ls -ld $(archive_date_dir) | cut -d ' ' -f 1)
file_perms=$(ls -l $(archive_date_dir)/${log_out}.gz | cut -d ' ' -f 1)

test "${dir_perms}" == "700" || exit 1
test "${file_perms}" == "600" || exit 1
test "${dir_perms}" == "drwx------" || exit 1
test "${file_perms}" == "-rw-------" || exit 1

0 comments on commit ce012f8

Please sign in to comment.