From: Kevin Kuehler Date: Tue, 5 Nov 2019 01:20:47 +0000 (-0800) Subject: tests: Add capability tests for ProtectKernelLogs X-Git-Tag: v244-rc1~47^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07cab0f72b084644f12dc3083f880514250590fe;p=thirdparty%2Fsystemd.git tests: Add capability tests for ProtectKernelLogs --- diff --git a/test/meson.build b/test/meson.build index 24ab4d1deef..eeb3c5f8f0b 100644 --- a/test/meson.build +++ b/test/meson.build @@ -109,6 +109,8 @@ test_data_files = ''' test-execute/exec-privatetmp-no.service test-execute/exec-privatetmp-yes.service test-execute/exec-protecthome-tmpfs-vs-protectsystem-strict.service + test-execute/exec-protectkernellogs-yes-capabilities.service + test-execute/exec-protectkernellogs-no-capabilities.service test-execute/exec-protectkernelmodules-no-capabilities.service test-execute/exec-protectkernelmodules-yes-capabilities.service test-execute/exec-protectkernelmodules-yes-mount-propagation.service diff --git a/test/test-execute/exec-protectkernellogs-no-capabilities.service b/test/test-execute/exec-protectkernellogs-no-capabilities.service new file mode 100644 index 00000000000..f0c7d4d6858 --- /dev/null +++ b/test/test-execute/exec-protectkernellogs-no-capabilities.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test CAP_SYSLOG for ProtectKernelLogs=no + +[Service] +ProtectKernelLogs=no +ExecStart=/bin/sh -x -c 'capsh --print | grep cap_syslog' +Type=oneshot diff --git a/test/test-execute/exec-protectkernellogs-yes-capabilities.service b/test/test-execute/exec-protectkernellogs-yes-capabilities.service new file mode 100644 index 00000000000..803ba7d5521 --- /dev/null +++ b/test/test-execute/exec-protectkernellogs-yes-capabilities.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test CAP_SYSLOG for ProtectKernelLogs=yes + +[Service] +ProtectKernelLogs=yes +ExecStart=/bin/sh -x -c '! capsh --print | grep cap_syslog' +Type=oneshot