systemd owns its package; systemd-networkd configures networkd and claims none
The service manager's package was declared by the networking module, so the module that is systemd could not own it and had to leave it out. networkd is a component of systemd: its module configures it. Removing the package resource from systemd-networkd uninstalls nothing — the host never removes a package that is not declared absent.
This commit is contained in:
@@ -156,9 +156,12 @@ test("a unit's name is never an option", async () => {
|
||||
assert.deepEqual(calls[0].args.slice(-2), ["--", "-x*"]);
|
||||
});
|
||||
|
||||
test("the manifest declares no package — the service manager is always there, and networkd declares it too", () => {
|
||||
test("the manifest owns the systemd package — the service manager's own, never a component module's", () => {
|
||||
const m = JSON.parse(readFileSync(new URL("../module.json", import.meta.url), "utf8"));
|
||||
assert.ok(!(m.resources ?? []).some((r: { type: string }) => r.type === "package"));
|
||||
assert.ok(!m.capabilities.includes("package-manager"));
|
||||
assert.ok((m.resources ?? []).some((r: { type: string; package?: string }) => r.type === "package" && r.package === "systemd"));
|
||||
assert.ok(m.capabilities.includes("package-manager"));
|
||||
// networkd is a component of systemd and configures it; it never claims the package.
|
||||
const networkd = JSON.parse(readFileSync(new URL("../../systemd-networkd/module.json", import.meta.url), "utf8"));
|
||||
assert.ok(!(networkd.resources ?? []).some((r: { type: string; package?: string }) => r.type === "package" && r.package === "systemd"));
|
||||
assert.deepEqual(m.claims[0].serves, ["units", "status", "start", "stop", "restart", "enable", "disable", "journal"]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user