diff --git a/test/tools/mongo_config.rb b/test/tools/mongo_config.rb index 4978b2d..c3b1bec 100755 --- a/test/tools/mongo_config.rb +++ b/test/tools/mongo_config.rb @@ -35,7 +35,7 @@ module Mongo MONGODS_OPT_KEYS = [:mongods] CLUSTER_OPT_KEYS = SHARDING_OPT_KEYS + REPLICA_OPT_KEYS + MONGODS_OPT_KEYS - FLAGS = [:noprealloc, :smallfiles, :logappend, :configsvr, :shardsvr, :quiet, :fastsync] + FLAGS = [:noprealloc, :smallfiles, :logappend, :configsvr, :shardsvr, :quiet, :fastsync, :nojournal] DEFAULT_VERIFIES = 60 BASE_PORT = 3000 @@ -103,6 +103,7 @@ module Mongo smallfiles = opts[:smallfiles] || true quiet = opts[:quiet] || true fast_sync = opts[:fastsync] || true + nojournal = opts[:nojournal] || true params.merge( :command => mongod, @@ -110,7 +111,8 @@ module Mongo :smallfiles => smallfiles, :noprealloc => noprealloc, :quiet => quiet, - :fastsync => fast_sync + :fastsync => fast_sync, + :nojournal => nojournal ) end @@ -145,6 +147,7 @@ module Mongo def self.port_available?(port) ret = false socket = Socket.new(Socket::Constants::AF_INET, Socket::Constants::SOCK_STREAM, 0) + socket.setsockopt(:SOCKET, :REUSEADDR, 1) sockaddr = Socket.sockaddr_in(port, '0.0.0.0') begin socket.bind(sockaddr)