Skip to content

Commit

Permalink
run mongod on non std port for less conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jehiah committed Jan 12, 2013
1 parent bb4c215 commit b6a25cf
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions test/test_authentication.py
Expand Up @@ -12,13 +12,13 @@ class AuthenticationTest(test_shunt.MongoTest):
def setUp(self):
super(AuthenticationTest, self).setUp()
logging.info('creating user')
pipe = subprocess.Popen('''echo -e 'use test;\n db.addUser("testuser", "testpass");\n exit;' | mongo --port 27017 --host 127.0.0.1''', shell=True)
pipe = subprocess.Popen('''echo -e 'use test;\n db.addUser("testuser", "testpass");\n exit;' | mongo --port 27018 --host 127.0.0.1''', shell=True)
pipe.wait()

def test_authentication(self):
try:
test_shunt.setup()
db = asyncmongo.Client(pool_id='testauth', host='127.0.0.1', port=27017, dbname='test', dbuser='testuser', dbpass='testpass', maxconnections=2)
db = asyncmongo.Client(pool_id='testauth', host='127.0.0.1', port=27018, dbname='test', dbuser='testuser', dbpass='testpass', maxconnections=2)

def update_callback(response, error):
tornado.ioloop.IOLoop.instance().stop()
Expand Down
2 changes: 1 addition & 1 deletion test/test_command.py
Expand Up @@ -8,7 +8,7 @@ class CommandTest(
test_shunt.MongoTest,
test_shunt.SynchronousMongoTest,
):
mongod_options = [('--port', '27017')]
mongod_options = [('--port', '27018')]

def setUp(self):
super(CommandTest, self).setUp()
Expand Down
6 changes: 3 additions & 3 deletions test/test_connection.py
Expand Up @@ -10,14 +10,14 @@

class ConnectionTest(test_shunt.MongoTest):
def test_getitem(self):
db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27017, dbname='test', mincached=3)
db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27018, dbname='test', mincached=3)
self.assert_(
repr(db['foo']) == repr(db.foo),
"dict-style access of a collection should be same as property access"
)

def test_connection(self):
db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27017, dbname='test', mincached=3)
db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27018, dbname='test', mincached=3)
for connection_name in [
'.',
'..',
Expand All @@ -35,7 +35,7 @@ def test_connection(self):
def test_query(self):
logging.info('in test_query')
test_shunt.setup()
db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27017, dbname='test', mincached=3)
db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27018, dbname='test', mincached=3)

def insert_callback(response, error):
tornado.ioloop.IOLoop.instance().stop()
Expand Down
2 changes: 1 addition & 1 deletion test/test_duplicate_insert.py
Expand Up @@ -10,7 +10,7 @@
class DuplicateInsertTest(test_shunt.MongoTest):
def test_duplicate_insert(self):
test_shunt.setup()
db = asyncmongo.Client(pool_id='dup_insert', host='127.0.0.1', port=27017, dbname='test')
db = asyncmongo.Client(pool_id='dup_insert', host='127.0.0.1', port=27018, dbname='test')

def insert_callback(response, error):
tornado.ioloop.IOLoop.instance().stop()
Expand Down
2 changes: 1 addition & 1 deletion test/test_insert_delete.py
Expand Up @@ -10,7 +10,7 @@
class InsertDeleteTest(test_shunt.MongoTest):
def test_insert(self):
test_shunt.setup()
db = asyncmongo.Client(pool_id='testinsert', host='127.0.0.1', port=27017, dbname='test')
db = asyncmongo.Client(pool_id='testinsert', host='127.0.0.1', port=27018, dbname='test')

