Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] #1053 Newcomers order is now random
- Loading branch information
Showing
2 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
"use strict"; | ||
|
||
const _ = require('underscore'); | ||
const co = require('co'); | ||
const assert = require('assert'); | ||
const user = require('./tools/user'); | ||
const commit = require('./tools/commit'); | ||
const toolbox = require('./tools/toolbox'); | ||
|
||
let s1, cat, tac, toc, tic | ||
|
||
describe("Newcomers shuffling", function() { | ||
|
||
before(() => co(function*() { | ||
|
||
s1 = toolbox.server({ | ||
pair: { | ||
pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', | ||
sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP' | ||
} | ||
}); | ||
|
||
cat = user('cat', { pub: 'HgTTJLAQ5sqfknMq7yLPZbehtuLSsKj9CxWN7k8QvYJd', sec: '51w4fEShBk1jCMauWu4mLpmDVfHksKmWcygpxriqCEZizbtERA6de4STKRkQBpxmMUwsKXRjSzuQ8ECwmqN1u2DP'}, { server: s1 }); | ||
tac = user('tac', { pub: '2LvDg21dVXvetTD9GdkPLURavLYEqP3whauvPWX4c2qc', sec: '2HuRLWgKgED1bVio1tdpeXrf7zuUszv1yPHDsDj7kcMC4rVSN9RC58ogjtKNfTbH1eFz7rn38U1PywNs3m6Q7UxE'}, { server: s1 }); | ||
toc = user('toc', { pub: 'DKpQPUL4ckzXYdnDRvCRKAm1gNvSdmAXnTrJZ7LvM5Qo', sec: '64EYRvdPpTfLGGmaX5nijLXRqWXaVz8r1Z1GtaahXwVSJGQRn7tqkxLb288zwSYzELMEG5ZhXSBYSxsTsz1m9y8F'}, { server: s1 }); | ||
tic = user('tic', { pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV', sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'}, { server: s1 }); | ||
|
||
yield s1.prepareForNetwork(); | ||
|
||
// Publishing identities | ||
yield cat.createIdentity(); | ||
yield tac.createIdentity(); | ||
yield cat.cert(tac); | ||
yield tac.cert(cat); | ||
yield cat.join(); | ||
yield tac.join(); | ||
yield s1.commit() | ||
})); | ||
|
||
after(() => { | ||
return Promise.all([ | ||
s1.closeCluster() | ||
]) | ||
}) | ||
|
||
it('toc and tic could join ', () => co(function*() { | ||
yield toc.createIdentity(); | ||
yield tic.createIdentity(); | ||
yield toc.join(); | ||
yield tic.join(); | ||
// same certifier for toc and tic | ||
yield cat.cert(toc) | ||
yield cat.cert(tic) | ||
// We do not known which one of toc or tic will be the first in! | ||
yield s1.commit() | ||
yield s1.commit() | ||
})); | ||
}); |