@@ -72,8 +72,8 @@ describe('Private network', function () {
72
72
let jsPrivateDaemon
73
73
let jsSameNetworkDaemon
74
74
let jsDiffNetworkDaemon
75
- // let goPublicNetworkDaemon
76
- // let jsPublicNetworkDaemon
75
+ let goPublicNetworkDaemon
76
+ let jsPublicNetworkDaemon
77
77
78
78
before ( 'start the nodes' , function ( done ) {
79
79
this . timeout ( 45 * 1000 )
@@ -83,16 +83,26 @@ describe('Private network', function () {
83
83
( cb ) => startIpfsNode ( goDf , goDiffNetworkRepoPath , networkBKey , cb ) ,
84
84
( cb ) => startIpfsNode ( jsDf , jsPrivateRepoPath , networkAKey , cb ) ,
85
85
( cb ) => startIpfsNode ( jsDf , jsSameNetworkRepoPath , networkAKey , cb ) ,
86
- ( cb ) => startIpfsNode ( jsDf , jsDiffNetworkRepoPath , networkBKey , cb )
86
+ ( cb ) => startIpfsNode ( jsDf , jsDiffNetworkRepoPath , networkBKey , cb ) ,
87
87
// Create and start 1 public go node
88
- // (cb) => goDf.spawn((err, daemon) => {
89
- // if (err) {
90
- // return cb(err)
91
- // }
92
-
93
- // goPublicNetworkDaemon = daemon
94
- // goPublicNetworkDaemon.start(cb)
95
- // })
88
+ ( cb ) => goDf . spawn ( ( err , daemon ) => {
89
+ if ( err ) {
90
+ return cb ( err )
91
+ }
92
+
93
+ goPublicNetworkDaemon = daemon
94
+ goPublicNetworkDaemon . start ( cb )
95
+ } ) ,
96
+ // Create and start 1 public js node
97
+ ( cb ) => jsDf . spawn ( ( err , daemon ) => {
98
+ if ( err ) {
99
+ return cb ( err )
100
+ }
101
+
102
+ jsPublicNetworkDaemon = daemon
103
+ // jsPublicNetworkDaemon.start(cb)
104
+ cb ( )
105
+ } )
96
106
] , ( err , nodes ) => {
97
107
goSameNetworkDaemon = nodes [ 0 ]
98
108
goDiffNetworkDaemon = nodes [ 1 ]
@@ -109,8 +119,9 @@ describe('Private network', function () {
109
119
( cb ) => goDiffNetworkDaemon . stop ( cb ) ,
110
120
( cb ) => jsPrivateDaemon . stop ( cb ) ,
111
121
( cb ) => jsSameNetworkDaemon . stop ( cb ) ,
112
- ( cb ) => jsDiffNetworkDaemon . stop ( cb )
113
- // (cb) => jsD.stop(cb)
122
+ ( cb ) => jsDiffNetworkDaemon . stop ( cb ) ,
123
+ ( cb ) => goPublicNetworkDaemon . stop ( cb ) ,
124
+ ( cb ) => jsPublicNetworkDaemon . stop ( cb )
114
125
] , done )
115
126
} )
116
127
@@ -210,15 +221,8 @@ describe('Private network', function () {
210
221
} )
211
222
} )
212
223
213
- /**
214
- * Skipping while https://github.com/dominictarr/pull-reader/issues/5 is unresolved
215
- * These tests will regularly timeout. Rather than basing the tests on timeouts,
216
- * they are being skipped until functionality is updated to properly end
217
- * bad connection attempts
218
- */
219
- describe . skip ( 'go <-> js on different private networks' , ( ) => {
220
- it ( 'should NOT be able to connect go <-> js' , function ( done ) {
221
- this . timeout ( 20 * 1000 )
224
+ describe ( 'go <-> js on different private networks' , ( ) => {
225
+ it ( 'should NOT be able to connect go <-> js' , ( done ) => {
222
226
let goId
223
227
224
228
series ( [
@@ -232,21 +236,16 @@ describe('Private network', function () {
232
236
} ) ,
233
237
( cb ) => jsPrivateDaemon . api . swarm . connect ( goId . addresses [ 0 ] , cb )
234
238
] , ( err ) => {
239
+ // These errors are currently a bit random depending on who sends data first
240
+ // This could be muxing errors, overreading errors, or stream destroyed errors
235
241
expect ( err ) . to . exist ( )
236
242
done ( )
237
243
} )
238
244
} )
239
245
} )
240
246
241
- /**
242
- * Skipping while https://github.com/dominictarr/pull-reader/issues/5 is unresolved
243
- * These tests will regularly timeout. Rather than basing the tests on timeouts,
244
- * they are being skipped until functionality is updated to properly end
245
- * bad connection attempts
246
- */
247
- describe . skip ( 'js <-> js on different private networks' , ( ) => {
248
- it ( 'should NOT be able to connect js <-> js' , function ( done ) {
249
- this . timeout ( 20 * 1000 )
247
+ describe ( 'js <-> js on different private networks' , ( ) => {
248
+ it ( 'should NOT be able to connect js <-> js' , ( done ) => {
250
249
let jsDiffId
251
250
252
251
series ( [
@@ -260,6 +259,54 @@ describe('Private network', function () {
260
259
} ) ,
261
260
( cb ) => jsPrivateDaemon . api . swarm . connect ( jsDiffId . addresses [ 0 ] , cb )
262
261
] , ( err ) => {
262
+ // These errors are currently a bit random depending on who sends data first
263
+ // This could be muxing errors, overreading errors, or stream destroyed errors
264
+ expect ( err ) . to . exist ( )
265
+ done ( )
266
+ } )
267
+ } )
268
+ } )
269
+
270
+ describe ( 'js private network <-> go public network' , ( ) => {
271
+ it ( 'should NOT be able to connect js <-> go' , ( done ) => {
272
+ let goPubId
273
+
274
+ series ( [
275
+ ( cb ) => parallel ( [
276
+ ( cb ) => jsPrivateDaemon . api . id ( cb ) ,
277
+ ( cb ) => goPublicNetworkDaemon . api . id ( cb )
278
+ ] , ( err , ids ) => {
279
+ expect ( err ) . to . not . exist ( )
280
+ goPubId = ids [ 1 ]
281
+ cb ( )
282
+ } ) ,
283
+ ( cb ) => jsPrivateDaemon . api . swarm . connect ( goPubId . addresses [ 0 ] , cb )
284
+ ] , ( err ) => {
285
+ // These errors are currently a bit random depending on who sends data first
286
+ // This could be muxing errors, bad nonce, or stream destroyed errors
287
+ expect ( err ) . to . exist ( )
288
+ done ( )
289
+ } )
290
+ } )
291
+ } )
292
+
293
+ describe ( 'js private network <-> js public network' , ( ) => {
294
+ it ( 'should NOT be able to connect js <-> js' , ( done ) => {
295
+ let jsPubId
296
+
297
+ series ( [
298
+ ( cb ) => parallel ( [
299
+ ( cb ) => jsPrivateDaemon . api . id ( cb ) ,
300
+ ( cb ) => jsPublicNetworkDaemon . api . id ( cb )
301
+ ] , ( err , ids ) => {
302
+ expect ( err ) . to . not . exist ( )
303
+ jsPubId = ids [ 1 ]
304
+ cb ( )
305
+ } ) ,
306
+ ( cb ) => jsPrivateDaemon . api . swarm . connect ( jsPubId . addresses [ 0 ] , cb )
307
+ ] , ( err ) => {
308
+ // These errors are currently a bit random depending on who sends data first
309
+ // This could be muxing errors, bad nonce, or stream destroyed errors
263
310
expect ( err ) . to . exist ( )
264
311
done ( )
265
312
} )
0 commit comments