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",