diff options
author | Jan Lehnardt <jan@apache.org> | 2013-02-08 20:35:56 +0100 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2013-02-08 21:04:18 +0100 |
commit | f3c9818fb6b37071cc7455b11ff716e1344afb98 (patch) | |
tree | 6ae236bef0d5139490d81d12ac36f43e1231407b | |
parent | 35739526745fe5069aafa51f35a1f3a470683f64 (diff) | |
download | couchdb-f3c9818fb6b37071cc7455b11ff716e1344afb98.tar.gz |
refactor replicator_db_security to be more resilient
-rw-r--r-- | share/www/script/test/replicator_db_security.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/share/www/script/test/replicator_db_security.js b/share/www/script/test/replicator_db_security.js index 67390cf74..7a2bfd18a 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", |