From a5cea1ca7b91ab5e008ec33db48c21090ccdd3ac Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Wed, 13 Sep 2023 10:30:32 -0700 Subject: [PATCH] ConfigureConnections in Tests --- testing/autodownload/file_sharing_integration_test.go | 4 +++- testing/cwtch_peer_server_integration_test.go | 3 +++ testing/filesharing/file_sharing_integration_test.go | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/testing/autodownload/file_sharing_integration_test.go b/testing/autodownload/file_sharing_integration_test.go index bbed71a..f388c92 100644 --- a/testing/autodownload/file_sharing_integration_test.go +++ b/testing/autodownload/file_sharing_integration_test.go @@ -114,9 +114,11 @@ func TestFileSharing(t *testing.T) { t.Logf("** Waiting for Alice, Bob...") alice := app2.WaitGetPeer(app, "alice") app.ActivatePeerEngine(alice.GetOnion()) + app.ConfigureConnections(alice.GetOnion(), true, true, true); bob := app2.WaitGetPeer(app, "bob") app.ActivatePeerEngine(bob.GetOnion()) - + app.ConfigureConnections(bob.GetOnion(), true, true, true); + alice.AutoHandleEvents([]event.Type{event.PeerStateChange, event.NewRetValMessageFromPeer}) bob.AutoHandleEvents([]event.Type{event.PeerStateChange, event.NewRetValMessageFromPeer}) diff --git a/testing/cwtch_peer_server_integration_test.go b/testing/cwtch_peer_server_integration_test.go index 73c53d7..6ec206f 100644 --- a/testing/cwtch_peer_server_integration_test.go +++ b/testing/cwtch_peer_server_integration_test.go @@ -163,6 +163,7 @@ func TestCwtchPeerIntegration(t *testing.T) { alice := app2.WaitGetPeer(app, "Alice") aliceBus := app.GetEventBus(alice.GetOnion()) app.ActivatePeerEngine(alice.GetOnion()) + app.ConfigureConnections(alice.GetOnion(), true, true, true); log.Infoln("Alice created:", alice.GetOnion()) // alice.SetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants.Name, "Alice") <- This is now done automatically by ProfileValueExtension, keeping this here for clarity alice.AutoHandleEvents([]event.Type{event.PeerStateChange, event.ServerStateChange, event.NewGroupInvite, event.NewRetValMessageFromPeer}) @@ -170,6 +171,7 @@ func TestCwtchPeerIntegration(t *testing.T) { bob := app2.WaitGetPeer(app, "Bob") bobBus := app.GetEventBus(bob.GetOnion()) app.ActivatePeerEngine(bob.GetOnion()) + app.ConfigureConnections(bob.GetOnion(), true, true, true); log.Infoln("Bob created:", bob.GetOnion()) // bob.SetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants.Name, "Bob") <- This is now done automatically by ProfileValueExtension, keeping this here for clarity bob.AutoHandleEvents([]event.Type{event.PeerStateChange, event.ServerStateChange, event.NewGroupInvite, event.NewRetValMessageFromPeer}) @@ -177,6 +179,7 @@ func TestCwtchPeerIntegration(t *testing.T) { carol := app2.WaitGetPeer(app, "Carol") carolBus := app.GetEventBus(carol.GetOnion()) app.ActivatePeerEngine(carol.GetOnion()) + app.ConfigureConnections(carol.GetOnion(), true, true, true); log.Infoln("Carol created:", carol.GetOnion()) // carol.SetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants.Name, "Carol") <- This is now done automatically by ProfileValueExtension, keeping this here for clarity carol.AutoHandleEvents([]event.Type{event.PeerStateChange, event.ServerStateChange, event.NewGroupInvite, event.NewRetValMessageFromPeer}) diff --git a/testing/filesharing/file_sharing_integration_test.go b/testing/filesharing/file_sharing_integration_test.go index 82ee983..5ce7e4d 100644 --- a/testing/filesharing/file_sharing_integration_test.go +++ b/testing/filesharing/file_sharing_integration_test.go @@ -116,9 +116,10 @@ func TestFileSharing(t *testing.T) { t.Logf("** Waiting for Alice, Bob...") alice := app2.WaitGetPeer(app, "alice") app.ActivatePeerEngine(alice.GetOnion()) + app.ConfigureConnections(alice.GetOnion(), true, true, true); bob := app2.WaitGetPeer(app, "bob") app.ActivatePeerEngine(bob.GetOnion()) - + app.ConfigureConnections(bob.GetOnion(), true, true, true); alice.AutoHandleEvents([]event.Type{event.PeerStateChange, event.NewRetValMessageFromPeer}) bob.AutoHandleEvents([]event.Type{event.PeerStateChange, event.NewRetValMessageFromPeer})