test: add tests for PrivateDevices= with '+' prefix
This commit is contained in:
parent
b5a33299b0
commit
cfa24ca0e6
|
@ -231,6 +231,7 @@ static void test_exec_privatedevices(Manager *m) {
|
||||||
|
|
||||||
test(m, "exec-privatedevices-yes.service", 0, CLD_EXITED);
|
test(m, "exec-privatedevices-yes.service", 0, CLD_EXITED);
|
||||||
test(m, "exec-privatedevices-no.service", 0, CLD_EXITED);
|
test(m, "exec-privatedevices-no.service", 0, CLD_EXITED);
|
||||||
|
test(m, "exec-privatedevices-disabled-by-prefix.service", 0, CLD_EXITED);
|
||||||
|
|
||||||
/* We use capsh to test if the capabilities are
|
/* We use capsh to test if the capabilities are
|
||||||
* properly set, so be sure that it exists */
|
* properly set, so be sure that it exists */
|
||||||
|
|
|
@ -81,6 +81,7 @@ test_data_files = '''
|
||||||
test-execute/exec-personality-s390.service
|
test-execute/exec-personality-s390.service
|
||||||
test-execute/exec-personality-x86-64.service
|
test-execute/exec-personality-x86-64.service
|
||||||
test-execute/exec-personality-x86.service
|
test-execute/exec-personality-x86.service
|
||||||
|
test-execute/exec-privatedevices-disabled-by-prefix.service
|
||||||
test-execute/exec-privatedevices-no-capability-mknod.service
|
test-execute/exec-privatedevices-no-capability-mknod.service
|
||||||
test-execute/exec-privatedevices-no-capability-sys-rawio.service
|
test-execute/exec-privatedevices-no-capability-sys-rawio.service
|
||||||
test-execute/exec-privatedevices-no.service
|
test-execute/exec-privatedevices-no.service
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Test for PrivateDevices=yes with prefix
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/bin/sh -x -c '! test -c /dev/kmsg'
|
||||||
|
ExecStart=+/bin/sh -x -c 'test -c /dev/kmsg'
|
||||||
|
Type=oneshot
|
||||||
|
PrivateDevices=yes
|
Loading…
Reference in a new issue