diff options
author | azul <azul@riseup.net> | 2013-03-14 07:36:54 -0700 |
---|---|---|
committer | azul <azul@riseup.net> | 2013-03-14 07:36:54 -0700 |
commit | 869ba2f363a48d0f76321efc08a228f54aeb6758 (patch) | |
tree | 00944b79cd5abb5058ac2ea432c32ea433b1aebd /test | |
parent | 886585a0f673e0ea70abb99504ff9c70180361d5 (diff) | |
parent | 1f874dc62e0d0add285f6ab5ff1b6d8fccaa1912 (diff) |
Merge pull request #37 from azul/feature/migration-flow
Migration flow for couch db
Diffstat (limited to 'test')
-rw-r--r-- | test/config/couchdb.yml.admin | 6 | ||||
-rw-r--r-- | test/config/couchdb.yml.user | 5 | ||||
-rwxr-xr-x | test/setup_couch.sh | 15 |
3 files changed, 26 insertions, 0 deletions
diff --git a/test/config/couchdb.yml.admin b/test/config/couchdb.yml.admin new file mode 100644 index 0000000..0988bc1 --- /dev/null +++ b/test/config/couchdb.yml.admin @@ -0,0 +1,6 @@ +test: + auto_update_design_doc: false + username: "anna" + password: "secret" + prefix: "" + diff --git a/test/config/couchdb.yml.user b/test/config/couchdb.yml.user new file mode 100644 index 0000000..9c8b67b --- /dev/null +++ b/test/config/couchdb.yml.user @@ -0,0 +1,5 @@ +test: + auto_update_design_doc: false + username: "me" + password: "pwd" + prefix: "" diff --git a/test/setup_couch.sh b/test/setup_couch.sh new file mode 100755 index 0000000..39e264f --- /dev/null +++ b/test/setup_couch.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +HOST="http://localhost:5984" +echo "creating user :" +curl -HContent-Type:application/json -XPUT $HOST/_users/org.couchdb.user:me --data-binary '{"_id": "org.couchdb.user:me","name": "me","roles": [],"type": "user","password": "pwd"}' +echo "creating databases :" +curl -X PUT $HOST/sessions +curl -X PUT $HOST/users +curl -X PUT $HOST/tickets +echo "restricting database access :" +curl -X PUT $HOST/sessions/_security -Hcontent-type:application/json --data-binary '{"admins":{"names":[],"roles":[]},"members":{"names":["me"],"roles":[]}}' +curl -X PUT $HOST/users/_security -Hcontent-type:application/json --data-binary '{"admins":{"names":[],"roles":[]},"members":{"names":["me"],"roles":[]}}' +curl -X PUT $HOST/tickets/_security -Hcontent-type:application/json --data-binary '{"admins":{"names":[],"roles":[]},"members":{"names":["me"],"roles":[]}}' +echo "adding admin :" +curl -X PUT $HOST/_config/admins/anna -d '"secret"' |