Skip to content
Snippets Groups Projects
Commit 591a1b12 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

(loadgen) now starts up, generates 30 keypairs, adds 30 users - simulated...

(loadgen) now starts up, generates 30 keypairs, adds 30 users - simulated signup mostly updated to new apis - issue #504
parent 257082ac
No related branches found
No related tags found
No related merge requests found
......@@ -281,7 +281,7 @@ function poll() {
}
// always start out by creating a bunch of users
var NUM_INITIAL_USERS = 1;
var NUM_INITIAL_USERS = 30;
// if an explicit target was specified, let's output what that means
// in understandable terms
......
......@@ -113,11 +113,11 @@ exports.startFunc = function(cfg, cb) {
// process
wcli.post(cfg, '/wsapi/cert_key', context, {
email: email,
pubkey: keypair.publicKey.toSimpleObject()
}, function(r) {
var rv = (r.code === 200 && r.body === '"complete"');
if (!rv) winston.error("registration_status failed during signup: " + JSON.stringify(r));
cb(rv);
pubkey: keypair.publicKey.serialize()
}, function(resp) {
if (typeof resp.body !== 'string') return cb(false);
userdb.addCertToUserCtx(context, email, resp.body);
cb(true);
});
});
});
......
......@@ -129,6 +129,10 @@ exports.addKeyToUserCtx = function(ctx, email) {
// the verifier, but that in turn will drastically increase the
// cost of the application of load. ho hum.
var k = exports.any(keys.keyPairs);
ctx.keys[email] = k;
ctx.keys[email] = { keyPair: k };
return k;
}
};
exports.addCertToUserCtx = function(ctx, email, cert) {
ctx.keys[email].cert = cert;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment