Lines Matching defs:changes

30         UnitFileChange *changes = NULL;
65 assert_se(unit_file_mask(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("a.service"), false, &changes, &n_changes) >= 0);
67 assert_se(changes[0].type == UNIT_FILE_SYMLINK);
68 assert_se(streq(changes[0].source, "/dev/null"));
70 assert_se(streq(changes[0].path, p));
72 unit_file_changes_free(changes, n_changes);
73 changes = NULL; n_changes = 0;
81 assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("a.service"), false, &changes, &n_changes) == -ESHUTDOWN);
82 unit_file_changes_free(changes, n_changes);
83 changes = NULL; n_changes = 0;
85 assert_se(unit_file_unmask(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("a.service"), &changes, &n_changes) >= 0);
87 assert_se(changes[0].type == UNIT_FILE_UNLINK);
89 assert_se(streq(changes[0].path, p));
90 unit_file_changes_free(changes, n_changes);
91 changes = NULL; n_changes = 0;
93 assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("a.service"), false, &changes, &n_changes) == 1);
95 assert_se(changes[0].type == UNIT_FILE_SYMLINK);
96 assert_se(streq(changes[0].source, "/usr/lib/systemd/system/a.service"));
98 assert_se(streq(changes[0].path, p));
99 unit_file_changes_free(changes, n_changes);
100 changes = NULL; n_changes = 0;
108 assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("a.service"), false, &changes, &n_changes) == 1);
110 unit_file_changes_free(changes, n_changes);
111 changes = NULL; n_changes = 0;
113 assert_se(unit_file_disable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("a.service"), &changes, &n_changes) >= 0);
115 assert_se(changes[0].type == UNIT_FILE_UNLINK);
117 assert_se(streq(changes[0].path, p));
118 unit_file_changes_free(changes, n_changes);
119 changes = NULL; n_changes = 0;
127 assert_se(unit_file_disable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("a.service"), &changes, &n_changes) >= 0);
129 unit_file_changes_free(changes, n_changes);
130 changes = NULL; n_changes = 0;
133 assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("d.service"), false, &changes, &n_changes) >= 0);
135 assert_se(changes[0].type == UNIT_FILE_SYMLINK);
136 assert_se(streq(changes[0].source, "/usr/lib/systemd/system/a.service"));
138 assert_se(streq(changes[0].path, p));
139 unit_file_changes_free(changes, n_changes);
140 changes = NULL; n_changes = 0;
149 assert_se(unit_file_reenable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("b.service"), false, &changes, &n_changes) >= 0);
151 assert_se(changes[0].type == UNIT_FILE_UNLINK);
153 assert_se(streq(changes[0].path, p));
154 assert_se(changes[1].type == UNIT_FILE_SYMLINK);
155 assert_se(streq(changes[1].source, "/usr/lib/systemd/system/a.service"));
156 assert_se(streq(changes[1].path, p));
157 unit_file_changes_free(changes, n_changes);
158 changes = NULL; n_changes = 0;
169 UnitFileChange *changes = NULL;
218 assert_se(unit_file_link(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("/opt/linked.service"), false, &changes, &n_changes) >= 0);
220 assert_se(changes[0].type == UNIT_FILE_SYMLINK);
221 assert_se(streq(changes[0].source, "/opt/linked.service"));
223 assert_se(streq(changes[0].path, p));
224 unit_file_changes_free(changes, n_changes);
225 changes = NULL; n_changes = 0;
230 assert_se(unit_file_disable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("linked.service"), &changes, &n_changes) >= 0);
232 assert_se(changes[0].type == UNIT_FILE_UNLINK);
234 assert_se(streq(changes[0].path, p));
235 unit_file_changes_free(changes, n_changes);
236 changes = NULL; n_changes = 0;
241 assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("/opt/linked.service"), false, &changes, &n_changes) >= 0);
246 assert_se(changes[i].type == UNIT_FILE_SYMLINK);
247 assert_se(streq(changes[i].source, "/opt/linked.service"));
249 if (p && streq(changes[i].path, p))
251 else if (q && streq(changes[i].path, q))
257 unit_file_changes_free(changes, n_changes);
258 changes = NULL; n_changes = 0;
263 assert_se(unit_file_disable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("linked.service"), &changes, &n_changes) >= 0);
268 assert_se(changes[i].type == UNIT_FILE_UNLINK);
270 if (p && streq(changes[i].path, p))
272 else if (q && streq(changes[i].path, q))
278 unit_file_changes_free(changes, n_changes);
279 changes = NULL; n_changes = 0;
283 assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("linked2.service"), false, &changes, &n_changes) >= 0);
288 assert_se(changes[i].type == UNIT_FILE_SYMLINK);
289 assert_se(streq(changes[i].source, "/opt/linked2.service"));
291 if (p && streq(changes[i].path, p))
293 else if (q && streq(changes[i].path, q))
299 unit_file_changes_free(changes, n_changes);
300 changes = NULL; n_changes = 0;
302 assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("linked3.service"), false, &changes, &n_changes) == -ELOOP);
303 unit_file_changes_free(changes, n_changes);
304 changes = NULL; n_changes = 0;
309 UnitFileChange *changes = NULL;
321 assert_se(unit_file_set_default(UNIT_FILE_SYSTEM, root, "idontexist.target", false, &changes, &n_changes) == -ENOENT);
323 unit_file_changes_free(changes, n_changes);
324 changes = NULL; n_changes = 0;
328 assert_se(unit_file_set_default(UNIT_FILE_SYSTEM, root, "test-default.target", false, &changes, &n_changes) >= 0);
330 assert_se(changes[0].type == UNIT_FILE_SYMLINK);
331 assert_se(streq(changes[0].source, "/usr/lib/systemd/system/test-default-real.target"));
333 assert_se(streq(changes[0].path, p));
334 unit_file_changes_free(changes, n_changes);
335 changes = NULL; n_changes = 0;
342 UnitFileChange *changes = NULL;
358 assert_se(unit_file_add_dependency(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("add-dependency-test-service.service"), "add-dependency-test-target.target", UNIT_WANTS, false, &changes, &n_changes) >= 0);
360 assert_se(changes[0].type == UNIT_FILE_SYMLINK);
361 assert_se(streq(changes[0].source, "/usr/lib/systemd/system/real-add-dependency-test-service.service"));
363 assert_se(streq(changes[0].path, p));
364 unit_file_changes_free(changes, n_changes);
365 changes = NULL; n_changes = 0;
369 UnitFileChange *changes = NULL;
395 assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("template@.service"), false, &changes, &n_changes) >= 0);
397 assert_se(changes[0].type == UNIT_FILE_SYMLINK);
398 assert_se(streq(changes[0].source, "/usr/lib/systemd/system/template@.service"));
400 assert_se(streq(changes[0].path, p));
401 unit_file_changes_free(changes, n_changes);
402 changes = NULL; n_changes = 0;
411 assert_se(unit_file_disable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("template@.service"), &changes, &n_changes) >= 0);
413 assert_se(changes[0].type == UNIT_FILE_UNLINK);
414 assert_se(streq(changes[0].path, p));
415 unit_file_changes_free(changes, n_changes);
416 changes = NULL; n_changes = 0;
425 assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("template@foo.service"), false, &changes, &n_changes) >= 0);
426 assert_se(changes[0].type == UNIT_FILE_SYMLINK);
427 assert_se(streq(changes[0].source, "/usr/lib/systemd/system/template@.service"));
429 assert_se(streq(changes[0].path, p));
430 unit_file_changes_free(changes, n_changes);
431 changes = NULL; n_changes = 0;
440 assert_se(unit_file_disable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("template@foo.service"), &changes, &n_changes) >= 0);
442 assert_se(changes[0].type == UNIT_FILE_UNLINK);
443 assert_se(streq(changes[0].path, p));
444 unit_file_changes_free(changes, n_changes);
445 changes = NULL; n_changes = 0;
456 assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("template-symlink@quux.service"), false, &changes, &n_changes) >= 0);
457 assert_se(changes[0].type == UNIT_FILE_SYMLINK);
458 assert_se(streq(changes[0].source, "/usr/lib/systemd/system/template@.service"));
460 assert_se(streq(changes[0].path, p));
461 unit_file_changes_free(changes, n_changes);
462 changes = NULL; n_changes = 0;
475 UnitFileChange *changes = NULL;
501 assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("indirectc.service"), false, &changes, &n_changes) >= 0);
503 assert_se(changes[0].type == UNIT_FILE_SYMLINK);
504 assert_se(streq(changes[0].source, "/usr/lib/systemd/system/indirectb.service"));
506 assert_se(streq(changes[0].path, p));
507 unit_file_changes_free(changes, n_changes);
508 changes = NULL; n_changes = 0;
514 assert_se(unit_file_disable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("indirectc.service"), &changes, &n_changes) >= 0);
516 assert_se(changes[0].type == UNIT_FILE_UNLINK);
518 assert_se(streq(changes[0].path, p));
519 unit_file_changes_free(changes, n_changes);
520 changes = NULL; n_changes = 0;
524 UnitFileChange *changes = NULL;
554 assert_se(unit_file_preset(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("preset-yes.service"), UNIT_FILE_PRESET_FULL, false, &changes, &n_changes) >= 0);
556 assert_se(changes[0].type == UNIT_FILE_SYMLINK);
557 assert_se(streq(changes[0].source, "/usr/lib/systemd/system/preset-yes.service"));
559 assert_se(streq(changes[0].path, p));
560 unit_file_changes_free(changes, n_changes);
561 changes = NULL; n_changes = 0;
566 assert_se(unit_file_disable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("preset-yes.service"), &changes, &n_changes) >= 0);
568 assert_se(changes[0].type == UNIT_FILE_UNLINK);
570 assert_se(streq(changes[0].path, p));
571 unit_file_changes_free(changes, n_changes);
572 changes = NULL; n_changes = 0;
577 assert_se(unit_file_preset(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("preset-no.service"), UNIT_FILE_PRESET_FULL, false, &changes, &n_changes) >= 0);
579 unit_file_changes_free(changes, n_changes);
580 changes = NULL; n_changes = 0;
585 assert_se(unit_file_preset_all(UNIT_FILE_SYSTEM, false, root, UNIT_FILE_PRESET_FULL, false, &changes, &n_changes) >= 0);
593 if (changes[i].type == UNIT_FILE_SYMLINK) {
594 assert_se(streq(changes[i].source, "/usr/lib/systemd/system/preset-yes.service"));
595 assert_se(streq(changes[i].path, p));
597 assert_se(changes[i].type == UNIT_FILE_UNLINK);
600 unit_file_changes_free(changes, n_changes);
601 changes = NULL; n_changes = 0;