summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDjalal Harouni <tixxdz@opendz.org>2016-10-07 19:17:34 +0200
committerDjalal Harouni <tixxdz@opendz.org>2016-10-12 13:36:27 +0200
commit3ae33295f00be5e2836f009bf1991b0caddf80b7 (patch)
treebb84d8fc0758804eb9e76098217d0e6044cc0456 /src
parent502d704e5ed2d288069471f4e3611115cde107d6 (diff)
test: add capability tests for ProtectKernelModules=
This just adds capabilities test.
Diffstat (limited to 'src')
-rw-r--r--src/test/test-execute.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index 8b4ff22495..f7d38fb0f3 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -142,6 +142,16 @@ static void test_exec_privatedevices_capabilities(Manager *m) {
test(m, "exec-privatedevices-no-capability-mknod.service", 0, CLD_EXITED);
}
+static void test_exec_protectkernelmodules_capabilities(Manager *m) {
+ if (detect_container() > 0) {
+ log_notice("testing in container, skipping protectkernelmodules tests");
+ return;
+ }
+
+ test(m, "exec-protectkernelmodules-no-capabilities.service", 0, CLD_EXITED);
+ test(m, "exec-protectkernelmodules-yes-capabilities.service", 0, CLD_EXITED);
+}
+
static void test_exec_readonlypaths(Manager *m) {
test(m, "exec-readonlypaths.service", 0, CLD_EXITED);
test(m, "exec-readonlypaths-mount-propagation.service", 0, CLD_EXITED);
@@ -368,6 +378,7 @@ int main(int argc, char *argv[]) {
test_exec_privatetmp,
test_exec_privatedevices,
test_exec_privatedevices_capabilities,
+ test_exec_protectkernelmodules_capabilities,
test_exec_readonlypaths,
test_exec_readwritepaths,
test_exec_inaccessiblepaths,