File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const AWS = require('aws-sdk');
33const { promisify } = require ( 'util' ) ;
44const { Logger } = require ( 'werelogs' ) ;
55const admincredentials = require ( 'vaultclient/tests/utils/admincredentials.json' ) ;
6+ const crypto = require ( 'crypto' ) ;
67
78const log = new Logger ( 'S3Setup' ) ;
89
@@ -18,7 +19,8 @@ const region = 'us-east-1';
1819async function createTestAccount ( vaultClient ) {
1920 const iamEndpoint = new AWS . Endpoint ( `http://${ iamHost } :${ iamPort } ` ) ;
2021 const s3Endpoint = new AWS . Endpoint ( `http://${ s3Host } :${ s3Port } ` ) ;
21- const accountName = `test-account-${ Math . random ( ) . toString ( 36 ) . substring ( 2 , 8 ) } ` ;
22+ const randomSuffix = crypto . randomBytes ( 4 ) . toString ( 'hex' ) . substring ( 0 , 6 ) ;
23+ const accountName = `test-account-${ randomSuffix } ` ;
2224 const accountEmail = `${ accountName } @example.com` ;
2325 const bucketName = accountName ;
2426 const iamUser = `${ accountName } -user` ;
You can’t perform that action at this time.
0 commit comments