test: setup test data dir before fake runtime dir

That way, if the test directory does not exist we don't leave behind
temporary files (as in that case or on test failure the cleanup actions
don't run).
This commit is contained in:
Martin Pitt
2017-02-16 21:36:30 +01:00
parent 31f8b331c7
commit 3e29e810ae
4 changed files with 5 additions and 7 deletions
+1 -2
View File
@@ -37,10 +37,9 @@ 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_DATA_DIR("")) >= 0);
assert_se(runtime_dir = setup_fake_runtime_dir());
r = manager_new(UNIT_FILE_USER, true, &m);
if (MANAGER_SKIP_TEST(r)) {
log_notice_errno(r, "Skipping test: manager_new: %m");