Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BVT for couchdb

 - Update assets submodule pointer

 -- Rebased based on elasticsearch bvt check-in

Change-Id: I1350d890d8f072b4101b39e1d35d8b833dd5d6fa
  • Loading branch information...
commit 3d35739229f18b8bf435820f2e0d5b271bb856ad 1 parent c3bdcf5
Harshawardhan Gadgil authored
2  assets
@@ -1 +1 @@
-Subproject commit edc11c9ae657460ece80f07e900b3782a69fadbe
+Subproject commit 5d4601dd8e5e1a33efcf1f26464768335c1c60f7
View
14 features/couchdb.feature
@@ -0,0 +1,14 @@
+Feature: couchdb service binding and app deployment
+
+ In order to use couchdb service in cloud foundry
+ As the VMC user
+ I want to deploy my app against couchdb service
+
+ @creates_couchdb_service @creates_couchdb_app
+ Scenario: deploy simple couchdb application
+ Given I am registered
+ Given I have provisioned a couchdb service
+ Given I have deployed a couchdb application that is bound to this service
+ Given I put a document in my couchdb service through my application
+ When I put a document in my couchdb service through my application
+ Then I should be able to get the document for the key
View
35 features/step_definitions/couchdb_steps.rb
@@ -0,0 +1,35 @@
+# Simple couchdb Application that uses the couchdb high performance key-value service
+
+Given /^I have provisioned a couchdb service$/ do
+ pending unless find_service 'couchdb'
+ @couchdb_service = provision_couchdb_service @token
+ @couchdb_service.should_not == nil
+end
+
+Given /^I have deployed a couchdb application that is bound to this service$/ do
+ @app = create_app COUCHDB_APP, @token
+ attach_provisioned_service @app, @couchdb_service, @token
+ upload_app @app, @token
+ start_app @app, @token
+ expected_health = 1.0
+ health = poll_until_done @app, expected_health, @token
+ health.should == expected_health
+end
+
+When /^I put a document in my couchdb service through my application$/ do
+ uri = get_uri(@app, "storeincouchdb")
+ r = post_record_no_close(uri, { :key => 'foo', :value => 'bar'})
+ r.response_code.should == 200
+ r.close
+end
+
+Then /^I should be able to get the document for the key$/ do
+ uri = get_uri @app, "getfromcouchdb/foo"
+ response = get_uri_contents uri
+ response.should_not == nil
+ response.response_code.should == 200
+ contents = JSON.parse response.body_str
+ contents["requested_key"].should == "foo"
+ contents["value"].should == "bar"
+ response.close
+end
View
13 features/support/env.rb
@@ -66,6 +66,7 @@
AUTO_RECONFIG_ANNOTATION_APP="auto-reconfig-annotation-app"
MEMCACHED_APP = "memcached_app"
ELASTICSEARCH_APP = "elasticsearch_app"
+COUCHDB_APP = "couchdb_app"
class Fixnum
def to_json(options = nil)
@@ -202,6 +203,7 @@ def cleanup
delete_app_internal(SERVICE_QUOTA_APP)
delete_app_internal(MEMCACHED_APP)
delete_app_internal(ELASTICSEARCH_APP)
+ delete_app_internal(COUCHDB_APP)
delete_services(all_my_services) unless @registered_user or !get_login_token
# This used to delete the entire user, but that now requires admin
# privs so it was removed, as was the delete_user method. See the
@@ -692,6 +694,17 @@ def provision_memcached_service token
}
end
+ def provision_couchdb_service token
+ name = "#{@namespace}#{@app || 'couchdb_app'}couchdb"
+ @client.create_service(:couchdb, name)
+ service_manifest = {
+ :vendor=>"couchdb",
+ :tier=>"free",
+ :version=>"1.2",
+ :name=>name
+ }
+ end
+
def provision_atmos_service token
name = "#{@namespace}#{@app || 'simple_atmos_app'}atmos"
@client.create_service(:atmos, name)
View
13 features/support/hooks.rb
@@ -109,6 +109,10 @@
AppCloudHelper.instance.delete_app_internal MEMCACHED_APP
end
+After("@creates_couchdb_app") do
+ AppCloudHelper.instance.delete_app_internal COUCHDB_APP
+end
+
at_exit do
AppCloudHelper.instance.cleanup
end
@@ -238,3 +242,12 @@
After("@creates_elasticsearch_service") do |scenario|
delete_service @elasticsearch_service[:name] if @elasticsearch_service
end
+
+# couchdb
+After("@creates_couchdb_app") do |scenario|
+ delete_app @app, @token if @app
+end
+
+After("@creates_couchdb_service") do |scenario|
+ delete_service @couchdb_service[:name] if @couchdb_service
+end
View
5 features/support/testconfig.yml
@@ -262,6 +262,11 @@ memcached_app:
memory: 64
path: "assets/sinatra/memcached_app"
+couchdb_app:
+ framework: "http://b20nine.com/unknown"
+ memory: 64
+ path: "assets/sinatra/couchdb_app"
+
neo4j_app:
framework: "http://b20nine.com/unknown"
memory: 128
Please sign in to comment.
Something went wrong with that request. Please try again.