Skip to content

Commit

Permalink
console/rsync_server: SELinux-aware test directory creation
Browse files Browse the repository at this point in the history
This is necessary to grant the rsync daemon access.
  • Loading branch information
Vogtinator committed Jan 22, 2025
1 parent a1f0f76 commit 4146ebf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/console/rsync_server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ sub run {
assert_script_run 'systemctl status rsyncd.service';
}

# The custom path needs to be explicitly allowed
assert_script_run 'semanage fcontext -a -t rsync_data_t "/srv/rsync_test(/.*)"' if has_selinux;

#making testing files for download
assert_script_run 'mkdir -p /srv/rsync_test/pub';
assert_script_run 'mkdir -Zp /srv/rsync_test/pub';
assert_script_run 'echo "content of rsync testing file" > /srv/rsync_test/pub/file1';
assert_script_run 'echo "content of second file" > /srv/rsync_test/pub/file2';
assert_script_run 'echo "third file" > /srv/rsync_test/pub/file3';
Expand Down

0 comments on commit 4146ebf

Please sign in to comment.