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/31 14:52:37 UTC

Initial RackSpace unit tests (rev 3)

Hi,

This revision includes fixed Mock tests and Rackspace tests are now working
without account in Rackspace.
Also I reworking login in common.rb, stripped out 'do_xml_request' and add
some better approach for this.
Once this patch will be acked I'll start working on EC2, GoGrid and other
providers to have complete set of unit tests for each provider.

  -- 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: mfojtik <mf...@13f79535-47bb-0310-9956-ffa450edef68>

---
 .../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 b5f0c27..e8fa906 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 d537d3a..9662bfb 100644
--- a/server/server.rb
+++ b/server/server.rb
@@ -364,17 +364,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: mfojtik <mf...@13f79535-47bb-0310-9956-ffa450edef68>

---
 server/Gemfile                                     |    2 +
 server/Rakefile                                    |    2 +-
 server/tests/common.rb                             |  115 +++++++++---
 server/tests/drivers/mock/api_test.rb              |   34 ++--
 .../tests/drivers/mock/hardware_profiles_test.rb   |   30 ++--
 server/tests/drivers/mock/images_test.rb           |   32 ++--
 server/tests/drivers/mock/instance_states_test.rb  |    8 +-
 server/tests/drivers/mock/instances_test.rb        |   60 +++---
 server/tests/drivers/mock/realms_test.rb           |   20 +-
 server/tests/drivers/rackspace/api_test.rb         |    6 +-
 ...et-1eb29b4121fee923d3d619fd8f7c6af68aae0ef4.yml |   77 ++++++++
 ...et-2ee5580739f1b704a8b4a5e453641be70c37dac1.yml |   77 ++++++++
 ...et-2fcfc33bdaf35e34ea8cd309f35c48ba675afa8b.yml |   79 ++++++++
 ...et-33788dfa9cf3ec4e37e4057bca0143591e54788e.yml |   75 ++++++++
 ...et-48f898a80864f048c98b231819b670ef2024c4b4.yml |   79 ++++++++
 ...et-6d10f489e397ce35ebc6a3afb0622a2ec6f32e8a.yml |   79 ++++++++
 ...et-6ecaf5e25b747645e181d79e55f08a6bac5bd1c3.yml |   77 ++++++++
 ...et-70db02f23c658bccd5d3e66781f98b26ab4107ca.yml |   79 ++++++++
 ...et-733e8ec18a1bd16ed292e9185e04835a7c1621db.yml |   79 ++++++++
 ...et-798577ad678724e877a068b645f4575981761625.yml |   77 ++++++++
 ...et-8fa5ace7e3bf48c86e82dcf78ec71baee0da8f5a.yml |   79 ++++++++
 ...et-9c33dc09276022f9e3cfbc9d76d7ae0ff567d99c.yml |   79 ++++++++
 ...et-9ce8c09907082114e9e5986915d806eeadcbf7cd.yml |   79 ++++++++
 ...et-b0c6d16b98a5f529998b16a0502ffaa883c2d5cc.yml |   75 ++++++++
 ...et-b73452ba27599b5e170faaae32bfef8b0a331fc6.yml |   77 ++++++++
 ...et-b84d468c592033e08492238bd5c80639cbc63bd3.yml |   36 ++++
 ...et-d69cab1f8c346dc2f51a2865feeeb744da88cdfd.yml |   79 ++++++++
 ...et-d6e43a79c4429459bf2618c5a6a6d80757a67ef9.yml |   79 ++++++++
 ...et-db67323871eddf68889aefc40aeed345459e6e63.yml |   79 ++++++++
 ...st-165f1ed29df23e6c585ba08d4bd1748b81bef0c2.yml |  118 ++++++++++++
 ...st-34c093a5823b18fbaee744bd095162aa29cf3338.yml |  198 ++++++++++++++++++++
 ...st-837a9c2f7f5471d7163f1a149a29195fc73364ea.yml |  196 +++++++++++++++++++
 ...st-aa64fab8820e4b7362b3784fb7373023223bfad3.yml |  196 +++++++++++++++++++
 ...st-c29de27eb57dd3b1d715623c78d86ae1e4ca70d3.yml |  118 ++++++++++++
 .../drivers/rackspace/hardware_profiles_test.rb    |   12 +-
 server/tests/drivers/rackspace/images_test.rb      |    6 +-
 server/tests/drivers/rackspace/instances_test.rb   |   48 ++---
 server/tests/drivers/rackspace/realms_test.rb      |    6 +-
 server/tests/drivers/rackspace/setup.rb            |   15 ++-
 39 files changed, 2490 insertions(+), 172 deletions(-)
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-1eb29b4121fee923d3d619fd8f7c6af68aae0ef4.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-2ee5580739f1b704a8b4a5e453641be70c37dac1.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-2fcfc33bdaf35e34ea8cd309f35c48ba675afa8b.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-33788dfa9cf3ec4e37e4057bca0143591e54788e.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-48f898a80864f048c98b231819b670ef2024c4b4.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-6d10f489e397ce35ebc6a3afb0622a2ec6f32e8a.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-6ecaf5e25b747645e181d79e55f08a6bac5bd1c3.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-70db02f23c658bccd5d3e66781f98b26ab4107ca.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-733e8ec18a1bd16ed292e9185e04835a7c1621db.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-798577ad678724e877a068b645f4575981761625.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-8fa5ace7e3bf48c86e82dcf78ec71baee0da8f5a.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-9c33dc09276022f9e3cfbc9d76d7ae0ff567d99c.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-9ce8c09907082114e9e5986915d806eeadcbf7cd.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-b0c6d16b98a5f529998b16a0502ffaa883c2d5cc.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-b73452ba27599b5e170faaae32bfef8b0a331fc6.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-b84d468c592033e08492238bd5c80639cbc63bd3.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-d69cab1f8c346dc2f51a2865feeeb744da88cdfd.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-d6e43a79c4429459bf2618c5a6a6d80757a67ef9.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/get-db67323871eddf68889aefc40aeed345459e6e63.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/post-165f1ed29df23e6c585ba08d4bd1748b81bef0c2.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/post-34c093a5823b18fbaee744bd095162aa29cf3338.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/post-837a9c2f7f5471d7163f1a149a29195fc73364ea.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/post-aa64fab8820e4b7362b3784fb7373023223bfad3.yml
 create mode 100644 server/tests/drivers/rackspace/fixtures/post-c29de27eb57dd3b1d715623c78d86ae1e4ca70d3.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/Rakefile b/server/Rakefile
index 3453bfe..8713941 100644
--- a/server/Rakefile
+++ b/server/Rakefile
@@ -32,7 +32,7 @@ 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.test_files = ['tests/common.rb', 'tests/drivers/mock/setup.rb'] + FileList.new('tests/drivers/mock/*_test.rb') + FileList.new('tests/rabbit_test.rb')
     t.options = "-v -v"
     t.verbose = true
     t.warning = false
diff --git a/server/tests/common.rb b/server/tests/common.rb
index e134388..7845040 100644
--- a/server/tests/common.rb
+++ b/server/tests/common.rb
@@ -17,14 +17,15 @@ ENV['API_PORT']     = '4040'
 require 'server'
 
 configure :test do
-  set :loggining, true
-  set :clean_trace, true
+  set :loggining, false
+  set :clean_trace, false
   set :dump_errors, true
-  set :raise_errors, true
+  set :raise_errors => false
   set :show_exceptions, false
 end
 
 require 'rack/test'
+require 'digest/sha1'
 
 Spec::Runner.configure do |conf|
   conf.include Rack::Test::Methods
@@ -32,22 +33,32 @@ end
 
 module DeltacloudTestCommon
 
-  def auth_hash(credentials)
-    "Basic " + Base64.encode64("#{credentials[:user]}:#{credentials[:password]}")
+  def recording?
+    @use_recording
   end
 
+  def record!
+    @use_recording = true
+  end
+
+
+  # Authentication helper for Basic HTTP authentication
+  # To change default user credentials stored in ENV['API_USER|PASSWORD'] you
+  # need to set opts[:credentials] = { :user => '...', :password => '...'}
+  #
   def authenticate(opts={})
     credentials = opts[:credentials] || { :user => ENV['API_USER'], :password => ENV['API_PASSWORD']}
     return {
-      'HTTP_AUTHORIZATION' => auth_hash(credentials),
+      'HTTP_AUTHORIZATION' => "Basic " + Base64.encode64("#{credentials[:user]}:#{credentials[:password]}")
     }
   end
 
