]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/test/test-engine.c
tests: override XDG_RUNTIME_DIR where we use the user runtime dir
[thirdparty/systemd.git] / src / test / test-engine.c
index 52b34c03df8b0d581d16a3d0eab3b586819d351c..361d1e7b0beacdd799569890b09e9fb75a6092ca 100644 (file)
 
 #include "bus-util.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;
         _cleanup_(sd_bus_error_free) sd_bus_error err = SD_BUS_ERROR_NULL;
         Manager *m = NULL;
         Unit *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL, *g = NULL, *h = NULL;
@@ -34,6 +37,8 @@ int main(int argc, char *argv[]) {
         Job *j;
         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);