diff --git a/modules/mesh-enrolment/cmd/mesh-enrolment/tokens_test.go b/modules/mesh-enrolment/cmd/mesh-enrolment/tokens_test.go index 10078f982..9b9a58264 100644 --- a/modules/mesh-enrolment/cmd/mesh-enrolment/tokens_test.go +++ b/modules/mesh-enrolment/cmd/mesh-enrolment/tokens_test.go @@ -76,6 +76,7 @@ func theManifestSaysWhatTheCodeDoes(t *testing.T) { } var m struct { Module string `json:"module"` + Class string `json:"class"` Runs string `json:"runs-as"` Consumes []string `json:"consumes"` Claims []struct { @@ -98,9 +99,10 @@ func theManifestSaysWhatTheCodeDoes(t *testing.T) { if err := json.Unmarshal(raw, &m); err != nil { t.Fatal(err) } + // It claims a seat, so its class is core (design 47 H2 §810, §814; H-A-394 (1)). if m.Runs != m.Module || len(m.Claims) != 1 || m.Claims[0].Name != Seat || m.Claims[0].Scope != "mesh" || - !slices.Equal(m.Claims[0].Serves, Verbs) || len(m.Emits) != 0 { - t.Errorf("module %q runs as %q, claims %+v, emits %v", m.Module, m.Runs, m.Claims, m.Emits) + !slices.Equal(m.Claims[0].Serves, Verbs) || len(m.Emits) != 0 || m.Class != "core" { + t.Errorf("module %q runs as %q, class %q, claims %+v, emits %v", m.Module, m.Runs, m.Class, m.Claims, m.Emits) } if slices.Contains(m.Reads, "mesh-controller.lease") { t.Error("the manifest reads the controller's lease, which the code no longer reads (issue 1126)") @@ -149,10 +151,10 @@ func theManifestSaysWhatTheCodeDoes(t *testing.T) { t.Errorf("state %s: enrolments must allow a time to live per key", m.State) } // Design 47 G §383, §387 (A-30): its findings are the requires findings (state) and finding-events (the three finding - // events, 7 days, 16 MiB), not a state or a stream of its own. + // events, 7 days, 8 MiB: design 47 H2 §820), not a state or a stream of its own. if len(m.Requires) != 2 || m.Requires[0].Name != "findings" || m.Requires[0].Storage != "key-value" || m.Requires[0].Template != "state" || m.Requires[1].Name != "finding-events" || m.Requires[1].Storage != "stream" || m.Requires[1].Template != "events" || - m.Requires[1].Options["max-age-days"] != float64(7) || m.Requires[1].Options["max-mib"] != float64(16) || + m.Requires[1].Options["max-age-days"] != float64(7) || m.Requires[1].Options["max-mib"] != float64(8) || !reflect.DeepEqual(m.Requires[1].Options["events"], []any{"finding-written.*", "finding-cleared.*", "findings-stated.*"}) { t.Errorf("requires %+v: want the findings state and the finding stream", m.Requires) } diff --git a/modules/mesh-enrolment/module.json b/modules/mesh-enrolment/module.json index 1add523cc..9dcc44f07 100644 --- a/modules/mesh-enrolment/module.json +++ b/modules/mesh-enrolment/module.json @@ -1,6 +1,7 @@ { "module": "mesh-enrolment", "version": "0.1", + "class": "core", "runs-as": "mesh-enrolment", "claims": [ { @@ -109,7 +110,7 @@ "findings-stated.*" ], "max-age-days": 7, - "max-mib": 16 + "max-mib": 8 } } ]