2021-10-17 16:07:22 +00:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
2017-12-05 15:36:55 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Test for BindPaths= and BindReadOnlyPaths=
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
|
|
|
# Create a file in /tmp/test-exec-bindpaths
|
2018-03-25 19:10:50 +00:00
|
|
|
ExecStart=touch /tmp/test-exec-bindpaths/thisisasimpletest
|
2017-12-05 15:36:55 +00:00
|
|
|
# Then, the file can be access through /tmp
|
2018-03-25 19:10:50 +00:00
|
|
|
ExecStart=test -f /tmp/thisisasimpletest
|
2017-12-05 15:36:55 +00:00
|
|
|
# Also, through /tmp/test-exec-bindreadonlypaths
|
2018-03-25 19:10:50 +00:00
|
|
|
ExecStart=test -f /tmp/test-exec-bindreadonlypaths/thisisasimpletest
|
2017-12-05 15:36:55 +00:00
|
|
|
# The file cannot modify through /tmp/test-exec-bindreadonlypaths
|
2024-01-04 14:24:52 +00:00
|
|
|
ExecStart=sh -x -c '! touch /tmp/test-exec-bindreadonlypaths/thisisasimpletest'
|
2017-12-05 15:36:55 +00:00
|
|
|
# Cleanup
|
2018-03-25 19:10:50 +00:00
|
|
|
ExecStart=rm /tmp/thisisasimpletest
|
2017-12-05 15:36:55 +00:00
|
|
|
BindPaths=/tmp:/tmp/test-exec-bindpaths
|
|
|
|
BindReadOnlyPaths=/tmp:/tmp/test-exec-bindreadonlypaths
|