Make MANAGER_TEST_RUN_MINIMAL just allocate data structures

When running tests like test-unit-name, there is not point in setting
up the cgroup and signals and interacting with the environment. Similarly
when running fuzz testing of the parser.

Add new MANAGER_TEST_RUN_BASIC which takes the role of MANAGER_TEST_RUN_MINIMAL,
and redefine MANAGER_TEST_RUN_MINIMAL to just create the basic data structures.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-03-11 16:33:59 +01:00
parent dc409696cf
commit e8112e67e4
9 changed files with 39 additions and 32 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ int main(int argc, char *argv[]) {
/* prepare the test */
assert_se(set_unit_path(get_testdata_dir("")) >= 0);
assert_se(runtime_dir = setup_fake_runtime_dir());
r = manager_new(UNIT_FILE_USER, MANAGER_TEST_RUN_MINIMAL, &m);
r = manager_new(UNIT_FILE_USER, MANAGER_TEST_RUN_BASIC, &m);
if (MANAGER_SKIP_TEST(r)) {
log_notice_errno(r, "Skipping test: manager_new: %m");
return EXIT_TEST_SKIP;