Updated Branches: refs/heads/master ae048910e -> e552f629d
refactor replicator_db_security to be more resilient Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e552f629 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e552f629 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e552f629 Branch: refs/heads/master Commit: e552f629d3967cca8d4394054b871c91568a60da Parents: ae04891 Author: Jan Lehnardt <[email protected]> Authored: Fri Feb 8 20:35:56 2013 +0100 Committer: Jan Lehnardt <[email protected]> Committed: Fri Feb 8 20:35:56 2013 +0100 ---------------------------------------------------------------------- share/www/script/test/replicator_db_security.js | 20 ++++++++++------- 1 files changed, 12 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/e552f629/share/www/script/test/replicator_db_security.js ---------------------------------------------------------------------- diff --git a/share/www/script/test/replicator_db_security.js b/share/www/script/test/replicator_db_security.js index 67390cf..7a2bfd1 100644 --- a/share/www/script/test/replicator_db_security.js +++ b/share/www/script/test/replicator_db_security.js @@ -11,14 +11,19 @@ // the License. couchTests.replicator_db_security = function(debug) { + + var reset_dbs = function(dbs) { + dbs.forEach(function(db) { + db.deleteDb(); + try { db.createDb() } catch (e) {}; + }); + }; + var dbs = ["couch_test_rep_db", "couch_test_users_db", "test_suite_db_a", "test_suite_db_b", "test_suite_db_c"] .map(function(db_name) { - var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"}); - db.deleteDb(); - db.createDb(); - return db; - }); + return new CouchDB(db_name, {"X-Couch-Full-Commit":"false"}); + }); var repDb = dbs[0]; var usersDb = dbs[1]; @@ -94,6 +99,8 @@ couchTests.replicator_db_security = function(debug) { var testFun = function() { + reset_dbs(dbs); + // _replicator db // in admin party mode, anonymous should be able to create a replication var repDoc = { @@ -372,9 +379,6 @@ couchTests.replicator_db_security = function(debug) { }); }; - usersDb.deleteDb(); - repDb.deleteDb(); - run_on_modified_server([ { section: "couch_httpd_auth",
