| 1 |
# SPDX-License-Identifier: LGPL-2.1-or-later |
| 2 |
[Unit] |
| 3 |
Description=Test for BindPaths= and BindReadOnlyPaths= |
| 4 |
|
| 5 |
[Service] |
| 6 |
Type=oneshot |
| 7 |
# Create a file in /tmp/test-exec-bindpaths |
| 8 |
ExecStart=touch /tmp/test-exec-bindpaths/thisisasimpletest |
| 9 |
# Then, the file can be access through /tmp |
| 10 |
ExecStart=test -f /tmp/thisisasimpletest |
| 11 |
# Also, through /tmp/test-exec-bindreadonlypaths |
| 12 |
ExecStart=test -f /tmp/test-exec-bindreadonlypaths/thisisasimpletest |
| 13 |
# The file cannot modify through /tmp/test-exec-bindreadonlypaths |
| 14 |
ExecStart=bash -x -c '! touch /tmp/test-exec-bindreadonlypaths/thisisasimpletest' |
| 15 |
# Cleanup |
| 16 |
ExecStart=rm /tmp/thisisasimpletest |
| 17 |
BindPaths=/tmp:/tmp/test-exec-bindpaths |
| 18 |
BindReadOnlyPaths=/tmp:/tmp/test-exec-bindreadonlypaths |