19YnF5A2nZHea25LEShpAi changeset

Changeset336133663134 (b)
ParentNone (a)
ab
0+not ok 1 form_submit
0+Reason: Failed to execute HTTP request: Recv failure: Connection reset by peer
0+Trace back (most recent call first):
0+
0+  37: /home/klausi/dev/CouchDB/couchdb/test/javascript/couch_http.js
0+      ("{}")
0+ 425: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ("POST","/test_suite_db/baz",[object Object])
0+  20: share/www/script/test/form_submit.js
0+      ()
0+  53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runTestConsole(1,"form_submit",(function (debug) {var db = new CouchDB
0+  72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runAllTestsConsole()
0+  85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+
0+
0+not ok 1 oauth
0+Reason: {gen_server,call,
0+        [couch_rep_sup,
0+         {start_child,
0+             {"ec3764f920bbf0b3908f454c4869581e",
0+              {gen_server,start_link,
0+                  [couch_replicator,
0+                   {rep,
0+                       {"ec3764f920bbf0b3908f454c4869581e",[]},
0+                       {httpdb,"http://127.0.0.1:6922/test_suite_db_a/",
0+                           {oauth,"key","foo",
0+                               "3dTucPTCGXSgCEgyO6+X67dFhaxMW9q9m1XEga8IFL2hUWbY+FwlmFjI1dKfVlVs",
0+                               "AYaybySMkaP8uE53RKRzpN2wtIQhqCaSqsgJEj5yFXfjKxKgYG8cojc5f+BCtb0n",
0+                               hmac_sha1},
0+                           [{"Accept","application/json"},
0+                            {"User-Agent","CouchDB/1.3.0"}],
0+                           30000,
0+                           [{socket_options,[{keepalive,true},{nodelay,false}]}],
0+                           10,250,nil,20},
0+                       {httpdb,"http://127.0.0.1:6922/test_suite_db_b/",nil,
0+                           [{"Accept","application/json"},
0+                            {"Authorization","Basic dGVzdGFkbWluOm9oc29zZWNyZXQ="},
0+                            {"User-Agent","CouchDB/1.3.0"}],
0+                           30000,
0+                           [{socket_options,[{keepalive,true},{nodelay,false}]}],
0+                           10,250,nil,20},
0+                       [{connection_timeout,30000},
0+                        {http_connections,20},
0+                        {retries,10},
0+                        {socket_options,[{keepalive,true},{nodelay,false}]},
0+                        {worker_batch_size,500},
0+                        {worker_processes,4}],
0+                       {user_ctx,<<"testadmin">>,
0+                           [<<"_admin">>],
0+                           <<"{couch_httpd_auth, default_authentication_handler}">>},
0+                       undefined},
0+                   [{timeout,30000}]]},
0+              temporary,1,worker,
0+              [couch_replicator]}},
0+         infinity]}
0+Trace back (most recent call first):
0+
0+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      CouchError([object Object])
0+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ([object CouchHTTP])
0+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ([object Object],[object Object],[object Object])
0+ 198: share/www/script/test/oauth.js
0+      ()
0+ 378: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch_test_runner.js
0+      run_on_modified_server([object Array],(function () {try {CouchDB.reque
0+ 290: share/www/script/test/oauth.js
0+      ()
0+  53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      var consumerSecret = generateSecret(64);var tokenSecret = generateSecr
0+  72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runAllTestsConsole()
0+  85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+
0+
0+not ok 1 purge
0+Reason: {gen_server,call,
0+        [couch_rep_sup,
0+         {start_child,
0+             {"acedb74dea7af10fc0c6dcdc2f275362",
0+              {gen_server,start_link,
0+                  [couch_replicator,
0+                   {rep,
0+                       {"acedb74dea7af10fc0c6dcdc2f275362",[]},
0+                       <<"test_suite_db_a">>,<<"test_suite_db_b">>,
0+                       [{connection_timeout,30000},
0+                        {http_connections,20},
0+                        {retries,10},
0+                        {socket_options,[{keepalive,true},{nodelay,false}]},
0+                        {worker_batch_size,500},
0+                        {worker_processes,4}],
0+                       {user_ctx,null,
0+                           [<<"_admin">>],
0+                           <<"{couch_httpd_auth, default_authentication_handler}">>},
0+                       undefined},
0+                   [{timeout,30000}]]},
0+              temporary,1,worker,
0+              [couch_replicator]}},
0+         infinity]}
0+Trace back (most recent call first):
0+
0+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      CouchError([object Object])
0+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ([object CouchHTTP])
0+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ("test_suite_db_a","test_suite_db_b")
0+ 125: share/www/script/test/purge.js
0+      ()
0+  53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runTestConsole(1,"purge",(function (debug) {var db = new CouchDB("test
0+  72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runAllTestsConsole()
0+  85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+
0+
0+not ok 1 replication
0+Reason: {gen_server,call,
0+        [couch_rep_sup,
0+         {start_child,
0+             {"8766a607cf45695fd1dccd1a60038fae",
0+              {gen_server,start_link,
0+                  [couch_replicator,
0+                   {rep,
0+                       {"8766a607cf45695fd1dccd1a60038fae",[]},
0+                       <<"test_suite_db_a">>,<<"test_suite_db_b">>,
0+                       [{connection_timeout,30000},
0+                        {http_connections,20},
0+                        {retries,10},
0+                        {socket_options,[{keepalive,true},{nodelay,false}]},
0+                        {worker_batch_size,500},
0+                        {worker_processes,4}],
0+                       {user_ctx,null,
0+                           [<<"_admin">>],
0+                           <<"{couch_httpd_auth, default_authentication_handler}">>},
0+                       undefined},
0+                   [{timeout,30000}]]},
0+              temporary,1,worker,
0+              [couch_replicator]}},
0+         infinity]}
0+Trace back (most recent call first):
0+
0+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      CouchError([object Object])
0+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ([object CouchHTTP])
0+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ("test_suite_db_a","test_suite_db_b")
0+ 194: share/www/script/test/replication.js
0+      ()
0+  CouchDB.protocol + host + "/" + sourceDb.name, target: CouchDB.protocol + "joe:erly@" + host + "/" + targetDb.name}];for (i = 0; i < dbPairs.length; i++) {usersDb.deleteDb();populateDb(sourceDb, docs);populateDb(targetDb, []);TEquals(true, targetDb.setSecObj({admins: {names: ["superman"], roles: ["god"]}}).ok);run_on_modified_server(server_config, function () {delete joeUserDoc._rev;TEquals(true, usersDb.save(joeUserDoc).ok);TEquals(true, CouchDB.login("joe", "erly").ok);TEquals("joe", CouchDB.session().userCtx.name);repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);TEquals(true, CouchDB.logout().ok);TEquals(true, repResult.ok);TEquals(docs.length, repResult.history[0].docs_read);TEquals(docs.length - 1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].doc_write_failures);});for (j = 0; j < docs.length; j++) {doc = docs[j];copy = targetDb.open(doc._id);if (doc._id.indexOf("_design/") === 0) {TEquals(null, copy);} else {T(copy !== null);TEquals(true, compareObjects(doc, copy));}}}dbPairs = [{source: sourceDb.name, target: targetDb.name}, {source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name, target: targetDb.name}, {source: sourceDb.name, target: CouchDB.protocol + host + "/" + targetDb.name}, {source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name, target: CouchDB.protocol + host + "/" + targetDb.name}];for (i = 0; i < dbPairs.length; i++) {usersDb.deleteDb();populateDb(sourceDb, docs);populateDb(targetDb, []);TEquals(true, sourceDb.setSecObj({admins: {names: ["superman"], roles: ["god"]}, readers: {names: ["john"], roles: ["secret"]}}).ok);run_on_modified_server(server_config, function () {delete joeUserDoc._rev;TEquals(true, usersDb.save(joeUserDoc).ok);TEquals(true, CouchDB.login("joe", "erly").ok);TEquals("joe", CouchDB.session().userCtx.name);try {CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);T(false, "should have raised an exception");} catch (x) {TEquals("unauthorized", x.error);}TEquals(true, CouchDB.logout().ok);});for (j = 0; j < docs.length; j++) {doc = docs[j];copy = targetDb.open(doc._id);TEquals(null, copy);}}sourceDb = new CouchDB("test_suite_db_a");targetDb = new CouchDB("test_suite_db_b");sourceDb.deleteDb();sourceDb.createDb();targetDb.deleteDb();targetDb.createDb();doc = {_id: "doc1"};TEquals(true, sourceDb.save(doc).ok);repResult = CouchDB.replicate(sourceDb.name, CouchDB.protocol + host + "/" + targetDb.name);TEquals(true, repResult.ok);TEquals(true, repResult.history instanceof Array);TEquals(1, repResult.history.length);TEquals(1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].docs_read);TEquals(0, repResult.history[0].doc_write_failures);doc._attachments = {'hello.txt': {content_type: "text/plain", data: "aGVsbG8gd29ybGQ="}, 'foo.dat': {content_type: "not/compressible", data: "aSBhbSBub3QgZ3ppcGVk"}};TEquals(true, sourceDb.save(doc).ok);repResult = CouchDB.replicate(sourceDb.name, CouchDB.protocol + host + "/" + targetDb.name);TEquals(true, repResult.ok);TEquals(true, repResult.history instanceof Array);TEquals(2, repResult.history.length);TEquals(1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].docs_read);TEquals(0, repResult.history[0].doc_write_failures);copy = targetDb.open(doc._id, {conflicts: true, deleted_conflicts: true, attachments: true, att_encoding_info: true});T(copy !== null);TEquals("undefined", typeof copy._conflicts);TEquals("undefined", typeof copy._deleted_conflicts);TEquals("text/plain", copy._attachments['hello.txt'].content_type);TEquals("aGVsbG8gd29ybGQ=", copy._attachments['hello.txt'].data);TEquals("gzip", copy._attachments['hello.txt'].encoding);TEquals("not/compressible", copy._attachments['foo.dat'].content_type);TEquals("aSBhbSBub3QgZ3ppcGVk", copy._attachments['foo.dat'].data);TEquals("undefined", typeof copy._attachments['foo.dat'].encoding);try {CouchDB.replicate(sourceDb, targetDb, {body: {filter: "mydesign/myfilter", query_params: {maxvalue: 4}}});} catch (e) {TEquals("bad_request", e.error);}populateDb(sourceDb, makeDocs(1, 6));populateDb(targetDb, []);repResult = CouchDB.replicate(CouchDB.protocol + host + "/" + sourceDb.name, targetDb.name, {body: {continuous: true, create_target: true}});TEquals(true, repResult.ok);TEquals("string", typeof repResult._local_id);xhr = CouchDB.request("GET", "/_active_tasks");tasks = JSON.parse(xhr.responseText);var repId;for (j = 0; j < tasks.length; j++) {if (tasks[j].replication_id === repResult._local_id) {repId = tasks[j].replication_id;}}TEquals(repResult._local_id, repId, "Replication found in _active_tasks");xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repId, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(200, xhr.status, "Replication cancel request success");xhr = CouchDB.request("GET", "/_active_tasks");tasks = JSON.parse(xhr.responseText);repId = null;for (j = 0; j < tasks.length; j++) {if (tasks[j].replication_id === repResult._local_id) {repId = tasks[j].replication_id;}}TEquals(null, repId, "Replication was canceled");xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(404, xhr.status, "2nd replication cancel failed");var userDoc = CouchDB.prepareUserDoc({name: "tony", roles: ["mafia"]}, "soprano");usersDb = new CouchDB("test_suite_auth", {'X-Couch-Full-Commit': "false"});server_config = [{section: "couch_httpd_auth", key: "authentication_db", value: usersDb.name}];run_on_modified_server(server_config, function () {populateDb(sourceDb, makeDocs(1, 6));populateDb(targetDb, []);TEquals(true, usersDb.save(userDoc).ok);repResult = CouchDB.replicate(CouchDB.protocol + host + "/" + sourceDb.name, targetDb.name, {body: {continuous: true}});TEquals(true, repResult.ok);TEquals("string", typeof repResult._local_id);TEquals(true, CouchDB.login("tony", "soprano").ok);TEquals("tony", CouchDB.session().userCtx.name);xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(401, xhr.status, "Unauthorized to cancel replication");TEquals("unauthorized", JSON.parse(xhr.responseText).error);TEquals(true, CouchDB.logout().ok);xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(200, xhr.status, "Authorized to cancel replication");});usersDb.deleteDb();sourceDb.deleteDb();targetDb.deleteDb();}))@/home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js:53: " + host + "/" + targetDb.name}, {source
0+      docs = makeDocs(1, 21);docs.push({_id: "_design/foo", language: "javas
0+  72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runAllTestsConsole()
0+  85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+
0+
0+not ok 1 replication
0+Reason: {gen_server,call,
0+        [couch_rep_sup,
0+         {start_child,
0+             {"8766a607cf45695fd1dccd1a60038fae",
0+              {gen_server,start_link,
0+                  [couch_replicator,
0+                   {rep,
0+                       {"8766a607cf45695fd1dccd1a60038fae",[]},
0+                       <<"test_suite_db_a">>,<<"test_suite_db_b">>,
0+                       [{connection_timeout,30000},
0+                        {http_connections,20},
0+                        {retries,10},
0+                        {socket_options,[{keepalive,true},{nodelay,false}]},
0+                        {worker_batch_size,500},
0+                        {worker_processes,4}],
0+                       {user_ctx,null,
0+                           [<<"_admin">>],
0+                           <<"{couch_httpd_auth, default_authentication_handler}">>},
0+                       undefined},
0+                   [{timeout,30000}]]},
0+              temporary,1,worker,
0+              [couch_replicator]}},
0+         infinity]}
0+Trace back (most recent call first):
0+
0+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      CouchError([object Object])
0+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ([object CouchHTTP])
0+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ("test_suite_db_a","test_suite_db_b")
0+ 194: share/www/script/test/replication.js
0+      ()
0+  CouchDB.protocol + host + "/" + sourceDb.name, target: CouchDB.protocol + "joe:erly@" + host + "/" + targetDb.name}];for (i = 0; i < dbPairs.length; i++) {usersDb.deleteDb();populateDb(sourceDb, docs);populateDb(targetDb, []);TEquals(true, targetDb.setSecObj({admins: {names: ["superman"], roles: ["god"]}}).ok);run_on_modified_server(server_config, function () {delete joeUserDoc._rev;TEquals(true, usersDb.save(joeUserDoc).ok);TEquals(true, CouchDB.login("joe", "erly").ok);TEquals("joe", CouchDB.session().userCtx.name);repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);TEquals(true, CouchDB.logout().ok);TEquals(true, repResult.ok);TEquals(docs.length, repResult.history[0].docs_read);TEquals(docs.length - 1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].doc_write_failures);});for (j = 0; j < docs.length; j++) {doc = docs[j];copy = targetDb.open(doc._id);if (doc._id.indexOf("_design/") === 0) {TEquals(null, copy);} else {T(copy !== null);TEquals(true, compareObjects(doc, copy));}}}dbPairs = [{source: sourceDb.name, target: targetDb.name}, {source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name, target: targetDb.name}, {source: sourceDb.name, target: CouchDB.protocol + host + "/" + targetDb.name}, {source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name, target: CouchDB.protocol + host + "/" + targetDb.name}];for (i = 0; i < dbPairs.length; i++) {usersDb.deleteDb();populateDb(sourceDb, docs);populateDb(targetDb, []);TEquals(true, sourceDb.setSecObj({admins: {names: ["superman"], roles: ["god"]}, readers: {names: ["john"], roles: ["secret"]}}).ok);run_on_modified_server(server_config, function () {delete joeUserDoc._rev;TEquals(true, usersDb.save(joeUserDoc).ok);TEquals(true, CouchDB.login("joe", "erly").ok);TEquals("joe", CouchDB.session().userCtx.name);try {CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);T(false, "should have raised an exception");} catch (x) {TEquals("unauthorized", x.error);}TEquals(true, CouchDB.logout().ok);});for (j = 0; j < docs.length; j++) {doc = docs[j];copy = targetDb.open(doc._id);TEquals(null, copy);}}sourceDb = new CouchDB("test_suite_db_a");targetDb = new CouchDB("test_suite_db_b");sourceDb.deleteDb();sourceDb.createDb();targetDb.deleteDb();targetDb.createDb();doc = {_id: "doc1"};TEquals(true, sourceDb.save(doc).ok);repResult = CouchDB.replicate(sourceDb.name, CouchDB.protocol + host + "/" + targetDb.name);TEquals(true, repResult.ok);TEquals(true, repResult.history instanceof Array);TEquals(1, repResult.history.length);TEquals(1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].docs_read);TEquals(0, repResult.history[0].doc_write_failures);doc._attachments = {'hello.txt': {content_type: "text/plain", data: "aGVsbG8gd29ybGQ="}, 'foo.dat': {content_type: "not/compressible", data: "aSBhbSBub3QgZ3ppcGVk"}};TEquals(true, sourceDb.save(doc).ok);repResult = CouchDB.replicate(sourceDb.name, CouchDB.protocol + host + "/" + targetDb.name);TEquals(true, repResult.ok);TEquals(true, repResult.history instanceof Array);TEquals(2, repResult.history.length);TEquals(1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].docs_read);TEquals(0, repResult.history[0].doc_write_failures);copy = targetDb.open(doc._id, {conflicts: true, deleted_conflicts: true, attachments: true, att_encoding_info: true});T(copy !== null);TEquals("undefined", typeof copy._conflicts);TEquals("undefined", typeof copy._deleted_conflicts);TEquals("text/plain", copy._attachments['hello.txt'].content_type);TEquals("aGVsbG8gd29ybGQ=", copy._attachments['hello.txt'].data);TEquals("gzip", copy._attachments['hello.txt'].encoding);TEquals("not/compressible", copy._attachments['foo.dat'].content_type);TEquals("aSBhbSBub3QgZ3ppcGVk", copy._attachments['foo.dat'].data);TEquals("undefined", typeof copy._attachments['foo.dat'].encoding);try {CouchDB.replicate(sourceDb, targetDb, {body: {filter: "mydesign/myfilter", query_params: {maxvalue: 4}}});} catch (e) {TEquals("bad_request", e.error);}populateDb(sourceDb, makeDocs(1, 6));populateDb(targetDb, []);repResult = CouchDB.replicate(CouchDB.protocol + host + "/" + sourceDb.name, targetDb.name, {body: {continuous: true, create_target: true}});TEquals(true, repResult.ok);TEquals("string", typeof repResult._local_id);xhr = CouchDB.request("GET", "/_active_tasks");tasks = JSON.parse(xhr.responseText);var repId;for (j = 0; j < tasks.length; j++) {if (tasks[j].replication_id === repResult._local_id) {repId = tasks[j].replication_id;}}TEquals(repResult._local_id, repId, "Replication found in _active_tasks");xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repId, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(200, xhr.status, "Replication cancel request success");xhr = CouchDB.request("GET", "/_active_tasks");tasks = JSON.parse(xhr.responseText);repId = null;for (j = 0; j < tasks.length; j++) {if (tasks[j].replication_id === repResult._local_id) {repId = tasks[j].replication_id;}}TEquals(null, repId, "Replication was canceled");xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(404, xhr.status, "2nd replication cancel failed");var userDoc = CouchDB.prepareUserDoc({name: "tony", roles: ["mafia"]}, "soprano");usersDb = new CouchDB("test_suite_auth", {'X-Couch-Full-Commit': "false"});server_config = [{section: "couch_httpd_auth", key: "authentication_db", value: usersDb.name}];run_on_modified_server(server_config, function () {populateDb(sourceDb, makeDocs(1, 6));populateDb(targetDb, []);TEquals(true, usersDb.save(userDoc).ok);repResult = CouchDB.replicate(CouchDB.protocol + host + "/" + sourceDb.name, targetDb.name, {body: {continuous: true}});TEquals(true, repResult.ok);TEquals("string", typeof repResult._local_id);TEquals(true, CouchDB.login("tony", "soprano").ok);TEquals("tony", CouchDB.session().userCtx.name);xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(401, xhr.status, "Unauthorized to cancel replication");TEquals("unauthorized", JSON.parse(xhr.responseText).error);TEquals(true, CouchDB.logout().ok);xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(200, xhr.status, "Authorized to cancel replication");});usersDb.deleteDb();sourceDb.deleteDb();targetDb.deleteDb();}))@/home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js:53: " + host + "/" + targetDb.name}, {source
0+      docs = makeDocs(1, 21);docs.push({_id: "_design/foo", language: "javas
0+  72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runAllTestsConsole()
0+  85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+
0+
0+not ok 1 replicator_db
0+Reason: false
0+Trace back (most recent call first):
0+
0+  46: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      T(false)
0+ 116: share/www/script/test/replicator_db.js
0+      simple_replication()
0+ 378: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch_test_runner.js
0+      run_on_modified_server([object Array],simple_replication)
0+ 1461: share/www/script/test/replicator_db.js
0+      ()
0+  53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      var server_config = [{section: "couch_httpd_auth", key: "iterations",
0+  72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runAllTestsConsole()
0+  85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+
0+
0+not ok 1 rev_stemming
0+Reason: {gen_server,call,
0+        [couch_rep_sup,
0+         {start_child,
0+             {"02ef80d43dbd7871e4a191ce122aa1c8",
0+              {gen_server,start_link,
0+                  [couch_replicator,
0+                   {rep,
0+                       {"02ef80d43dbd7871e4a191ce122aa1c8",[]},
0+                       <<"test_suite_db_a">>,<<"test_suite_db_b">>,
0+                       [{connection_timeout,30000},
0+                        {http_connections,20},
0+                        {retries,10},
0+                        {socket_options,[{keepalive,true},{nodelay,false}]},
0+                        {worker_batch_size,500},
0+                        {worker_processes,4}],
0+                       {user_ctx,null,
0+                           [<<"_admin">>],
0+                           <<"{couch_httpd_auth, default_authentication_handler}">>},
0+                       undefined},
0+                   [{timeout,30000}]]},
0+              temporary,1,worker,
0+              [couch_replicator]}},
0+         infinity]}
0+Trace back (most recent call first):
0+
0+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      CouchError([object Object])
0+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ([object CouchHTTP])
0+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ("test_suite_db_a","test_suite_db_b")
0+  61: share/www/script/test/rev_stemming.js
0+      ()
0+  53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runTestConsole(1,"rev_stemming",(function (debug) {var db = new CouchD
0+  72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runAllTestsConsole()
0+  85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+
0+
0+not ok 1 security_validation
0+Reason: {gen_server,call,
0+        [couch_rep_sup,
0+         {start_child,
0+             {"b93b15c0df513f798fccaa6cbaadd6d9",
0+              {gen_server,start_link,
0+                  [couch_replicator,
0+                   {rep,
0+                       {"b93b15c0df513f798fccaa6cbaadd6d9",[]},
0+                       <<"test_suite_db_a">>,<<"test_suite_db_b">>,
0+                       [{connection_timeout,30000},
0+                        {http_connections,20},
0+                        {retries,10},
0+                        {socket_options,[{keepalive,true},{nodelay,false}]},
0+                        {worker_batch_size,500},
0+                        {worker_processes,4}],
0+                       {user_ctx,<<"Christopher Lenz">>,[],
0+                           <<"{couch_httpd_auth, special_test_authentication_handler}">>},
0+                       undefined},
0+                   [{timeout,30000}]]},
0+              temporary,1,worker,
0+              [couch_replicator]}},
0+         infinity]}
0+Trace back (most recent call first):
0+
0+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      CouchError([object Object])
0+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ([object CouchHTTP])
0+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ("test_suite_db_a","test_suite_db_b",[object Object])
0+ 287: share/www/script/test/security_validation.js
0+      ()
0+ 378: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch_test_runner.js
0+      run_on_modified_server([object Array],(function () {var wrongPasswordD
0+  48: share/www/script/test/security_validation.js
0+      ()
0+  53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runTestConsole(1,"security_validation",(function (debug) {var db = new
0+  72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runAllTestsConsole()
0+  85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+
0+
0+not ok 1 view_conflicts
0+Reason: {gen_server,call,
0+        [couch_rep_sup,
0+         {start_child,
0+             {"b2931760edcee98af7775b5f06a55c9b",
0+              {gen_server,start_link,
0+                  [couch_replicator,
0+                   {rep,
0+                       {"b2931760edcee98af7775b5f06a55c9b",[]},
0+                       <<"test_suite_db_a">>,<<"test_suite_db_b">>,
0+                       [{connection_timeout,30000},
0+                        {http_connections,20},
0+                        {retries,10},
0+                        {socket_options,[{keepalive,true},{nodelay,false}]},
0+                        {worker_batch_size,500},
0+                        {worker_processes,4}],
0+                       {user_ctx,null,
0+                           [<<"_admin">>],
0+                           <<"{couch_httpd_auth, default_authentication_handler}">>},
0+                       undefined},
0+                   [{timeout,30000}]]},
0+              temporary,1,worker,
0+              [couch_replicator]}},
0+         infinity]}
0+Trace back (most recent call first):
0+
0+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      CouchError([object Object])
0+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ([object CouchHTTP])
0+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ("test_suite_db_a","test_suite_db_b")
0+  24: share/www/script/test/view_conflicts.js
0+      ()
0+  53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runTestConsole(1,"view_conflicts",(function (debug) {var dbA = new Cou
0+  72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runAllTestsConsole()
0+  85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+
0+
0+not ok 1 view_include_docs
0+Reason: {gen_server,call,
0+        [couch_rep_sup,
0+         {start_child,
0+             {"f08e95d153b8be94ba7828c24a746e09",
0+              {gen_server,start_link,
0+                  [couch_replicator,
0+                   {rep,
0+                       {"f08e95d153b8be94ba7828c24a746e09",[]},
0+                       <<"test_suite_db_a">>,<<"test_suite_db_b">>,
0+                       [{connection_timeout,30000},
0+                        {http_connections,20},
0+                        {retries,10},
0+                        {socket_options,[{keepalive,true},{nodelay,false}]},
0+                        {worker_batch_size,500},
0+                        {worker_processes,4}],
0+                       {user_ctx,null,
0+                           [<<"_admin">>],
0+                           <<"{couch_httpd_auth, default_authentication_handler}">>},
0+                       undefined},
0+                   [{timeout,30000}]]},
0+              temporary,1,worker,
0+              [couch_replicator]}},
0+         infinity]}
0+Trace back (most recent call first):
0+
0+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      CouchError([object Object])
0+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ([object CouchHTTP])
0+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
0+      ("test_suite_db_a","test_suite_db_b")
0+ 171: share/www/script/test/view_include_docs.js
0+      ()
0+  53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runTestConsole(1,"view_include_docs",(function (debug) {var db = new C
0+  72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
0+      runAllTestsConsole()
0+  85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
--- Revision None
+++ Revision 336133663134
@@ -0,0 +1,385 @@
+not ok 1 form_submit
+Reason: Failed to execute HTTP request: Recv failure: Connection reset by peer
+Trace back (most recent call first):
+
+ 37: /home/klausi/dev/CouchDB/couchdb/test/javascript/couch_http.js
+ ("{}")
+ 425: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ("POST","/test_suite_db/baz",[object Object])
+ 20: share/www/script/test/form_submit.js
+ ()
+ 53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runTestConsole(1,"form_submit",(function (debug) {var db = new CouchDB
+ 72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runAllTestsConsole()
+ 85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+
+
+not ok 1 oauth
+Reason: {gen_server,call,
+ [couch_rep_sup,
+ {start_child,
+ {"ec3764f920bbf0b3908f454c4869581e",
+ {gen_server,start_link,
+ [couch_replicator,
+ {rep,
+ {"ec3764f920bbf0b3908f454c4869581e",[]},
+ {httpdb,"http://127.0.0.1:6922/test_suite_db_a/",
+ {oauth,"key","foo",
+ "3dTucPTCGXSgCEgyO6+X67dFhaxMW9q9m1XEga8IFL2hUWbY+FwlmFjI1dKfVlVs",
+ "AYaybySMkaP8uE53RKRzpN2wtIQhqCaSqsgJEj5yFXfjKxKgYG8cojc5f+BCtb0n",
+ hmac_sha1},
+ [{"Accept","application/json"},
+ {"User-Agent","CouchDB/1.3.0"}],
+ 30000,
+ [{socket_options,[{keepalive,true},{nodelay,false}]}],
+ 10,250,nil,20},
+ {httpdb,"http://127.0.0.1:6922/test_suite_db_b/",nil,
+ [{"Accept","application/json"},
+ {"Authorization","Basic dGVzdGFkbWluOm9oc29zZWNyZXQ="},
+ {"User-Agent","CouchDB/1.3.0"}],
+ 30000,
+ [{socket_options,[{keepalive,true},{nodelay,false}]}],
+ 10,250,nil,20},
+ [{connection_timeout,30000},
+ {http_connections,20},
+ {retries,10},
+ {socket_options,[{keepalive,true},{nodelay,false}]},
+ {worker_batch_size,500},
+ {worker_processes,4}],
+ {user_ctx,<<"testadmin">>,
+ [<<"_admin">>],
+ <<"{couch_httpd_auth, default_authentication_handler}">>},
+ undefined},
+ [{timeout,30000}]]},
+ temporary,1,worker,
+ [couch_replicator]}},
+ infinity]}
+Trace back (most recent call first):
+
+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ CouchError([object Object])
+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ([object CouchHTTP])
+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ([object Object],[object Object],[object Object])
+ 198: share/www/script/test/oauth.js
+ ()
+ 378: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch_test_runner.js
+ run_on_modified_server([object Array],(function () {try {CouchDB.reque
+ 290: share/www/script/test/oauth.js
+ ()
+ 53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ var consumerSecret = generateSecret(64);var tokenSecret = generateSecr
+ 72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runAllTestsConsole()
+ 85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+
+
+not ok 1 purge
+Reason: {gen_server,call,
+ [couch_rep_sup,
+ {start_child,
+ {"acedb74dea7af10fc0c6dcdc2f275362",
+ {gen_server,start_link,
+ [couch_replicator,
+ {rep,
+ {"acedb74dea7af10fc0c6dcdc2f275362",[]},
+ <<"test_suite_db_a">>,<<"test_suite_db_b">>,
+ [{connection_timeout,30000},
+ {http_connections,20},
+ {retries,10},
+ {socket_options,[{keepalive,true},{nodelay,false}]},
+ {worker_batch_size,500},
+ {worker_processes,4}],
+ {user_ctx,null,
+ [<<"_admin">>],
+ <<"{couch_httpd_auth, default_authentication_handler}">>},
+ undefined},
+ [{timeout,30000}]]},
+ temporary,1,worker,
+ [couch_replicator]}},
+ infinity]}
+Trace back (most recent call first):
+
+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ CouchError([object Object])
+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ([object CouchHTTP])
+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ("test_suite_db_a","test_suite_db_b")
+ 125: share/www/script/test/purge.js
+ ()
+ 53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runTestConsole(1,"purge",(function (debug) {var db = new CouchDB("test
+ 72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runAllTestsConsole()
+ 85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+
+
+not ok 1 replication
+Reason: {gen_server,call,
+ [couch_rep_sup,
+ {start_child,
+ {"8766a607cf45695fd1dccd1a60038fae",
+ {gen_server,start_link,
+ [couch_replicator,
+ {rep,
+ {"8766a607cf45695fd1dccd1a60038fae",[]},
+ <<"test_suite_db_a">>,<<"test_suite_db_b">>,
+ [{connection_timeout,30000},
+ {http_connections,20},
+ {retries,10},
+ {socket_options,[{keepalive,true},{nodelay,false}]},
+ {worker_batch_size,500},
+ {worker_processes,4}],
+ {user_ctx,null,
+ [<<"_admin">>],
+ <<"{couch_httpd_auth, default_authentication_handler}">>},
+ undefined},
+ [{timeout,30000}]]},
+ temporary,1,worker,
+ [couch_replicator]}},
+ infinity]}
+Trace back (most recent call first):
+
+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ CouchError([object Object])
+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ([object CouchHTTP])
+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ("test_suite_db_a","test_suite_db_b")
+ 194: share/www/script/test/replication.js
+ ()
+ CouchDB.protocol + host + "/" + sourceDb.name, target: CouchDB.protocol + "joe:erly@" + host + "/" + targetDb.name}];for (i = 0; i < dbPairs.length; i++) {usersDb.deleteDb();populateDb(sourceDb, docs);populateDb(targetDb, []);TEquals(true, targetDb.setSecObj({admins: {names: ["superman"], roles: ["god"]}}).ok);run_on_modified_server(server_config, function () {delete joeUserDoc._rev;TEquals(true, usersDb.save(joeUserDoc).ok);TEquals(true, CouchDB.login("joe", "erly").ok);TEquals("joe", CouchDB.session().userCtx.name);repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);TEquals(true, CouchDB.logout().ok);TEquals(true, repResult.ok);TEquals(docs.length, repResult.history[0].docs_read);TEquals(docs.length - 1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].doc_write_failures);});for (j = 0; j < docs.length; j++) {doc = docs[j];copy = targetDb.open(doc._id);if (doc._id.indexOf("_design/") === 0) {TEquals(null, copy);} else {T(copy !== null);TEquals(true, compareObjects(doc, copy));}}}dbPairs = [{source: sourceDb.name, target: targetDb.name}, {source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name, target: targetDb.name}, {source: sourceDb.name, target: CouchDB.protocol + host + "/" + targetDb.name}, {source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name, target: CouchDB.protocol + host + "/" + targetDb.name}];for (i = 0; i < dbPairs.length; i++) {usersDb.deleteDb();populateDb(sourceDb, docs);populateDb(targetDb, []);TEquals(true, sourceDb.setSecObj({admins: {names: ["superman"], roles: ["god"]}, readers: {names: ["john"], roles: ["secret"]}}).ok);run_on_modified_server(server_config, function () {delete joeUserDoc._rev;TEquals(true, usersDb.save(joeUserDoc).ok);TEquals(true, CouchDB.login("joe", "erly").ok);TEquals("joe", CouchDB.session().userCtx.name);try {CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);T(false, "should have raised an exception");} catch (x) {TEquals("unauthorized", x.error);}TEquals(true, CouchDB.logout().ok);});for (j = 0; j < docs.length; j++) {doc = docs[j];copy = targetDb.open(doc._id);TEquals(null, copy);}}sourceDb = new CouchDB("test_suite_db_a");targetDb = new CouchDB("test_suite_db_b");sourceDb.deleteDb();sourceDb.createDb();targetDb.deleteDb();targetDb.createDb();doc = {_id: "doc1"};TEquals(true, sourceDb.save(doc).ok);repResult = CouchDB.replicate(sourceDb.name, CouchDB.protocol + host + "/" + targetDb.name);TEquals(true, repResult.ok);TEquals(true, repResult.history instanceof Array);TEquals(1, repResult.history.length);TEquals(1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].docs_read);TEquals(0, repResult.history[0].doc_write_failures);doc._attachments = {'hello.txt': {content_type: "text/plain", data: "aGVsbG8gd29ybGQ="}, 'foo.dat': {content_type: "not/compressible", data: "aSBhbSBub3QgZ3ppcGVk"}};TEquals(true, sourceDb.save(doc).ok);repResult = CouchDB.replicate(sourceDb.name, CouchDB.protocol + host + "/" + targetDb.name);TEquals(true, repResult.ok);TEquals(true, repResult.history instanceof Array);TEquals(2, repResult.history.length);TEquals(1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].docs_read);TEquals(0, repResult.history[0].doc_write_failures);copy = targetDb.open(doc._id, {conflicts: true, deleted_conflicts: true, attachments: true, att_encoding_info: true});T(copy !== null);TEquals("undefined", typeof copy._conflicts);TEquals("undefined", typeof copy._deleted_conflicts);TEquals("text/plain", copy._attachments['hello.txt'].content_type);TEquals("aGVsbG8gd29ybGQ=", copy._attachments['hello.txt'].data);TEquals("gzip", copy._attachments['hello.txt'].encoding);TEquals("not/compressible", copy._attachments['foo.dat'].content_type);TEquals("aSBhbSBub3QgZ3ppcGVk", copy._attachments['foo.dat'].data);TEquals("undefined", typeof copy._attachments['foo.dat'].encoding);try {CouchDB.replicate(sourceDb, targetDb, {body: {filter: "mydesign/myfilter", query_params: {maxvalue: 4}}});} catch (e) {TEquals("bad_request", e.error);}populateDb(sourceDb, makeDocs(1, 6));populateDb(targetDb, []);repResult = CouchDB.replicate(CouchDB.protocol + host + "/" + sourceDb.name, targetDb.name, {body: {continuous: true, create_target: true}});TEquals(true, repResult.ok);TEquals("string", typeof repResult._local_id);xhr = CouchDB.request("GET", "/_active_tasks");tasks = JSON.parse(xhr.responseText);var repId;for (j = 0; j < tasks.length; j++) {if (tasks[j].replication_id === repResult._local_id) {repId = tasks[j].replication_id;}}TEquals(repResult._local_id, repId, "Replication found in _active_tasks");xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repId, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(200, xhr.status, "Replication cancel request success");xhr = CouchDB.request("GET", "/_active_tasks");tasks = JSON.parse(xhr.responseText);repId = null;for (j = 0; j < tasks.length; j++) {if (tasks[j].replication_id === repResult._local_id) {repId = tasks[j].replication_id;}}TEquals(null, repId, "Replication was canceled");xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(404, xhr.status, "2nd replication cancel failed");var userDoc = CouchDB.prepareUserDoc({name: "tony", roles: ["mafia"]}, "soprano");usersDb = new CouchDB("test_suite_auth", {'X-Couch-Full-Commit': "false"});server_config = [{section: "couch_httpd_auth", key: "authentication_db", value: usersDb.name}];run_on_modified_server(server_config, function () {populateDb(sourceDb, makeDocs(1, 6));populateDb(targetDb, []);TEquals(true, usersDb.save(userDoc).ok);repResult = CouchDB.replicate(CouchDB.protocol + host + "/" + sourceDb.name, targetDb.name, {body: {continuous: true}});TEquals(true, repResult.ok);TEquals("string", typeof repResult._local_id);TEquals(true, CouchDB.login("tony", "soprano").ok);TEquals("tony", CouchDB.session().userCtx.name);xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(401, xhr.status, "Unauthorized to cancel replication");TEquals("unauthorized", JSON.parse(xhr.responseText).error);TEquals(true, CouchDB.logout().ok);xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(200, xhr.status, "Authorized to cancel replication");});usersDb.deleteDb();sourceDb.deleteDb();targetDb.deleteDb();}))@/home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js:53: " + host + "/" + targetDb.name}, {source
+ docs = makeDocs(1, 21);docs.push({_id: "_design/foo", language: "javas
+ 72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runAllTestsConsole()
+ 85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+
+
+not ok 1 replication
+Reason: {gen_server,call,
+ [couch_rep_sup,
+ {start_child,
+ {"8766a607cf45695fd1dccd1a60038fae",
+ {gen_server,start_link,
+ [couch_replicator,
+ {rep,
+ {"8766a607cf45695fd1dccd1a60038fae",[]},
+ <<"test_suite_db_a">>,<<"test_suite_db_b">>,
+ [{connection_timeout,30000},
+ {http_connections,20},
+ {retries,10},
+ {socket_options,[{keepalive,true},{nodelay,false}]},
+ {worker_batch_size,500},
+ {worker_processes,4}],
+ {user_ctx,null,
+ [<<"_admin">>],
+ <<"{couch_httpd_auth, default_authentication_handler}">>},
+ undefined},
+ [{timeout,30000}]]},
+ temporary,1,worker,
+ [couch_replicator]}},
+ infinity]}
+Trace back (most recent call first):
+
+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ CouchError([object Object])
+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ([object CouchHTTP])
+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ("test_suite_db_a","test_suite_db_b")
+ 194: share/www/script/test/replication.js
+ ()
+ CouchDB.protocol + host + "/" + sourceDb.name, target: CouchDB.protocol + "joe:erly@" + host + "/" + targetDb.name}];for (i = 0; i < dbPairs.length; i++) {usersDb.deleteDb();populateDb(sourceDb, docs);populateDb(targetDb, []);TEquals(true, targetDb.setSecObj({admins: {names: ["superman"], roles: ["god"]}}).ok);run_on_modified_server(server_config, function () {delete joeUserDoc._rev;TEquals(true, usersDb.save(joeUserDoc).ok);TEquals(true, CouchDB.login("joe", "erly").ok);TEquals("joe", CouchDB.session().userCtx.name);repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);TEquals(true, CouchDB.logout().ok);TEquals(true, repResult.ok);TEquals(docs.length, repResult.history[0].docs_read);TEquals(docs.length - 1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].doc_write_failures);});for (j = 0; j < docs.length; j++) {doc = docs[j];copy = targetDb.open(doc._id);if (doc._id.indexOf("_design/") === 0) {TEquals(null, copy);} else {T(copy !== null);TEquals(true, compareObjects(doc, copy));}}}dbPairs = [{source: sourceDb.name, target: targetDb.name}, {source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name, target: targetDb.name}, {source: sourceDb.name, target: CouchDB.protocol + host + "/" + targetDb.name}, {source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name, target: CouchDB.protocol + host + "/" + targetDb.name}];for (i = 0; i < dbPairs.length; i++) {usersDb.deleteDb();populateDb(sourceDb, docs);populateDb(targetDb, []);TEquals(true, sourceDb.setSecObj({admins: {names: ["superman"], roles: ["god"]}, readers: {names: ["john"], roles: ["secret"]}}).ok);run_on_modified_server(server_config, function () {delete joeUserDoc._rev;TEquals(true, usersDb.save(joeUserDoc).ok);TEquals(true, CouchDB.login("joe", "erly").ok);TEquals("joe", CouchDB.session().userCtx.name);try {CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);T(false, "should have raised an exception");} catch (x) {TEquals("unauthorized", x.error);}TEquals(true, CouchDB.logout().ok);});for (j = 0; j < docs.length; j++) {doc = docs[j];copy = targetDb.open(doc._id);TEquals(null, copy);}}sourceDb = new CouchDB("test_suite_db_a");targetDb = new CouchDB("test_suite_db_b");sourceDb.deleteDb();sourceDb.createDb();targetDb.deleteDb();targetDb.createDb();doc = {_id: "doc1"};TEquals(true, sourceDb.save(doc).ok);repResult = CouchDB.replicate(sourceDb.name, CouchDB.protocol + host + "/" + targetDb.name);TEquals(true, repResult.ok);TEquals(true, repResult.history instanceof Array);TEquals(1, repResult.history.length);TEquals(1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].docs_read);TEquals(0, repResult.history[0].doc_write_failures);doc._attachments = {'hello.txt': {content_type: "text/plain", data: "aGVsbG8gd29ybGQ="}, 'foo.dat': {content_type: "not/compressible", data: "aSBhbSBub3QgZ3ppcGVk"}};TEquals(true, sourceDb.save(doc).ok);repResult = CouchDB.replicate(sourceDb.name, CouchDB.protocol + host + "/" + targetDb.name);TEquals(true, repResult.ok);TEquals(true, repResult.history instanceof Array);TEquals(2, repResult.history.length);TEquals(1, repResult.history[0].docs_written);TEquals(1, repResult.history[0].docs_read);TEquals(0, repResult.history[0].doc_write_failures);copy = targetDb.open(doc._id, {conflicts: true, deleted_conflicts: true, attachments: true, att_encoding_info: true});T(copy !== null);TEquals("undefined", typeof copy._conflicts);TEquals("undefined", typeof copy._deleted_conflicts);TEquals("text/plain", copy._attachments['hello.txt'].content_type);TEquals("aGVsbG8gd29ybGQ=", copy._attachments['hello.txt'].data);TEquals("gzip", copy._attachments['hello.txt'].encoding);TEquals("not/compressible", copy._attachments['foo.dat'].content_type);TEquals("aSBhbSBub3QgZ3ppcGVk", copy._attachments['foo.dat'].data);TEquals("undefined", typeof copy._attachments['foo.dat'].encoding);try {CouchDB.replicate(sourceDb, targetDb, {body: {filter: "mydesign/myfilter", query_params: {maxvalue: 4}}});} catch (e) {TEquals("bad_request", e.error);}populateDb(sourceDb, makeDocs(1, 6));populateDb(targetDb, []);repResult = CouchDB.replicate(CouchDB.protocol + host + "/" + sourceDb.name, targetDb.name, {body: {continuous: true, create_target: true}});TEquals(true, repResult.ok);TEquals("string", typeof repResult._local_id);xhr = CouchDB.request("GET", "/_active_tasks");tasks = JSON.parse(xhr.responseText);var repId;for (j = 0; j < tasks.length; j++) {if (tasks[j].replication_id === repResult._local_id) {repId = tasks[j].replication_id;}}TEquals(repResult._local_id, repId, "Replication found in _active_tasks");xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repId, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(200, xhr.status, "Replication cancel request success");xhr = CouchDB.request("GET", "/_active_tasks");tasks = JSON.parse(xhr.responseText);repId = null;for (j = 0; j < tasks.length; j++) {if (tasks[j].replication_id === repResult._local_id) {repId = tasks[j].replication_id;}}TEquals(null, repId, "Replication was canceled");xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(404, xhr.status, "2nd replication cancel failed");var userDoc = CouchDB.prepareUserDoc({name: "tony", roles: ["mafia"]}, "soprano");usersDb = new CouchDB("test_suite_auth", {'X-Couch-Full-Commit': "false"});server_config = [{section: "couch_httpd_auth", key: "authentication_db", value: usersDb.name}];run_on_modified_server(server_config, function () {populateDb(sourceDb, makeDocs(1, 6));populateDb(targetDb, []);TEquals(true, usersDb.save(userDoc).ok);repResult = CouchDB.replicate(CouchDB.protocol + host + "/" + sourceDb.name, targetDb.name, {body: {continuous: true}});TEquals(true, repResult.ok);TEquals("string", typeof repResult._local_id);TEquals(true, CouchDB.login("tony", "soprano").ok);TEquals("tony", CouchDB.session().userCtx.name);xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(401, xhr.status, "Unauthorized to cancel replication");TEquals("unauthorized", JSON.parse(xhr.responseText).error);TEquals(true, CouchDB.logout().ok);xhr = CouchDB.request("POST", "/_replicate", {body: JSON.stringify({replication_id: repResult._local_id, cancel: true}), headers: {'Content-Type': "application/json"}});TEquals(200, xhr.status, "Authorized to cancel replication");});usersDb.deleteDb();sourceDb.deleteDb();targetDb.deleteDb();}))@/home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js:53: " + host + "/" + targetDb.name}, {source
+ docs = makeDocs(1, 21);docs.push({_id: "_design/foo", language: "javas
+ 72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runAllTestsConsole()
+ 85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+
+
+not ok 1 replicator_db
+Reason: false
+Trace back (most recent call first):
+
+ 46: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ T(false)
+ 116: share/www/script/test/replicator_db.js
+ simple_replication()
+ 378: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch_test_runner.js
+ run_on_modified_server([object Array],simple_replication)
+ 1461: share/www/script/test/replicator_db.js
+ ()
+ 53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ var server_config = [{section: "couch_httpd_auth", key: "iterations",
+ 72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runAllTestsConsole()
+ 85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+
+
+not ok 1 rev_stemming
+Reason: {gen_server,call,
+ [couch_rep_sup,
+ {start_child,
+ {"02ef80d43dbd7871e4a191ce122aa1c8",
+ {gen_server,start_link,
+ [couch_replicator,
+ {rep,
+ {"02ef80d43dbd7871e4a191ce122aa1c8",[]},
+ <<"test_suite_db_a">>,<<"test_suite_db_b">>,
+ [{connection_timeout,30000},
+ {http_connections,20},
+ {retries,10},
+ {socket_options,[{keepalive,true},{nodelay,false}]},
+ {worker_batch_size,500},
+ {worker_processes,4}],
+ {user_ctx,null,
+ [<<"_admin">>],
+ <<"{couch_httpd_auth, default_authentication_handler}">>},
+ undefined},
+ [{timeout,30000}]]},
+ temporary,1,worker,
+ [couch_replicator]}},
+ infinity]}
+Trace back (most recent call first):
+
+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ CouchError([object Object])
+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ([object CouchHTTP])
+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ("test_suite_db_a","test_suite_db_b")
+ 61: share/www/script/test/rev_stemming.js
+ ()
+ 53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runTestConsole(1,"rev_stemming",(function (debug) {var db = new CouchD
+ 72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runAllTestsConsole()
+ 85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+
+
+not ok 1 security_validation
+Reason: {gen_server,call,
+ [couch_rep_sup,
+ {start_child,
+ {"b93b15c0df513f798fccaa6cbaadd6d9",
+ {gen_server,start_link,
+ [couch_replicator,
+ {rep,
+ {"b93b15c0df513f798fccaa6cbaadd6d9",[]},
+ <<"test_suite_db_a">>,<<"test_suite_db_b">>,
+ [{connection_timeout,30000},
+ {http_connections,20},
+ {retries,10},
+ {socket_options,[{keepalive,true},{nodelay,false}]},
+ {worker_batch_size,500},
+ {worker_processes,4}],
+ {user_ctx,<<"Christopher Lenz">>,[],
+ <<"{couch_httpd_auth, special_test_authentication_handler}">>},
+ undefined},
+ [{timeout,30000}]]},
+ temporary,1,worker,
+ [couch_replicator]}},
+ infinity]}
+Trace back (most recent call first):
+
+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ CouchError([object Object])
+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ([object CouchHTTP])
+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ("test_suite_db_a","test_suite_db_b",[object Object])
+ 287: share/www/script/test/security_validation.js
+ ()
+ 378: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch_test_runner.js
+ run_on_modified_server([object Array],(function () {var wrongPasswordD
+ 48: share/www/script/test/security_validation.js
+ ()
+ 53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runTestConsole(1,"security_validation",(function (debug) {var db = new
+ 72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runAllTestsConsole()
+ 85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+
+
+not ok 1 view_conflicts
+Reason: {gen_server,call,
+ [couch_rep_sup,
+ {start_child,
+ {"b2931760edcee98af7775b5f06a55c9b",
+ {gen_server,start_link,
+ [couch_replicator,
+ {rep,
+ {"b2931760edcee98af7775b5f06a55c9b",[]},
+ <<"test_suite_db_a">>,<<"test_suite_db_b">>,
+ [{connection_timeout,30000},
+ {http_connections,20},
+ {retries,10},
+ {socket_options,[{keepalive,true},{nodelay,false}]},
+ {worker_batch_size,500},
+ {worker_processes,4}],
+ {user_ctx,null,
+ [<<"_admin">>],
+ <<"{couch_httpd_auth, default_authentication_handler}">>},
+ undefined},
+ [{timeout,30000}]]},
+ temporary,1,worker,
+ [couch_replicator]}},
+ infinity]}
+Trace back (most recent call first):
+
+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ CouchError([object Object])
+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ([object CouchHTTP])
+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ("test_suite_db_a","test_suite_db_b")
+ 24: share/www/script/test/view_conflicts.js
+ ()
+ 53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runTestConsole(1,"view_conflicts",(function (debug) {var dbA = new Cou
+ 72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runAllTestsConsole()
+ 85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+
+
+not ok 1 view_include_docs
+Reason: {gen_server,call,
+ [couch_rep_sup,
+ {start_child,
+ {"f08e95d153b8be94ba7828c24a746e09",
+ {gen_server,start_link,
+ [couch_replicator,
+ {rep,
+ {"f08e95d153b8be94ba7828c24a746e09",[]},
+ <<"test_suite_db_a">>,<<"test_suite_db_b">>,
+ [{connection_timeout,30000},
+ {http_connections,20},
+ {retries,10},
+ {socket_options,[{keepalive,true},{nodelay,false}]},
+ {worker_batch_size,500},
+ {worker_processes,4}],
+ {user_ctx,null,
+ [<<"_admin">>],
+ <<"{couch_httpd_auth, default_authentication_handler}">>},
+ undefined},
+ [{timeout,30000}]]},
+ temporary,1,worker,
+ [couch_replicator]}},
+ infinity]}
+Trace back (most recent call first):
+
+ 508: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ CouchError([object Object])
+ 471: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ([object CouchHTTP])
+ 369: /home/klausi/dev/CouchDB/couchdb/share/www/script/couch.js
+ ("test_suite_db_a","test_suite_db_b")
+ 171: share/www/script/test/view_include_docs.js
+ ()
+ 53: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runTestConsole(1,"view_include_docs",(function (debug) {var db = new C
+ 72: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js
+ runAllTestsConsole()
+ 85: /home/klausi/dev/CouchDB/couchdb/test/javascript/cli_runner.js