You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2011/03/30 15:31:10 UTC
Initial RackSpace unit tests (rev 2)
Hi,
This new patchset contains mock data recorded by 'VCR' gem[1].
It's a very nice gem that we can use to record communication
between cloudservers gem and rackspace.
Recorded fixtures are stored in tests/rackspace/fixtures and those
are just plain YAML files.
To 'replay' you can do: rake test:rackspace, which will perfectly 'emulate'
communication with Rackspace.
To record new 'cassettes' you need to change username and api key and:
c.default_cassette_options = { :record => :new_episodes } to
c.default_cassette_options = { :record => :all }
in setup.rb inside tests/drivers/rackspace directory.
-- Michal
NOTE: Username and API key are obsoleted, so you can no longer use it against Rackspace :-)
PS: Working on Mock driver right now, seems like it's broken somehow.
[1] http://relishapp.com/myronmarston/vcr
-- Michal
[PATCH core 2/3] Fixed Rackspace driver error code when you're trying to get non-existing instance Removed extra call to images when you're starting a new instance.
Posted by mf...@redhat.com.
From: Michal Fojtik <mf...@redhat.com>
---
.../drivers/rackspace/rackspace_driver.rb | 15 +++++++++------
server/server.rb | 8 +++-----
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb b/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
index 4363580..c0c93e4 100644
--- a/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
+++ b/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
@@ -154,13 +154,16 @@ class RackspaceDriver < Deltacloud::BaseDriver
insts = []
safely do
- if opts[:id]
- server = rs.get_server(opts[:id].to_i)
- insts << convert_instance_after_create(server, credentials.user)
- else
- insts = rs.list_servers_detail.collect do |server|
- convert_instance(server, credentials.user)
+ begin
+ if opts[:id]
+ server = rs.get_server(opts[:id].to_i)
+ insts << convert_instance_after_create(server, credentials.user)
+ else
+ insts = rs.list_servers_detail.collect do |server|
+ convert_instance(server, credentials.user)
+ end
end
+ rescue CloudServers::Exception::ItemNotFound
end
end
diff --git a/server/server.rb b/server/server.rb
index 3c4273c..05b715c 100644
--- a/server/server.rb
+++ b/server/server.rb
@@ -363,17 +363,15 @@ END
param :realm_id, :string, :optional
param :hwp_id, :string, :optional
control do
- @image = driver.image(credentials, :id => params[:image_id])
- instance = driver.create_instance(credentials, @image.id, params)
+ @instance = driver.create_instance(credentials, params[:image_id], params)
respond_to do |format|
format.xml do
response.status = 201 # Created
- response['Location'] = instance_url(instance.id)
- @instance = instance
+ response['Location'] = instance_url(@instance.id)
haml :"instances/show"
end
format.html do
- redirect instance_url(instance.id) if instance and instance.id
+ redirect instance_url(@instance.id) if @instance and @instance.id
redirect instances_url
end
end
--
1.7.4.1
[PATCH core 3/3] Added VCR gem to recort Test::Unit
Posted by mf...@redhat.com.
From: Michal Fojtik <mf...@redhat.com>
---
server/Gemfile | 2 +
server/tests/common.rb | 17 ++-
server/tests/drivers/rackspace/instances_test.rb | 31 ++--
server/tests/drivers/rackspace/setup.rb | 11 +-
.../11c8bc2b7e52a46b9a004dd40c2512dd3c489f64.yml | 196 +++++++++++++++++++
.../1f3658efb8b59ffcd7e73860fafffa3bd95e02f5.yml | 79 ++++++++
.../25f930c42a61cf5e4e966e351590ae20345ad30e.yml | 79 ++++++++
.../30691ff4842a33afdbcc653195b1bd4ec93bd644.yml | 77 ++++++++
.../3573bb0263b44db6f99a809f92047289108e604f.yml | 198 ++++++++++++++++++++
.../3c394d211d025518184ec6a793eb906c901045c1.yml | 196 +++++++++++++++++++
.../3f559471f7f352032117bfa6a521415b928d67a5.yml | 79 ++++++++
.../57833ca12de5561f349e567f6278da04fefc4880.yml | 118 ++++++++++++
.../7115e1f7a3a156de28733eb38670635bd4a67824.yml | 79 ++++++++
.../86c5bac6a91239044d567c41ee7061850753aceb.yml | 77 ++++++++
.../9357e09a4d550b4e9608549638d13a7bd68b1ceb.yml | 118 ++++++++++++
.../9663e49d06662082f6be10bec846857ddb1a2b66.yml | 79 ++++++++
.../ad0d40707087d6f351926eada3e98a6dc08a5e38.yml | 77 ++++++++
.../b3475ee551d099862e0123ec4d7a38f96f031f5e.yml | 79 ++++++++
.../b4db99458905e95872d37bf8484c3af7dc41d264.yml | 75 ++++++++
.../c02df61167a57ada65fafcaa985357a91314f930.yml | 79 ++++++++
.../c3bd10b31498023723c8c5ff8de08a900469d62b.yml | 79 ++++++++
.../cc7ccfa2f6e74357956824051e8360d7f0751004.yml | 77 ++++++++
.../ccbb5c591ed1b2c1a3d4233329c9475a9965ba2d.yml | 79 ++++++++
.../e306158847e6efd491e1b51770012a76b010d81a.yml | 75 ++++++++
.../e5f1a88e1991237fb416428685888ad232604fa1.yml | 36 ++++
.../eff069c1da23b5e703dc9894dbb9186a6c3fd8d2.yml | 79 ++++++++
.../f2349b91a95d0d93889416e7fc17f2187140247b.yml | 79 ++++++++
27 files changed, 2229 insertions(+), 21 deletions(-)
create mode 100644 server/tests/rackspace/fixtures/11c8bc2b7e52a46b9a004dd40c2512dd3c489f64.yml
create mode 100644 server/tests/rackspace/fixtures/1f3658efb8b59ffcd7e73860fafffa3bd95e02f5.yml
create mode 100644 server/tests/rackspace/fixtures/25f930c42a61cf5e4e966e351590ae20345ad30e.yml
create mode 100644 server/tests/rackspace/fixtures/30691ff4842a33afdbcc653195b1bd4ec93bd644.yml
create mode 100644 server/tests/rackspace/fixtures/3573bb0263b44db6f99a809f92047289108e604f.yml
create mode 100644 server/tests/rackspace/fixtures/3c394d211d025518184ec6a793eb906c901045c1.yml
create mode 100644 server/tests/rackspace/fixtures/3f559471f7f352032117bfa6a521415b928d67a5.yml
create mode 100644 server/tests/rackspace/fixtures/57833ca12de5561f349e567f6278da04fefc4880.yml
create mode 100644 server/tests/rackspace/fixtures/7115e1f7a3a156de28733eb38670635bd4a67824.yml
create mode 100644 server/tests/rackspace/fixtures/86c5bac6a91239044d567c41ee7061850753aceb.yml
create mode 100644 server/tests/rackspace/fixtures/9357e09a4d550b4e9608549638d13a7bd68b1ceb.yml
create mode 100644 server/tests/rackspace/fixtures/9663e49d06662082f6be10bec846857ddb1a2b66.yml
create mode 100644 server/tests/rackspace/fixtures/ad0d40707087d6f351926eada3e98a6dc08a5e38.yml
create mode 100644 server/tests/rackspace/fixtures/b3475ee551d099862e0123ec4d7a38f96f031f5e.yml
create mode 100644 server/tests/rackspace/fixtures/b4db99458905e95872d37bf8484c3af7dc41d264.yml
create mode 100644 server/tests/rackspace/fixtures/c02df61167a57ada65fafcaa985357a91314f930.yml
create mode 100644 server/tests/rackspace/fixtures/c3bd10b31498023723c8c5ff8de08a900469d62b.yml
create mode 100644 server/tests/rackspace/fixtures/cc7ccfa2f6e74357956824051e8360d7f0751004.yml
create mode 100644 server/tests/rackspace/fixtures/ccbb5c591ed1b2c1a3d4233329c9475a9965ba2d.yml
create mode 100644 server/tests/rackspace/fixtures/e306158847e6efd491e1b51770012a76b010d81a.yml
create mode 100644 server/tests/rackspace/fixtures/e5f1a88e1991237fb416428685888ad232604fa1.yml
create mode 100644 server/tests/rackspace/fixtures/eff069c1da23b5e703dc9894dbb9186a6c3fd8d2.yml
create mode 100644 server/tests/rackspace/fixtures/f2349b91a95d0d93889416e7fc17f2187140247b.yml
diff --git a/server/Gemfile b/server/Gemfile
index 211cec8..98569e3 100644
--- a/server/Gemfile
+++ b/server/Gemfile
@@ -38,6 +38,8 @@ group :test do
gem 'ruby-debug', :platforms => :mri_18
gem 'ruby-debug19', :platforms => :mri_19, :require => 'ruby-debug'
gem "compass"
+ gem "vcr"
+ gem "webmock"
gem "nokogiri"
gem "rack-test"
gem "ci_reporter"
diff --git a/server/tests/common.rb b/server/tests/common.rb
index e134388..d15ba92 100644
--- a/server/tests/common.rb
+++ b/server/tests/common.rb
@@ -60,21 +60,32 @@ module DeltacloudTestCommon
"#{url}"
end
+ require 'digest/sha1'
+
def do_request(uri, params=nil, authentication=false, opts={ :format => :xml })
header 'Accept', accept_header(opts[:format])
- get create_url(uri), params || {}, (authentication) ? authenticate(opts) : {}
+ VCR.use_cassette(Digest::SHA1.hexdigest("#{uri}-#{params}-#{authentication}")) do
+ get create_url(uri), params || {}, (authentication) ? authenticate(opts) : {}
+ end
end
def do_xml_request(uri, params=nil, authentication=false)
header 'Accept', accept_header(:xml)
- get create_url(uri), params || {}, (authentication) ? authenticate : {}
- puts "[401] Authentication required to get #{uri}" if last_response.status == 401
+ VCR.use_cassette(Digest::SHA1.hexdigest("#{uri}-#{params}-#{(authentication) ? authenticate : ''}")) do
+ get create_url(uri), params || {}, (authentication) ? authenticate : {}
+ end
if last_response.status == 200
@xml_response = false
@xml_response = Nokogiri::XML(last_response.body)
end
end
+ def do_post(uri, params, authentication)
+ VCR.use_cassette(Digest::SHA1.hexdigest("#{uri}-#{params}-#{(authentication) ? authenticate : ''}")) do
+ post uri, params, authentication ? authenticate : nil
+ end
+ end
+
def require_authentication?(uri)
get uri, {}
true if last_response.status.eql?(401)
diff --git a/server/tests/drivers/rackspace/instances_test.rb b/server/tests/drivers/rackspace/instances_test.rb
index fc1af4f..2de2ac1 100644
--- a/server/tests/drivers/rackspace/instances_test.rb
+++ b/server/tests/drivers/rackspace/instances_test.rb
@@ -16,7 +16,7 @@ module RackspaceTest
:'api[driver]' => 'rackspace',
}
header 'Accept', accept_header(:xml)
- post '/api/instances', params, authenticate
+ do_post '/api/instances', params, authenticate
last_response.status.should == 201 # Created
@@instance = Nokogiri::XML(last_response.body)
(@@instance/'instance').length.should > 0
@@ -34,7 +34,7 @@ module RackspaceTest
:'api[driver]' => 'rackspace',
}
header 'Accept', accept_header(:xml)
- post '/api/instances', params, authenticate
+ do_post '/api/instances', params, authenticate
last_response.status.should == 201 # Created
@@instance2 = Nokogiri::XML(last_response.body)
(@@instance2/'instance').length.should > 0
@@ -80,8 +80,8 @@ module RackspaceTest
end
def test_04_01_created_instance_goes_to_running_state
- 20.times do
- do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", {}, true
+ 20.times do |tick|
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", { :tick => tick}, true
last_response.status.should_not == 500
state = (last_xml_response/'instance/state').first.text
break if state=='RUNNING'
@@ -98,8 +98,8 @@ module RackspaceTest
end
def test_04_02_created_instance_goes_to_running_state
- 20.times do
- do_xml_request "/api;driver=rackspace/instances/#{(@@instance2/'instance').first[:id]}", {}, true
+ 20.times do |tick|
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance2/'instance').first[:id]}", { :tick => tick}, true
last_response.status.should_not == 500
state = (last_xml_response/'instance/state').first.text
break if state=='RUNNING'
@@ -120,10 +120,10 @@ module RackspaceTest
:'api[driver]' => 'rackspace',
}
header 'Accept', accept_header(:xml)
- post "/api/instances/#{(@@instance/'instance').first[:id]}/reboot", params, authenticate
+ do_post "/api/instances/#{(@@instance/'instance').first[:id]}/reboot", params, authenticate
last_response.status.should == 200
- 20.times do
- do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", {}, true
+ 20.times do |tick|
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", { :tick => tick}, true
last_response.status.should_not == 500
state = (last_xml_response/'instance/state').first.text
break if state=='RUNNING'
@@ -136,10 +136,10 @@ module RackspaceTest
:'api[driver]' => 'rackspace',
}
header 'Accept', accept_header(:xml)
- post "/api/instances/#{(@@instance/'instance').first[:id]}/stop", params, authenticate
+ do_post "/api/instances/#{(@@instance/'instance').first[:id]}/stop", params, authenticate
last_response.status.should == 200
- 20.times do
- do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", {}, true
+ 20.times do |tick|
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", { :tick => tick}, true
last_response.status.should_not == 500
break if last_response.status == 404
sleep(5)
@@ -152,16 +152,15 @@ module RackspaceTest
:'api[driver]' => 'rackspace',
}
header 'Accept', accept_header(:xml)
- post "/api/instances/#{(@@instance2/'instance').first[:id]}/stop", params, authenticate
+ do_post "/api/instances/#{(@@instance2/'instance').first[:id]}/stop", params, authenticate
last_response.status.should == 200
- 20.times do
- do_xml_request "/api;driver=rackspace/instances/#{(@@instance2/'instance').first[:id]}", {}, true
+ 20.times do |tick|
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance2/'instance').first[:id]}", { :tick => tick}, true
last_response.status.should_not == 500
break if last_response.status == 404
sleep(5)
end
last_response.status.should == 404
end
-
end
end
diff --git a/server/tests/drivers/rackspace/setup.rb b/server/tests/drivers/rackspace/setup.rb
index 723ed7a..7370d84 100644
--- a/server/tests/drivers/rackspace/setup.rb
+++ b/server/tests/drivers/rackspace/setup.rb
@@ -1,3 +1,10 @@
ENV['API_DRIVER'] = "rackspace"
-ENV['API_USER'] = '<RACKSPACE_USERNAME>'
-ENV['API_PASSWORD'] = '<RACKSPACE_API_KEY>'
+ENV['API_USER'] = 'michalfojtik'
+ENV['API_PASSWORD'] = '1f82168de18f91542834f1e861f37420'
+
+require 'vcr'
+VCR.config do |c|
+ c.cassette_library_dir = 'tests/rackspace/fixtures/'
+ c.stub_with :webmock
+ c.default_cassette_options = { :record => :new_episodes }
+end
diff --git a/server/tests/rackspace/fixtures/11c8bc2b7e52a46b9a004dd40c2512dd3c489f64.yml b/server/tests/rackspace/fixtures/11c8bc2b7e52a46b9a004dd40c2512dd3c489f64.yml
new file mode 100644
index 0000000..69dfd9c
--- /dev/null
+++ b/server/tests/rackspace/fixtures/11c8bc2b7e52a46b9a004dd40c2512dd3c489f64.yml
@@ -0,0 +1,196 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:20:34 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:20:07 GMT
+ x-varnish:
+ - "432414148"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:20:36 GMT
+ content-length:
+ - "243"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/servers/719789
+ body: "{\"server\":{\"progress\":100,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:20:36 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:20:07 GMT
+ x-varnish:
+ - "432414591"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:20:38 GMT
+ content-length:
+ - "243"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/servers/719789
+ body: "{\"server\":{\"progress\":100,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :delete
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 202
+ message: Accepted
+ headers:
+ x-varnish:
+ - "432414739"
+ connection:
+ - keep-alive
+ content-type:
+ - text/xml
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:20:41 GMT
+ content-length:
+ - "0"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body:
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/1f3658efb8b59ffcd7e73860fafffa3bd95e02f5.yml b/server/tests/rackspace/fixtures/1f3658efb8b59ffcd7e73860fafffa3bd95e02f5.yml
new file mode 100644
index 0000000..10ef60c
--- /dev/null
+++ b/server/tests/rackspace/fixtures/1f3658efb8b59ffcd7e73860fafffa3bd95e02f5.yml
@@ -0,0 +1,79 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:18:38 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/images/detail
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 203
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 16 Mar 2011 16:37:05 GMT
+ x-varnish:
+ - 432398637 432381864
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:18:39 GMT
+ content-length:
+ - "2460"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "493"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/images
+ body: "{\"images\":[{\"id\":58,\"status\":\"ACTIVE\",\"updated\":\"2010-09-17T07:19:20-05:00\",\"name\":\"Windows Server 2008 R2 x64 - MSSQL2K8R2\"},{\"id\":71,\"status\":\"ACTIVE\",\"updated\":\"2010-11-13T17:00:35-06:00\",\"name\":\"Fedora 14\"},{\"id\":62,\"status\":\"ACTIVE\",\"updated\":\"2011-03-16T11:37:05-05:00\",\"name\":\"Red Hat Enterprise Linux 5.5\"},{\"id\":29,\"status\":\"ACTIVE\",\"updated\":\"2010-01-26T12:07:32-06:00\",\"name\":\"Windows Server 2003 R2 SP2 x86\"},{\"id\":40,\"status\":\"ACTIVE\",\"updated\":\"2010-10-28T11:40:20-05:00\",\"name\":\"Oracle EL Server Release 5 Update 4\"},{\"id\":23,\"status\":\"ACTIVE\",\"updated\":\"2010-01-26T12:05:53-06:00\",\"name\":\"Windows Server 2003 R2 SP2 x64\"},{\"id\":19,\"status\":\"ACTIVE\",\"updated\":\"2009-12-15T15:43:39-06:00\",\"name\":\"Gentoo 10.1\"},{\"id\":31,\"status\":\"ACTIVE\",\"updated\":\"2010-01-26T12:07:44-06:00\",\"name\":\"Windows Server 2008 SP2 x86\"},{\"id\":57,\"status\":\"ACTIVE\",\"!
updated\":\"2010-09-17T07:16:25-05:00\",\"name\":\"Windows Server 2008 SP2 x64 - MSSQL2K8R2\"},{\"id\":14362,\"status\":\"ACTIVE\",\"updated\":\"2009-11-06T05:09:40-06:00\",\"name\":\"Ubuntu 9.10 (karmic)\"},{\"id\":49,\"status\":\"ACTIVE\",\"updated\":\"2010-05-04T08:58:18-05:00\",\"name\":\"Ubuntu 10.04 LTS (lucid)\"},{\"id\":55,\"status\":\"ACTIVE\",\"updated\":\"2010-06-29T05:21:55-05:00\",\"name\":\"Arch 2010.05\"},{\"id\":41,\"status\":\"ACTIVE\",\"updated\":\"2010-09-20T09:08:35-05:00\",\"name\":\"Oracle EL JeOS Release 5 Update 3\"},{\"id\":10,\"status\":\"ACTIVE\",\"updated\":\"2009-08-26T14:59:54-05:00\",\"name\":\"Ubuntu 8.04.2 LTS (hardy)\"},{\"id\":187811,\"status\":\"ACTIVE\",\"updated\":\"2009-12-16T01:02:17-06:00\",\"name\":\"CentOS 5.4\"},{\"id\":53,\"status\":\"ACTIVE\",\"updated\":\"2010-06-27T20:13:08-05:00\",\"name\":\"Fedora 13\"},{\"id\":24,\"status\":\"ACTIVE\",\"updated\":\"2010-01-26T12:07:04-06:00\",\"name\":\"Windows Server 2008 SP2 x64\"},{\"id\!
":51,\"status\":\"ACTIVE\",\"updated\":\"2010-05-21T00:01:43-05:00\",\
"name\":\"CentOS 5.5\"},{\"id\":69,\"status\":\"ACTIVE\",\"updated\":\"2010-10-21T15:36:29-05:00\",\"name\":\"Ubuntu 10.10 (maverick)\"},{\"id\":28,\"status\":\"ACTIVE\",\"updated\":\"2010-01-26T12:07:17-06:00\",\"name\":\"Windows Server 2008 R2 x64\"},{\"id\":56,\"status\":\"ACTIVE\",\"updated\":\"2010-09-17T07:12:56-05:00\",\"name\":\"Windows Server 2008 SP2 x86 - MSSQL2K8R2\"},{\"id\":14,\"status\":\"ACTIVE\",\"updated\":\"2009-12-15T15:37:22-06:00\",\"name\":\"Red Hat Enterprise Linux 5.4\"},{\"id\":4,\"status\":\"ACTIVE\",\"updated\":\"2009-08-26T14:59:52-05:00\",\"name\":\"Debian 5.0 (lenny)\"},{\"progress\":100,\"id\":8766576,\"status\":\"ACTIVE\",\"created\":\"2011-02-28T07:40:50-06:00\",\"updated\":\"2011-03-01T06:33:53-06:00\",\"name\":\"Test11\"}]}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/25f930c42a61cf5e4e966e351590ae20345ad30e.yml b/server/tests/rackspace/fixtures/25f930c42a61cf5e4e966e351590ae20345ad30e.yml
new file mode 100644
index 0000000..7aa2bab
--- /dev/null
+++ b/server/tests/rackspace/fixtures/25f930c42a61cf5e4e966e351590ae20345ad30e.yml
@@ -0,0 +1,79 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:18:36 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/flavors/detail
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 203
+ message: OK
+ headers:
+ last-modified:
+ - Tue, 18 Mar 2008 17:54:15 GMT
+ x-varnish:
+ - 432398346 432381490
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:18:37 GMT
+ content-length:
+ - "368"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "499"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /flavors
+ body: "{\"flavors\":[{\"id\":1,\"ram\":256,\"disk\":10,\"name\":\"256 server\"},{\"id\":2,\"ram\":512,\"disk\":20,\"name\":\"512 server\"},{\"id\":3,\"ram\":1024,\"disk\":40,\"name\":\"1GB server\"},{\"id\":4,\"ram\":2048,\"disk\":80,\"name\":\"2GB server\"},{\"id\":5,\"ram\":4096,\"disk\":160,\"name\":\"4GB server\"},{\"id\":6,\"ram\":8192,\"disk\":320,\"name\":\"8GB server\"},{\"id\":7,\"ram\":15872,\"disk\":620,\"name\":\"15.5GB server\"}]}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/30691ff4842a33afdbcc653195b1bd4ec93bd644.yml b/server/tests/rackspace/fixtures/30691ff4842a33afdbcc653195b1bd4ec93bd644.yml
new file mode 100644
index 0000000..88c2115
--- /dev/null
+++ b/server/tests/rackspace/fixtures/30691ff4842a33afdbcc653195b1bd4ec93bd644.yml
@@ -0,0 +1,77 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:19:18 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:19 GMT
+ x-varnish:
+ - "432404302"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:19:20 GMT
+ content-length:
+ - "242"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body: "{\"server\":{\"progress\":100,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/3573bb0263b44db6f99a809f92047289108e604f.yml b/server/tests/rackspace/fixtures/3573bb0263b44db6f99a809f92047289108e604f.yml
new file mode 100644
index 0000000..516e9ca
--- /dev/null
+++ b/server/tests/rackspace/fixtures/3573bb0263b44db6f99a809f92047289108e604f.yml
@@ -0,0 +1,198 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:19:42 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:23 GMT
+ x-varnish:
+ - "432407347"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:19:47 GMT
+ content-length:
+ - "243"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/servers/719789
+ body: "{\"server\":{\"progress\":100,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:19:47 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:23 GMT
+ x-varnish:
+ - "432407714"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:19:50 GMT
+ content-length:
+ - "243"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/servers/719789
+ body: "{\"server\":{\"progress\":100,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :post
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789/action
+ body: "{\"reboot\":{\"type\":\"HARD\"}}"
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ content-type:
+ - application/json
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 202
+ message: Accepted
+ headers:
+ x-varnish:
+ - "432408150"
+ connection:
+ - keep-alive
+ content-type:
+ - text/xml
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:19:53 GMT
+ content-length:
+ - "0"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body:
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/3c394d211d025518184ec6a793eb906c901045c1.yml b/server/tests/rackspace/fixtures/3c394d211d025518184ec6a793eb906c901045c1.yml
new file mode 100644
index 0000000..d3c2435
--- /dev/null
+++ b/server/tests/rackspace/fixtures/3c394d211d025518184ec6a793eb906c901045c1.yml
@@ -0,0 +1,196 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:20:14 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719790
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:33 GMT
+ x-varnish:
+ - "432411359"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:20:16 GMT
+ content-length:
+ - "243"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/servers/719790
+ body: "{\"server\":{\"progress\":100,\"id\":719790,\"imageId\":71,\"flavorId\":2,\"status\":\"ACTIVE\",\"name\":\"WedMar3015184902002011\",\"hostId\":\"e714c2314598ddf91387d2a3099dc0bb\",\"addresses\":{\"public\":[\"50.56.107.228\"],\"private\":[\"10.181.184.204\"]},\"metadata\":{}}}"
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:20:16 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719790
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:33 GMT
+ x-varnish:
+ - "432411726"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:20:18 GMT
+ content-length:
+ - "243"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/servers/719790
+ body: "{\"server\":{\"progress\":100,\"id\":719790,\"imageId\":71,\"flavorId\":2,\"status\":\"ACTIVE\",\"name\":\"WedMar3015184902002011\",\"hostId\":\"e714c2314598ddf91387d2a3099dc0bb\",\"addresses\":{\"public\":[\"50.56.107.228\"],\"private\":[\"10.181.184.204\"]},\"metadata\":{}}}"
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :delete
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719790
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 202
+ message: Accepted
+ headers:
+ x-varnish:
+ - "432411804"
+ connection:
+ - keep-alive
+ content-type:
+ - text/xml
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:20:21 GMT
+ content-length:
+ - "0"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body:
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/3f559471f7f352032117bfa6a521415b928d67a5.yml b/server/tests/rackspace/fixtures/3f559471f7f352032117bfa6a521415b928d67a5.yml
new file mode 100644
index 0000000..f8d2edf
--- /dev/null
+++ b/server/tests/rackspace/fixtures/3f559471f7f352032117bfa6a521415b928d67a5.yml
@@ -0,0 +1,79 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:19:26 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:23 GMT
+ x-varnish:
+ - "432405135"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:19:27 GMT
+ content-length:
+ - "243"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/servers/719789
+ body: "{\"server\":{\"progress\":100,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/57833ca12de5561f349e567f6278da04fefc4880.yml b/server/tests/rackspace/fixtures/57833ca12de5561f349e567f6278da04fefc4880.yml
new file mode 100644
index 0000000..e5436be
--- /dev/null
+++ b/server/tests/rackspace/fixtures/57833ca12de5561f349e567f6278da04fefc4880.yml
@@ -0,0 +1,118 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:18:49 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :post
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers
+ body: "{\"server\":{\"imageId\":71,\"flavorId\":2,\"personality\":null,\"name\":\"Wed Mar 30 15:18:49 +0200 2011\"}}"
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ content-type:
+ - application/json
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 202
+ message: Accepted
+ headers:
+ x-varnish:
+ - "432400102"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:18:53 GMT
+ content-length:
+ - "286"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body: "{\"server\":{\"progress\":0,\"id\":719790,\"imageId\":71,\"flavorId\":2,\"status\":\"BUILD\",\"adminPass\":\"WedMar30151849020020112jS3a6rTN\",\"name\":\"WedMar3015184902002011\",\"hostId\":\"e714c2314598ddf91387d2a3099dc0bb\",\"addresses\":{\"public\":[\"50.56.107.228\"],\"private\":[\"10.181.184.204\"]},\"metadata\":{}}}"
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719790
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:18:53 GMT
+ x-varnish:
+ - "432400262"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:18:55 GMT
+ content-length:
+ - "240"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body: "{\"server\":{\"progress\":0,\"id\":719790,\"imageId\":71,\"flavorId\":2,\"status\":\"BUILD\",\"name\":\"WedMar3015184902002011\",\"hostId\":\"e714c2314598ddf91387d2a3099dc0bb\",\"addresses\":{\"public\":[\"50.56.107.228\"],\"private\":[\"10.181.184.204\"]},\"metadata\":{}}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/7115e1f7a3a156de28733eb38670635bd4a67824.yml b/server/tests/rackspace/fixtures/7115e1f7a3a156de28733eb38670635bd4a67824.yml
new file mode 100644
index 0000000..21e8ec9
--- /dev/null
+++ b/server/tests/rackspace/fixtures/7115e1f7a3a156de28733eb38670635bd4a67824.yml
@@ -0,0 +1,79 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:18:31 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/flavors/detail
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 203
+ message: OK
+ headers:
+ last-modified:
+ - Tue, 18 Mar 2008 17:54:15 GMT
+ x-varnish:
+ - 432397622 432381490
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:18:32 GMT
+ content-length:
+ - "368"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "494"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /flavors
+ body: "{\"flavors\":[{\"id\":1,\"ram\":256,\"disk\":10,\"name\":\"256 server\"},{\"id\":2,\"ram\":512,\"disk\":20,\"name\":\"512 server\"},{\"id\":3,\"ram\":1024,\"disk\":40,\"name\":\"1GB server\"},{\"id\":4,\"ram\":2048,\"disk\":80,\"name\":\"2GB server\"},{\"id\":5,\"ram\":4096,\"disk\":160,\"name\":\"4GB server\"},{\"id\":6,\"ram\":8192,\"disk\":320,\"name\":\"8GB server\"},{\"id\":7,\"ram\":15872,\"disk\":620,\"name\":\"15.5GB server\"}]}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/86c5bac6a91239044d567c41ee7061850753aceb.yml b/server/tests/rackspace/fixtures/86c5bac6a91239044d567c41ee7061850753aceb.yml
new file mode 100644
index 0000000..6c0d031
--- /dev/null
+++ b/server/tests/rackspace/fixtures/86c5bac6a91239044d567c41ee7061850753aceb.yml
@@ -0,0 +1,77 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:18:56 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:18:48 GMT
+ x-varnish:
+ - "432400791"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:18:57 GMT
+ content-length:
+ - "240"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body: "{\"server\":{\"progress\":0,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/9357e09a4d550b4e9608549638d13a7bd68b1ceb.yml b/server/tests/rackspace/fixtures/9357e09a4d550b4e9608549638d13a7bd68b1ceb.yml
new file mode 100644
index 0000000..30c7e87
--- /dev/null
+++ b/server/tests/rackspace/fixtures/9357e09a4d550b4e9608549638d13a7bd68b1ceb.yml
@@ -0,0 +1,118 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:18:42 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :post
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers
+ body: "{\"server\":{\"imageId\":71,\"flavorId\":1,\"personality\":null,\"name\":\"Wed Mar 30 15:18:42 +0200 2011\"}}"
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ content-type:
+ - application/json
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 202
+ message: Accepted
+ headers:
+ x-varnish:
+ - "432399438"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:18:46 GMT
+ content-length:
+ - "286"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body: "{\"server\":{\"progress\":0,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"adminPass\":\"WedMar30151842020020116LG4l5Mux\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:18:46 GMT
+ x-varnish:
+ - "432399798"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:18:48 GMT
+ content-length:
+ - "240"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body: "{\"server\":{\"progress\":0,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/9663e49d06662082f6be10bec846857ddb1a2b66.yml b/server/tests/rackspace/fixtures/9663e49d06662082f6be10bec846857ddb1a2b66.yml
new file mode 100644
index 0000000..340a3f5
--- /dev/null
+++ b/server/tests/rackspace/fixtures/9663e49d06662082f6be10bec846857ddb1a2b66.yml
@@ -0,0 +1,79 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:19:28 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:23 GMT
+ x-varnish:
+ - "432405428"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:19:29 GMT
+ content-length:
+ - "243"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/servers/719789
+ body: "{\"server\":{\"progress\":100,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/ad0d40707087d6f351926eada3e98a6dc08a5e38.yml b/server/tests/rackspace/fixtures/ad0d40707087d6f351926eada3e98a6dc08a5e38.yml
new file mode 100644
index 0000000..79f25d7
--- /dev/null
+++ b/server/tests/rackspace/fixtures/ad0d40707087d6f351926eada3e98a6dc08a5e38.yml
@@ -0,0 +1,77 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:19:03 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:01 GMT
+ x-varnish:
+ - "432402048"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:19:05 GMT
+ content-length:
+ - "242"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body: "{\"server\":{\"progress\":100,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/b3475ee551d099862e0123ec4d7a38f96f031f5e.yml b/server/tests/rackspace/fixtures/b3475ee551d099862e0123ec4d7a38f96f031f5e.yml
new file mode 100644
index 0000000..481727e
--- /dev/null
+++ b/server/tests/rackspace/fixtures/b3475ee551d099862e0123ec4d7a38f96f031f5e.yml
@@ -0,0 +1,79 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:18:35 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/flavors/detail
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 203
+ message: OK
+ headers:
+ last-modified:
+ - Tue, 18 Mar 2008 17:54:15 GMT
+ x-varnish:
+ - 432398201 432381490
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:18:35 GMT
+ content-length:
+ - "368"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "497"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /flavors
+ body: "{\"flavors\":[{\"id\":1,\"ram\":256,\"disk\":10,\"name\":\"256 server\"},{\"id\":2,\"ram\":512,\"disk\":20,\"name\":\"512 server\"},{\"id\":3,\"ram\":1024,\"disk\":40,\"name\":\"1GB server\"},{\"id\":4,\"ram\":2048,\"disk\":80,\"name\":\"2GB server\"},{\"id\":5,\"ram\":4096,\"disk\":160,\"name\":\"4GB server\"},{\"id\":6,\"ram\":8192,\"disk\":320,\"name\":\"8GB server\"},{\"id\":7,\"ram\":15872,\"disk\":620,\"name\":\"15.5GB server\"}]}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/b4db99458905e95872d37bf8484c3af7dc41d264.yml b/server/tests/rackspace/fixtures/b4db99458905e95872d37bf8484c3af7dc41d264.yml
new file mode 100644
index 0000000..8d30f2b
--- /dev/null
+++ b/server/tests/rackspace/fixtures/b4db99458905e95872d37bf8484c3af7dc41d264.yml
@@ -0,0 +1,75 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:21:07 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 404
+ message: Not Found
+ headers:
+ x-varnish:
+ - "432419189"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:21:08 GMT
+ content-length:
+ - "129"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body: "{\"itemNotFound\":{\"message\":\"Not Found\",\"details\":\"com.rackspace.cloud.service.servers.ItemNotFoundFault: Not Found\",\"code\":404}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/c02df61167a57ada65fafcaa985357a91314f930.yml b/server/tests/rackspace/fixtures/c02df61167a57ada65fafcaa985357a91314f930.yml
new file mode 100644
index 0000000..6b0224e
--- /dev/null
+++ b/server/tests/rackspace/fixtures/c02df61167a57ada65fafcaa985357a91314f930.yml
@@ -0,0 +1,79 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:19:37 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719790
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:33 GMT
+ x-varnish:
+ - "432406663"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:19:39 GMT
+ content-length:
+ - "243"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/servers/719790
+ body: "{\"server\":{\"progress\":100,\"id\":719790,\"imageId\":71,\"flavorId\":2,\"status\":\"ACTIVE\",\"name\":\"WedMar3015184902002011\",\"hostId\":\"e714c2314598ddf91387d2a3099dc0bb\",\"addresses\":{\"public\":[\"50.56.107.228\"],\"private\":[\"10.181.184.204\"]},\"metadata\":{}}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/c3bd10b31498023723c8c5ff8de08a900469d62b.yml b/server/tests/rackspace/fixtures/c3bd10b31498023723c8c5ff8de08a900469d62b.yml
new file mode 100644
index 0000000..f2a7f2d
--- /dev/null
+++ b/server/tests/rackspace/fixtures/c3bd10b31498023723c8c5ff8de08a900469d62b.yml
@@ -0,0 +1,79 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:19:30 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719790
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:31 GMT
+ x-varnish:
+ - "432405789"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:19:32 GMT
+ content-length:
+ - "244"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/servers/719790
+ body: "{\"server\":{\"progress\":100,\"id\":719790,\"imageId\":71,\"flavorId\":2,\"status\":\"UNKNOWN\",\"name\":\"WedMar3015184902002011\",\"hostId\":\"e714c2314598ddf91387d2a3099dc0bb\",\"addresses\":{\"public\":[\"50.56.107.228\"],\"private\":[\"10.181.184.204\"]},\"metadata\":{}}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/cc7ccfa2f6e74357956824051e8360d7f0751004.yml b/server/tests/rackspace/fixtures/cc7ccfa2f6e74357956824051e8360d7f0751004.yml
new file mode 100644
index 0000000..8fcc153
--- /dev/null
+++ b/server/tests/rackspace/fixtures/cc7ccfa2f6e74357956824051e8360d7f0751004.yml
@@ -0,0 +1,77 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:19:11 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719789
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:01 GMT
+ x-varnish:
+ - "432403002"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:19:12 GMT
+ content-length:
+ - "242"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body: "{\"server\":{\"progress\":100,\"id\":719789,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"name\":\"WedMar3015184202002011\",\"hostId\":\"67694fd94dffda406a0456fcada68afb\",\"addresses\":{\"public\":[\"50.56.107.227\"],\"private\":[\"10.181.184.203\"]},\"metadata\":{}}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/ccbb5c591ed1b2c1a3d4233329c9475a9965ba2d.yml b/server/tests/rackspace/fixtures/ccbb5c591ed1b2c1a3d4233329c9475a9965ba2d.yml
new file mode 100644
index 0000000..a2c7b5a
--- /dev/null
+++ b/server/tests/rackspace/fixtures/ccbb5c591ed1b2c1a3d4233329c9475a9965ba2d.yml
@@ -0,0 +1,79 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:18:40 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/images/detail
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 203
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 16 Mar 2011 16:37:05 GMT
+ x-varnish:
+ - 432399321 432381864
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:18:41 GMT
+ content-length:
+ - "2460"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "495"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/images
+ body: "{\"images\":[{\"id\":58,\"status\":\"ACTIVE\",\"updated\":\"2010-09-17T07:19:20-05:00\",\"name\":\"Windows Server 2008 R2 x64 - MSSQL2K8R2\"},{\"id\":71,\"status\":\"ACTIVE\",\"updated\":\"2010-11-13T17:00:35-06:00\",\"name\":\"Fedora 14\"},{\"id\":62,\"status\":\"ACTIVE\",\"updated\":\"2011-03-16T11:37:05-05:00\",\"name\":\"Red Hat Enterprise Linux 5.5\"},{\"id\":29,\"status\":\"ACTIVE\",\"updated\":\"2010-01-26T12:07:32-06:00\",\"name\":\"Windows Server 2003 R2 SP2 x86\"},{\"id\":40,\"status\":\"ACTIVE\",\"updated\":\"2010-10-28T11:40:20-05:00\",\"name\":\"Oracle EL Server Release 5 Update 4\"},{\"id\":23,\"status\":\"ACTIVE\",\"updated\":\"2010-01-26T12:05:53-06:00\",\"name\":\"Windows Server 2003 R2 SP2 x64\"},{\"id\":19,\"status\":\"ACTIVE\",\"updated\":\"2009-12-15T15:43:39-06:00\",\"name\":\"Gentoo 10.1\"},{\"id\":31,\"status\":\"ACTIVE\",\"updated\":\"2010-01-26T12:07:44-06:00\",\"name\":\"Windows Server 2008 SP2 x86\"},{\"id\":57,\"status\":\"ACTIVE\",\"!
updated\":\"2010-09-17T07:16:25-05:00\",\"name\":\"Windows Server 2008 SP2 x64 - MSSQL2K8R2\"},{\"id\":14362,\"status\":\"ACTIVE\",\"updated\":\"2009-11-06T05:09:40-06:00\",\"name\":\"Ubuntu 9.10 (karmic)\"},{\"id\":49,\"status\":\"ACTIVE\",\"updated\":\"2010-05-04T08:58:18-05:00\",\"name\":\"Ubuntu 10.04 LTS (lucid)\"},{\"id\":55,\"status\":\"ACTIVE\",\"updated\":\"2010-06-29T05:21:55-05:00\",\"name\":\"Arch 2010.05\"},{\"id\":41,\"status\":\"ACTIVE\",\"updated\":\"2010-09-20T09:08:35-05:00\",\"name\":\"Oracle EL JeOS Release 5 Update 3\"},{\"id\":10,\"status\":\"ACTIVE\",\"updated\":\"2009-08-26T14:59:54-05:00\",\"name\":\"Ubuntu 8.04.2 LTS (hardy)\"},{\"id\":187811,\"status\":\"ACTIVE\",\"updated\":\"2009-12-16T01:02:17-06:00\",\"name\":\"CentOS 5.4\"},{\"id\":53,\"status\":\"ACTIVE\",\"updated\":\"2010-06-27T20:13:08-05:00\",\"name\":\"Fedora 13\"},{\"id\":24,\"status\":\"ACTIVE\",\"updated\":\"2010-01-26T12:07:04-06:00\",\"name\":\"Windows Server 2008 SP2 x64\"},{\"id\!
":51,\"status\":\"ACTIVE\",\"updated\":\"2010-05-21T00:01:43-05:00\",\
"name\":\"CentOS 5.5\"},{\"id\":69,\"status\":\"ACTIVE\",\"updated\":\"2010-10-21T15:36:29-05:00\",\"name\":\"Ubuntu 10.10 (maverick)\"},{\"id\":28,\"status\":\"ACTIVE\",\"updated\":\"2010-01-26T12:07:17-06:00\",\"name\":\"Windows Server 2008 R2 x64\"},{\"id\":56,\"status\":\"ACTIVE\",\"updated\":\"2010-09-17T07:12:56-05:00\",\"name\":\"Windows Server 2008 SP2 x86 - MSSQL2K8R2\"},{\"id\":14,\"status\":\"ACTIVE\",\"updated\":\"2009-12-15T15:37:22-06:00\",\"name\":\"Red Hat Enterprise Linux 5.4\"},{\"id\":4,\"status\":\"ACTIVE\",\"updated\":\"2009-08-26T14:59:52-05:00\",\"name\":\"Debian 5.0 (lenny)\"},{\"progress\":100,\"id\":8766576,\"status\":\"ACTIVE\",\"created\":\"2011-02-28T07:40:50-06:00\",\"updated\":\"2011-03-01T06:33:53-06:00\",\"name\":\"Test11\"}]}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/e306158847e6efd491e1b51770012a76b010d81a.yml b/server/tests/rackspace/fixtures/e306158847e6efd491e1b51770012a76b010d81a.yml
new file mode 100644
index 0000000..f9fab65
--- /dev/null
+++ b/server/tests/rackspace/fixtures/e306158847e6efd491e1b51770012a76b010d81a.yml
@@ -0,0 +1,75 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:20:32 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719790
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 404
+ message: Not Found
+ headers:
+ x-varnish:
+ - "432413852"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:20:33 GMT
+ content-length:
+ - "129"
+ cache-control:
+ - no-cache
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ body: "{\"itemNotFound\":{\"message\":\"Not Found\",\"details\":\"com.rackspace.cloud.service.servers.ItemNotFoundFault: Not Found\",\"code\":404}}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/e5f1a88e1991237fb416428685888ad232604fa1.yml b/server/tests/rackspace/fixtures/e5f1a88e1991237fb416428685888ad232604fa1.yml
new file mode 100644
index 0000000..4fc5511
--- /dev/null
+++ b/server/tests/rackspace/fixtures/e5f1a88e1991237fb416428685888ad232604fa1.yml
@@ -0,0 +1,36 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:18:31 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/eff069c1da23b5e703dc9894dbb9186a6c3fd8d2.yml b/server/tests/rackspace/fixtures/eff069c1da23b5e703dc9894dbb9186a6c3fd8d2.yml
new file mode 100644
index 0000000..9f557a2
--- /dev/null
+++ b/server/tests/rackspace/fixtures/eff069c1da23b5e703dc9894dbb9186a6c3fd8d2.yml
@@ -0,0 +1,79 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:18:33 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/flavors/detail
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 203
+ message: OK
+ headers:
+ last-modified:
+ - Tue, 18 Mar 2008 17:54:15 GMT
+ x-varnish:
+ - 432397912 432381490
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:18:34 GMT
+ content-length:
+ - "368"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "496"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /flavors
+ body: "{\"flavors\":[{\"id\":1,\"ram\":256,\"disk\":10,\"name\":\"256 server\"},{\"id\":2,\"ram\":512,\"disk\":20,\"name\":\"512 server\"},{\"id\":3,\"ram\":1024,\"disk\":40,\"name\":\"1GB server\"},{\"id\":4,\"ram\":2048,\"disk\":80,\"name\":\"2GB server\"},{\"id\":5,\"ram\":4096,\"disk\":160,\"name\":\"4GB server\"},{\"id\":6,\"ram\":8192,\"disk\":320,\"name\":\"8GB server\"},{\"id\":7,\"ram\":15872,\"disk\":620,\"name\":\"15.5GB server\"}]}"
+ http_version: "1.1"
diff --git a/server/tests/rackspace/fixtures/f2349b91a95d0d93889416e7fc17f2187140247b.yml b/server/tests/rackspace/fixtures/f2349b91a95d0d93889416e7fc17f2187140247b.yml
new file mode 100644
index 0000000..1ddb93c
--- /dev/null
+++ b/server/tests/rackspace/fixtures/f2349b91a95d0d93889416e7fc17f2187140247b.yml
@@ -0,0 +1,79 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://auth.api.rackspacecloud.com:443/v1.0
+ body:
+ headers:
+ x-auth-user:
+ - michalfojtik
+ x-auth-key:
+ - 1f82168de18f91542834f1e861f37420
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 204
+ message: No Content
+ headers:
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ content-type:
+ - application/octet-stream
+ server:
+ - Apache/2.2.3 (Mosso Engineering)
+ date:
+ - Wed, 30 Mar 2011 13:19:40 GMT
+ x-cdn-management-url:
+ - https://cdn2.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ content-length:
+ - "0"
+ x-server-management-url:
+ - https://servers.api.rackspacecloud.com/v1.0/561604
+ x-storage-url:
+ - https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_317909a7-4980-462e-b37c-42da54393ba5
+ x-storage-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri: https://servers.api.rackspacecloud.com:443/v1.0/561604/servers/719790
+ body:
+ headers:
+ accept:
+ - application/json
+ x-auth-token:
+ - 04301cb7-242b-4277-8735-2b81a227fd50
+ user-agent:
+ - CloudServers Ruby API 0.4.1
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ last-modified:
+ - Wed, 30 Mar 2011 13:19:33 GMT
+ x-varnish:
+ - "432406842"
+ connection:
+ - keep-alive
+ content-type:
+ - application/json
+ via:
+ - 1.1 varnish
+ server:
+ - Apache-Coyote/1.1
+ date:
+ - Wed, 30 Mar 2011 13:19:42 GMT
+ content-length:
+ - "243"
+ cache-control:
+ - s-maxage=1800
+ age:
+ - "0"
+ vary:
+ - Accept, Accept-Encoding, X-Auth-Token
+ x-purge-key:
+ - /561604/servers/719790
+ body: "{\"server\":{\"progress\":100,\"id\":719790,\"imageId\":71,\"flavorId\":2,\"status\":\"ACTIVE\",\"name\":\"WedMar3015184902002011\",\"hostId\":\"e714c2314598ddf91387d2a3099dc0bb\",\"addresses\":{\"public\":[\"50.56.107.228\"],\"private\":[\"10.181.184.204\"]},\"metadata\":{}}}"
+ http_version: "1.1"
--
1.7.4.1
[PATCH core 1/3] Added basic RackSpace unit tests
Posted by mf...@redhat.com.
From: Michal Fojtik <mf...@redhat.com>
---
server/Rakefile | 26 +++-
server/tests/common.rb | 4 +-
server/tests/drivers/mock/setup.rb | 3 +
server/tests/drivers/rackspace/api_test.rb | 41 +++++
.../drivers/rackspace/hardware_profiles_test.rb | 53 ++++++
server/tests/drivers/rackspace/images_test.rb | 40 +++++
server/tests/drivers/rackspace/instances_test.rb | 167 ++++++++++++++++++++
server/tests/drivers/rackspace/realms_test.rb | 36 +++++
server/tests/drivers/rackspace/setup.rb | 3 +
9 files changed, 364 insertions(+), 9 deletions(-)
create mode 100644 server/tests/drivers/mock/setup.rb
create mode 100644 server/tests/drivers/rackspace/api_test.rb
create mode 100644 server/tests/drivers/rackspace/hardware_profiles_test.rb
create mode 100644 server/tests/drivers/rackspace/images_test.rb
create mode 100644 server/tests/drivers/rackspace/instances_test.rb
create mode 100644 server/tests/drivers/rackspace/realms_test.rb
create mode 100644 server/tests/drivers/rackspace/setup.rb
diff --git a/server/Rakefile b/server/Rakefile
index e562cb5..3453bfe 100644
--- a/server/Rakefile
+++ b/server/Rakefile
@@ -28,12 +28,26 @@ begin
rescue LoadError
end
-desc "Run basic unit tests"
-Rake::TestTask.new("test") { |t|
- t.test_files = FileList.new('tests/**/*_test.rb')
- t.verbose = true
- t.warning = false
-}
+namespace :test do
+
+ desc "Run mock unit tests"
+ Rake::TestTask.new("mock") { |t|
+ t.test_files = FileList.new('tests/drivers/mock/*_test.rb') + FileList.new('tests/rabbit_test.rb')
+ t.options = "-v -v"
+ t.verbose = true
+ t.warning = false
+ }
+
+ desc "Run rackspace unit tests"
+ Rake::TestTask.new("rackspace") { |t|
+ t.test_files = ['tests/common.rb', 'tests/drivers/rackspace/setup.rb'] + FileList.new('tests/drivers/rackspace/*_test.rb')
+ t.options = "-v -v"
+ t.verbose = true
+ t.warning = false
+ }
+
+
+end
begin
require 'yard'
diff --git a/server/tests/common.rb b/server/tests/common.rb
index 6efe089..e134388 100644
--- a/server/tests/common.rb
+++ b/server/tests/common.rb
@@ -1,6 +1,7 @@
$:.unshift File.join(File.dirname(__FILE__), '..')
require 'rubygems'
+require 'yaml'
require 'base64'
require 'test/unit'
require 'spec'
@@ -10,11 +11,8 @@ require 'json'
# Set proper environment variables for running test
ENV['RACK_ENV'] = 'test'
-ENV['API_DRIVER'] = 'mock'
ENV['API_HOST'] = 'localhost'
ENV['API_PORT'] = '4040'
-ENV['API_USER'] = 'mockuser'
-ENV['API_PASSWORD'] = 'mockpassword'
require 'server'
diff --git a/server/tests/drivers/mock/setup.rb b/server/tests/drivers/mock/setup.rb
new file mode 100644
index 0000000..60a7094
--- /dev/null
+++ b/server/tests/drivers/mock/setup.rb
@@ -0,0 +1,3 @@
+ENV['API_DRIVER'] = "mock"
+ENV['API_USER'] = 'mockuser'
+ENV['API_PASSWORD'] = 'mockpassword'
diff --git a/server/tests/drivers/rackspace/api_test.rb b/server/tests/drivers/rackspace/api_test.rb
new file mode 100644
index 0000000..e351388
--- /dev/null
+++ b/server/tests/drivers/rackspace/api_test.rb
@@ -0,0 +1,41 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module RackspaceTest
+
+ class ApiTest < Test::Unit::TestCase
+ include Rack::Test::Methods
+
+ def app
+ Sinatra::Application
+ end
+
+ def test_01_it_returns_entry_points
+ do_xml_request '/api;driver=rackspace/?force_auth=1', {}, true
+ (last_xml_response/'/api').first[:driver].should == 'rackspace'
+ (last_xml_response/'/api/link').length.should > 0
+ end
+
+ def test_02_it_has_rackspace_features
+ do_xml_request '/api;driver=rackspace'
+ features = (last_xml_response/'/api/link[@rel="instances"]/feature').collect { |f| f[:name] }
+ features.include?('user_name').should == true
+ features.include?('authentication_password').should == true
+ features.include?('user_files').should == true
+ features.length.should == 3
+ end
+
+ def test_03_it_has_rackspace_collections
+ do_xml_request '/api;driver=rackspace'
+ collections = (last_xml_response/'/api/link').collect { |f| f[:rel] }
+ collections.include?('instance_states').should == true
+ collections.include?('instances').should == true
+ collections.include?('images').should == true
+ collections.include?('buckets').should == true
+ collections.include?('realms').should == true
+ collections.include?('hardware_profiles').should == true
+ collections.length.should == 6
+ end
+
+ end
+end
diff --git a/server/tests/drivers/rackspace/hardware_profiles_test.rb b/server/tests/drivers/rackspace/hardware_profiles_test.rb
new file mode 100644
index 0000000..90720a4
--- /dev/null
+++ b/server/tests/drivers/rackspace/hardware_profiles_test.rb
@@ -0,0 +1,53 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module RackspaceTest
+
+ class HardwareProfilesTest < Test::Unit::TestCase
+ include Rack::Test::Methods
+
+ def app
+ Sinatra::Application
+ end
+
+ def test_01_it_returns_hardware_profiles
+ do_xml_request '/api;driver=rackspace/hardware_profiles', {}, true
+ (last_xml_response/'hardware_profiles/hardware_profile').length.should == 7
+ end
+
+ def test_02_each_hardware_profile_has_a_name
+ do_xml_request '/api;driver=rackspace/hardware_profiles', {}, true
+ (last_xml_response/'hardware_profiles/hardware_profile').each do |profile|
+ (profile/'name').text.should_not == nil
+ (profile/'name').text.should_not == ''
+ end
+ end
+
+ def test_03_each_hardware_profile_has_correct_properties
+ do_xml_request '/api;driver=rackspace/hardware_profiles', {}, true
+ (last_xml_response/'hardware_profiles/hardware_profile').each do |profile|
+ (profile/'property[@name="architecture"]').first[:value].should == 'x86_64'
+ (profile/'property[@name="memory"]').first[:unit].should == 'MB'
+ (profile/'property[@name="memory"]').first[:kind].should == 'fixed'
+ (profile/'property[@name="storage"]').first[:unit].should == 'GB'
+ (profile/'property[@name="storage"]').first[:kind].should == 'fixed'
+ end
+ end
+
+ def test_04_it_returns_single_hardware_profile
+ do_xml_request '/api;driver=rackspace/hardware_profiles/1', {}, true
+ (last_xml_response/'hardware_profile/name').first.text.should == '1'
+ (last_xml_response/'hardware_profile/property[@name="architecture"]').first[:value].should == 'x86_64'
+ (last_xml_response/'hardware_profile/property[@name="memory"]').first[:value].should == '256'
+ (last_xml_response/'hardware_profile/property[@name="storage"]').first[:value].should == '10'
+ end
+
+ def test_05_it_filter_hardware_profiles
+ do_xml_request '/api;driver=rackspace/hardware_profiles?architecture=i386', {}, true
+ (last_xml_response/'hardware_profiles/hardware_profile').length.should == 0
+ do_xml_request '/api;driver=rackspace/hardware_profiles?architecture=x86_64', {}, true
+ (last_xml_response/'hardware_profiles/hardware_profile').length.should == 7
+ end
+
+ end
+end
diff --git a/server/tests/drivers/rackspace/images_test.rb b/server/tests/drivers/rackspace/images_test.rb
new file mode 100644
index 0000000..66fdc0a
--- /dev/null
+++ b/server/tests/drivers/rackspace/images_test.rb
@@ -0,0 +1,40 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module RackspaceTest
+
+ class ImagesTest < Test::Unit::TestCase
+ include Rack::Test::Methods
+
+ def app
+ Sinatra::Application
+ end
+
+ def test_01_it_returns_images
+ do_xml_request '/api;driver=rackspace/images', {}, true
+ (last_xml_response/'images/image').length.should > 0
+ end
+
+ def test_02_each_image_has_correct_properties
+ do_xml_request '/api;driver=rackspace/images', {}, true
+ (last_xml_response/'images/image').each do |image|
+ (image/'name').should_not == nil
+ (image/'name').should_not == ''
+ (image/'description').should_not == nil
+ (image/'description').should_not == ''
+ (image/'architecture').should_not == nil
+ (image/'architecture').should_not == ''
+ (image/'state').text.should == 'ACTIVE'
+ (image/'owner_id').text.should == ENV['API_USER']
+ (image/'actions/link').length.should == 1
+ (image/'actions/link').first[:rel].should == 'create_instance'
+ end
+ end
+
+ def test_03_it_returns_single_image
+ do_xml_request '/api;driver=rackspace/images/71', {}, true
+ (last_xml_response/'image').length.should == 1
+ end
+
+ end
+end
diff --git a/server/tests/drivers/rackspace/instances_test.rb b/server/tests/drivers/rackspace/instances_test.rb
new file mode 100644
index 0000000..fc1af4f
--- /dev/null
+++ b/server/tests/drivers/rackspace/instances_test.rb
@@ -0,0 +1,167 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module RackspaceTest
+
+ class InstancesTest < Test::Unit::TestCase
+ include Rack::Test::Methods
+
+ def app
+ Sinatra::Application
+ end
+
+ def test_01_01_it_can_create_instance_without_hardware_profile
+ params = {
+ :image_id => '71',
+ :'api[driver]' => 'rackspace',
+ }
+ header 'Accept', accept_header(:xml)
+ post '/api/instances', params, authenticate
+ last_response.status.should == 201 # Created
+ @@instance = Nokogiri::XML(last_response.body)
+ (@@instance/'instance').length.should > 0
+ (@@instance/'instance/name').first.text.should_not == nil
+ (@@instance/'instance/name').first.text.should_not == nil
+ (@@instance/'instance/owner_id').first.text.should_not == ''
+ (@@instance/'instance/owner_id').first.text.should == ENV['API_USER']
+ (@@instance/'instance/state').first.text.should == 'PENDING'
+ end
+
+ def test_01_02_it_can_create_instance_with_hardware_profile
+ params = {
+ :image_id => '71',
+ :hwp_id => '2',
+ :'api[driver]' => 'rackspace',
+ }
+ header 'Accept', accept_header(:xml)
+ post '/api/instances', params, authenticate
+ last_response.status.should == 201 # Created
+ @@instance2 = Nokogiri::XML(last_response.body)
+ (@@instance2/'instance').length.should > 0
+ (@@instance2/'instance/name').first.text.should_not == nil
+ (@@instance2/'instance/name').first.text.should_not == nil
+ (@@instance2/'instance/owner_id').first.text.should_not == ''
+ (@@instance2/'instance/owner_id').first.text.should == ENV['API_USER']
+ (@@instance2/'instance/state').first.text.should == 'PENDING'
+ end
+
+ def test_02_01_created_instance_has_correct_authentication
+ (@@instance/'instance/authentication').first.should_not == nil
+ (@@instance/'instance/authentication').first[:type].should == 'password'
+ (@@instance/'instance/authentication/login/username').first.text.should == 'root'
+ (@@instance/'instance/authentication/login/password').first.text.should_not == nil
+ (@@instance/'instance/authentication/login/password').first.text.should_not == ''
+ end
+
+ def test_02_02_created_instance_has_correct_authentication
+ (@@instance2/'instance/authentication').first.should_not == nil
+ (@@instance2/'instance/authentication').first[:type].should == 'password'
+ (@@instance2/'instance/authentication/login/username').first.text.should == 'root'
+ (@@instance2/'instance/authentication/login/password').first.text.should_not == nil
+ (@@instance2/'instance/authentication/login/password').first.text.should_not == ''
+ end
+
+ def test_03_01_created_instance_has_correct_addresses
+ (@@instance/'instance/public_addresses/address').length.should > 0
+ (@@instance/'instance/public_addresses/address').first.text.should_not == nil
+ (@@instance/'instance/public_addresses/address').first.text.should_not == ''
+ end
+
+ def test_03_02_created_instance_has_correct_addresses
+ (@@instance2/'instance/public_addresses/address').length.should > 0
+ (@@instance2/'instance/public_addresses/address').first.text.should_not == nil
+ (@@instance2/'instance/public_addresses/address').first.text.should_not == ''
+ end
+
+ def test_03_02_created_instance_has_correct_hardware_profile
+ (@@instance2/'instance/hardware_profile').length.should == 1
+ (@@instance2/'instance/hardware_profile').first[:id].should == "2"
+ (@@instance2/'instance/hardware_profile').first[:href].should_not == nil
+ end
+
+ def test_04_01_created_instance_goes_to_running_state
+ 20.times do
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", {}, true
+ last_response.status.should_not == 500
+ state = (last_xml_response/'instance/state').first.text
+ break if state=='RUNNING'
+ sleep(5)
+ end
+ @@instance = last_xml_response
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", {}, true
+ last_response.status.should_not == 500
+ (last_xml_response/'instance/state').first.text.should == 'RUNNING'
+ (last_xml_response/'instance/actions/link[@rel="reboot"]').first.should_not == nil
+ (last_xml_response/'instance/actions/link[@rel="stop"]').first.should_not == nil
+ (last_xml_response/'instance/actions/link[@rel="create_image"]').first.should_not == nil
+ (last_xml_response/'instance/actions/link[@rel="run"]').first.should_not == nil
+ end
+
+ def test_04_02_created_instance_goes_to_running_state
+ 20.times do
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance2/'instance').first[:id]}", {}, true
+ last_response.status.should_not == 500
+ state = (last_xml_response/'instance/state').first.text
+ break if state=='RUNNING'
+ sleep(5)
+ end
+ @@instance2 = last_xml_response
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance2/'instance').first[:id]}", {}, true
+ last_response.status.should_not == 500
+ (last_xml_response/'instance/state').first.text.should == 'RUNNING'
+ (last_xml_response/'instance/actions/link[@rel="reboot"]').first.should_not == nil
+ (last_xml_response/'instance/actions/link[@rel="stop"]').first.should_not == nil
+ (last_xml_response/'instance/actions/link[@rel="create_image"]').first.should_not == nil
+ (last_xml_response/'instance/actions/link[@rel="run"]').first.should_not == nil
+ end
+
+ def test_05_created_instance_can_be_rebooted
+ params = {
+ :'api[driver]' => 'rackspace',
+ }
+ header 'Accept', accept_header(:xml)
+ post "/api/instances/#{(@@instance/'instance').first[:id]}/reboot", params, authenticate
+ last_response.status.should == 200
+ 20.times do
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", {}, true
+ last_response.status.should_not == 500
+ state = (last_xml_response/'instance/state').first.text
+ break if state=='RUNNING'
+ sleep(5)
+ end
+ end
+
+ def test_06_created_instance_can_be_destroyed
+ params = {
+ :'api[driver]' => 'rackspace',
+ }
+ header 'Accept', accept_header(:xml)
+ post "/api/instances/#{(@@instance/'instance').first[:id]}/stop", params, authenticate
+ last_response.status.should == 200
+ 20.times do
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", {}, true
+ last_response.status.should_not == 500
+ break if last_response.status == 404
+ sleep(5)
+ end
+ last_response.status.should == 404
+ end
+
+ def test_06_02_created_instance_can_be_destroyed
+ params = {
+ :'api[driver]' => 'rackspace',
+ }
+ header 'Accept', accept_header(:xml)
+ post "/api/instances/#{(@@instance2/'instance').first[:id]}/stop", params, authenticate
+ last_response.status.should == 200
+ 20.times do
+ do_xml_request "/api;driver=rackspace/instances/#{(@@instance2/'instance').first[:id]}", {}, true
+ last_response.status.should_not == 500
+ break if last_response.status == 404
+ sleep(5)
+ end
+ last_response.status.should == 404
+ end
+
+ end
+end
diff --git a/server/tests/drivers/rackspace/realms_test.rb b/server/tests/drivers/rackspace/realms_test.rb
new file mode 100644
index 0000000..ca44d15
--- /dev/null
+++ b/server/tests/drivers/rackspace/realms_test.rb
@@ -0,0 +1,36 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module RackspaceTest
+
+ class RealmsTest < Test::Unit::TestCase
+ include Rack::Test::Methods
+
+ def app
+ Sinatra::Application
+ end
+
+ def test_01_it_returns_realms
+ do_xml_request '/api;driver=rackspace/realms', {}, true
+ (last_xml_response/'realms/realm').length.should == 1
+ end
+
+ def test_02_each_realm_has_a_name
+ do_xml_request '/api;driver=rackspace/realms', {}, true
+ (last_xml_response/'realms/realm').each do |profile|
+ (profile/'name').text.should_not == nil
+ (profile/'name').text.should_not == ''
+ (profile/'name').text.should == 'United States'
+ end
+ end
+
+ def test_03_it_returns_single_realm
+ do_xml_request '/api;driver=rackspace/realms/us', {}, true
+ (last_xml_response/'realm').first[:id].should == 'us'
+ (last_xml_response/'realm/name').first.text.should == 'United States'
+ (last_xml_response/'realm/state').first.text.should == 'AVAILABLE'
+ (last_xml_response/'realm/limit').first.text.should == ''
+ end
+
+ end
+end
diff --git a/server/tests/drivers/rackspace/setup.rb b/server/tests/drivers/rackspace/setup.rb
new file mode 100644
index 0000000..723ed7a
--- /dev/null
+++ b/server/tests/drivers/rackspace/setup.rb
@@ -0,0 +1,3 @@
+ENV['API_DRIVER'] = "rackspace"
+ENV['API_USER'] = '<RACKSPACE_USERNAME>'
+ENV['API_PASSWORD'] = '<RACKSPACE_API_KEY>'
--
1.7.4.1