-  def default_headers
-    { 'SERVER_PORT' => ENV['API_PORT'] }
-  end
-
-  def accept_header(format=:xml)
+  # HTTP Accept header helper.
+  # Will set appropriate value for this header.
+  # Available options for format are: :json, :html or :xml
+  # By default :xml is used
+  #
+  def accept(format=:xml)
     case format
       when :json then 'application/json;q=0.9'
       when :html then 'text/html;q=0.9'
@@ -56,37 +67,75 @@ module DeltacloudTestCommon
     end
   end
 
-  def create_url(url, format = :xml)
-    "#{url}"
+  # This helper will execute GET operation on given URI.
+  # You can set additional parameters using params Hash, which will be passed to
+  # request.
+  # You can change format used for communication using opts[:format] = :xml | :html :json
+  # You can turn on recording (you need to configure it first in setup.rb) using
+  # opts[:record] (true/false)
+  # You can force authentication using opts[:auth] parameter or use
+  # 'get_auth_url' which will do it for you ;-)
+  #
+  def get_url(uri, params={}, opts={})
+    header 'Accept', accept(opts[:format] || :xml)
+    if DeltacloudTestCommon::recording?
+      VCR.use_cassette("get-" + Digest::SHA1.hexdigest("#{uri}-#{params}}")) do
+        get(uri, params || {}, opts[:auth] ? authenticate(opts) : {})
+      end
+    else
+        get(uri, params || {}, opts[:auth] ? authenticate(opts) : {})
+    end
+    last_response.status.should_not == 401
+  end
+
+  def get_auth_url(uri, params={}, opts={})
+    opts.merge!(:auth => true)
+    get_url(uri, params, opts)
   end
 
