diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-04-08 18:54:05 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-04-12 13:43:33 +0200 |
commit | d2120590ffdcc041f098667355ca3db5161d25d9 (patch) | |
tree | 9e5b921b5023e7eb40f7812161f285c49da45039 /src/test/test-sched-prio.c | |
parent | 815b09d39b74a9ece31b7d7ef45f8f00784b8d8b (diff) |
tests: override XDG_RUNTIME_DIR where we use the user runtime dir
We don#t really support systems where XDG_RUNTIME_DIR is not supported for
systemd --user. Hence, let's always set our own XDG_RUNTIME_DIR for tests that
involve systemd --user, so that we know it is set, and that it doesn't polute
the user's actual runtime dir.
Diffstat (limited to 'src/test/test-sched-prio.c')
-rw-r--r-- | src/test/test-sched-prio.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/test-sched-prio.c b/src/test/test-sched-prio.c index 5083cd53c2..3e9caafc71 100644 --- a/src/test/test-sched-prio.c +++ b/src/test/test-sched-prio.c @@ -21,9 +21,12 @@ #include "macro.h" #include "manager.h" +#include "rm-rf.h" #include "test-helper.h" +#include "tests.h" int main(int argc, char *argv[]) { + _cleanup_(rm_rf_and_freep) char *runtime_dir = NULL; Manager *m = NULL; Unit *idle_ok, *idle_bad, *rr_ok, *rr_bad, *rr_sched; Service *ser; @@ -31,6 +34,8 @@ int main(int argc, char *argv[]) { FDSet *fdset = NULL; int r; + assert_se(runtime_dir = setup_fake_runtime_dir()); + /* prepare the test */ assert_se(set_unit_path(TEST_DIR) >= 0); r = manager_new(UNIT_FILE_USER, true, &m); |