jstests/auth/lib/commands_builtin_roles.js
/**
 * First of two entry points for this test library.
 * To be invoked as an test argument to authCommandsLib.runTests().
 */
First of two entry points for this test library.
To be invoked as an test argument to authCommandsLib.runTests().
First of two entry points for this test library . To be invoked as an test argument to authCommandsLib . runTests () .
function runOneTest(conn, t) {
    var failures = [];
    let disableSearchFailpoint;
    if (t.disableSearch) {
        disableSearchFailpoint = configureFailPoint(conn.rs0 ? conn.rs0.getPrimary() : conn,
                                                    'searchReturnEofImmediately');
    }
    for (var i = 0; i < t.testcases.length; i++) {
        var testcase = t.testcases[i];
        if (!("roles" in testcase)) {
            continue;
        }
        for (var j = 0; j < roles.length; j++) {
            var msg = testProperAuthorization(conn, t, testcase, roles[j]);
            if (msg) {
                failures.push(t.testname + ": " + msg);
            }
        }
    }
    if (disableSearchFailpoint) {
        disableSearchFailpoint.off();
    }
    return failures;
}
function runOneTest ( conn , t ) { var failures = [ ] ; let disableSearchFailpoint ; if ( t . disableSearch ) { disableSearchFailpoint = configureFailPoint ( conn . rs0 ? conn . rs0 . getPrimary ( ) : conn , 'searchReturnEofImmediately' ) ; } for ( var i = 0 ; i < t . testcases . length ; i ++ ) { var testcase = t . testcases [ i ] ; if ( ! ( "roles" in testcase ) ) { continue ; } for ( var j = 0 ; j < roles . length ; j ++ ) { var msg = testProperAuthorization ( conn , t , testcase , roles [ j ] ) ; if ( msg ) { failures . push ( t . testname + ": " + msg ) ; } } } if ( disableSearchFailpoint ) { disableSearchFailpoint . off ( ) ; } return failures ; }
First of two entry points for this test library.
First of two entry points for this test library .
// Some tests requires mongot, however, setting this failpoint will make search queries to // return EOF, that way all the hassle of setting it up can be avoided.