summaryrefslogtreecommitdiff
path: root/jstests/sslSpecial/mixed_mode_sharded_transition_nossl.js
blob: 4978b56e11f4ae074ee2ad1e752ce19667c37fd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * Tests simultaneous upgrade from noauth/no-ssl to x509/requireSSL on a sharded cluster.
 * The purpose is to verify the connectivity between mongos, config server, and the shards
 *
 * NOTE: This test is similar to the mixed_mode_sharded_transition.js in the ssl
 * test suite. This suite does not use ssl so it cannot test modes with ssl.
 */

load('jstests/ssl/libs/ssl_helpers.js');

(function() {
    'use strict';

    // Disable auth explicitly
    var noAuthOptions = {
        noauth: ''
    };
    var transitionToX509AllowSSL =
        Object.merge(allowSSL, {transitionToAuth: '', clusterAuthMode: 'x509'});
    var x509RequireSSL = Object.merge(requireSSL, {clusterAuthMode: 'x509'});

    print('=== Testing no-auth/transitionToAuth cluster ===');
    mixedShardTest(noAuthOptions, transitionToX509AllowSSL, true);
    mixedShardTest(transitionToX509AllowSSL, noAuthOptions, true);

    print('=== Testing transitionToAuth/transitionToAuth cluster ===');
    mixedShardTest(transitionToX509AllowSSL, transitionToX509AllowSSL, true);
}());