diff --git a/core/coreapi/test/api_test.go b/core/coreapi/test/api_test.go index dafadcc1f287..64d8738963c1 100644 --- a/core/coreapi/test/api_test.go +++ b/core/coreapi/test/api_test.go @@ -31,7 +31,7 @@ const testPeerID = "QmTFauExutTsy4XP6JbMFcw2Wa9645HJt2bTqL6qYDCKfe" type NodeProvider struct{} -func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]coreiface.CoreAPI, error) { +func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, online bool, n int) ([]coreiface.CoreAPI, error) { mn := mocknet.New() nodes := make([]*core.IpfsNode, n) @@ -82,7 +82,7 @@ func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) Routing: libp2p.DHTServerOption, Repo: r, Host: mock.MockHostOption(mn), - Online: fullIdentity, + Online: online, ExtraOpts: map[string]bool{ "pubsub": true, }, @@ -102,15 +102,17 @@ func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) return nil, err } - bsinf := bootstrap.BootstrapConfigWithPeers( - []peer.AddrInfo{ - nodes[0].Peerstore.PeerInfo(nodes[0].Identity), - }, - ) + if online { + bsinf := bootstrap.BootstrapConfigWithPeers( + []peer.AddrInfo{ + nodes[0].Peerstore.PeerInfo(nodes[0].Identity), + }, + ) - for _, n := range nodes[1:] { - if err := n.Bootstrap(bsinf); err != nil { - return nil, err + for _, n := range nodes[1:] { + if err := n.Bootstrap(bsinf); err != nil { + return nil, err + } } } diff --git a/core/coreapi/test/path_test.go b/core/coreapi/test/path_test.go index 9f67f3c7187a..c89ce48c9602 100644 --- a/core/coreapi/test/path_test.go +++ b/core/coreapi/test/path_test.go @@ -19,7 +19,7 @@ func TestPathUnixFSHAMTPartial(t *testing.T) { defer cancel() // Create a node - apis, err := NodeProvider{}.MakeAPISwarm(ctx, true, 1) + apis, err := NodeProvider{}.MakeAPISwarm(ctx, true, true, 1) if err != nil { t.Fatal(err) }