Beispiel #1
0
        int runDbTests(int argc, char** argv) {
            frameworkGlobalParams.perfHist = 1;
            frameworkGlobalParams.seed = time( 0 );
            frameworkGlobalParams.runsPerTest = 1;

            Client::initThread("testsuite");
            acquirePathLock();

            srand( (unsigned) frameworkGlobalParams.seed );
            printGitVersion();
            printOpenSSLVersion();
            printSysInfo();

            FileAllocator::get()->start();

            dur::startup();

            TestWatchDog twd;
            twd.go();

            // set tlogLevel to -1 to suppress MONGO_TLOG(0) output in a test program
            tlogLevel = -1;

            int ret = ::mongo::unittest::Suite::run(frameworkGlobalParams.suites,
                                                    frameworkGlobalParams.filter,
                                                    frameworkGlobalParams.runsPerTest);

#if !defined(_WIN32) && !defined(__sunos__)
            flock( lockFile, LOCK_UN );
#endif

            cc().shutdown();
            dbexit( (ExitCode)ret ); // so everything shuts down cleanly
            return ret;
        }
Beispiel #2
0
    void printShardingVersionInfo( bool out ) {
        if ( out ) {
            cout << "MongoS version " << versionString << " starting: pid=" <<
                ProcessId::getCurrent() << " port=" << cmdLine.port <<
                ( sizeof(int*) == 4 ? " 32" : " 64" ) << "-bit host=" << getHostNameCached() <<
                " (--help for usage)" << endl;
            DEV cout << "_DEBUG build" << endl;
            cout << "git version: " << gitVersion() << endl;
#ifdef MONGO_SSL
            cout << "OpenSSL version: " << openSSLVersion() << endl;
#endif
            cout <<  "build sys info: " << sysInfo() << endl;
        }
        else {
            log() << "MongoS version " << versionString << " starting: pid=" <<
                ProcessId::getCurrent() << " port=" << cmdLine.port <<
                ( sizeof( int* ) == 4 ? " 32" : " 64" ) << "-bit host=" << getHostNameCached() <<
                " (--help for usage)" << endl;
            DEV log() << "_DEBUG build" << endl;
            printGitVersion();
#ifdef MONGO_SSL
            printOpenSSLVersion();
#endif
            printSysInfo();
            printCommandLineOpts();
        }
    }
Beispiel #3
0
        int runDbTests(int argc, char** argv) {
            frameworkGlobalParams.perfHist = 1;
            frameworkGlobalParams.seed = time( 0 );
            frameworkGlobalParams.runsPerTest = 1;

            Client::initThread("testsuite");

            srand( (unsigned) frameworkGlobalParams.seed );
            printGitVersion();
            printOpenSSLVersion();
            printSysInfo();

            getGlobalEnvironment()->setGlobalStorageEngine(storageGlobalParams.engine);

            TestWatchDog twd;
            twd.go();

            int ret = ::mongo::unittest::Suite::run(frameworkGlobalParams.suites,
                                                    frameworkGlobalParams.filter,
                                                    frameworkGlobalParams.runsPerTest);


            cc().shutdown();
            exitCleanly( (ExitCode)ret ); // so everything shuts down cleanly
            return ret;
        }
Beispiel #4
0
    Status handlePreValidationMongodOptions(const moe::Environment& params,
                                            const std::vector<std::string>& args) {
        if (params.count("help")) {
            printMongodHelp(serverOptions);
            ::_exit(EXIT_SUCCESS);
        }
        if (params.count("version")) {
            cout << mongodVersion() << endl;
            printGitVersion();
            printOpenSSLVersion();
            ::_exit(EXIT_SUCCESS);
        }
        if (params.count("sysinfo")) {
            sysRuntimeInfo();
            ::_exit(EXIT_SUCCESS);
        }

        return Status::OK();
    }
bool handlePreValidationMongodOptions(const moe::Environment& params,
                                      const std::vector<std::string>& args) {
    if (params.count("help")) {
        printMongodHelp(moe::startupOptions);
        return false;
    }
    if (params.count("version")) {
        cout << mongodVersion() << endl;
        printGitVersion();
        printOpenSSLVersion();
        return false;
    }
    if (params.count("sysinfo")) {
        sysRuntimeInfo();
        return false;
    }

    return true;
}
Beispiel #6
0
int runDbTests(int argc, char** argv) {
    frameworkGlobalParams.perfHist = 1;
    frameworkGlobalParams.seed = time(0);
    frameworkGlobalParams.runsPerTest = 1;

    Client::initThread("testsuite");

    srand((unsigned)frameworkGlobalParams.seed);
    printGitVersion();
    printOpenSSLVersion();

    getGlobalServiceContext()->initializeGlobalStorageEngine();

    {
        auto txn = cc().makeOperationContext();
        // Initialize the sharding state so we can run sharding tests in isolation
        ShardingState::get(getGlobalServiceContext())->initialize(txn.get(), "$dummy:10000");
    }

    // Note: ShardingState::initialize also initializes the distLockMgr.
    {
        auto txn = cc().makeOperationContext();
        auto distLockMgr = dynamic_cast<LegacyDistLockManager*>(
            grid.catalogManager(txn.get())->getDistLockManager());
        if (distLockMgr) {
            distLockMgr->enablePinger(false);
        }
    }


    int ret = unittest::Suite::run(frameworkGlobalParams.suites,
                                   frameworkGlobalParams.filter,
                                   frameworkGlobalParams.runsPerTest);

    // So everything shuts down cleanly
    exitCleanly((ExitCode)ret);
    return ret;
}