-  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) : {}
+  def post_url(uri, params={}, opts={})
+    header 'Accept', accept(opts[:format] || :xml)
+    if DeltacloudTestCommon::recording?
+      VCR.use_cassette("post-" + Digest::SHA1.hexdigest("#{uri}-#{params}")) do
+        post(uri, params || {}, authenticate(opts))
+      end
+    else
+        post(uri, params || {}, 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
-    if last_response.status == 200
-      @xml_response = false
-      @xml_response = Nokogiri::XML(last_response.body)
+  def delete_url(uri, params={}, opts={})
+    header 'Accept', accept(opts[:format] || :xml)
+    if DeltacloudTestCommon::recording?
+      VCR.use_cassette("delete-"+Digest::SHA1.hexdigest("#{uri}-#{params}")) do
+        delete(uri, params || {}, authenticate(opts))
+      end
+    else
+        delete(uri, params || {}, authenticate(opts))
     end
   end
 
-  def require_authentication?(uri)
-    get uri, {}
-    true if last_response.status.eql?(401)
+  def put_url(uri, params={}, opts={})
+    header 'Accept', accept(opts[:format] || :xml)
+    if DeltacloudTestCommon::recording?
+      VCR.use_cassette("put-"+Digest::SHA1.hexdigest("#{uri}-#{params}-#{authenticate(opts)}")) do
+        put(uri, params || {}, authenticate(opts))
+      end
+    else
+        put(uri, params || {}, authenticate(opts))
+    end
   end
 
+  # This helper will automatically convert output from method above to Nokogiri
+  # XML object
   def last_xml_response
-    @xml_response || Nokogiri::XML::Document.new
+    Nokogiri::XML(last_response.body) #if last_response.status.to_s =~ /2(\d+)/
   end
 
-  def add_created_instance(id)
-    $created_instances ||= []
-    $created_instances << id
+  # Check if given URI require authentication
+  def require_authentication?(uri)
+    get uri, {}
+    true if last_response.status == 401
   end
 
   def with_provider(new_provider, &block)
@@ -98,6 +147,12 @@ module DeltacloudTestCommon
       ENV["API_PROVIDER"] = old_provider
     end
   end
+
+  def add_created_instance(id)
+    $created_instances ||= []
+    $created_instances << id
+  end
+
 end
 
 include DeltacloudTestCommon
diff --git a/server/tests/drivers/mock/api_test.rb b/server/tests/drivers/mock/api_test.rb
index 1b0fd55..e433fab 100644
--- a/server/tests/drivers/mock/api_test.rb
+++ b/server/tests/drivers/mock/api_test.rb
@@ -10,25 +10,25 @@ module DeltacloudUnitTest
     end
 
     def test_it_returns_entry_points
-      do_xml_request '/api'
+      get_auth_url '/api'
       (last_xml_response/'/api/link').length.should > 0
     end
 
     def test_it_has_correct_attributes_set
-      do_xml_request '/api'
+      get_auth_url '/api'
       (last_xml_response/'/api/link').each do |link|
         link.attributes.keys.sort.should == [ 'href', 'rel' ]
       end
     end
 
     def test_it_responses_to_html
-      do_request '/api', {}, false, { :format => :html }
+      get_url '/api', {}, { :format => :html }
       last_response.status.should == 200
       Nokogiri::HTML(last_response.body).search('html').first.name.should == 'html'
     end
 
     def test_it_responses_to_json
-      do_request '/api', {}, false, { :format => :json }
+      get_url '/api', {}, { :format => :json }
       last_response.status.should == 200
       JSON::parse(last_response.body).class.should == Hash
       JSON::parse(last_response.body)['api'].class.should == Hash
@@ -36,33 +36,33 @@ module DeltacloudUnitTest
 
     def test_it_switches_drivers
       with_provider("") do
-        do_xml_request '/api'
+        get_auth_url '/api'
         (last_xml_response/"api/link[rel = 'instances']").first.should_not == nil
       end
 
       # Switch to storage-only mock driver
       with_provider("storage") do
-        do_xml_request '/api'
+        get_auth_url '/api'
         (last_xml_response/"api/link[rel = 'instances']").first.should == nil
       end
     end
 
     def test_it_handles_unsupported_collections
-      do_xml_request '/api/no_such_collection'
+      get_auth_url '/api/no_such_collection'
       last_response.status.should == 404
 
       with_provider("storage") do
-        do_xml_request '/api/instances'
+        get_auth_url '/api/instances'
         last_response.status.should == 404
       end
     end
 
     def test_it_allows_accessing_docs
-      do_request '/api/docs/instances'
+      get_url '/api/docs/instances'
       last_response.status.should == 200
 
       with_provider("storage") do
-        do_request '/api/docs/instances'
+        get_url '/api/docs/instances'
         last_response.status.should == 404
       end
     end
@@ -74,14 +74,14 @@ module DeltacloudUnitTest
     end
 
     def test_it_expose_available_drivers
-      do_xml_request '/api/drivers'
+      get_auth_url '/api/drivers'
       last_response.status.should == 200
       (last_xml_response/"api/drivers").length.should > 0
       (last_xml_response/'api/drivers/driver').length.should > 0
     end
 
     def test_it_expose_ec2_driver_entrypoints
-      do_xml_request '/api/drivers'
+      get_auth_url '/api/drivers'
       last_response.status.should == 200
       (last_xml_response/"api/drivers").length.should > 0
       (last_xml_response/'api/drivers/driver[@id=ec2]/entrypoints').length.should > 0
@@ -90,21 +90,21 @@ module DeltacloudUnitTest
     end
 
     def test_it_supports_matrix_params
-      do_xml_request "/api;driver=ec2"
+      get_auth_url "/api;driver=ec2"
       last_response.status.should == 200
       (last_xml_response/'api').first[:driver].should == 'ec2'
-      do_xml_request "/api;driver=mock"
+      get_auth_url "/api;driver=mock"
       (last_xml_response/'api').first[:driver].should == 'mock'
-      do_xml_request "/api;driver=ec2/hardware_profiles"
+      get_auth_url "/api;driver=ec2/hardware_profiles"
       (last_xml_response/'hardware_profiles/hardware_profile/@id').map {|n| n.to_s}.include?('m1.small').should == true
       last_response.status.should == 200
     end
 
     def test_it_change_features_after_driver_change
-      do_xml_request "/api;driver=ec2"
+      get_auth_url "/api;driver=ec2"
       (last_xml_response/'api/link[@rel="instances"]/feature[@name="user_name"]').first.should == nil
       (last_xml_response/'api/link[@rel="instances"]/feature[@name="user_data"]').first.should_not == nil
-      do_xml_request "/api;driver=mock"
+      get_auth_url "/api;driver=mock"
       (last_xml_response/'api/link[@rel="instances"]/feature[@name="user_name"]').first.should_not == nil
       (last_xml_response/'api/link[@rel="instances"]/feature[@name="user_data"]').first.should == nil
     end
diff --git a/server/tests/drivers/mock/hardware_profiles_test.rb b/server/tests/drivers/mock/hardware_profiles_test.rb
index 8cdf5e1..c8bd012 100644
--- a/server/tests/drivers/mock/hardware_profiles_test.rb
+++ b/server/tests/drivers/mock/hardware_profiles_test.rb
@@ -10,26 +10,26 @@ module DeltacloudUnitTest
     end
 
     def test_it_returns_hardware_profiles
-      do_xml_request '/api/hardware_profiles'
+      get_url '/api/hardware_profiles'
       (last_xml_response/'hardware_profiles/hardware_profile').length.should > 0
     end
 
     def test_it_has_correct_attributes_set
-      do_xml_request '/api/hardware_profiles'
+      get_auth_url '/api/hardware_profiles'
       (last_xml_response/'hardware_profiles/hardware_profile').each do |profile|
         profile.attributes.keys.sort.should == [ 'href', 'id' ]
       end
     end
 
     def test_hardware_profiles_have_name
-      do_xml_request '/api/hardware_profiles'
+      get_auth_url '/api/hardware_profiles'
       (last_xml_response/'hardware_profiles/hardware_profile').each do |profile|
         (profile/'name').text.should_not == nil
       end
     end
 
     def test_hardware_profiles_have_unique_name
-      do_xml_request '/api/hardware_profiles'
+      get_auth_url '/api/hardware_profiles'
       names = []
       (last_xml_response/'hardware_profiles/hardware_profile').each do |profile|
         names << (profile/'name').text
@@ -38,7 +38,7 @@ module DeltacloudUnitTest
     end
 
     def test_hardware_profiles_have_unique_id
-      do_xml_request '/api/hardware_profiles'
+      get_auth_url '/api/hardware_profiles'
       ids = []
       (last_xml_response/'hardware_profiles/hardware_profile').each do |profile|
         ids << profile['id']
@@ -47,44 +47,42 @@ module DeltacloudUnitTest
     end
 
     def test_m1_xlarge_profile_has_correct_attributes
-      do_xml_request '/api/hardware_profiles'
+      get_auth_url '/api/hardware_profiles'
       profile = (last_xml_response/'hardware_profiles/hardware_profile[@id="m1-xlarge"]')
       test_profile_properties(profile)
     end
 
     def test_it_returns_valid_hardware_profile
-      do_xml_request '/api/hardware_profiles/m1-xlarge'
+      get_auth_url '/api/hardware_profiles/m1-xlarge'
       profile = (last_xml_response/'hardware_profile')
       test_profile_properties(profile)
     end
 
     def test_it_responses_to_json
-      do_request '/api/hardware_profiles', {}, false, { :format => :json }
+      get_url '/api/hardware_profiles', {}, { :format => :json }
       JSON::parse(last_response.body).class.should == Hash
       JSON::parse(last_response.body)['hardware_profiles'].class.should == Array
-
-      do_request '/api/hardware_profiles/m1-xlarge', {}, false, { :format => :json }
+      get_url '/api/hardware_profiles/m1-xlarge', {}, { :format => :json }
       last_response.status.should == 200
       JSON::parse(last_response.body).class.should == Hash
       JSON::parse(last_response.body)['hardware_profile'].class.should == Hash
     end
 
     def test_it_responses_to_html
-      do_request '/api/hardware_profiles', {}, false, { :format => :html }
+      get_url '/api/hardware_profiles', {}, { :format => :html }
       last_response.status.should == 200
       Nokogiri::HTML(last_response.body).search('html').first.name.should == 'html'
-
-      do_request '/api/hardware_profiles/m1-xlarge', {}, false, { :format => :html }
+      get_url '/api/hardware_profiles/m1-xlarge', {}, { :format => :html }
       last_response.status.should == 200
       Nokogiri::HTML(last_response.body).search('html').first.name.should == 'html'
     end
 
     def test_it_returns_error_on_wrong_name
-      do_request '/api/hardware_profiles/m1-unknown-wrongname', {}, false, { :format => :html }
+      get_url '/api/hardware_profiles/m1-unknown-wrongname', {}, { :format => :html }
       last_response.status.should == 404
-      do_xml_request '/api/hardware_profiles/m1-unknown-wrongname'
+      get_auth_url '/api/hardware_profiles/m1-unknown-wrongname'
       last_response.status.should == 404
-      do_request '/api/hardware_profiles/m1-unknown-wrongname', {}, false, { :format => :json }
+      get_url '/api/hardware_profiles/m1-unknown-wrongname', {}, { :format => :json }
       last_response.status.should == 404
     end
 
diff --git a/server/tests/drivers/mock/images_test.rb b/server/tests/drivers/mock/images_test.rb
index be2a51f..796ead2 100644
--- a/server/tests/drivers/mock/images_test.rb
+++ b/server/tests/drivers/mock/images_test.rb
@@ -14,31 +14,31 @@ module DeltacloudUnitTest
     end
 
     def test_it_returns_images
-      do_xml_request '/api/images', {}, true
+      get_auth_url '/api/images', {}
       (last_xml_response/'images/image').length.should > 0
     end
 
     def test_it_has_correct_attributes_set
-      do_xml_request '/api/images', {}, true
+      get_auth_url '/api/images', {}
       (last_xml_response/'images/image').each do |image|
         image.attributes.keys.sort.should == [ 'href', 'id' ]
       end
     end
 
     def test_img1_has_correct_attributes
-      do_xml_request '/api/images', {}, true
+      get_auth_url '/api/images', {}
       image = (last_xml_response/'images/image[@id="img1"]')
       test_image_attributes(image)
     end
 
     def test_it_returns_valid_image
-      do_xml_request '/api/images/img1', {}, true
+      get_auth_url '/api/images/img1', {}
       image = (last_xml_response/'image')
       test_image_attributes(image)
     end
 
     def test_it_has_unique_ids
-      do_xml_request '/api/images', {}, true
+      get_auth_url '/api/images', {}
       ids = []
       (last_xml_response/'images/image').each do |image|
         ids << image['id'].to_s
@@ -47,54 +47,52 @@ module DeltacloudUnitTest
     end
 
     def test_it_has_valid_urls
-      do_xml_request '/api/images', {}, true
+      get_auth_url '/api/images', {}
       ids = []
       images = (last_xml_response/'images/image')
       images.each do |image|
-        do_xml_request image['href'].to_s, {}, true
+        get_auth_url image['href'].to_s, {}
         (last_xml_response/'image').first['href'].should == image['href'].to_s
       end
     end
 
     def test_it_can_filter_using_owner_id
-      do_xml_request '/api/images', { :owner_id => 'mockuser' }, true
+      get_auth_url '/api/images', { :owner_id => 'mockuser' }
       (last_xml_response/'images/image').length.should == 1
       (last_xml_response/'images/image/owner_id').first.text.should == 'mockuser'
     end
 
     def test_it_can_filter_using_unknown_owner_id
-      do_xml_request '/api/images', { :architecture => 'unknown_user' }, true
+      get_auth_url '/api/images', { :architecture => 'unknown_user' }
       (last_xml_response/'images/image').length.should == 0
     end
 
     def test_it_can_filter_using_architecture
-      do_xml_request '/api/images', { :architecture => 'x86_64' }, true
+      get_auth_url '/api/images', { :architecture => 'x86_64' }
       (last_xml_response/'images/image').length.should == 1
       (last_xml_response/'images/image/architecture').first.text.should == 'x86_64'
     end
 
     def test_it_can_filter_using_unknown_architecture
-      do_xml_request '/api/images', { :architecture => 'unknown_arch' }, true
+      get_auth_url '/api/images', { :architecture => 'unknown_arch' }
       (last_xml_response/'images/image').length.should == 0
     end
 
     def test_it_responses_to_json
-      do_request '/api/images', {}, true, { :format => :json }
+      get_auth_url '/api/images', {}, { :format => :json }
       JSON::parse(last_response.body).class.should == Hash
       JSON::parse(last_response.body)['images'].class.should == Array
-
-      do_request '/api/images/img1', {}, true, { :format => :json }
+      get_auth_url '/api/images/img1', {}, { :format => :json }
       last_response.status.should == 200
       JSON::parse(last_response.body).class.should == Hash
       JSON::parse(last_response.body)['image'].class.should == Hash
     end
 
     def test_it_responses_to_html
-      do_request '/api/images', {}, true, { :format => :html }
+      get_auth_url '/api/images', {}, { :format => :html }
       last_response.status.should == 200
       Nokogiri::HTML(last_response.body).search('html').first.name.should == 'html'
-
-      do_request '/api/images/img1', {}, true, { :format => :html }
+      get_auth_url '/api/images/img1', {}, { :format => :html }
       last_response.status.should == 200
       Nokogiri::HTML(last_response.body).search('html').first.name.should == 'html'
     end
diff --git a/server/tests/drivers/mock/instance_states_test.rb b/server/tests/drivers/mock/instance_states_test.rb
index 60a17b7..36145a9 100644
--- a/server/tests/drivers/mock/instance_states_test.rb
+++ b/server/tests/drivers/mock/instance_states_test.rb
@@ -14,12 +14,12 @@ module DeltacloudUnitTest
     end
 
     def test_it_returns_instance_states
-      do_xml_request '/api/instance_states', {}, true
+      get_auth_url '/api/instance_states', {}
       (last_xml_response/'states/state').length.should > 0
     end
 
     def test_each_state_has_transition
-      do_xml_request '/api/instance_states', {}, true
+      get_auth_url '/api/instance_states', {}
       (last_xml_response/'states/state').each do |state|
         next if state['name'].eql?('finish') # Finnish state doesn't have transitions
         (state/'transition').length.should > 0
@@ -40,13 +40,13 @@ module DeltacloudUnitTest
     end
 
     def test_it_responses_to_html
-      do_request '/api/instance_states', {}, false, { :format => :html }
+      get_url '/api/instance_states', {}, { :format => :html }
       last_response.status.should == 200
       Nokogiri::HTML(last_response.body).search('html').first.name.should == 'html'
     end
 
     def test_it_responses_to_png
-      do_request '/api/instance_states', { :format => 'png' }, false
+      get_url '/api/instance_states', { :format => 'png' }
       last_response.status.should == 200
       last_response.headers['Content-Type'].should =~ /^image\/png/
     end
diff --git a/server/tests/drivers/mock/instances_test.rb b/server/tests/drivers/mock/instances_test.rb
index 14541ae..4725720 100644
--- a/server/tests/drivers/mock/instances_test.rb
+++ b/server/tests/drivers/mock/instances_test.rb
@@ -14,19 +14,19 @@ module DeltacloudUnitTest
     end
 
     def test_it_returns_instances
-      do_xml_request '/api/instances', {}, true
+      get_auth_url '/api/instances', {}
       (last_xml_response/'instances/instance').length.should > 0
     end
 
     def test_it_has_correct_attributes_set
-      do_xml_request '/api/images', {}, true
+      get_auth_url '/api/images', {}
       (last_xml_response/'images/image').each do |image|
         image.attributes.keys.sort.should == [ 'href', 'id' ]
       end
     end
 
     def test_it_has_unique_ids
-      do_xml_request '/api/instances', {}, true
+      get_auth_url '/api/instances', {}
       ids = []
       (last_xml_response/'instances/instance').each do |image|
         ids << image['id'].to_s
@@ -35,34 +35,33 @@ module DeltacloudUnitTest
     end
 
     def test_inst1_has_correct_attributes
-      do_xml_request '/api/instances', {}, true
+      get_auth_url '/api/instances', {}
       instance = (last_xml_response/'instances/instance[@id="inst1"]')
       test_instance_attributes(instance)
     end
 
     def test_it_returns_valid_realm
-      do_xml_request '/api/instances/inst1', {}, true
+      get_auth_url '/api/instances/inst1', {}
       instance = (last_xml_response/'instance')
       test_instance_attributes(instance)
     end
 
     def test_it_responses_to_json
-      do_request '/api/instances', {}, true, { :format => :json }
+      get_auth_url '/api/instances', {}, { :format => :json }
       JSON::parse(last_response.body).class.should == Hash
       JSON::parse(last_response.body)['instances'].class.should == Array
 
-      do_request '/api/instances/inst1', {}, true, { :format => :json }
+      get_auth_url '/api/instances/inst1', {}, { :format => :json }
       last_response.status.should == 200
       JSON::parse(last_response.body).class.should == Hash
       JSON::parse(last_response.body)['instance'].class.should == Hash
     end
 
     def test_it_responses_to_html
-      do_request '/api/instances', {}, true, { :format => :html }
+      get_auth_url '/api/instances', {}, { :format => :html }
       last_response.status.should == 200
       Nokogiri::HTML(last_response.body).search('html').first.name.should == 'html'
-
-      do_request '/api/instances/inst1', {}, true, { :format => :html }
+      get_auth_url '/api/instances/inst1', {}, { :format => :html }
       last_response.status.should == 200
       Nokogiri::HTML(last_response.body).search('html').first.name.should == 'html'
     end
@@ -71,11 +70,10 @@ module DeltacloudUnitTest
       params = {
         :image_id => 'img1'
       }
-      header 'Accept', accept_header(:xml)
-      post '/api/instances', params, authenticate
+      post_url '/api/instances', params
       last_response.status.should == 201
       last_response.headers['Location'].should_not == nil
-      do_xml_request last_response.headers['Location'], {}, true
+      get_auth_url last_response.headers['Location'], {}
       (last_xml_response/'instance/name').should_not == nil
       add_created_instance (last_xml_response/'instance').first['id']
       test_instance_attributes(last_xml_response/'instance')
@@ -86,11 +84,10 @@ module DeltacloudUnitTest
         :image_id => 'img1',
         :name => "unit_test_instance1"
       }
