void initScope(Scope& scope) { // Need to define this method before JSFiles::utils is executed. scope.injectNative("_useWriteCommandsDefault", useWriteCommandsDefault); scope.injectNative("_writeMode", writeMode); scope.injectNative("_readMode", readMode); scope.externalSetup(); mongo::shell_utils::installShellUtils(scope); scope.execSetup(JSFiles::servers); scope.execSetup(JSFiles::shardingtest); scope.execSetup(JSFiles::servers_misc); scope.execSetup(JSFiles::replsettest); scope.execSetup(JSFiles::replsetbridge); scope.injectNative("benchRun", BenchRunner::benchRunSync); scope.injectNative("benchRunSync", BenchRunner::benchRunSync); scope.injectNative("benchStart", BenchRunner::benchStart); scope.injectNative("benchFinish", BenchRunner::benchFinish); if (!_dbConnect.empty()) { uassert(12513, "connect failed", scope.exec(_dbConnect, "(connect)", false, true, false)); } if (!_dbAuth.empty()) { uassert(12514, "login failed", scope.exec(_dbAuth, "(auth)", true, true, false)); } }
void initScope( Scope &scope ) { scope.externalSetup(); mongo::shell_utils::installShellUtils( scope ); scope.execSetup(JSFiles::servers); scope.execSetup(JSFiles::shardingtest); scope.execSetup(JSFiles::servers_misc); scope.execSetup(JSFiles::replsettest); scope.execSetup(JSFiles::replsetbridge); scope.installBenchRun(); if ( !_dbConnect.empty() ) { uassert( 12513, "connect failed", scope.exec( _dbConnect , "(connect)" , false , true , false ) ); if ( !_dbAuth.empty() ) { installGlobalUtils( scope ); uassert( 12514, "login failed", scope.exec( _dbAuth , "(auth)" , true , true , false ) ); } } }