diff options
author | Aaron <aaron@10gen.com> | 2012-03-14 22:18:12 -0700 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2012-03-22 13:09:51 -0700 |
commit | 6501a582a0bd97cd126b0257b29e7749869a95cc (patch) | |
tree | 989e22af1ba82980d31be29be4592390c0962696 /jstests/profile4.js | |
parent | 3d8adc091015f90acc239ad2c20d3cf05f5d4831 (diff) | |
download | mongo-6501a582a0bd97cd126b0257b29e7749869a95cc.tar.gz |
SERVER-5293 Run some profile js tests from test specific user roles and filter the profile collection based on user name to exclude slave clone operations.
Diffstat (limited to 'jstests/profile4.js')
-rw-r--r-- | jstests/profile4.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/jstests/profile4.js b/jstests/profile4.js index fe3c572c59d..214e7947b75 100644 --- a/jstests/profile4.js +++ b/jstests/profile4.js @@ -7,8 +7,12 @@ var db = db.getSisterDB("profile4"); t = db.profile4; t.drop(); +function profileCursor() { + return db.system.profile.find( { user:username } ); +} + function lastOp() { - p = db.system.profile.find().sort( { $natural:-1 } ).next(); + p = profileCursor().sort( { $natural:-1 } ).next(); // printjson( p ); return p; } @@ -22,10 +26,14 @@ function checkLastOp( spec ) { } try { + username = "jstests_profile4_user"; + db.addUser( username, "password" ); + db.auth( username, "password" ); + db.setProfilingLevel(0); db.system.profile.drop(); - assert.eq( 0 , db.system.profile.count() ) + assert.eq( 0 , profileCursor().count() ) db.setProfilingLevel(2); |