Report what an adopted node holds, its firewall and what is reachable, and speak unasked when that changes (hq ADR 0100)
This commit is contained in:
@@ -220,6 +220,19 @@ func TestTheWireFormatIsExactlyTheseFieldNames(t *testing.T) {
|
||||
if len(fields) != 5 {
|
||||
t.Errorf("the token has %d fields, expected 5: %v", len(fields), fields)
|
||||
}
|
||||
|
||||
// novox/hq ADR 0100: an adopted node's token says so, and a converged one's is unchanged.
|
||||
raw, err = json.Marshal(Token{Version: 1, Secret: "s", Adopted: true})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fields = map[string]any{}
|
||||
if err := json.Unmarshal(raw, &fields); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if fields["adopted"] != true {
|
||||
t.Errorf("an adopted token does not say \"adopted\": %v", fields)
|
||||
}
|
||||
}
|
||||
|
||||
func TestACompleteTokenParses(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user