-      header 'Accept', accept_header(:xml)
-      post '/api/instances', params, authenticate(:format => :xml)
+      post_url '/api/instances', params
       last_response.status.should == 201
       last_response.headers['Location'].should_not == nil
-      do_xml_request last_response.headers['Location'], {}, true
+      get_auth_url last_response.headers['Location'], {}
       (last_xml_response/'instance/name').text.should == 'unit_test_instance1'
       add_created_instance (last_xml_response/'instance').first['id']
       test_instance_attributes(last_xml_response/'instance')
@@ -102,11 +99,10 @@ module DeltacloudUnitTest
         :name => "unit_test_instance1",
         :hwp_id => "m1-xlarge"
       }
-      header 'Accept', accept_header(:xml)
-      post '/api/instances', params, authenticate(:format => :xml)
+      post_url '/api/instances', params
       last_response.status.should == 201
       last_response.headers['Location'].should_not == nil
-      do_xml_request last_response.headers['Location'], {}, true
+      get_auth_url last_response.headers['Location'], {}
       (last_xml_response/'instance/name').text.should == 'unit_test_instance1'
       (last_xml_response/'instance/hardware_profile').first['id'].should == 'm1-xlarge'
       add_created_instance (last_xml_response/'instance').first['id']
@@ -115,18 +111,18 @@ module DeltacloudUnitTest
 
     def test_it_z0_stop_and_start_instance
       $created_instances.each do |instance_id|
-        do_xml_request "/api/instances/#{instance_id}", {}, true
+        get_auth_url "/api/instances/#{instance_id}", {}
         stop_url = (last_xml_response/'actions/link[@rel="stop"]').first['href']
         stop_url.should_not == nil
-        post create_url(stop_url), { :format => 'xml' }, authenticate
+        post_url stop_url
         last_response.status.should == 200
         instance = Nokogiri::XML(last_response.body)
         test_instance_attributes(instance)
         (instance/'state').text.should == 'STOPPED'
-        do_xml_request "/api/instances/#{instance_id}", {}, true
+        get_auth_url "/api/instances/#{instance_id}", {}
         start_url = (last_xml_response/'actions/link[@rel="start"]').first['href']
         start_url.should_not == nil
-        post create_url(start_url), { :format => 'xml'}, authenticate
+        post_url start_url
         last_response.status.should == 200
         instance = Nokogiri::XML(last_response.body)
         test_instance_attributes(instance)
@@ -136,10 +132,10 @@ module DeltacloudUnitTest
 
     def test_z0_reboot_instance
       $created_instances.each do |instance_id|
-        do_xml_request "/api/instances/#{instance_id}", {}, true
+        get_auth_url "/api/instances/#{instance_id}", {}
         reboot_url = (last_xml_response/'actions/link[@rel="reboot"]').first['href']
         reboot_url.should_not == nil
-        post create_url(reboot_url), { :format => "xml"}, authenticate
+        post_url reboot_url
         last_response.status.should == 200
         instance = Nokogiri::XML(last_response.body)
         test_instance_attributes(instance)
@@ -149,10 +145,10 @@ module DeltacloudUnitTest
 
     def test_z1_stop_created_instances
       $created_instances.each do |instance_id|
