nickva commented on PR #5639:
URL: https://github.com/apache/couchdb/pull/5639#issuecomment-3260612444

   To test it, start a dev cluster should see a message about all the loaded OS 
CA certs in the log:
   
   ```
   couch_replicator_sup : successfully loaded 154 os ca certificates
   ```
   
   Then get an account behind a properly setup tls server with certs all in 
order and can use this test script to:
   
   ```shell
   #!/bin/bash
   
   # ./dev/run --admin=adm:pass -n 1
   # then set $TDB to some remote account with https and proper certs set up
   
   TDB='https://myuser:[email protected]/target'
   SRV=http://adm:pass@localhost:15984
   SDB=${SRV}/src
   REP=${SRV}/_replicator
   
   JSON="Content-Type: application/json"
   
   echo "Setting 'verify_ssl_certificates = true'"
   curl -s -XPUT $SRV/_node/_local/_config/replicator/verify_ssl_certificates 
X-Couch-Persist:false -d '"true"'
   
   echo "Cleaning up old source, target and _replicator"
   curl -s -XDELETE $SDB > /dev/null
   curl -s -XDELETE $TDB > /dev/null
   curl -s -XDELETE $REP > /dev/null
   
   sleep 1
   echo "Creating _replicator"
   curl -f -s -XPUT $REP > /dev/null
   
   sleep 1
   echo "Creating source and target"
   curl -f -s -XPUT $TDB > /dev/null
   curl -f -s -XPUT $SDB > /dev/null
   
   echo "Posting replication job"
   curl -f -XPUT $REP/job -H "$JSON" -d "{\"source\":\"${SDB}\", 
\"target\":\"${TDB}\", \"continuous\":true}"
   
   sleep 2
   echo ""
   echo "Adding docs to source and checking when they appear on target"
   echo ""
   
   DOCID=0
   while true; do
       let DOCID++
       echo "Adding doc $DOCID"
       curl -f -s -XPUT $SDB/$DOCID -H "$JSON" -d '{}' > /dev/null
       sleep 1
       TGT_DOC_COUNT=`curl -s ${TDB} | jq '.doc_count'`
       echo "Target doc count: $TGT_DOC_COUNT"
       sleep 1
   done
   ```
   
   The job should start in about 10-15 seconds and doc ids should match and 
logs shouldn't show any crashes. I got something like this replicating to a 
cloudant account from my local machine:
   
   ```
   ...
   Adding docs to source and checking when they appear on target
   
   Adding doc 1
   Target doc count: 0
   Adding doc 2
   Target doc count: 0
   Adding doc 3
   Target doc count: 0
   Adding doc 4
   Target doc count: 0
   Adding doc 5
   Target doc count: 0
   Adding doc 6
   Target doc count: 0
   Adding doc 7
   Target doc count: 0
   Adding doc 8
   Target doc count: 0
   Adding doc 9
   Target doc count: 0
   Adding doc 10
   Target doc count: 0
   Adding doc 11
   Target doc count: 0
   Adding doc 12
   Target doc count: 0
   Adding doc 13
   Target doc count: 0
   Adding doc 14
   Target doc count: 14
   Adding doc 15
   Target doc count: 15
   Adding doc 16
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to