test: add test for trailing dot in WorkingDirectory= and RuntimeDirectory=
This commit is contained in:
parent
2f4d31c117
commit
2b633119a0
|
@ -176,6 +176,7 @@ static void test_exec_workingdirectory(Manager *m) {
|
||||||
assert_se(mkdir_p("/tmp/test-exec_workingdirectory", 0755) >= 0);
|
assert_se(mkdir_p("/tmp/test-exec_workingdirectory", 0755) >= 0);
|
||||||
|
|
||||||
test(m, "exec-workingdirectory.service", 0, CLD_EXITED);
|
test(m, "exec-workingdirectory.service", 0, CLD_EXITED);
|
||||||
|
test(m, "exec-workingdirectory-trailing-dot.service", 0, CLD_EXITED);
|
||||||
|
|
||||||
(void) rm_rf("/tmp/test-exec_workingdirectory", REMOVE_ROOT|REMOVE_PHYSICAL);
|
(void) rm_rf("/tmp/test-exec_workingdirectory", REMOVE_ROOT|REMOVE_PHYSICAL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,6 +145,7 @@ test_data_files = '''
|
||||||
test-execute/exec-user-nobody.service
|
test-execute/exec-user-nobody.service
|
||||||
test-execute/exec-user.service
|
test-execute/exec-user.service
|
||||||
test-execute/exec-workingdirectory.service
|
test-execute/exec-workingdirectory.service
|
||||||
|
test-execute/exec-workingdirectory-trailing-dot.service
|
||||||
test-path/basic.target
|
test-path/basic.target
|
||||||
test-path/path-changed.path
|
test-path/path-changed.path
|
||||||
test-path/path-changed.service
|
test-path/path-changed.service
|
||||||
|
|
|
@ -3,5 +3,7 @@ Description=Test for RuntimeDirectory
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectory'
|
ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectory'
|
||||||
|
ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectory2/hogehoge'
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RuntimeDirectory=test-exec_runtimedirectory
|
RuntimeDirectory=test-exec_runtimedirectory
|
||||||
|
RuntimeDirectory=./test-exec_runtimedirectory2///./hogehoge/.
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Test for WorkingDirectory with trailing dot
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/bin/sh -x -c 'test "$$PWD" = "/tmp/test-exec_workingdirectory"'
|
||||||
|
Type=oneshot
|
||||||
|
WorkingDirectory=/tmp///./test-exec_workingdirectory/.
|
Loading…
Reference in New Issue