summaryrefslogtreecommitdiff
path: root/jstests/slow1
diff options
context:
space:
mode:
authorMatt Dannenberg <matt.dannenberg@10gen.com>2014-03-28 14:54:03 -0400
committerMatt Dannenberg <matt.dannenberg@10gen.com>2014-03-28 14:54:03 -0400
commitb59223f406209d8c259f73740631159e9fa0e659 (patch)
tree5cdfd0645e803a3c7ee1b888726fba69ea7d61b7 /jstests/slow1
parent31bdbdb213372f9877f370bd072a478ce04060ba (diff)
downloadmongo-b59223f406209d8c259f73740631159e9fa0e659.tar.gz
Revert "add a logrotate test"
This reverts commit 5b461a3eae881a0ca20fe6659d7959962753bb20.
Diffstat (limited to 'jstests/slow1')
-rw-r--r--jstests/slow1/logrotate.js55
1 files changed, 0 insertions, 55 deletions
diff --git a/jstests/slow1/logrotate.js b/jstests/slow1/logrotate.js
deleted file mode 100644
index 1fe924ebadb..00000000000
--- a/jstests/slow1/logrotate.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// test that rotating logs creates a new log file for the old logs
-// then redo that test with auth confirming that the needed roles are as expected
-
-var logDir = "/tmp";
-var logPath = logDir + "/testlog";
-
-// start up a mongod with a log path
-var mongodInstance = MongoRunner.runMongod({logpath: logPath});
-var newDB = mongodInstance.getDB("log_rotate");
-newDB.dropDatabase();
-var i;
-for (i = 0; i < 100; i++) {
- newDB.logtest.insert({thing: i});
-}
-
-// rotate logs and see that file count in the log directory increases by one
-var pre_count = listFiles(logDir).length;
-assert.commandWorked(newDB.adminCommand({logRotate: 1}));
-var post_count = listFiles(logDir).length;
-assert.eq(pre_count + 1, post_count);
-
-// shut down mongod
-MongoRunner.stopMongod(mongodInstance.port);
-
-// now again but with auth to confirm necessary roles are as expected
-var authzErrorCode = 13;
-var dbAdminUsername = 'admin';
-var dbAdminPassword = 'admin';
-mongodInstance = MongoRunner.runMongod({logpath: logPath, auth: ""});
-
-// create a user to create logs
-newDB = mongodInstance.getDB('admin');
-newDB.dropDatabase();
-newDB.createUser({'user':dbAdminUsername, 'pwd':dbAdminPassword, 'roles':['userAdminAnyDatabase']});
-newDB.auth(dbAdminUsername, dbAdminPassword);
-pre_count = listFiles(logDir).length;
-
-// create user without the clusterAdmin role and make sure that logRotate fails
-newDB.createUser({'user':'nonClusterAdmin', 'pwd':'nonClusterAdmin', 'roles':['dbAdmin','read','readWrite','dbAdmin','userAdmin']});
-newDB.auth('nonClusterAdmin', 'nonClusterAdmin');
-assert.commandFailedWithCode(newDB.runCommand('logRotate'), authzErrorCode);
-
-// remove the above user that was created
-newDB.auth(dbAdminUsername, dbAdminPassword);
-newDB.dropUser('nonClusterAdmin');
-
-// create user with the clusterAdmin role and ensure that logRotate passes
-newDB.createUser({'user':'clusterAdmin', 'pwd':'clusterAdmin', 'roles':['clusterAdmin']});
-newDB.auth('clusterAdmin', 'clusterAdmin');
-assert.commandWorked(newDB.runCommand('logRotate'));
-post_count = listFiles(logDir).length;
-assert.eq(pre_count + 1, post_count);
-
-// shut down mongod
-MongoRunner.stopMongod(mongodInstance.port);