mirror of
https://github.com/garethgeorge/backrest.git
synced 2026-05-04 03:50:30 +00:00
test fixes
This commit is contained in:
@@ -136,13 +136,13 @@ func establishEncryption(stream syncCommandStreamTrait) (syncCommandStreamTrait,
|
||||
},
|
||||
},
|
||||
}); err != nil {
|
||||
return nil, NewSyncErrorProtocol(fmt.Errorf("sending ECDH public key: %w", err))
|
||||
return nil, NewSyncErrorDisconnected(fmt.Errorf("sending ECDH public key: %w", err))
|
||||
}
|
||||
|
||||
// Receive the peer's ephemeral ECDH public key
|
||||
peerMsg, err := stream.Receive()
|
||||
if err != nil {
|
||||
return nil, NewSyncErrorProtocol(fmt.Errorf("receiving ECDH public key: %w", err))
|
||||
return nil, NewSyncErrorDisconnected(fmt.Errorf("receiving ECDH public key: %w", err))
|
||||
}
|
||||
peerSecret := peerMsg.GetEstablishSharedSecret()
|
||||
if peerSecret == nil {
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/garethgeorge/backrest/gen/go/v1sync"
|
||||
"github.com/garethgeorge/backrest/internal/cryptoutil"
|
||||
"github.com/garethgeorge/backrest/internal/testutil"
|
||||
)
|
||||
|
||||
// fakeStream is a pair of in-memory channels simulating a bidirectional transport.
|
||||
@@ -135,6 +136,7 @@ func TestEncryptedStream_BidirectionalMultiMessage(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestEstablishEncryption_Integration(t *testing.T) {
|
||||
testutil.InstallZapLogger(t)
|
||||
transportA, transportB := newFakeStreamPair()
|
||||
|
||||
var encA, encB syncCommandStreamTrait
|
||||
|
||||
@@ -74,7 +74,7 @@ var (
|
||||
|
||||
func TestConnectionSucceeds(t *testing.T) {
|
||||
testutil.InstallZapLogger(t)
|
||||
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
|
||||
peerHostAddr := testutil.AllocOpenBindAddr(t)
|
||||
peerClientAddr := testutil.AllocOpenBindAddr(t)
|
||||
@@ -121,7 +121,7 @@ func TestConnectionSucceeds(t *testing.T) {
|
||||
|
||||
func TestConnectionBadKeyRejected(t *testing.T) {
|
||||
testutil.InstallZapLogger(t)
|
||||
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
|
||||
peerHostAddr := testutil.AllocOpenBindAddr(t)
|
||||
peerClientAddr := testutil.AllocOpenBindAddr(t)
|
||||
@@ -270,7 +270,7 @@ func TestSyncConfigChange(t *testing.T) {
|
||||
|
||||
func TestSimpleOperationSync(t *testing.T) {
|
||||
testutil.InstallZapLogger(t)
|
||||
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
|
||||
peerHostAddr := testutil.AllocOpenBindAddr(t)
|
||||
peerClientAddr := testutil.AllocOpenBindAddr(t)
|
||||
|
||||
Reference in New Issue
Block a user