Declare ssh-client's keys state and its forge-account requirement (issue 955 S2)
This commit is contained in:
@@ -62,3 +62,29 @@ func TestEveryFileTakesItsTextFromATemplate(t *testing.T) {
|
||||
t.Errorf("the build packs files/ into %d archives, not one", packs)
|
||||
}
|
||||
}
|
||||
|
||||
// Issue 955, area S2: the module keeps the keys state and requires the forge's account provision. It declares
|
||||
// no provision `ssh-key`: the state serves the public half (novox/hq ADR 0400 §1).
|
||||
func TestManifestKeepsKeysAndRequiresForgeAccount(t *testing.T) {
|
||||
raw, err := os.ReadFile(filepath.Join(moduleDir, "module.json"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var m struct {
|
||||
State []string `json:"state"`
|
||||
Requires []any `json:"requires"`
|
||||
Provides []any `json:"provides"`
|
||||
}
|
||||
if err := json.Unmarshal(raw, &m); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(m.State) != 1 || m.State[0] != "keys" {
|
||||
t.Errorf("state = %v, want [keys]", m.State)
|
||||
}
|
||||
if len(m.Requires) != 1 || m.Requires[0] != "forge-account" {
|
||||
t.Errorf("requires = %v, want [forge-account]", m.Requires)
|
||||
}
|
||||
if len(m.Provides) != 0 {
|
||||
t.Errorf("provides = %v, want none (no ssh-key provision yet)", m.Provides)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user