networkmanager: the watcher's health is its unit's state
The sign-in process is judged by its unit being active, on the machine without the bus, and NetworkManager's service keeps no state and no health again. The watcher exits non-zero when it cannot subscribe once the system bus came back, so its unit shows failing; uplink_health stays a tool that reads and no longer gives the names again. Builds: design 08 sign-in-page §11, §13, §14, §23, §24, §25, §27; lead answer C-2c (hq 6752a5cf)
This commit is contained in:
@@ -64,10 +64,9 @@ 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, 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).
|
||||
// The manifest declares the watcher's process as the account, its health its unit's state; the folder the two parts
|
||||
// share, the account's alone; the event the bundle consumes and the verbs it invokes; and the five tools. NetworkManager's
|
||||
// unit keeps no state and no health (design 08 sign-in-page §11, §12, §13, §27; lead answer C-2c).
|
||||
func TestTheManifestDeclaresTheSignInParts(t *testing.T) {
|
||||
raw, err := os.ReadFile(filepath.Join(moduleDir, "module.json"))
|
||||
if err != nil {
|
||||
@@ -116,11 +115,11 @@ func TestTheManifestDeclaresTheSignInParts(t *testing.T) {
|
||||
h, _ := json.Marshal(p["health"])
|
||||
if p["type"] != "process" || p["name"] != "networkmanager-sign-in" || p["artifact"] != "tools" ||
|
||||
string(run) != `["./uplink-tools","watch"]` || p["user"] != "${machine:account}" ||
|
||||
string(h) != `{"grace":"60s","interval":"60s","kind":"tool","looks":2,"timeout":"20s","tool":"uplink_health"}` {
|
||||
string(h) != `{"kind":"unit"}` {
|
||||
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)
|
||||
if byID["service"]["health"] != nil || byID["service"]["state"] != nil {
|
||||
t.Errorf("NetworkManager's unit carries a state or a health: %v", byID["service"])
|
||||
}
|
||||
for _, id := range []string{"package", "config", "service"} {
|
||||
if byID[id] == nil {
|
||||
|
||||
Reference in New Issue
Block a user