feat: add empty client spool reconciliation

This commit is contained in:
2026-09-06 07:03:08 +00:00
parent bcb31a7f4e
commit fb778ce3e2
5 changed files with 74 additions and 0 deletions
+18
View File
@@ -46,6 +46,24 @@ func TestHandshakeRejectsNonWelcome_BH_SES_07(t *testing.T) {
}
}
func TestReconcileSnapshot_HP_SES_08(t *testing.T) {
t.Parallel()
result := &rvboxv1.AgentEnvelope{SessionId: "issued-session", SessionGeneration: 7, Payload: &rvboxv1.AgentEnvelope_ReconcileResult{ReconcileResult: &rvboxv1.ReconcileResult{}}}
encoded, err := proto.Marshal(result)
if err != nil {
t.Fatal(err)
}
transport := &fakeTransport{read: encoded}
reconciled, err := Reconcile(context.Background(), transport, Session{ID: "issued-session", Generation: 7}, &rvboxv1.ReconcileSnapshot{}, agentproto.DefaultLimits())
if err != nil || reconciled == nil {
t.Fatalf("Reconcile = %#v, %v", reconciled, err)
}
var sent rvboxv1.AgentEnvelope
if err := proto.Unmarshal(transport.written, &sent); err != nil || sent.GetReconcileSnapshot() == nil || sent.GetSessionId() != "issued-session" || sent.GetSessionGeneration() != 7 {
t.Fatalf("sent snapshot valid=%t session=%q generation=%d err=%v", sent.GetReconcileSnapshot() != nil, sent.GetSessionId(), sent.GetSessionGeneration(), err)
}
}
type fakeTransport struct {
written []byte
read []byte