def insert_callback(response, error):
tornado.ioloop.IOLoop.instance().stop()
Expand Down
4 changes: 2 additions & 2 deletions test/test_pooled_db.py
Expand Up @@ -15,7 +15,7 @@ def test_pooled_db(self):
"""
print asyncmongo.__file__
test_shunt.setup()
client = asyncmongo.Client('id1', maxconnections=5, host='127.0.0.1', port=27017, dbname='test')
client = asyncmongo.Client('id1', maxconnections=5, host='127.0.0.1', port=27018, dbname='test')
test_users_collection = client.connection('test_users')

def insert_callback(response, error):
Expand Down Expand Up @@ -51,7 +51,7 @@ def pool_callback2(response, error):

def too_many_connections(self):
clients = [
asyncmongo.Client('id2', maxconnections=2, host='127.0.0.1', port=27017, dbname='test')
asyncmongo.Client('id2', maxconnections=2, host='127.0.0.1', port=27018, dbname='test')
for i in range(3)
]

Expand Down
2 changes: 1 addition & 1 deletion test/test_query.py
Expand Up @@ -7,7 +7,7 @@


class QueryTest(test_shunt.MongoTest, test_shunt.SynchronousMongoTest):
mongod_options = [('--port', '27017')]
mongod_options = [('--port', '27018')]

def setUp(self):
super(QueryTest, self).setUp()
Expand Down
2 changes: 1 addition & 1 deletion test/test_safe_updates.py
Expand Up @@ -10,7 +10,7 @@
class SafeUpdatesTest(test_shunt.MongoTest):
def test_update_safe(self):
test_shunt.setup()
db = asyncmongo.Client(pool_id='testinsert', host='127.0.0.1', port=27017, dbname='test', maxconnections=2)
db = asyncmongo.Client(pool_id='testinsert', host='127.0.0.1', port=27018, dbname='test', maxconnections=2)

def update_callback(response, error):
tornado.ioloop.IOLoop.instance().stop()
Expand Down
6 changes: 3 additions & 3 deletions test/test_shunt.py
Expand Up @@ -39,7 +39,7 @@ class MongoTest(unittest.TestCase):
"""
Starts and stops a mongod
"""
mongod_options = [('--port', str(27017))]
mongod_options = [('--port', str(27018))]
def setUp(self):
"""setup method that starts up mongod instances using `self.mongo_options`"""
# So any function that calls IOLoop.instance() gets the
Expand All @@ -62,7 +62,7 @@ def setUp(self):
self.temp_dirs.append(dirname)

options = ['mongod', '--bind_ip', '127.0.0.1', '--oplogSize', '10',
'--dbpath', dirname, '--smallfiles', '-v'] + list(options)
'--dbpath', dirname, '--smallfiles', '-v', '--nojournal'] + list(options)
logging.debug(options)
pipe = subprocess.Popen(options)
self.mongods.append(pipe)
Expand Down Expand Up @@ -90,7 +90,7 @@ class SynchronousMongoTest(unittest.TestCase):
Convenience class: a test case that can make synchronous calls to the
official pymongo to ease setup code, via the pymongo_conn property.
"""
mongod_options = [('--port', str(27017))]
mongod_options = [('--port', str(27018))]
@property
def pymongo_conn(self):
if not hasattr(self, '_pymongo_conn'):
Expand Down
8 changes: 4 additions & 4 deletions test/test_slave_only.py
Expand Up @@ -9,14 +9,14 @@

class SlaveOnlyTest(test_shunt.MongoTest):
mongod_options = [
('--port', '27017', '--master'),
('--port', '27018', '--slave', '--source', '127.0.0.1:27017'),
('--port', '27018', '--master'),
('--port', '27019', '--slave', '--source', '127.0.0.1:27018'),
]
def test_query_slave(self):
try:
test_shunt.setup()
masterdb = asyncmongo.Client(pool_id='testquerymaster', host='127.0.0.1', port=27017, dbname='test', maxconnections=2)
slavedb = asyncmongo.Client(pool_id='testqueryslave', host='127.0.0.1', port=27018, dbname='test', maxconnections=2, slave_okay=True)
masterdb = asyncmongo.Client(pool_id='testquerymaster', host='127.0.0.1', port=27018, dbname='test', maxconnections=2)
slavedb = asyncmongo.Client(pool_id='testqueryslave', host='127.0.0.1', port=27019, dbname='test', maxconnections=2, slave_okay=True)
logging.debug('waiting for replication to start (sleeping 4 seconds)')
time.sleep(4)

Expand Down
2 changes: 1 addition & 1 deletion test/testgtk2/test.py
Expand Up @@ -7,7 +7,7 @@
import gtk
import asyncmongo

database= {'host' : '127.0.0.1', 'port' : 27017, 'dbname' : 'testdb', 'maxconnections':5}
database= {'host' : '127.0.0.1', 'port' : 27018, 'dbname' : 'testdb', 'maxconnections':5}

class TestApp(object):
def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion test/testgtk3/test.py
Expand Up @@ -5,7 +5,7 @@
import asyncmongo
from gi.repository import Gtk

database= {'host' : '127.0.0.1', 'port' : 27017, 'dbname' : 'testdb', 'maxconnections':5}
database= {'host' : '127.0.0.1', 'port' : 27018, 'dbname' : 'testdb', 'maxconnections':5}

class TestApp(object):
def __init__(self):
Expand Down

0 comments on commit b6a25cf

Please sign in to comment.