aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-07-16 23:32:22 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-07-16 23:32:22 +0200
commitce786e84321b5c4d0ddbf43049ff5357fb72fcea (patch)
treebdd14f6e4de4fa0f11c036d75ca4d107db508b4f
parent501e478e96631c7ff5a0671b3217a4a0b7587665 (diff)
selftest: check existence of additional directories
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--.travis.yml2
-rw-r--r--src/utils.c13
2 files changed, 14 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index 661a1a8..a9566e0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,4 +21,4 @@ script:
- ./autogen.sh
- CFLAGS="-DCAP_AUDIT_READ=0 -DCAP_AUDIT_WRITE=0" ./configure
- make V=s
- - TERM=linux valgrind --error-exitcode=1 ./src/potd --test --redirect 127.0.0.1:2222:127.0.0.1:22222 --protocol 127.0.0.1:22222:127.0.0.1:33333 --jail 127.0.0.1:33333 --rofile /tmp/potd-rofile --rodir /tmp/potd-rodir
+ - TERM=linux valgrind --error-exitcode=1 ./src/potd --test --redirect 127.0.0.1:2222:127.0.0.1:22222 --protocol 127.0.0.1:22222:127.0.0.1:33333 --jail 127.0.0.1:33333 --rofile /tmp/potd-rofile --rodir /tmp/potd-rodir --root / --netns-rundir /tmp/potd-netns --ssh-rundir /tmp/potd-ssh
diff --git a/src/utils.c b/src/utils.c
index 7933938..bbb05ba 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1067,6 +1067,19 @@ int selftest_minimal_requirements(void)
E_STRERR("RO-directory '%s' check", getopt_str(OPT_RODIR));
goto error;
}
+ if (mkdir(getopt_str(OPT_ROOT), S_IRWXU) && errno != EEXIST) {
+ E_STRERR("ROOT-directory '%s' check", getopt_str(OPT_ROOT));
+ goto error;
+ }
+ if (mkdir(getopt_str(OPT_NETNS_RUN_DIR), S_IRWXU) && errno != EEXIST) {
+ E_STRERR("NETNS-directory '%s' check", getopt_str(OPT_NETNS_RUN_DIR));
+ goto error;
+ }
+
+ if (mkdir(getopt_str(OPT_SSH_RUN_DIR), S_IRWXU) && errno != EEXIST) {
+ E_STRERR("SSH-directory '%s' check", getopt_str(OPT_SSH_RUN_DIR));
+ goto error;
+ }
if (getopt_used(OPT_RUNTEST)) {
N("%s", "Selftest success");