diff options
Diffstat (limited to 'jstests/auth')
-rw-r--r-- | jstests/auth/auth1.js | 2 | ||||
-rw-r--r-- | jstests/auth/auth2.js | 2 | ||||
-rw-r--r-- | jstests/auth/copyauth.js | 8 | ||||
-rw-r--r-- | jstests/auth/localhostAuthBypass.js | 2 | ||||
-rw-r--r-- | jstests/auth/mr_auth.js | 4 | ||||
-rw-r--r-- | jstests/auth/rename.js | 2 | ||||
-rw-r--r-- | jstests/auth/server-4892.js | 2 | ||||
-rw-r--r-- | jstests/auth/show_log_auth.js | 2 |
8 files changed, 12 insertions, 12 deletions
diff --git a/jstests/auth/auth1.js b/jstests/auth/auth1.js index 27d89eca3f0..9419230869d 100644 --- a/jstests/auth/auth1.js +++ b/jstests/auth/auth1.js @@ -5,7 +5,7 @@ print("START auth1.js"); port = allocatePorts( 1 )[ 0 ]; baseName = "jstests_auth_auth1"; -m = startMongod( "--auth", "--port", port, "--dbpath", "/data/db/" + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" ); +m = startMongod( "--auth", "--port", port, "--dbpath", MongoRunner.dataPath + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" ); db = m.getDB( "test" ); t = db[ baseName ]; diff --git a/jstests/auth/auth2.js b/jstests/auth/auth2.js index f63390edf84..9e070e0bb68 100644 --- a/jstests/auth/auth2.js +++ b/jstests/auth/auth2.js @@ -3,7 +3,7 @@ port = allocatePorts( 1 )[ 0 ]; baseName = "jstests_auth_auth2"; -m = startMongod( "--auth", "--port", port, "--dbpath", "/data/db/" + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" , "--nojournal" , "--smallfiles" ); +m = startMongod( "--auth", "--port", port, "--dbpath", MongoRunner.dataPath + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" , "--nojournal" , "--smallfiles" ); db = m.getDB( "admin" ); t = db[ baseName ]; diff --git a/jstests/auth/copyauth.js b/jstests/auth/copyauth.js index cac98fe6608..d82f5b22093 100644 --- a/jstests/auth/copyauth.js +++ b/jstests/auth/copyauth.js @@ -8,8 +8,8 @@ ports = allocatePorts( 2 ); var baseName = "jstests_clone_copyauth"; // test copyDatabase from an auth enabled source, with an unauthed dest. -var source = startMongod( "--auth", "--port", ports[ 0 ], "--dbpath", "/data/db/" + baseName + "_source", "--nohttpinterface", "--bind_ip", "127.0.0.1", "--smallfiles" ); -var target = startMongod( "--port", ports[ 1 ], "--dbpath", "/data/db/" + baseName + "_target", "--nohttpinterface", "--bind_ip", "127.0.0.1", "--smallfiles" ); +var source = startMongod( "--auth", "--port", ports[ 0 ], "--dbpath", MongoRunner.dataPath + baseName + "_source", "--nohttpinterface", "--bind_ip", "127.0.0.1", "--smallfiles" ); +var target = startMongod( "--port", ports[ 1 ], "--dbpath", MongoRunner.dataPath + baseName + "_target", "--nohttpinterface", "--bind_ip", "127.0.0.1", "--smallfiles" ); source.getDB( "admin" ).addUser( "super", "super" ); source.getDB( "admin" ).auth( "super", "super" ); @@ -29,7 +29,7 @@ assert.eq( 1, target.getDB( baseName )[ baseName ].findOne().i ); // Test with auth-enabled source and dest stopMongod( ports[ 1 ] ); -var target = startMongod( "--auth", "--port", ports[ 1 ], "--dbpath", "/data/db/" + baseName + "_target", "--nohttpinterface", "--bind_ip", "127.0.0.1", "--smallfiles" ); +var target = startMongod( "--auth", "--port", ports[ 1 ], "--dbpath", MongoRunner.dataPath + baseName + "_target", "--nohttpinterface", "--bind_ip", "127.0.0.1", "--smallfiles" ); target.getDB( "admin" ).addUser( "super1", "super1" ); assert.throws( function() { source.getDB( baseName )[ baseName ].findOne(); } ); @@ -48,7 +48,7 @@ assert.eq( 1, target.getDB( baseName )[ baseName ].findOne().i ); // Test with auth-enabled dest, but un-authed source stopMongod(ports[0]); var source = startMongod( "--port", ports[ 0 ], - "--dbpath", "/data/db/" + baseName + "_source", + "--dbpath", MongoRunner.dataPath + baseName + "_source", "--nohttpinterface", "--bind_ip", "127.0.0.1", "--smallfiles" ); diff --git a/jstests/auth/localhostAuthBypass.js b/jstests/auth/localhostAuthBypass.js index f5abf7b8398..8d5c140fdc8 100644 --- a/jstests/auth/localhostAuthBypass.js +++ b/jstests/auth/localhostAuthBypass.js @@ -4,7 +4,7 @@ //mongod whether it is hosted with "localhost" or a hostname. var baseName = "auth_server-6591"; -var dbpath = "/data/db/" + baseName; +var dbpath = MongoRunner.dataPath + baseName; var username = "foo"; var password = "bar"; var port = allocatePorts(1)[0]; diff --git a/jstests/auth/mr_auth.js b/jstests/auth/mr_auth.js index 89d08229b7d..a9945b515c5 100644 --- a/jstests/auth/mr_auth.js +++ b/jstests/auth/mr_auth.js @@ -13,7 +13,7 @@ ports = allocatePorts( 2 ); // make sure writing is allowed when started without --auth enabled port = ports[ 0 ]; -dbms = startMongod( "--port", port, "--dbpath", "/data/db/" + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" ); +dbms = startMongod( "--port", port, "--dbpath", MongoRunner.dataPath + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" ); var d = dbms.getDB( dbName ); var t = d[ baseName ]; @@ -41,7 +41,7 @@ stopMongod( port ); // In --auth mode, read-only user should not be able to write to existing or temporary collection, thus only can execute inline mode port = ports[ 1 ]; -dbms = startMongodNoReset( "--auth", "--port", port, "--dbpath", "/data/db/" + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" ); +dbms = startMongodNoReset( "--auth", "--port", port, "--dbpath", MongoRunner.dataPath + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" ); d = dbms.getDB( dbName ); t = d[ baseName ]; diff --git a/jstests/auth/rename.js b/jstests/auth/rename.js index 99d6a7bd8a3..0cdf191ef26 100644 --- a/jstests/auth/rename.js +++ b/jstests/auth/rename.js @@ -3,7 +3,7 @@ port = allocatePorts( 1 )[ 0 ]; baseName = "jstests_rename_auth"; -m = startMongod( "--auth", "--port", port, "--dbpath", "/data/db/" + baseName, "--nohttpinterface" ); +m = startMongod( "--auth", "--port", port, "--dbpath", MongoRunner.dataPath + baseName, "--nohttpinterface" ); db1 = m.getDB( baseName ) db2 = m.getDB( baseName + '_other' ) diff --git a/jstests/auth/server-4892.js b/jstests/auth/server-4892.js index ba8236d3d80..bec2baf7e85 100644 --- a/jstests/auth/server-4892.js +++ b/jstests/auth/server-4892.js @@ -6,7 +6,7 @@ */ var baseName = 'jstests_auth_server4892'; -var dbpath = '/data/db/' + baseName; +var dbpath = MongoRunner.dataPath + baseName; var port = allocatePorts( 1 )[ 0 ]; var mongod_common_args = [ '--port', port, '--dbpath', dbpath, '--bind_ip', '127.0.0.1', '--nohttpinterface' ]; diff --git a/jstests/auth/show_log_auth.js b/jstests/auth/show_log_auth.js index 35847b30489..11c795b7593 100644 --- a/jstests/auth/show_log_auth.js +++ b/jstests/auth/show_log_auth.js @@ -3,7 +3,7 @@ var port = allocatePorts( 1 )[ 0 ]; var baseName = "jstests_show_log_auth"; -var m = startMongod( "--auth", "--port", port, "--dbpath", "/data/db/" + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" , "--nojournal" , "--smallfiles" ); +var m = startMongod( "--auth", "--port", port, "--dbpath", MongoRunner.dataPath + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" , "--nojournal" , "--smallfiles" ); var db = m.getDB( "admin" ); db.addUser({user: "admin" , pwd: "pass", roles: jsTest.adminUserRoles}); |