From f70366e27aaac985c876d1d0260d7aab8b7ed8b5 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 6 Mar 2013 11:43:49 +0100 Subject: simulate couch migration workflow on travis * first setup couch similar to what we'll have on the platform * then run migrations as admin * then drop admin privileges * then proceed with the normal test script --- test/setup_couch.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 test/setup_couch.sh (limited to 'test/setup_couch.sh') 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"' -- cgit v1.2.3