Name no node: trim node names from the per-module manifest denylists now that the catalogue-wide check covers them (1838/AC1)
This commit is contained in:
@@ -107,7 +107,8 @@ func TestItPlacesBetterbirdWhereTheCommunityPackageDidAndOnlyAfterItIsGone(t *te
|
||||
}
|
||||
}
|
||||
s := strings.ToLower(raw)
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "http://", "mediahuis"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "http://", "mediahuis"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -101,7 +101,8 @@ func TestTheToolsAgreeWithTheManifest(t *testing.T) {
|
||||
t.Errorf("the Go tools bundle: %v", b)
|
||||
}
|
||||
s := strings.ToLower(raw)
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "http", "password", "token"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "http", "password", "token"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -49,7 +49,8 @@ func TestTheManifestNamesExactlyTheToolsTheBundleServesAndNoMachine(t *testing.T
|
||||
if len(m.Resources) != 0 {
|
||||
t.Errorf("the module only reads, and declares %d resources", len(m.Resources))
|
||||
}
|
||||
for _, banned := range []string{"g14", "novox", "ace", "shanks", "jochen", "/home/"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, banned := range []string{"jochen", "/home/"} {
|
||||
if strings.Contains(string(raw), banned) {
|
||||
t.Errorf("the manifest says %q", banned)
|
||||
}
|
||||
|
||||
@@ -227,7 +227,8 @@ func checkNoSecretsOrInstallationNames(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s := strings.ToLower(string(raw))
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "api_key", ".hal/", "greenclip daemon"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "api_key", ".hal/", "greenclip daemon"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -259,7 +259,8 @@ func checkNoSecretsOrInstallationNames(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s := strings.ToLower(string(raw))
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "api_key", ".hal/", "greenclip daemon"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "api_key", ".hal/", "greenclip daemon"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -82,7 +82,8 @@ func TestTheToolsAgreeWithTheManifest(t *testing.T) {
|
||||
t.Errorf("the Go tools bundle: %v", b)
|
||||
}
|
||||
s := strings.ToLower(raw)
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "http", "password", "token"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "http", "password", "token"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -257,7 +257,8 @@ func checkNoSecretsOrInstallationNames(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s := strings.ToLower(string(raw))
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "api_key", ".hal/", "greenclip daemon"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "api_key", ".hal/", "greenclip daemon"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -261,7 +261,8 @@ func checkNoSecretsOrInstallationNames(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s := strings.ToLower(string(raw))
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "api_key", ".hal/", "greenclip daemon"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "api_key", ".hal/", "greenclip daemon"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -34,7 +34,8 @@ func TestTheManifestNamesExactlyTheToolsTheBundleServesAndNoMachine(t *testing.T
|
||||
if strings.Join(m.Emits, ",") != "pressure.cleared,pressure.high" {
|
||||
t.Fatalf("emits %v", m.Emits)
|
||||
}
|
||||
for _, banned := range []string{"g14", "jochen", "/home/", "shanks", "/run/user/1000"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, banned := range []string{"jochen", "/home/", "/run/user/1000"} {
|
||||
if strings.Contains(string(raw), banned) {
|
||||
t.Errorf("the manifest says %q", banned)
|
||||
}
|
||||
|
||||
@@ -185,7 +185,8 @@ func TestTheSettingsStartTheCounterAndRegisterTheOwners(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, never := range []string{"/home/", "jochen", "shanks", "novox.be"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen"} {
|
||||
if strings.Contains(strings.ToLower(raw), never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -95,7 +95,8 @@ func TestItDeclaresAndHoldsTheKnowledgeBaseSeatOnceForTheMesh(t *testing.T) {
|
||||
m.Build.Artifacts[0].Env["MESH_KNOWLEDGE_STATUS"] == "" || !reflect.DeepEqual(m.Build.Artifacts[0].Loads, []string{Module}) {
|
||||
t.Fatalf("build %+v", m.Build)
|
||||
}
|
||||
for _, never := range []string{"/home/", "jochen", "node-d", "node-c.be"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen"} {
|
||||
if strings.Contains(strings.ToLower(raw), never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -60,7 +60,8 @@ func TestTheManifestSaysWhatTheCodeDoes(t *testing.T) {
|
||||
if !reflect.DeepEqual(served, listed) {
|
||||
t.Fatalf("serves %v, lists %v", served, listed)
|
||||
}
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox", "zurag", "api.telegram"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "zurag", "api.telegram"} {
|
||||
if strings.Contains(strings.ToLower(string(raw)), never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -134,7 +134,8 @@ func TestTheToolsAgreeWithTheManifest(t *testing.T) {
|
||||
if !reflect.DeepEqual(verbs, m.Claims[0].Serves) {
|
||||
t.Fatalf("verbs %v, claim %v", verbs, m.Claims[0].Serves)
|
||||
}
|
||||
for _, never := range []string{"/home/", "jochen", "node-b", "node-d", "node-c", "zurag", "telegram"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "zurag", "telegram"} {
|
||||
if strings.Contains(strings.ToLower(raw), never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -110,7 +110,8 @@ func TestTheManifestNamesWhatTheBundleServesAndWhatItNeeds(t *testing.T) {
|
||||
}
|
||||
}
|
||||
// A machine's or a person's name, as a word: "novox/hq" names the record, not the machine.
|
||||
if hit := regexp.MustCompile(`\b(g14|novox|ace|shanks|jochen|recalbox)\b|/home/|/storage`).FindString(strings.ReplaceAll(raw, "novox/hq", "")); hit != "" {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
if hit := regexp.MustCompile(`\b(jochen|recalbox)\b|/home/|/storage`).FindString(strings.ReplaceAll(raw, "novox/hq", "")); hit != "" {
|
||||
t.Errorf("the manifest says %q", hit)
|
||||
}
|
||||
if strings.Contains(raw, "/etc/fstab") {
|
||||
|
||||
@@ -100,7 +100,8 @@ func TestTheToolsAgreeWithTheManifest(t *testing.T) {
|
||||
t.Errorf("the Go tools bundle: %v", b)
|
||||
}
|
||||
s := strings.ToLower(raw)
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "http", "password", "token"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "http", "password", "token"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -98,7 +98,8 @@ func TestItListensOnTwoThousandFortyNineFromTheMeshOnlyAndProvidesTheShare(t *te
|
||||
// assignment's config value, required and with no default (ADR 0348 §4), and the range the mesh's.
|
||||
func TestTheDefinitionNamesNoFolderNoMachineAndGivesTheSharesNoDefault(t *testing.T) {
|
||||
m, raw := readManifest(t)
|
||||
if hit := regexp.MustCompile(`\b(g14|novox|ace|shanks|jochen)\b|/home/|/storage|/srv/`).FindString(strings.ReplaceAll(raw, "novox/hq", "")); hit != "" {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
if hit := regexp.MustCompile(`\bjochen\b|/home/|/storage|/srv/`).FindString(strings.ReplaceAll(raw, "novox/hq", "")); hit != "" {
|
||||
t.Errorf("the manifest says %q", hit)
|
||||
}
|
||||
if s := m.Config["shares"]; s["required"] != true || s["default"] != nil || s["type"] != "string" {
|
||||
|
||||
@@ -77,7 +77,8 @@ func TestTheToolsAgreeWithTheManifest(t *testing.T) {
|
||||
t.Errorf("the Go tools bundle: %v", b)
|
||||
}
|
||||
s := strings.ToLower(raw)
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "http", "password", "token"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "http", "password", "token"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -77,7 +77,8 @@ func TestTheToolsAgreeWithTheManifest(t *testing.T) {
|
||||
t.Errorf("the Go tools bundle: %v", b)
|
||||
}
|
||||
s := strings.ToLower(raw)
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "http", "password", "token"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "http", "password", "token"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -223,7 +223,8 @@ func checkNoSecretsOrInstallationNames(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s := strings.ToLower(string(raw))
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "api_key", ".hal/", "greenclip daemon"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "api_key", ".hal/", "greenclip daemon"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -80,7 +80,8 @@ func TestTheToolsAgreeWithTheManifest(t *testing.T) {
|
||||
t.Errorf("the Go tools bundle: %v", b)
|
||||
}
|
||||
s := strings.ToLower(raw)
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "http", "password", "token"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "http", "password", "token"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -211,7 +211,8 @@ func checkNoSecretsOrInstallationNames(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s := strings.ToLower(string(raw))
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "api_key", ".hal/", "greenclip daemon"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "api_key", ".hal/", "greenclip daemon"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -257,7 +257,8 @@ func checkNoSecretsOrInstallationNames(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s := strings.ToLower(string(raw))
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "api_key", ".hal/", "greenclip daemon"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "api_key", ".hal/", "greenclip daemon"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ func TestTheManifestNamesExactlyTheToolsTheBundleServesAllReadOnlyAndNoMachine(t
|
||||
t.Errorf("the module holds no seat (ADR 0256 rule 3), and claims %v", m.Claims)
|
||||
}
|
||||
// A machine's or a person's name, as a word: "novox/hq" names the record, not the machine.
|
||||
if hit := regexp.MustCompile(`\b(g14|novox|ace|shanks|jochen)\b|/home/`).FindString(strings.ReplaceAll(raw, "novox/hq", "")); hit != "" {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
if hit := regexp.MustCompile(`\bjochen\b|/home/`).FindString(strings.ReplaceAll(raw, "novox/hq", "")); hit != "" {
|
||||
t.Errorf("the manifest says %q", hit)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +147,8 @@ func TestTheToolsAgreeWithTheManifest(t *testing.T) {
|
||||
t.Errorf("the Go tools bundle: %v", b)
|
||||
}
|
||||
s := strings.ToLower(raw)
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "http", "password", "token"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "http", "password", "token"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -61,7 +61,8 @@ func TestItRunsAsItsOwnAccountWhichAloneHoldsTheToken(t *testing.T) {
|
||||
if !account || !state {
|
||||
t.Errorf("the account %v, its state %v", account, state)
|
||||
}
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox", "api.telegram"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "api.telegram"} {
|
||||
if strings.Contains(strings.ToLower(string(raw)), never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -189,7 +189,8 @@ func TestTheToolsAgreeWithTheManifest(t *testing.T) {
|
||||
t.Errorf("the Go tools bundle: %v", bundle)
|
||||
}
|
||||
s := strings.ToLower(raw)
|
||||
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox.be", "zurag", ".hal/", "api_key"} {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
for _, never := range []string{"/home/", "jochen", "zurag", ".hal/", "api_key"} {
|
||||
if strings.Contains(s, never) {
|
||||
t.Errorf("module.json names %q", never)
|
||||
}
|
||||
|
||||
@@ -71,7 +71,8 @@ func TestTheManifestNamesTheToolsTheBundleServesAndWhatEachReplaces(t *testing.T
|
||||
if strings.Join(m.Emits, ",") != SnapshotEvent+","+ScrubEvent {
|
||||
t.Errorf("emits %v", m.Emits)
|
||||
}
|
||||
if hit := regexp.MustCompile(`\b(g14|novox|ace|shanks|jochen)\b|/home/`).FindString(strings.ReplaceAll(raw, "novox/hq", "")); hit != "" {
|
||||
// 1838/AC1: the catalogue-wide check covers a node's name now; this list keeps what it does not.
|
||||
if hit := regexp.MustCompile(`\bjochen\b|/home/`).FindString(strings.ReplaceAll(raw, "novox/hq", "")); hit != "" {
|
||||
t.Errorf("the manifest says %q", hit)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user