-        do_xml_request "/api/instances/#{instance_id}", {}, true
+        get_auth_url "/api/instances/#{instance_id}", {}
         stop_url = (last_xml_response/'actions/link[@rel="stop"]').first['href']
         stop_url.should_not == nil
-        post create_url(stop_url), {}, authenticate
+        post_url stop_url, {}
         last_response.status.should == 200
         instance = Nokogiri::XML(last_response.body)
         test_instance_attributes(instance)
@@ -162,10 +158,10 @@ module DeltacloudUnitTest
 
     def test_z2_destroy_created_instances
       $created_instances.each do |instance_id|
-        do_xml_request "/api/instances/#{instance_id}", {}, true
+        get_auth_url "/api/instances/#{instance_id}", {}
         destroy_url = (last_xml_response/'actions/link[@rel="destroy"]').first['href']
         destroy_url.should_not == nil
-        delete create_url(destroy_url), {}, authenticate
+        delete_url destroy_url, {}
         last_response.status.should == 204
       end
     end
@@ -196,21 +192,21 @@ module DeltacloudUnitTest
       (instance/'image').size.should > 0
       (instance/'image').first['href'].should_not == ""
       (instance/'image').first['id'].should_not == ""
-      do_xml_request (instance/'image').first['href'], {}, true
+      get_auth_url (instance/'image').first['href'], {}
       (last_xml_response/'image').should_not == nil
       (last_xml_response/'image').first['href'] == (instance/'image').first['href']
 
       (instance/'realm').size.should > 0
       (instance/'realm').first['href'].should_not == ""
       (instance/'realm').first['id'].should_not == ""
-      do_xml_request (instance/'realm').first['href']
+      get_auth_url (instance/'realm').first['href']
       (last_xml_response/'realm').should_not == nil
       (last_xml_response/'realm').first['href'] == (instance/'realm').first['href']
 
       (instance/'hardware_profile').size.should > 0
       (instance/'hardware_profile').first['href'].should_not == ""
       (instance/'hardware_profile').first['id'].should_not == ""
-      do_xml_request (instance/'hardware_profile').first['href']
+      get_auth_url (instance/'hardware_profile').first['href']
       (last_xml_response/'hardware_profile').should_not == nil
       (last_xml_response/'hardware_profile').first['href'] == (instance/'hardware_profile').first['href']
     end
diff --git a/server/tests/drivers/mock/realms_test.rb b/server/tests/drivers/mock/realms_test.rb
index e96b8db..5de01a6 100644
--- a/server/tests/drivers/mock/realms_test.rb
+++ b/server/tests/drivers/mock/realms_test.rb
@@ -14,31 +14,31 @@ module DeltacloudUnitTest
     end
 
     def test_it_returns_realms
-      do_xml_request '/api/realms', {}, true
+      get_auth_url '/api/realms', {}
       (last_xml_response/'realms/realm').length.should > 0
     end
 
     def test_it_has_correct_attributes_set
-      do_xml_request '/api/realms', {}, true
+      get_auth_url '/api/realms', {}
       (last_xml_response/'realms/realm').each do |realm|
         realm.attributes.keys.sort.should == [ 'href', 'id' ]
       end
     end
 
     def test_us_has_correct_attributes
-      do_xml_request '/api/realms', {}, true
+      get_auth_url '/api/realms', {}
       realm = (last_xml_response/'realms/realm[@id="us"]')
       test_realm_attributes(realm)
     end
 
     def test_it_returns_valid_realm
-      do_xml_request '/api/realms/us', {}, true
+      get_auth_url '/api/realms/us', {}
       realm = (last_xml_response/'realm')
       test_realm_attributes(realm)
     end
 
     def test_it_has_unique_ids
-      do_xml_request '/api/realms', {}, true
+      get_auth_url '/api/realms', {}
       ids = []
       (last_xml_response/'realms/realm').each do |realm|
         ids << realm['id'].to_s
@@ -47,22 +47,20 @@ module DeltacloudUnitTest
     end
 
     def test_it_responses_to_json
-      do_request '/api/realms', {}, false, { :format => :json }
+      get_auth_url '/api/realms', {}, { :format => :json }
       JSON::parse(last_response.body).class.should == Hash
       JSON::parse(last_response.body)['realms'].class.should == Array
-
-      do_request '/api/realms/us', {}, false, { :format => :json }
+      get_auth_url '/api/realms/us', {}, { :format => :json }
       last_response.status.should == 200
       JSON::parse(last_response.body).class.should == Hash
       JSON::parse(last_response.body)['realm'].class.should == Hash
     end
 
     def test_it_responses_to_html
-      do_request '/api/realms', {}, false, { :format => :html }
+      get_auth_url '/api/realms', {}, { :format => :html }
       last_response.status.should == 200
       Nokogiri::HTML(last_response.body).search('html').first.name.should == 'html'
-
-      do_request '/api/realms/us', {}, false, { :format => :html }
+      get_auth_url '/api/realms/us', {}, { :format => :html }
       last_response.status.should == 200
       Nokogiri::HTML(last_response.body).search('html').first.name.should == 'html'
     end
diff --git a/server/tests/drivers/rackspace/api_test.rb b/server/tests/drivers/rackspace/api_test.rb
index e351388..e9d54f8 100644
--- a/server/tests/drivers/rackspace/api_test.rb
+++ b/server/tests/drivers/rackspace/api_test.rb
@@ -11,13 +11,13 @@ module RackspaceTest
     end
 
     def test_01_it_returns_entry_points
