jstests/libs/cluster_server_parameter_utils.js
// Tests valid usages of getClusterParameter and verifies that the expected values are returned.
Tests valid usages of getClusterParameter and verifies that the expected values are returned.
Tests valid usages of getClusterParameter and verifies that the expected values are returned .
function testValidClusterParameterCommands(conn) {
    if (conn instanceof ReplSetTest) {
        runGetClusterParameterReplicaSet(conn, clusterParameterNames, clusterParametersDefault);
        runGetClusterParameterReplicaSet(conn, '*', clusterParametersDefault);
        for (let i = 0; i < clusterParameterNames.length; i++) {
            runSetClusterParameter(conn.getPrimary(), clusterParametersInsert[i]);
            runGetClusterParameterReplicaSet(
                conn, clusterParameterNames[i], [clusterParametersInsert[i]]);
        }
        for (let i = 0; i < clusterParameterNames.length; i++) {
            runSetClusterParameter(conn.getPrimary(), clusterParametersUpdate[i]);
            runGetClusterParameterReplicaSet(
                conn, clusterParameterNames[i], [clusterParametersUpdate[i]]);
        }
        runGetClusterParameterReplicaSet(conn, clusterParameterNames, clusterParametersUpdate);
        runGetClusterParameterReplicaSet(conn, '*', clusterParametersUpdate);
    } else {
        runGetClusterParameterSharded(conn, clusterParameterNames, clusterParametersDefault);
        runGetClusterParameterSharded(conn, '*', clusterParametersDefault);
        for (let i = 0; i < clusterParameterNames.length; i++) {
            runSetClusterParameter(conn.s0, clusterParametersInsert[i]);
            runGetClusterParameterSharded(
                conn, clusterParameterNames[i], [clusterParametersInsert[i]]);
        }
        for (let i = 0; i < clusterParameterNames.length; i++) {
            runSetClusterParameter(conn.s0, clusterParametersUpdate[i]);
            runGetClusterParameterSharded(
                conn, clusterParameterNames[i], [clusterParametersUpdate[i]]);
        }
        runGetClusterParameterSharded(conn, clusterParameterNames, clusterParametersUpdate);
        runGetClusterParameterSharded(conn, '*', clusterParametersUpdate);
    }
}
function testValidClusterParameterCommands ( conn ) { if ( conn instanceof ReplSetTest ) { runGetClusterParameterReplicaSet ( conn , clusterParameterNames , clusterParametersDefault ) ; runGetClusterParameterReplicaSet ( conn , '*' , clusterParametersDefault ) ; for ( let i = 0 ; i < clusterParameterNames . length ; i ++ ) { runSetClusterParameter ( conn . getPrimary ( ) , clusterParametersInsert [ i ] ) ; runGetClusterParameterReplicaSet ( conn , clusterParameterNames [ i ] , [ clusterParametersInsert [ i ] ] ) ; } for ( let i = 0 ; i < clusterParameterNames . length ; i ++ ) { runSetClusterParameter ( conn . getPrimary ( ) , clusterParametersUpdate [ i ] ) ; runGetClusterParameterReplicaSet ( conn , clusterParameterNames [ i ] , [ clusterParametersUpdate [ i ] ] ) ; } runGetClusterParameterReplicaSet ( conn , clusterParameterNames , clusterParametersUpdate ) ; runGetClusterParameterReplicaSet ( conn , '*' , clusterParametersUpdate ) ; } else { runGetClusterParameterSharded ( conn , clusterParameterNames , clusterParametersDefault ) ; runGetClusterParameterSharded ( conn , '*' , clusterParametersDefault ) ; for ( let i = 0 ; i < clusterParameterNames . length ; i ++ ) { runSetClusterParameter ( conn . s0 , clusterParametersInsert [ i ] ) ; runGetClusterParameterSharded ( conn , clusterParameterNames [ i ] , [ clusterParametersInsert [ i ] ] ) ; } for ( let i = 0 ; i < clusterParameterNames . length ; i ++ ) { runSetClusterParameter ( conn . s0 , clusterParametersUpdate [ i ] ) ; runGetClusterParameterSharded ( conn , clusterParameterNames [ i ] , [ clusterParametersUpdate [ i ] ] ) ; } runGetClusterParameterSharded ( conn , clusterParameterNames , clusterParametersUpdate ) ; runGetClusterParameterSharded ( conn , '*' , clusterParametersUpdate ) ; } }
Tests valid usages of getClusterParameter and verifies that the expected values are returned.
Tests valid usages of getClusterParameter and verifies that the expected values are returned .
// Run getClusterParameter in list format and '*' and ensure it returns all default values // on all nodes in the replica set. // For each parameter, run setClusterParameter and verify that getClusterParameter // returns the updated value on all nodes in the replica set. // Do the above again to verify that document updates are also handled properly. // Finally, run getClusterParameter in list format and '*' and ensure that they now all // return updated values. // Run getClusterParameter in list format and '*' and ensure it returns all default values // on all nodes in the sharded cluster. // For each parameter, simulate setClusterParameter and verify that getClusterParameter // returns the updated value on all nodes in the sharded cluster. // Do the above again to verify that document updates are also handled properly. // Finally, run getClusterParameter in list format and '*' and ensure that they now all // return updated values.