summaryrefslogtreecommitdiff
path: root/jstests/auth
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/auth')
-rw-r--r--jstests/auth/auth1.js18
-rw-r--r--jstests/auth/js_scope_leak.js23
-rw-r--r--jstests/auth/lib/commands_lib.js20
3 files changed, 4 insertions, 57 deletions
diff --git a/jstests/auth/auth1.js b/jstests/auth/auth1.js
index a0fb16dbac3..f636403c6c0 100644
--- a/jstests/auth/auth1.js
+++ b/jstests/auth/auth1.js
@@ -41,8 +41,6 @@ function runTest(m) {
print("make sure we can't run certain commands w/out auth");
var codeUnauthorized = 13;
- var rslt = db.runCommand({eval: "function() { return 1; }"});
- assert.eq(rslt.code, codeUnauthorized, tojson(rslt));
var rslt = db.runCommand({getLog: "global"});
assert.eq(rslt.code, codeUnauthorized, tojson(rslt));
@@ -75,19 +73,9 @@ function runTest(m) {
assert.eq(1000, tRO.count(), "B6");
db.getSiblingDB('admin').auth('super', 'super');
- assert.eq(1000,
- db.eval(function() {
- return db["jstests_auth_auth1"].count();
- }),
- "D1");
- db.eval(function() {
- db["jstests_auth_auth1"].save({i: 1000});
- });
- assert.eq(1001,
- db.eval(function() {
- return db["jstests_auth_auth1"].count();
- }),
- "D2");
+ assert.eq(1000, t.count(), "D1");
+ t.insert({i: 1000});
+ assert.eq(1001, t.count(), "D2");
print("SUCCESS auth1.js");
}
diff --git a/jstests/auth/js_scope_leak.js b/jstests/auth/js_scope_leak.js
index ef6d539d0db..cb09fcda70e 100644
--- a/jstests/auth/js_scope_leak.js
+++ b/jstests/auth/js_scope_leak.js
@@ -5,7 +5,7 @@
// auth user 'a' -> auth user 'b'
// auth user 'b' -> logout
//
-// These transitions are tested for dbEval, $where and MapReduce.
+// These transitions are tested for $where and MapReduce.
var conn = MongoRunner.runMongod({smallfiles: ""});
var test = conn.getDB("test");
@@ -26,27 +26,6 @@ function missingOrEquals(string) {
'}()';
}
-function testDbEval() {
- // set the global variable 'someGlobal' before authenticating
- test.eval('someGlobal = "noUsers";');
-
- // test new user auth causes scope to be cleared
- test.auth('a', 'a');
- assert(test.eval('return ' + missingOrEquals('a')), "dbEval: Auth user 'a'");
-
- // test auth as another user causes scope to be cleared
- test.eval('someGlobal = "a";');
- test.auth('b', 'b');
- assert(test.eval('return ' + missingOrEquals('a&b')), "dbEval: Auth user 'b'");
-
- // test user logout causes scope to be cleared
- test.eval('someGlobal = "a&b";');
- test.logout();
- assert(test.eval('return ' + missingOrEquals('noUsers')), "dbEval: log out");
-}
-testDbEval();
-testDbEval();
-
// test $where
function testWhere() {
// set the global variable 'someGlobal' before authenticating
diff --git a/jstests/auth/lib/commands_lib.js b/jstests/auth/lib/commands_lib.js
index b04f48f060d..ed7ae60138b 100644
--- a/jstests/auth/lib/commands_lib.js
+++ b/jstests/auth/lib/commands_lib.js
@@ -3566,26 +3566,6 @@ var authCommandsLib = {
]
},
{
- testname: "eval",
- command: {
- $eval: function() {
- print("noop");
- }
- },
- testcases: [
- {
- runOnDb: firstDbName,
- roles: {__system: 1},
- privileges: [{resource: {anyResource: true}, actions: ["anyAction"]}]
- },
- {
- runOnDb: secondDbName,
- roles: {__system: 1},
- privileges: [{resource: {anyResource: true}, actions: ["anyAction"]}]
- }
- ]
- },
- {
testname: "features",
command: {features: 1},
testcases: [