-      do_xml_request '/api;driver=rackspace/?force_auth=1', {}, true
+      get_auth_url '/api;driver=rackspace/?force_auth=1'
       (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'
+      get_url '/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
@@ -26,7 +26,7 @@ module RackspaceTest
     end
 
     def test_03_it_has_rackspace_collections
-      do_xml_request '/api;driver=rackspace'
+      get_url '/api;driver=rackspace'
       collections = (last_xml_response/'/api/link').collect { |f| f[:rel] }
       collections.include?('instance_states').should == true
       collections.include?('instances').should == true
diff --git a/server/tests/drivers/rackspace/fixtures/get-1eb29b4121fee923d3d619fd8f7c6af68aae0ef4.yml b/server/tests/drivers/rackspace/fixtures/get-1eb29b4121fee923d3d619fd8f7c6af68aae0ef4.yml
new file mode 100644
index 0000000..ee1518f
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-1eb29b4121fee923d3d619fd8f7c6af68aae0ef4.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:36:00 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:00 GMT
+      x-varnish: 
+      - "437922094"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:02 GMT
+      content-length: 
+      - "242"
+      cache-control: 
+      - no-cache
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+    body: "{\"server\":{\"progress\":100,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/get-2ee5580739f1b704a8b4a5e453641be70c37dac1.yml b/server/tests/drivers/rackspace/fixtures/get-2ee5580739f1b704a8b4a5e453641be70c37dac1.yml
new file mode 100644
index 0000000..24d10a8
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-2ee5580739f1b704a8b4a5e453641be70c37dac1.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:36:08 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:00 GMT
+      x-varnish: 
+      - "437922607"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:09 GMT
+      content-length: 
+      - "242"
+      cache-control: 
+      - no-cache
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+    body: "{\"server\":{\"progress\":100,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/get-2fcfc33bdaf35e34ea8cd309f35c48ba675afa8b.yml b/server/tests/drivers/rackspace/fixtures/get-2fcfc33bdaf35e34ea8cd309f35c48ba675afa8b.yml
new file mode 100644
index 0000000..4a385db
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-2fcfc33bdaf35e34ea8cd309f35c48ba675afa8b.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:35: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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - 437918347 437909592
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:35:34 GMT
+      content-length: 
+      - "368"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "102"
+      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/drivers/rackspace/fixtures/get-33788dfa9cf3ec4e37e4057bca0143591e54788e.yml b/server/tests/drivers/rackspace/fixtures/get-33788dfa9cf3ec4e37e4057bca0143591e54788e.yml
new file mode 100644
index 0000000..f2ac292
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-33788dfa9cf3ec4e37e4057bca0143591e54788e.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:38: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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722338
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - "437934866"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:38:19 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/drivers/rackspace/fixtures/get-48f898a80864f048c98b231819b670ef2024c4b4.yml b/server/tests/drivers/rackspace/fixtures/get-48f898a80864f048c98b231819b670ef2024c4b4.yml
new file mode 100644
index 0000000..d33fb88
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-48f898a80864f048c98b231819b670ef2024c4b4.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:36:46 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722338
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:44 GMT
+      x-varnish: 
+      - "437926725"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:47 GMT
+      content-length: 
+      - "243"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+      x-purge-key: 
+      - /561604/servers/722338
+    body: "{\"server\":{\"progress\":100,\"id\":722338,\"imageId\":71,\"flavorId\":2,\"status\":\"ACTIVE\",\"name\":\"ThuMar3114354602002011\",\"hostId\":\"9d13306835530e8b384b0751b2bbb51b\",\"addresses\":{\"public\":[\"50.56.108.136\"],\"private\":[\"10.181.175.131\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/get-6d10f489e397ce35ebc6a3afb0622a2ec6f32e8a.yml b/server/tests/drivers/rackspace/fixtures/get-6d10f489e397ce35ebc6a3afb0622a2ec6f32e8a.yml
new file mode 100644
index 0000000..9fe6b14
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-6d10f489e397ce35ebc6a3afb0622a2ec6f32e8a.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:36: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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:26 GMT
+      x-varnish: 
+      - "437924330"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:32 GMT
+      content-length: 
+      - "243"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+      x-purge-key: 
+      - /561604/servers/722336
+    body: "{\"server\":{\"progress\":100,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/get-6ecaf5e25b747645e181d79e55f08a6bac5bd1c3.yml b/server/tests/drivers/rackspace/fixtures/get-6ecaf5e25b747645e181d79e55f08a6bac5bd1c3.yml
new file mode 100644
index 0000000..4dc31f7
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-6ecaf5e25b747645e181d79e55f08a6bac5bd1c3.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:35:53 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:35:47 GMT
+      x-varnish: 
+      - "437921409"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:35:54 GMT
+      content-length: 
+      - "240"
+      cache-control: 
+      - no-cache
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+    body: "{\"server\":{\"progress\":0,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/get-70db02f23c658bccd5d3e66781f98b26ab4107ca.yml b/server/tests/drivers/rackspace/fixtures/get-70db02f23c658bccd5d3e66781f98b26ab4107ca.yml
new file mode 100644
index 0000000..1b41e72
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-70db02f23c658bccd5d3e66781f98b26ab4107ca.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:36:43 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722338
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:44 GMT
+      x-varnish: 
+      - "437926208"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:45 GMT
+      content-length: 
+      - "243"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+      x-purge-key: 
+      - /561604/servers/722338
+    body: "{\"server\":{\"progress\":100,\"id\":722338,\"imageId\":71,\"flavorId\":2,\"status\":\"ACTIVE\",\"name\":\"ThuMar3114354602002011\",\"hostId\":\"9d13306835530e8b384b0751b2bbb51b\",\"addresses\":{\"public\":[\"50.56.108.136\"],\"private\":[\"10.181.175.131\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/get-733e8ec18a1bd16ed292e9185e04835a7c1621db.yml b/server/tests/drivers/rackspace/fixtures/get-733e8ec18a1bd16ed292e9185e04835a7c1621db.yml
new file mode 100644
index 0000000..7be11d7
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-733e8ec18a1bd16ed292e9185e04835a7c1621db.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:35: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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - 437917767 437909592
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:35:32 GMT
+      content-length: 
+      - "368"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "100"
+      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/drivers/rackspace/fixtures/get-798577ad678724e877a068b645f4575981761625.yml b/server/tests/drivers/rackspace/fixtures/get-798577ad678724e877a068b645f4575981761625.yml
new file mode 100644
index 0000000..896d9ce
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-798577ad678724e877a068b645f4575981761625.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:36: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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722338
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:08 GMT
+      x-varnish: 
+      - "437925562"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:37 GMT
+      content-length: 
+      - "242"
+      cache-control: 
+      - no-cache
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+    body: "{\"server\":{\"progress\":100,\"id\":722338,\"imageId\":71,\"flavorId\":2,\"status\":\"BUILD\",\"name\":\"ThuMar3114354602002011\",\"hostId\":\"9d13306835530e8b384b0751b2bbb51b\",\"addresses\":{\"public\":[\"50.56.108.136\"],\"private\":[\"10.181.175.131\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/get-8fa5ace7e3bf48c86e82dcf78ec71baee0da8f5a.yml b/server/tests/drivers/rackspace/fixtures/get-8fa5ace7e3bf48c86e82dcf78ec71baee0da8f5a.yml
new file mode 100644
index 0000000..017ee05
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-8fa5ace7e3bf48c86e82dcf78ec71baee0da8f5a.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:35: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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - 437917622 437909592
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:35:30 GMT
+      content-length: 
+      - "368"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "98"
+      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/drivers/rackspace/fixtures/get-9c33dc09276022f9e3cfbc9d76d7ae0ff567d99c.yml b/server/tests/drivers/rackspace/fixtures/get-9c33dc09276022f9e3cfbc9d76d7ae0ff567d99c.yml
new file mode 100644
index 0000000..12c0885
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-9c33dc09276022f9e3cfbc9d76d7ae0ff567d99c.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:36:23 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:24 GMT
+      x-varnish: 
+      - "437923937"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:24 GMT
+      content-length: 
+      - "244"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+      x-purge-key: 
+      - /561604/servers/722336
+    body: "{\"server\":{\"progress\":100,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"UNKNOWN\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/get-9ce8c09907082114e9e5986915d806eeadcbf7cd.yml b/server/tests/drivers/rackspace/fixtures/get-9ce8c09907082114e9e5986915d806eeadcbf7cd.yml
new file mode 100644
index 0000000..43b32d9
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-9ce8c09907082114e9e5986915d806eeadcbf7cd.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:35: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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - 437918579 437909890
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:35:38 GMT
+      content-length: 
+      - "2460"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "98"
+      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/drivers/rackspace/fixtures/get-b0c6d16b98a5f529998b16a0502ffaa883c2d5cc.yml b/server/tests/drivers/rackspace/fixtures/get-b0c6d16b98a5f529998b16a0502ffaa883c2d5cc.yml
new file mode 100644
index 0000000..92d9b95
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-b0c6d16b98a5f529998b16a0502ffaa883c2d5cc.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:37:59 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - "437933406"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:38:00 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/drivers/rackspace/fixtures/get-b73452ba27599b5e170faaae32bfef8b0a331fc6.yml b/server/tests/drivers/rackspace/fixtures/get-b73452ba27599b5e170faaae32bfef8b0a331fc6.yml
new file mode 100644
index 0000000..e7a250c
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-b73452ba27599b5e170faaae32bfef8b0a331fc6.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:36:15 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:00 GMT
+      x-varnish: 
+      - "437923080"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:17 GMT
+      content-length: 
+      - "242"
+      cache-control: 
+      - no-cache
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+    body: "{\"server\":{\"progress\":100,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/get-b84d468c592033e08492238bd5c80639cbc63bd3.yml b/server/tests/drivers/rackspace/fixtures/get-b84d468c592033e08492238bd5c80639cbc63bd3.yml
new file mode 100644
index 0000000..3035cea
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-b84d468c592033e08492238bd5c80639cbc63bd3.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:35:27 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    body: 
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/get-d69cab1f8c346dc2f51a2865feeeb744da88cdfd.yml b/server/tests/drivers/rackspace/fixtures/get-d69cab1f8c346dc2f51a2865feeeb744da88cdfd.yml
new file mode 100644
index 0000000..e2b5490
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-d69cab1f8c346dc2f51a2865feeeb744da88cdfd.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:35: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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - 437917617 437909592
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:35:29 GMT
+      content-length: 
+      - "368"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "96"
+      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/drivers/rackspace/fixtures/get-d6e43a79c4429459bf2618c5a6a6d80757a67ef9.yml b/server/tests/drivers/rackspace/fixtures/get-d6e43a79c4429459bf2618c5a6a6d80757a67ef9.yml
new file mode 100644
index 0000000..7636644
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-d6e43a79c4429459bf2618c5a6a6d80757a67ef9.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:35: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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - 437918350 437909890
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:35:36 GMT
+      content-length: 
+      - "2460"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "96"
+      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/drivers/rackspace/fixtures/get-db67323871eddf68889aefc40aeed345459e6e63.yml b/server/tests/drivers/rackspace/fixtures/get-db67323871eddf68889aefc40aeed345459e6e63.yml
new file mode 100644
index 0000000..c1e371a
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/get-db67323871eddf68889aefc40aeed345459e6e63.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:36: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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:26 GMT
+      x-varnish: 
+      - "437924950"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:35 GMT
+      content-length: 
+      - "243"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+      x-purge-key: 
+      - /561604/servers/722336
+    body: "{\"server\":{\"progress\":100,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/post-165f1ed29df23e6c585ba08d4bd1748b81bef0c2.yml b/server/tests/drivers/rackspace/fixtures/post-165f1ed29df23e6c585ba08d4bd1748b81bef0c2.yml
new file mode 100644
index 0000000..9d8031f
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/post-165f1ed29df23e6c585ba08d4bd1748b81bef0c2.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:35:46 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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\":\"Thu Mar 31 14:35:46 +0200 2011\"}}"
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - "437920217"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:35:51 GMT
+      content-length: 
+      - "286"
+      cache-control: 
+      - no-cache
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+    body: "{\"server\":{\"progress\":0,\"id\":722338,\"imageId\":71,\"flavorId\":2,\"status\":\"BUILD\",\"adminPass\":\"ThuMar311435460200201156oVOLhc2\",\"name\":\"ThuMar3114354602002011\",\"hostId\":\"9d13306835530e8b384b0751b2bbb51b\",\"addresses\":{\"public\":[\"50.56.108.136\"],\"private\":[\"10.181.175.131\"]},\"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/722338
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:35:51 GMT
+      x-varnish: 
+      - "437921027"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:35:52 GMT
+      content-length: 
+      - "240"
+      cache-control: 
+      - no-cache
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+    body: "{\"server\":{\"progress\":0,\"id\":722338,\"imageId\":71,\"flavorId\":2,\"status\":\"BUILD\",\"name\":\"ThuMar3114354602002011\",\"hostId\":\"9d13306835530e8b384b0751b2bbb51b\",\"addresses\":{\"public\":[\"50.56.108.136\"],\"private\":[\"10.181.175.131\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/fixtures/post-34c093a5823b18fbaee744bd095162aa29cf3338.yml b/server/tests/drivers/rackspace/fixtures/post-34c093a5823b18fbaee744bd095162aa29cf3338.yml
new file mode 100644
index 0000000..6db0416
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/post-34c093a5823b18fbaee744bd095162aa29cf3338.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:36:48 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:26 GMT
+      x-varnish: 
+      - "437926870"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:50 GMT
+      content-length: 
+      - "243"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+      x-purge-key: 
+      - /561604/servers/722336
+    body: "{\"server\":{\"progress\":100,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:36:50 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:26 GMT
+      x-varnish: 
+      - "437927160"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:52 GMT
+      content-length: 
+      - "243"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+      x-purge-key: 
+      - /561604/servers/722336
+    body: "{\"server\":{\"progress\":100,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"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/722336/action
+    body: "{\"reboot\":{\"type\":\"HARD\"}}"
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - "437927306"
+      connection: 
+      - keep-alive
+      content-type: 
+      - text/xml
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:36:55 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/drivers/rackspace/fixtures/post-837a9c2f7f5471d7163f1a149a29195fc73364ea.yml b/server/tests/drivers/rackspace/fixtures/post-837a9c2f7f5471d7163f1a149a29195fc73364ea.yml
new file mode 100644
index 0000000..b4645b7
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/post-837a9c2f7f5471d7163f1a149a29195fc73364ea.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:38:01 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722338
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:44 GMT
+      x-varnish: 
+      - "437933481"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:38:02 GMT
+      content-length: 
+      - "243"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+      x-purge-key: 
+      - /561604/servers/722338
+    body: "{\"server\":{\"progress\":100,\"id\":722338,\"imageId\":71,\"flavorId\":2,\"status\":\"ACTIVE\",\"name\":\"ThuMar3114354602002011\",\"hostId\":\"9d13306835530e8b384b0751b2bbb51b\",\"addresses\":{\"public\":[\"50.56.108.136\"],\"private\":[\"10.181.175.131\"]},\"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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:38:04 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722338
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:36:44 GMT
+      x-varnish: 
+      - 437933775 437933481
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:38:04 GMT
+      content-length: 
+      - "243"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "2"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+      x-purge-key: 
+      - /561604/servers/722338
+    body: "{\"server\":{\"progress\":100,\"id\":722338,\"imageId\":71,\"flavorId\":2,\"status\":\"ACTIVE\",\"name\":\"ThuMar3114354602002011\",\"hostId\":\"9d13306835530e8b384b0751b2bbb51b\",\"addresses\":{\"public\":[\"50.56.108.136\"],\"private\":[\"10.181.175.131\"]},\"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/722338
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - "437933848"
+      connection: 
+      - keep-alive
+      content-type: 
+      - text/xml
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:38:07 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/drivers/rackspace/fixtures/post-aa64fab8820e4b7362b3784fb7373023223bfad3.yml b/server/tests/drivers/rackspace/fixtures/post-aa64fab8820e4b7362b3784fb7373023223bfad3.yml
new file mode 100644
index 0000000..92d4acc
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/post-aa64fab8820e4b7362b3784fb7373023223bfad3.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:37:21 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:37:07 GMT
+      x-varnish: 
+      - "437930088"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:37:22 GMT
+      content-length: 
+      - "243"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+      x-purge-key: 
+      - /561604/servers/722336
+    body: "{\"server\":{\"progress\":100,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:37:23 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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:37:07 GMT
+      x-varnish: 
+      - "437930162"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:37:25 GMT
+      content-length: 
+      - "243"
+      cache-control: 
+      - s-maxage=1800
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+      x-purge-key: 
+      - /561604/servers/722336
+    body: "{\"server\":{\"progress\":100,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"ACTIVE\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - "437930164"
+      connection: 
+      - keep-alive
+      content-type: 
+      - text/xml
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:37:28 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/drivers/rackspace/fixtures/post-c29de27eb57dd3b1d715623c78d86ae1e4ca70d3.yml b/server/tests/drivers/rackspace/fixtures/post-c29de27eb57dd3b1d715623c78d86ae1e4ca70d3.yml
new file mode 100644
index 0000000..7212577
--- /dev/null
+++ b/server/tests/drivers/rackspace/fixtures/post-c29de27eb57dd3b1d715623c78d86ae1e4ca70d3.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: 
+      - 47de1170d57eb8f11dba2f6e7fd26838
+  response: !ruby/struct:VCR::Response 
+    status: !ruby/struct:VCR::ResponseStatus 
+      code: 204
+      message: No Content
+    headers: 
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      content-type: 
+      - application/octet-stream
+      server: 
+      - Apache/2.2.3 (Mosso Engineering)
+      date: 
+      - Thu, 31 Mar 2011 12:35: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: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+    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\":\"Thu Mar 31 14:35:38 +0200 2011\"}}"
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - "437918823"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:35:43 GMT
+      content-length: 
+      - "286"
+      cache-control: 
+      - no-cache
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+    body: "{\"server\":{\"progress\":0,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"adminPass\":\"ThuMar3114353802002011sBX72f3iP\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"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/722336
+    body: 
+    headers: 
+      accept: 
+      - application/json
+      x-auth-token: 
+      - 82fcef6b-9aa8-476b-a6aa-3adfb5985ef4
+      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: 
+      - Thu, 31 Mar 2011 12:35:43 GMT
+      x-varnish: 
+      - "437919847"
+      connection: 
+      - keep-alive
+      content-type: 
+      - application/json
+      via: 
+      - 1.1 varnish
+      server: 
+      - Apache-Coyote/1.1
+      date: 
+      - Thu, 31 Mar 2011 12:35:45 GMT
+      content-length: 
+      - "240"
+      cache-control: 
+      - no-cache
+      age: 
+      - "0"
+      vary: 
+      - Accept, Accept-Encoding, X-Auth-Token
+    body: "{\"server\":{\"progress\":0,\"id\":722336,\"imageId\":71,\"flavorId\":1,\"status\":\"BUILD\",\"name\":\"ThuMar3114353802002011\",\"hostId\":\"54b46e1cf423140b1b3bda212d153d3e\",\"addresses\":{\"public\":[\"50.56.108.139\"],\"private\":[\"10.181.161.149\"]},\"metadata\":{}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/rackspace/hardware_profiles_test.rb b/server/tests/drivers/rackspace/hardware_profiles_test.rb
index 90720a4..2cd6418 100644
--- a/server/tests/drivers/rackspace/hardware_profiles_test.rb
+++ b/server/tests/drivers/rackspace/hardware_profiles_test.rb
@@ -11,12 +11,12 @@ module RackspaceTest
     end
 
     def test_01_it_returns_hardware_profiles
-      do_xml_request '/api;driver=rackspace/hardware_profiles', {}, true
+      get_auth_url '/api;driver=rackspace/hardware_profiles'
       (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
+      get_auth_url '/api;driver=rackspace/hardware_profiles'
       (last_xml_response/'hardware_profiles/hardware_profile').each do |profile|
         (profile/'name').text.should_not == nil
         (profile/'name').text.should_not == ''
@@ -24,7 +24,7 @@ module RackspaceTest
     end
 
     def test_03_each_hardware_profile_has_correct_properties
-      do_xml_request '/api;driver=rackspace/hardware_profiles', {}, true
+      get_auth_url '/api;driver=rackspace/hardware_profiles'
       (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'
@@ -35,7 +35,7 @@ module RackspaceTest
     end
 
     def test_04_it_returns_single_hardware_profile
-      do_xml_request '/api;driver=rackspace/hardware_profiles/1', {}, true
+      get_auth_url '/api;driver=rackspace/hardware_profiles/1'
       (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'
@@ -43,9 +43,9 @@ module RackspaceTest
     end
 
     def test_05_it_filter_hardware_profiles
-      do_xml_request '/api;driver=rackspace/hardware_profiles?architecture=i386', {}, true
+      get_auth_url '/api;driver=rackspace/hardware_profiles?architecture=i386'
       (last_xml_response/'hardware_profiles/hardware_profile').length.should == 0
-      do_xml_request '/api;driver=rackspace/hardware_profiles?architecture=x86_64', {}, true
+      get_auth_url '/api;driver=rackspace/hardware_profiles?architecture=x86_64'
       (last_xml_response/'hardware_profiles/hardware_profile').length.should == 7
     end
 
diff --git a/server/tests/drivers/rackspace/images_test.rb b/server/tests/drivers/rackspace/images_test.rb
index 66fdc0a..5bb2cc8 100644
--- a/server/tests/drivers/rackspace/images_test.rb
+++ b/server/tests/drivers/rackspace/images_test.rb
@@ -11,12 +11,12 @@ module RackspaceTest
     end
 
     def test_01_it_returns_images
-      do_xml_request '/api;driver=rackspace/images', {}, true
+      get_auth_url '/api;driver=rackspace/images'
       (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
+      get_auth_url '/api;driver=rackspace/images'
       (last_xml_response/'images/image').each do |image|
         (image/'name').should_not == nil
         (image/'name').should_not == ''
@@ -32,7 +32,7 @@ module RackspaceTest
     end
 
     def test_03_it_returns_single_image
-      do_xml_request '/api;driver=rackspace/images/71', {}, true
+      get_auth_url '/api;driver=rackspace/images/71'
       (last_xml_response/'image').length.should == 1
     end
 
diff --git a/server/tests/drivers/rackspace/instances_test.rb b/server/tests/drivers/rackspace/instances_test.rb
index fc1af4f..f185625 100644
--- a/server/tests/drivers/rackspace/instances_test.rb
+++ b/server/tests/drivers/rackspace/instances_test.rb
@@ -15,10 +15,9 @@ module RackspaceTest
         :image_id => '71',
         :'api[driver]' => 'rackspace',
       }
-      header 'Accept', accept_header(:xml)
-      post '/api/instances', params, authenticate
+      post_url '/api/instances', params
       last_response.status.should == 201 # Created
-      @@instance = Nokogiri::XML(last_response.body)
+      @@instance = last_xml_response
       (@@instance/'instance').length.should > 0
       (@@instance/'instance/name').first.text.should_not == nil
       (@@instance/'instance/name').first.text.should_not == nil
@@ -33,10 +32,9 @@ module RackspaceTest
         :hwp_id => '2',
         :'api[driver]' => 'rackspace',
       }
-      header 'Accept', accept_header(:xml)
-      post '/api/instances', params, authenticate
+      post_url '/api/instances', params
       last_response.status.should == 201 # Created
-      @@instance2 = Nokogiri::XML(last_response.body)
+      @@instance2 = last_xml_response
       (@@instance2/'instance').length.should > 0
       (@@instance2/'instance/name').first.text.should_not == nil
       (@@instance2/'instance/name').first.text.should_not == nil
@@ -80,15 +78,15 @@ 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|
+        get_auth_url "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", { :tick => tick}
         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
+      get_auth_url "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}"
       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
@@ -98,15 +96,15 @@ 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|
+        get_auth_url "/api;driver=rackspace/instances/#{(@@instance2/'instance').first[:id]}", { :tick => tick}
         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
+      get_auth_url "/api;driver=rackspace/instances/#{(@@instance2/'instance').first[:id]}"
       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
@@ -115,15 +113,14 @@ module RackspaceTest
       (last_xml_response/'instance/actions/link[@rel="run"]').first.should_not == nil
     end
 
-    def test_05_created_instance_can_be_rebooted
+    def test_05_01_created_instance_can_be_rebooted
       params = {
         :'api[driver]' => 'rackspace',
       }
-      header 'Accept', accept_header(:xml)
-      post "/api/instances/#{(@@instance/'instance').first[:id]}/reboot", params, authenticate
+      post_url "/api/instances/#{(@@instance/'instance').first[:id]}/reboot", params
       last_response.status.should == 200
-      20.times do
-        do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", {}, true
+      20.times do |tick|
+        get_auth_url "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", { :tick => tick}
         last_response.status.should_not == 500
         state = (last_xml_response/'instance/state').first.text
         break if state=='RUNNING'
@@ -131,15 +128,14 @@ module RackspaceTest
       end
     end
 
-    def test_06_created_instance_can_be_destroyed
+    def test_06_01_created_instance_can_be_destroyed
       params = {
         :'api[driver]' => 'rackspace',
       }
-      header 'Accept', accept_header(:xml)
-      post "/api/instances/#{(@@instance/'instance').first[:id]}/stop", params, authenticate
+      post_url "/api/instances/#{(@@instance/'instance').first[:id]}/stop", params
       last_response.status.should == 200
-      20.times do
-        do_xml_request "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", {}, true
+      20.times do |tick|
+        get_auth_url "/api;driver=rackspace/instances/#{(@@instance/'instance').first[:id]}", { :tick => tick}
         last_response.status.should_not == 500
         break if last_response.status == 404
         sleep(5)
@@ -151,17 +147,15 @@ module RackspaceTest
       params = {
         :'api[driver]' => 'rackspace',
       }
-      header 'Accept', accept_header(:xml)
-      post "/api/instances/#{(@@instance2/'instance').first[:id]}/stop", params, authenticate
+      post_url "/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|
+        get_auth_url "/api;driver=rackspace/instances/#{(@@instance2/'instance').first[:id]}", { :tick => tick}
         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
index ca44d15..9a01898 100644
--- a/server/tests/drivers/rackspace/realms_test.rb
+++ b/server/tests/drivers/rackspace/realms_test.rb
@@ -11,12 +11,12 @@ module RackspaceTest
     end
 
     def test_01_it_returns_realms
-      do_xml_request '/api;driver=rackspace/realms', {}, true
+      get_auth_url '/api;driver=rackspace/realms'
       (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
+      get_auth_url '/api;driver=rackspace/realms'
       (last_xml_response/'realms/realm').each do |profile|
         (profile/'name').text.should_not == nil
         (profile/'name').text.should_not == ''
@@ -25,7 +25,7 @@ module RackspaceTest
     end
 
     def test_03_it_returns_single_realm
-      do_xml_request '/api;driver=rackspace/realms/us', {}, true
+      get_auth_url '/api;driver=rackspace/realms/us'
       (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'
diff --git a/server/tests/drivers/rackspace/setup.rb b/server/tests/drivers/rackspace/setup.rb
index 723ed7a..38ce1be 100644
--- a/server/tests/drivers/rackspace/setup.rb
+++ b/server/tests/drivers/rackspace/setup.rb
@@ -1,3 +1,14 @@
 ENV['API_DRIVER']   = "rackspace"
-ENV['API_USER']     = '<RACKSPACE_USERNAME>'
-ENV['API_PASSWORD'] = '<RACKSPACE_API_KEY>'
+ENV['API_USER']     = 'michalfojtik'
+ENV['API_PASSWORD'] = '47de1170d57eb8f11dba2f6e7fd26838'
+
+require 'vcr'
+
+DeltacloudTestCommon::record!
+
+VCR.config do |c|
+  c.cassette_library_dir = 'tests/drivers/rackspace/fixtures/'
+  c.stub_with :webmock
+  c.default_cassette_options = { :record => :new_episodes }
+end
+
-- 
1.7.4.1


[PATCH core 1/3] Added basic RackSpace unit tests

Posted by mf...@redhat.com.
From: mfojtik <mf...@13f79535-47bb-0310-9956-ffa450edef68>

---
 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