diff options
author | Martin Pitt <martin@piware.de> | 2017-02-14 22:33:52 +0100 |
---|---|---|
committer | Martin Pitt <martin@piware.de> | 2017-02-16 21:36:30 +0100 |
commit | 3e29e810ae48c96c17fdaca7ce9da9378eb4056d (patch) | |
tree | f173b2beaa5f6b821a6ffd56b09ca23fb3e8791e /src/test/test-engine.c | |
parent | test: clarify error message if test data directory does not exist (diff) | |
download | systemd-3e29e810ae48c96c17fdaca7ce9da9378eb4056d.tar.xz systemd-3e29e810ae48c96c17fdaca7ce9da9378eb4056d.zip |
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).
Diffstat (limited to 'src/test/test-engine.c')
-rw-r--r-- | src/test/test-engine.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/test/test-engine.c b/src/test/test-engine.c index 3ec2dfe10e..3c0c18b188 100644 --- a/src/test/test-engine.c +++ b/src/test/test-engine.c @@ -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"); |