From 77602d858678e53eeaeacb3815f125b118fc2b61 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 24 Nov 2026 21:49:25 +0100 Subject: [PATCH] networkmanager: NetworkManager's unit is checked beside the watcher's tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NetworkManager's service carries a check of kind unit, still with no state, so the watcher's tool check stands beside a check of another kind, as zfs's units stand beside its watch process's tool check. Builds: design 08 sign-in-page §27; lead answer C-2 (hq df22a138) --- modules/networkmanager/cmd/uplink-tools/templates_test.go | 6 +++++- modules/networkmanager/module.json | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/networkmanager/cmd/uplink-tools/templates_test.go b/modules/networkmanager/cmd/uplink-tools/templates_test.go index 7c438ea2d..c28ec7a5a 100644 --- a/modules/networkmanager/cmd/uplink-tools/templates_test.go +++ b/modules/networkmanager/cmd/uplink-tools/templates_test.go @@ -66,7 +66,8 @@ func TestEveryFileTakesItsTextFromATemplate(t *testing.T) { // The manifest declares the watcher's process as the account, with the health of its tool; the folder the two parts // share, the account's alone; the event the bundle consumes and the verbs it invokes; and the five tools, the health -// tool among them (design 08 sign-in-page §11, §12, §13, §27). +// tool among them, and NetworkManager's unit a check of kind unit beside the watcher's tool check (design 08 +// sign-in-page §11, §12, §13, §27; lead answer C-2). func TestTheManifestDeclaresTheSignInParts(t *testing.T) { raw, err := os.ReadFile(filepath.Join(moduleDir, "module.json")) if err != nil { @@ -118,6 +119,9 @@ func TestTheManifestDeclaresTheSignInParts(t *testing.T) { string(h) != `{"grace":"60s","interval":"60s","kind":"tool","looks":2,"timeout":"20s","tool":"uplink_health"}` { t.Errorf("the watcher is %v", p) } + if svc, _ := json.Marshal(byID["service"]["health"]); string(svc) != `{"kind":"unit"}` || byID["service"]["state"] != nil { + t.Errorf("NetworkManager's unit carries the health %s, not a unit check beside the watcher's tool check", svc) + } for _, id := range []string{"package", "config", "service"} { if byID[id] == nil { t.Errorf("the resource %s is gone", id) diff --git a/modules/networkmanager/module.json b/modules/networkmanager/module.json index deba6b7a5..4b6079cbf 100644 --- a/modules/networkmanager/module.json +++ b/modules/networkmanager/module.json @@ -81,7 +81,10 @@ "unit": "NetworkManager.service", "reload-on": [ "config" - ] + ], + "health": { + "kind": "unit" + } }, { "id": "sign-in-state",