mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
test: add test for BindPaths= and BindReadOnlyPaths=
Follow-up for a8cabc612b.
This commit is contained in:
@@ -46,6 +46,7 @@ test_data_files = '''
|
||||
test-path/path-makedirectory.path
|
||||
test-path/path-modified.path
|
||||
test-path/path-unit.path
|
||||
test-execute/exec-bind-paths.service
|
||||
test-execute/exec-environment-empty.service
|
||||
test-execute/exec-environment-multiple.service
|
||||
test-execute/exec-environment.service
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
[Service]
|
||||
Type=oneshot
|
||||
# Create a file in /tmp/test-exec_bind_paths
|
||||
ExecStart=/bin/sh -c 'touch /tmp/test-exec_bind_paths/thisisasimpletest'
|
||||
# Then, the file can be access through /tmp
|
||||
ExecStart=/bin/sh -c 'test -f /tmp/thisisasimpletest'
|
||||
# Also, through /tmp/test-exec_bind_readonly_paths
|
||||
ExecStart=/bin/sh -c 'test -f /tmp/test-exec_bind_readonly_paths/thisisasimpletest'
|
||||
# The file cannot modify through /tmp/test-exec_bind_readonly_paths
|
||||
ExecStart=/bin/sh -x -c '! touch /tmp/test-exec_bind_readonly_paths/thisisasimpletest'
|
||||
# Cleanup
|
||||
ExecStart=/bin/sh -c 'rm /tmp/thisisasimpletest'
|
||||
BindPaths=/tmp:/tmp/test-exec_bind_paths
|
||||
BindReadOnlyPaths=/tmp:/tmp/test-exec_bind_readonly_paths
|
||||
Reference in New Issue
Block a user