summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-12-21 00:58:08 +0100
committerLennart Poettering <lennart@poettering.net>2016-12-21 19:09:32 +0100
commit34b86909b721e552eff90ca20d2ade754ebe3e04 (patch)
tree3bec80248c09b45883bf02fa040c2596ddc911fa
parent87447ae4598d8de5aad557ec746e27e8271a60a7 (diff)
test: make sure test-execute can run in a read-only environment
This makes sure we can invoke it safely from out "mkosi.build" script when mkosi is invoked for a read-only image.
-rw-r--r--src/test/test-execute.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index 4670458ffb..3254f0f231 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -33,6 +33,7 @@
#ifdef HAVE_SECCOMP
#include "seccomp-util.h"
#endif
+#include "stat-util.h"
#include "test-helper.h"
#include "unit.h"
#include "util.h"
@@ -188,15 +189,27 @@ static void test_exec_protectkernelmodules(Manager *m) {
}
static void test_exec_readonlypaths(Manager *m) {
+
+ if (path_is_read_only_fs("/var") > 0)
+ return;
+
test(m, "exec-readonlypaths.service", 0, CLD_EXITED);
test(m, "exec-readonlypaths-mount-propagation.service", 0, CLD_EXITED);
}
static void test_exec_readwritepaths(Manager *m) {
+
+ if (path_is_read_only_fs("/") > 0)
+ return;
+
test(m, "exec-readwritepaths-mount-propagation.service", 0, CLD_EXITED);
}
static void test_exec_inaccessiblepaths(Manager *m) {
+
+ if (path_is_read_only_fs("/") > 0)
+ return;
+
test(m, "exec-inaccessiblepaths-mount-propagation.service", 0, CLD_EXITED);
}