test-execute.c revision 4c80d201ace0377312c27143afab04e9c9f1ee64
/***
This file is part of systemd.
Copyright 2014 Ronny Chevalier
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <grp.h>
#include <pwd.h>
#include <stdio.h>
#include "fileio.h"
#include "fs-util.h"
#include "macro.h"
#include "manager.h"
#include "mkdir.h"
#include "path-util.h"
#include "rm-rf.h"
#include "unit.h"
#include "util.h"
typedef void (*test_function_t)(Manager *m);
assert_se(m);
int r;
usec_t n;
assert_se(r >= 0);
n = now(CLOCK_MONOTONIC);
}
}
}
}
static void test_exec_workingdirectory(Manager *m) {
}
static void test_exec_personality(Manager *m) {
#if defined(__x86_64__)
#else
#endif
}
static void test_exec_ignoresigpipe(Manager *m) {
}
static void test_exec_privatetmp(Manager *m) {
}
static void test_exec_privatedevices(Manager *m) {
}
static void test_exec_systemcallfilter(Manager *m) {
#ifdef HAVE_SECCOMP
#endif
}
static void test_exec_systemcallerrornumber(Manager *m) {
#ifdef HAVE_SECCOMP
#endif
}
static void test_exec_user(Manager *m) {
if (getpwnam("nobody"))
else
}
static void test_exec_group(Manager *m) {
if (getgrnam("nobody"))
else
}
static void test_exec_environment(Manager *m) {
}
static void test_exec_environmentfile(Manager *m) {
static const char e[] =
"VAR1='word1 word2'\n"
"VAR2=word3 \n"
"# comment1\n"
"\n"
"; comment2\n"
" ; # comment3\n"
"line without an equal\n"
"VAR3='$word 5 6'\n";
int r;
assert_se(r == 0);
}
static void test_exec_passenvironment(Manager *m) {
}
static void test_exec_umask(Manager *m) {
}
static void test_exec_runtimedirectory(Manager *m) {
if (getgrnam("nobody"))
else
log_error_errno(errno, "Skipping test_exec_runtimedirectory-owner, could not find nobody group: %m");
}
static void test_exec_capabilityboundingset(Manager *m) {
int r;
/* We use capsh to test if the capabilities are
* properly set, so be sure that it exists */
if (r < 0) {
log_error_errno(r, "Skipping test_exec_capabilityboundingset, could not find capsh binary: %m");
return;
}
}
static void test_exec_privatenetwork(Manager *m) {
int r;
if (r < 0) {
log_error_errno(r, "Skipping test_exec_privatenetwork, could not find ip binary: %m");
return;
}
}
static void test_exec_oomscoreadjust(Manager *m) {
}
static void test_exec_ioschedulingclass(Manager *m) {
}
test_function_t tests[] = {
NULL,
};
int r;
log_open();
/* It is needed otherwise cgroup creation fails */
if (getuid() != 0) {
printf("Skipping test: not root\n");
return EXIT_TEST_SKIP;
}
r = manager_new(MANAGER_USER, true, &m);
return EXIT_TEST_SKIP;
}
assert_se(r >= 0);
(*test)(m);
manager_free(m);
return 0;
}