jstests/libs/cluster_server_parameter_utils.js
// Tests that invalid uses of getClusterParameter fails on a given node.
Tests that invalid uses of getClusterParameter fails on a given node.
Tests that invalid uses of getClusterParameter fails on a given node .
function testInvalidGetClusterParameter(conn) {
    const adminDB = conn.getDB('admin');
    assert.commandFailedWithCode(adminDB.runCommand({getClusterParameter: "nonexistentParam"}),
                                 ErrorCodes.NoSuchKey);
    assert.commandFailedWithCode(adminDB.runCommand({getClusterParameter: ["nonexistentParam"]}),
                                 ErrorCodes.NoSuchKey);
    assert.commandFailedWithCode(
        adminDB.runCommand({getClusterParameter: ["testIntClusterParameter", "nonexistentParam"]}),
        ErrorCodes.NoSuchKey);
    assert.commandFailedWithCode(adminDB.runCommand({getClusterParameter: []}),
                                 ErrorCodes.BadValue);
}
function testInvalidGetClusterParameter ( conn ) { const adminDB = conn . getDB ( 'admin' ) ; assert . commandFailedWithCode ( adminDB . runCommand ( { getClusterParameter : "nonexistentParam" } ) , ErrorCodes . NoSuchKey ) ; assert . commandFailedWithCode ( adminDB . runCommand ( { getClusterParameter : [ "nonexistentParam" ] } ) , ErrorCodes . NoSuchKey ) ; assert . commandFailedWithCode ( adminDB . runCommand ( { getClusterParameter : [ "testIntClusterParameter" , "nonexistentParam" ] } ) , ErrorCodes . NoSuchKey ) ; assert . commandFailedWithCode ( adminDB . runCommand ( { getClusterParameter : [ ] } ) , ErrorCodes . BadValue ) ; }
Tests that invalid uses of getClusterParameter fails on a given node.
Tests that invalid uses of getClusterParameter fails on a given node .
// Assert that specifying a nonexistent parameter returns an error.