networkmanager: NetworkManager's unit is checked beside the watcher's tool

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)
This commit is contained in:
jochen
2026-11-24 21:49:42 +01:00
parent e20d3c7548
commit 77602d8586
2 changed files with 9 additions and 2 deletions
@@ -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)