You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2014/11/07 15:46:43 UTC

[19/23] couchdb-setup git commit: add simple test script

add simple test script


Project: http://git-wip-us.apache.org/repos/asf/couchdb-setup/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-setup/commit/fc39fab4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-setup/tree/fc39fab4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-setup/diff/fc39fab4

Branch: refs/heads/master
Commit: fc39fab4ed8f1492785d5d510307db9d2ac2a082
Parents: 92da54e
Author: Jan Lehnardt <ja...@apache.org>
Authored: Fri Nov 7 15:01:52 2014 +0100
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Nov 7 15:01:52 2014 +0100

----------------------------------------------------------------------
 test/t.sh | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-setup/blob/fc39fab4/test/t.sh
----------------------------------------------------------------------
diff --git a/test/t.sh b/test/t.sh
new file mode 100755
index 0000000..7b1ca1b
--- /dev/null
+++ b/test/t.sh
@@ -0,0 +1,34 @@
+#!/bin/sh -ex
+
+HEADERS="-HContent-Type:application/json"
+# show cluster state:
+curl a:b@127.0.0.1:15986/nodes/_all_docs
+
+# Enable Cluster on node A
+curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"enable_cluster","username":"foo","password":"baz","bind_address":"0.0.0.0"}' $HEADERS
+
+# Enable Cluster on node B
+curl a:b@127.0.0.1:25984/_cluster_setup -d '{"action":"enable_cluster","username":"foo","password":"baz","bind_address":"0.0.0.0"}' $HEADERS
+
+# Add node B on node A
+curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"add_node","username":"foo","password":"baz","host":"127.0.0.1","port":25984}' $HEADERS
+
+# Show cluster state:
+curl a:b@127.0.0.1:15986/nodes/_all_docs
+
+# Show db doesn’t exist on node A
+curl a:b@127.0.0.1:15984/foo
+
+# Show db doesn’t exist on node B
+curl a:b@127.0.0.1:25984/foo
+
+# Create database (on node A)
+curl -X PUT a:b@127.0.0.1:15984/foo
+
+# Show db does exist on node A
+curl a:b@127.0.0.1:15984/foo
+
+# Show db does exist on node B
+curl a:b@127.0.0.1:25984/foo
+
+echo "YAY ALL GOOD"
\ No newline at end of file