diff options
author | Andy Schwerin <schwerin@10gen.com> | 2013-01-02 12:59:36 -0500 |
---|---|---|
committer | Andy Schwerin <schwerin@10gen.com> | 2013-01-02 13:09:01 -0500 |
commit | 8c9373d63d68efa0966c76bb41e36922972b5fcd (patch) | |
tree | 2fd7e2961c268efafa3e25743d58e1a34a5f35ab /buildscripts | |
parent | c1da06e5c42172e6fa867bf8a132d2531471ff9d (diff) | |
download | mongo-8c9373d63d68efa0966c76bb41e36922972b5fcd.tar.gz |
SERVER-7128 Changes to smoke.py and utils.js to run tests with sasl authentication.
Diffstat (limited to 'buildscripts')
-rwxr-xr-x | buildscripts/smoke.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/buildscripts/smoke.py b/buildscripts/smoke.py index 286d0767636..507c09800d5 100755 --- a/buildscripts/smoke.py +++ b/buildscripts/smoke.py @@ -205,6 +205,9 @@ class mongod(object): argv += ['--nopreallocj'] if self.kwargs.get('auth'): argv += ['--auth'] + authMechanism = self.kwargs.get('authMechanism', 'MONGO-CR') + if authMechanism != 'MONGO-CR': + argv.append('--setParameter=authenticationMechanisms=' + authMechanism) self.auth = True if self.kwargs.get('use_ssl'): argv += ['--sslOnNormalPorts', @@ -449,6 +452,7 @@ def runTest(test): 'TestData.noJournal = ' + ternary( no_journal ) + ";" + \ 'TestData.noJournalPrealloc = ' + ternary( no_preallocj ) + ";" + \ 'TestData.auth = ' + ternary( auth ) + ";" + \ + 'TestData.authMechanism = "' + authMechanism + '";' + \ 'TestData.keyFile = ' + ternary( keyFile , '"' + str(keyFile) + '"' , 'null' ) + ";" + \ 'TestData.keyFileData = ' + ternary( keyFile , '"' + str(keyFileData) + '"' , 'null' ) + ";" if os.sys.platform == "win32": @@ -518,6 +522,7 @@ def run_tests(tests): no_journal=no_journal, no_preallocj=no_preallocj, auth=auth, + authMechanism=authMechanism, use_ssl=use_ssl).__enter__() else: master = Nothing() @@ -531,6 +536,7 @@ def run_tests(tests): no_journal=no_journal, no_preallocj=no_preallocj, auth=auth, + authMechanism=authMechanism, use_ssl=use_ssl).__enter__() primary = Connection(port=master.port, slave_okay=True); @@ -574,6 +580,7 @@ def run_tests(tests): no_journal=no_journal, no_preallocj=no_preallocj, auth=auth, + authMechanism=authMechanism, use_ssl=use_ssl).__enter__() except TestFailure, f: @@ -716,7 +723,7 @@ def add_exe(e): def set_globals(options, tests): global mongod_executable, mongod_port, shell_executable, continue_on_failure, small_oplog, small_oplog_rs - global no_journal, no_preallocj, auth, keyFile, smoke_db_prefix, test_path, start_mongod + global no_journal, no_preallocj, auth, authMechanism, keyFile, smoke_db_prefix, test_path, start_mongod global use_ssl global file_of_commands_mode start_mongod = options.start_mongod @@ -748,8 +755,10 @@ def set_globals(options, tests): print "Not running client suite with auth even though --auth was provided" auth = False; keyFile = False; + authMechanism = None else: auth = options.auth + authMechanism = options.authMechanism keyFile = options.keyFile if auth and not keyFile: @@ -868,6 +877,8 @@ def main(): parser.add_option('--auth', dest='auth', default=False, action="store_true", help='Run standalone mongods in tests with authentication enabled') + parser.add_option('--authMechanism', dest='authMechanism', default='MONGO-CR', + help='Use the given authentication mechanism, when --auth is used.') parser.add_option('--keyFile', dest='keyFile', default=None, help='Path to keyFile to use to run replSet and sharding tests with authentication enabled') parser.add_option('--ignore', dest='ignore_files', default=None, |