incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core] OpenStack: Initial Test::Unit suite for openstack driver
Date Mon, 24 Oct 2011 15:45:56 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/Rakefile                                    |    2 +-
 server/tests/drivers/openstack/api_test.rb         |   41 +++++
 ...et-0d6a11a7367ad7e8e80f9c7713c9744367bb4b4c.yml |   59 +++++++
 ...et-1d8b012e4b0da40d4e3ef0bfc1545276d20621cc.yml |   59 +++++++
 ...et-58e09edce17ca002ad15ac70676fbe73012bf118.yml |   32 ++++
 ...et-6c76fc9c314d5bf21bd0d9434a4372d2295e3e5b.yml |   59 +++++++
 ...et-70180bd9c3ee8f1cb840006e6540100fb0dea0ca.yml |   59 +++++++
 ...et-75cc23544e49af4430fbe198e09a4a2c55325396.yml |   59 +++++++
 ...et-78ba408530e4298285626f97d7fabbf528b94e40.yml |   59 +++++++
 ...et-7952b1a23c5d4fc4fd2ae56fe614afae30dc649c.yml |   59 +++++++
 ...et-8918cacaff6f52b31c7e9364ec06ecb6ec6a8c03.yml |   59 +++++++
 ...et-97b4700e48509c5356b852ffc592576c0706dc29.yml |   59 +++++++
 ...et-9e88e1e38b19393921ccddbc0f3e73e1d555dce1.yml |   59 +++++++
 ...et-ad599a1c1f8f61a6484b9a522a9cd6359191c94c.yml |   59 +++++++
 ...et-c7cacbf72cb21d3339069f0ff66b497d978487a6.yml |   59 +++++++
 ...et-db146cf9e4fcd7de837f088d5527fbabafe6cd49.yml |   59 +++++++
 ...et-eb4e7f3c634f35e8472b265f3125734fe94542fd.yml |   59 +++++++
 ...st-17960f44ea839fa0dab7be3c33467fafe7a52b93.yml |  144 +++++++++++++++++
 ...st-44cdf0849148e3968a70488f10f4914cf6a075fe.yml |   88 +++++++++++
 ...st-5e4576f1ae82702e893b34895a64afe1cf61d6ce.yml |  146 ++++++++++++++++++
 ...st-7927ddd2e1073e7ebfd53e31fc66a0c371240c90.yml |  144 +++++++++++++++++
 ...st-9c0f9765cb7f4aba0c854f71328fa7d1b9dc6afb.yml |   88 +++++++++++
 .../drivers/openstack/hardware_profiles_test.rb    |   53 +++++++
 server/tests/drivers/openstack/images_test.rb      |   40 +++++
 server/tests/drivers/openstack/instances_test.rb   |  163 ++++++++++++++++++++
 server/tests/drivers/openstack/realms_test.rb      |   36 +++++
 server/tests/drivers/openstack/setup.rb            |   20 +++
 27 files changed, 1822 insertions(+), 1 deletions(-)
 create mode 100644 server/tests/drivers/openstack/api_test.rb
 create mode 100644 server/tests/drivers/openstack/fixtures/get-0d6a11a7367ad7e8e80f9c7713c9744367bb4b4c.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-1d8b012e4b0da40d4e3ef0bfc1545276d20621cc.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-58e09edce17ca002ad15ac70676fbe73012bf118.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-6c76fc9c314d5bf21bd0d9434a4372d2295e3e5b.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-70180bd9c3ee8f1cb840006e6540100fb0dea0ca.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-75cc23544e49af4430fbe198e09a4a2c55325396.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-78ba408530e4298285626f97d7fabbf528b94e40.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-7952b1a23c5d4fc4fd2ae56fe614afae30dc649c.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-8918cacaff6f52b31c7e9364ec06ecb6ec6a8c03.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-97b4700e48509c5356b852ffc592576c0706dc29.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-9e88e1e38b19393921ccddbc0f3e73e1d555dce1.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-ad599a1c1f8f61a6484b9a522a9cd6359191c94c.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-c7cacbf72cb21d3339069f0ff66b497d978487a6.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-db146cf9e4fcd7de837f088d5527fbabafe6cd49.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/get-eb4e7f3c634f35e8472b265f3125734fe94542fd.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/post-17960f44ea839fa0dab7be3c33467fafe7a52b93.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/post-44cdf0849148e3968a70488f10f4914cf6a075fe.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/post-5e4576f1ae82702e893b34895a64afe1cf61d6ce.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/post-7927ddd2e1073e7ebfd53e31fc66a0c371240c90.yml
 create mode 100644 server/tests/drivers/openstack/fixtures/post-9c0f9765cb7f4aba0c854f71328fa7d1b9dc6afb.yml
 create mode 100644 server/tests/drivers/openstack/hardware_profiles_test.rb
 create mode 100644 server/tests/drivers/openstack/images_test.rb
 create mode 100644 server/tests/drivers/openstack/instances_test.rb
 create mode 100644 server/tests/drivers/openstack/realms_test.rb
 create mode 100644 server/tests/drivers/openstack/setup.rb

diff --git a/server/Rakefile b/server/Rakefile
index a74cbce..27605d5 100644
--- a/server/Rakefile
+++ b/server/Rakefile
@@ -53,7 +53,7 @@ rescue LoadError
 end
 
 namespace :test do
-  %w(mock rackspace rhevm).each do |driver|
+  %w(mock rackspace rhevm openstack).each do |driver|
     desc "Run #{driver} unit tests"
     Rake::TestTask.new(driver) { |t|
       t.test_files = ['tests/common.rb', "tests/drivers/#{driver}/setup.rb"] + FileList.new("tests/drivers/#{driver}/*_test.rb") + FileList.new('tests/rabbit_test.rb')
diff --git a/server/tests/drivers/openstack/api_test.rb b/server/tests/drivers/openstack/api_test.rb
new file mode 100644
index 0000000..4ec0ac6
--- /dev/null
+++ b/server/tests/drivers/openstack/api_test.rb
@@ -0,0 +1,41 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module OpenstackTest
+
+  class ApiTest < Test::Unit::TestCase
+    include Rack::Test::Methods
+
+    def app
+      Sinatra::Application
+    end
+
+    def test_01_it_returns_entry_points
+      get_auth_url '/api;driver=openstack/?force_auth=1'
+      (last_xml_response/'/api').first[:driver].should == 'openstack'
+      (last_xml_response/'/api/link').length.should > 0
+    end
+
+    def test_02_it_has_openstack_features
+      get_url '/api;driver=openstack'
+      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_openstack_collections
+      get_url '/api;driver=openstack'
+      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 == 7
+    end
+
+  end
+end
diff --git a/server/tests/drivers/openstack/fixtures/get-0d6a11a7367ad7e8e80f9c7713c9744367bb4b4c.yml b/server/tests/drivers/openstack/fixtures/get-0d6a11a7367ad7e8e80f9c7713c9744367bb4b4c.yml
new file mode 100644
index 0000000..4d46b77
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-0d6a11a7367ad7e8e80f9c7713c9744367bb4b4c.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:32:48 GMT
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-cdn-management-url:
+      - ""
+      content-length:
+      - "0"
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/images/detail
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:18 GMT
+      content-length:
+      - "559"
+    body: "{\"images\": [{\"status\": \"ACTIVE\", \"updated\": \"2011-10-18T10:52:53Z\", \"name\": \"ubuntu\", \"created\": \"2011-10-18T10:52:52Z\", \"progress\": 100, \"id\": 4}, {\"status\": \"ACTIVE\", \"updated\": \"2011-10-17T11:34:52Z\", \"name\": \"ami-tty\", \"created\": \"2011-10-17T11:34:52Z\", \"progress\": 100, \"id\": 3}, {\"status\": \"ACTIVE\", \"updated\": \"2011-10-17T11:34:52Z\", \"name\": \"ari-tty\", \"created\": \"2011-10-17T11:34:52Z\", \"progress\": 100, \"id\": 2}, {\"status\": \"ACTIVE\", \"updated\": \"2011-10-17T11:34:52Z\", \"name\": \"aki-tty\", \"created\": \"2011-10-17T11:34:51Z\", \"progress\": 100, \"id\": 1}]}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-1d8b012e4b0da40d4e3ef0bfc1545276d20621cc.yml b/server/tests/drivers/openstack/fixtures/get-1d8b012e4b0da40d4e3ef0bfc1545276d20621cc.yml
new file mode 100644
index 0000000..6d3826c
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-1d8b012e4b0da40d4e3ef0bfc1545276d20621cc.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:25 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/18
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:25 GMT
+      content-length:
+      - "362"
+    body: "{\"server\": {\"status\": \"ACTIVE\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:40 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.2\", \"192.168.122.2\"]}, \"tenant_id\": \"admin\", \"uuid\": \"0326cb45-5a45-4fcd-8cba-fa569e182af0\", \"imageId\": 4, \"flavorId\": 1, \"id\": 18, \"metadata\": {}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-58e09edce17ca002ad15ac70676fbe73012bf118.yml b/server/tests/drivers/openstack/fixtures/get-58e09edce17ca002ad15ac70676fbe73012bf118.yml
new file mode 100644
index 0000000..73fd3de
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-58e09edce17ca002ad15ac70676fbe73012bf118.yml
@@ -0,0 +1,32 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:32:48 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-6c76fc9c314d5bf21bd0d9434a4372d2295e3e5b.yml b/server/tests/drivers/openstack/fixtures/get-6c76fc9c314d5bf21bd0d9434a4372d2295e3e5b.yml
new file mode 100644
index 0000000..6cfc93e
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-6c76fc9c314d5bf21bd0d9434a4372d2295e3e5b.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:32:48 GMT
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-cdn-management-url:
+      - ""
+      content-length:
+      - "0"
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/flavors/detail
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:17 GMT
+      content-length:
+      - "569"
+    body: "{\"flavors\": [{\"rxtx_quota\": 0, \"name\": \"m1.medium\", \"ram\": 4096, \"vcpus\": 2, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 40, \"id\": 3}, {\"rxtx_quota\": 0, \"name\": \"m1.large\", \"ram\": 8192, \"vcpus\": 4, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 80, \"id\": 4}, {\"rxtx_quota\": 0, \"name\": \"m1.tiny\", \"ram\": 512, \"vcpus\": 1, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 0, \"id\": 1}, {\"rxtx_quota\": 0, \"name\": \"m1.xlarge\", \"ram\": 16384, \"vcpus\": 8, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 160, \"id\": 5}, {\"rxtx_quota\": 0, \"name\": \"m1.small\", \"ram\": 2048, \"vcpus\": 1, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 20, \"id\": 2}]}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-70180bd9c3ee8f1cb840006e6540100fb0dea0ca.yml b/server/tests/drivers/openstack/fixtures/get-70180bd9c3ee8f1cb840006e6540100fb0dea0ca.yml
new file mode 100644
index 0000000..0604c51
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-70180bd9c3ee8f1cb840006e6540100fb0dea0ca.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:57 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/19
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 404
+      message: Not Found
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:57 GMT
+      content-length:
+      - "78"
+    body: "{\"itemNotFound\": {\"message\": \"The resource could not be found.\", \"code\": 404}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-75cc23544e49af4430fbe198e09a4a2c55325396.yml b/server/tests/drivers/openstack/fixtures/get-75cc23544e49af4430fbe198e09a4a2c55325396.yml
new file mode 100644
index 0000000..4711c3d
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-75cc23544e49af4430fbe198e09a4a2c55325396.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:20 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/18
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:20 GMT
+      content-length:
+      - "361"
+    body: "{\"server\": {\"status\": \"BUILD\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:40 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.2\", \"192.168.122.2\"]}, \"tenant_id\": \"admin\", \"uuid\": \"0326cb45-5a45-4fcd-8cba-fa569e182af0\", \"imageId\": 4, \"flavorId\": 1, \"id\": 18, \"metadata\": {}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-78ba408530e4298285626f97d7fabbf528b94e40.yml b/server/tests/drivers/openstack/fixtures/get-78ba408530e4298285626f97d7fabbf528b94e40.yml
new file mode 100644
index 0000000..658636b
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-78ba408530e4298285626f97d7fabbf528b94e40.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:30 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/19
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:30 GMT
+      content-length:
+      - "362"
+    body: "{\"server\": {\"status\": \"ACTIVE\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:41 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.5\", \"192.168.122.5\"]}, \"tenant_id\": \"admin\", \"uuid\": \"ca4fa9ac-785f-4cc5-9116-6bb0a0cd635e\", \"imageId\": 4, \"flavorId\": 2, \"id\": 19, \"metadata\": {}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-7952b1a23c5d4fc4fd2ae56fe614afae30dc649c.yml b/server/tests/drivers/openstack/fixtures/get-7952b1a23c5d4fc4fd2ae56fe614afae30dc649c.yml
new file mode 100644
index 0000000..b3d64dd
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-7952b1a23c5d4fc4fd2ae56fe614afae30dc649c.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:32:48 GMT
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-cdn-management-url:
+      - ""
+      content-length:
+      - "0"
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/images/detail
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:32:48 GMT
+      content-length:
+      - "559"
+    body: "{\"images\": [{\"status\": \"ACTIVE\", \"updated\": \"2011-10-18T10:52:53Z\", \"name\": \"ubuntu\", \"created\": \"2011-10-18T10:52:52Z\", \"progress\": 100, \"id\": 4}, {\"status\": \"ACTIVE\", \"updated\": \"2011-10-17T11:34:52Z\", \"name\": \"ami-tty\", \"created\": \"2011-10-17T11:34:52Z\", \"progress\": 100, \"id\": 3}, {\"status\": \"ACTIVE\", \"updated\": \"2011-10-17T11:34:52Z\", \"name\": \"ari-tty\", \"created\": \"2011-10-17T11:34:52Z\", \"progress\": 100, \"id\": 2}, {\"status\": \"ACTIVE\", \"updated\": \"2011-10-17T11:34:52Z\", \"name\": \"aki-tty\", \"created\": \"2011-10-17T11:34:51Z\", \"progress\": 100, \"id\": 1}]}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-8918cacaff6f52b31c7e9364ec06ecb6ec6a8c03.yml b/server/tests/drivers/openstack/fixtures/get-8918cacaff6f52b31c7e9364ec06ecb6ec6a8c03.yml
new file mode 100644
index 0000000..6cfc93e
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-8918cacaff6f52b31c7e9364ec06ecb6ec6a8c03.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:32:48 GMT
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-cdn-management-url:
+      - ""
+      content-length:
+      - "0"
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/flavors/detail
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:17 GMT
+      content-length:
+      - "569"
+    body: "{\"flavors\": [{\"rxtx_quota\": 0, \"name\": \"m1.medium\", \"ram\": 4096, \"vcpus\": 2, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 40, \"id\": 3}, {\"rxtx_quota\": 0, \"name\": \"m1.large\", \"ram\": 8192, \"vcpus\": 4, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 80, \"id\": 4}, {\"rxtx_quota\": 0, \"name\": \"m1.tiny\", \"ram\": 512, \"vcpus\": 1, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 0, \"id\": 1}, {\"rxtx_quota\": 0, \"name\": \"m1.xlarge\", \"ram\": 16384, \"vcpus\": 8, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 160, \"id\": 5}, {\"rxtx_quota\": 0, \"name\": \"m1.small\", \"ram\": 2048, \"vcpus\": 1, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 20, \"id\": 2}]}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-97b4700e48509c5356b852ffc592576c0706dc29.yml b/server/tests/drivers/openstack/fixtures/get-97b4700e48509c5356b852ffc592576c0706dc29.yml
new file mode 100644
index 0000000..658636b
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-97b4700e48509c5356b852ffc592576c0706dc29.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:30 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/19
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:30 GMT
+      content-length:
+      - "362"
+    body: "{\"server\": {\"status\": \"ACTIVE\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:41 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.5\", \"192.168.122.5\"]}, \"tenant_id\": \"admin\", \"uuid\": \"ca4fa9ac-785f-4cc5-9116-6bb0a0cd635e\", \"imageId\": 4, \"flavorId\": 2, \"id\": 19, \"metadata\": {}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-9e88e1e38b19393921ccddbc0f3e73e1d555dce1.yml b/server/tests/drivers/openstack/fixtures/get-9e88e1e38b19393921ccddbc0f3e73e1d555dce1.yml
new file mode 100644
index 0000000..f86f73b
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-9e88e1e38b19393921ccddbc0f3e73e1d555dce1.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:46 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/18
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 404
+      message: Not Found
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:46 GMT
+      content-length:
+      - "78"
+    body: "{\"itemNotFound\": {\"message\": \"The resource could not be found.\", \"code\": 404}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-ad599a1c1f8f61a6484b9a522a9cd6359191c94c.yml b/server/tests/drivers/openstack/fixtures/get-ad599a1c1f8f61a6484b9a522a9cd6359191c94c.yml
new file mode 100644
index 0000000..e5b96cc
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-ad599a1c1f8f61a6484b9a522a9cd6359191c94c.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:32:48 GMT
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-cdn-management-url:
+      - ""
+      content-length:
+      - "0"
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/flavors/detail
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:32:48 GMT
+      content-length:
+      - "569"
+    body: "{\"flavors\": [{\"rxtx_quota\": 0, \"name\": \"m1.medium\", \"ram\": 4096, \"vcpus\": 2, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 40, \"id\": 3}, {\"rxtx_quota\": 0, \"name\": \"m1.large\", \"ram\": 8192, \"vcpus\": 4, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 80, \"id\": 4}, {\"rxtx_quota\": 0, \"name\": \"m1.tiny\", \"ram\": 512, \"vcpus\": 1, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 0, \"id\": 1}, {\"rxtx_quota\": 0, \"name\": \"m1.xlarge\", \"ram\": 16384, \"vcpus\": 8, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 160, \"id\": 5}, {\"rxtx_quota\": 0, \"name\": \"m1.small\", \"ram\": 2048, \"vcpus\": 1, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 20, \"id\": 2}]}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-c7cacbf72cb21d3339069f0ff66b497d978487a6.yml b/server/tests/drivers/openstack/fixtures/get-c7cacbf72cb21d3339069f0ff66b497d978487a6.yml
new file mode 100644
index 0000000..6d3826c
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-c7cacbf72cb21d3339069f0ff66b497d978487a6.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:25 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/18
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:25 GMT
+      content-length:
+      - "362"
+    body: "{\"server\": {\"status\": \"ACTIVE\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:40 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.2\", \"192.168.122.2\"]}, \"tenant_id\": \"admin\", \"uuid\": \"0326cb45-5a45-4fcd-8cba-fa569e182af0\", \"imageId\": 4, \"flavorId\": 1, \"id\": 18, \"metadata\": {}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-db146cf9e4fcd7de837f088d5527fbabafe6cd49.yml b/server/tests/drivers/openstack/fixtures/get-db146cf9e4fcd7de837f088d5527fbabafe6cd49.yml
new file mode 100644
index 0000000..6cfc93e
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-db146cf9e4fcd7de837f088d5527fbabafe6cd49.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:32:48 GMT
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-cdn-management-url:
+      - ""
+      content-length:
+      - "0"
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/flavors/detail
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:17 GMT
+      content-length:
+      - "569"
+    body: "{\"flavors\": [{\"rxtx_quota\": 0, \"name\": \"m1.medium\", \"ram\": 4096, \"vcpus\": 2, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 40, \"id\": 3}, {\"rxtx_quota\": 0, \"name\": \"m1.large\", \"ram\": 8192, \"vcpus\": 4, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 80, \"id\": 4}, {\"rxtx_quota\": 0, \"name\": \"m1.tiny\", \"ram\": 512, \"vcpus\": 1, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 0, \"id\": 1}, {\"rxtx_quota\": 0, \"name\": \"m1.xlarge\", \"ram\": 16384, \"vcpus\": 8, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 160, \"id\": 5}, {\"rxtx_quota\": 0, \"name\": \"m1.small\", \"ram\": 2048, \"vcpus\": 1, \"rxtx_cap\": 0, \"swap\": 0, \"disk\": 20, \"id\": 2}]}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/get-eb4e7f3c634f35e8472b265f3125734fe94542fd.yml b/server/tests/drivers/openstack/fixtures/get-eb4e7f3c634f35e8472b265f3125734fe94542fd.yml
new file mode 100644
index 0000000..824a635
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/get-eb4e7f3c634f35e8472b265f3125734fe94542fd.yml
@@ -0,0 +1,59 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:25 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/19
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:25 GMT
+      content-length:
+      - "361"
+    body: "{\"server\": {\"status\": \"BUILD\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:41 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.5\", \"192.168.122.5\"]}, \"tenant_id\": \"admin\", \"uuid\": \"ca4fa9ac-785f-4cc5-9116-6bb0a0cd635e\", \"imageId\": 4, \"flavorId\": 2, \"id\": 19, \"metadata\": {}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/post-17960f44ea839fa0dab7be3c33467fafe7a52b93.yml b/server/tests/drivers/openstack/fixtures/post-17960f44ea839fa0dab7be3c33467fafe7a52b93.yml
new file mode 100644
index 0000000..4ee2c19
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/post-17960f44ea839fa0dab7be3c33467fafe7a52b93.yml
@@ -0,0 +1,144 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:46 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/19
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:46 GMT
+      content-length:
+      - "362"
+    body: "{\"server\": {\"status\": \"ACTIVE\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:41 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.5\", \"192.168.122.5\"]}, \"tenant_id\": \"admin\", \"uuid\": \"ca4fa9ac-785f-4cc5-9116-6bb0a0cd635e\", \"imageId\": 4, \"flavorId\": 2, \"id\": 19, \"metadata\": {}}}"
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:46 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/19
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:47 GMT
+      content-length:
+      - "362"
+    body: "{\"server\": {\"status\": \"ACTIVE\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:41 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.5\", \"192.168.122.5\"]}, \"tenant_id\": \"admin\", \"uuid\": \"ca4fa9ac-785f-4cc5-9116-6bb0a0cd635e\", \"imageId\": 4, \"flavorId\": 2, \"id\": 19, \"metadata\": {}}}"
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :delete
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/19
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 202
+      message: Accepted
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - text/html; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:47 GMT
+      content-length:
+      - "0"
+    body:
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/post-44cdf0849148e3968a70488f10f4914cf6a075fe.yml b/server/tests/drivers/openstack/fixtures/post-44cdf0849148e3968a70488f10f4914cf6a075fe.yml
new file mode 100644
index 0000000..46aef83
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/post-44cdf0849148e3968a70488f10f4914cf6a075fe.yml
@@ -0,0 +1,88 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:32:48 GMT
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-cdn-management-url:
+      - ""
+      content-length:
+      - "0"
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :post
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers
+    body: "{\"server\":{\"imageId\":4,\"personality\":null,\"flavorId\":1,\"name\":\"Mon Oct 24 17:42:40 +0200 2011\"}}"
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      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:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:18 GMT
+      content-length:
+      - "311"
+    body: "{\"server\": {\"status\": \"BUILD\", \"hostId\": \"\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:40 +0200 2011\", \"addresses\": {\"public\": [], \"private\": []}, \"tenant_id\": \"admin\", \"adminPass\": \"ysxPqCMMJLNckS7Y\", \"uuid\": \"0326cb45-5a45-4fcd-8cba-fa569e182af0\", \"imageId\": 4, \"flavorId\": 1, \"id\": 18, \"metadata\": {}}}"
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/18
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:18 GMT
+      content-length:
+      - "278"
+    body: "{\"server\": {\"status\": \"BUILD\", \"hostId\": \"\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:40 +0200 2011\", \"addresses\": {\"public\": [], \"private\": []}, \"tenant_id\": \"admin\", \"uuid\": \"0326cb45-5a45-4fcd-8cba-fa569e182af0\", \"imageId\": 4, \"flavorId\": 1, \"id\": 18, \"metadata\": {}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/post-5e4576f1ae82702e893b34895a64afe1cf61d6ce.yml b/server/tests/drivers/openstack/fixtures/post-5e4576f1ae82702e893b34895a64afe1cf61d6ce.yml
new file mode 100644
index 0000000..148d075
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/post-5e4576f1ae82702e893b34895a64afe1cf61d6ce.yml
@@ -0,0 +1,146 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:30 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/18
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:30 GMT
+      content-length:
+      - "362"
+    body: "{\"server\": {\"status\": \"ACTIVE\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:40 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.2\", \"192.168.122.2\"]}, \"tenant_id\": \"admin\", \"uuid\": \"0326cb45-5a45-4fcd-8cba-fa569e182af0\", \"imageId\": 4, \"flavorId\": 1, \"id\": 18, \"metadata\": {}}}"
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:30 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/18
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:30 GMT
+      content-length:
+      - "362"
+    body: "{\"server\": {\"status\": \"ACTIVE\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:40 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.2\", \"192.168.122.2\"]}, \"tenant_id\": \"admin\", \"uuid\": \"0326cb45-5a45-4fcd-8cba-fa569e182af0\", \"imageId\": 4, \"flavorId\": 1, \"id\": 18, \"metadata\": {}}}"
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :post
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/18/action
+    body: "{\"reboot\":{\"type\":\"HARD\"}}"
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      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:
+      connection:
+      - keep-alive
+      content-type:
+      - text/html; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:31 GMT
+      content-length:
+      - "0"
+    body:
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/post-7927ddd2e1073e7ebfd53e31fc66a0c371240c90.yml b/server/tests/drivers/openstack/fixtures/post-7927ddd2e1073e7ebfd53e31fc66a0c371240c90.yml
new file mode 100644
index 0000000..3f5fad4
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/post-7927ddd2e1073e7ebfd53e31fc66a0c371240c90.yml
@@ -0,0 +1,144 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:36 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/18
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:36 GMT
+      content-length:
+      - "362"
+    body: "{\"server\": {\"status\": \"ACTIVE\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:40 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.2\", \"192.168.122.2\"]}, \"tenant_id\": \"admin\", \"uuid\": \"0326cb45-5a45-4fcd-8cba-fa569e182af0\", \"imageId\": 4, \"flavorId\": 1, \"id\": 18, \"metadata\": {}}}"
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:36 GMT
+      content-length:
+      - "0"
+      x-cdn-management-url:
+      - ""
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/18
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:36 GMT
+      content-length:
+      - "362"
+    body: "{\"server\": {\"status\": \"ACTIVE\", \"hostId\": \"4b3b655c67d8d60d6959b506830e4257bc23bc9946f98f1f63eceeb9\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:40 +0200 2011\", \"addresses\": {\"public\": [], \"private\": [\"10.0.0.2\", \"192.168.122.2\"]}, \"tenant_id\": \"admin\", \"uuid\": \"0326cb45-5a45-4fcd-8cba-fa569e182af0\", \"imageId\": 4, \"flavorId\": 1, \"id\": 18, \"metadata\": {}}}"
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :delete
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/18
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 202
+      message: Accepted
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - text/html; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:33:36 GMT
+      content-length:
+      - "0"
+    body:
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/fixtures/post-9c0f9765cb7f4aba0c854f71328fa7d1b9dc6afb.yml b/server/tests/drivers/openstack/fixtures/post-9c0f9765cb7f4aba0c854f71328fa7d1b9dc6afb.yml
new file mode 100644
index 0000000..0c80c57
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/post-9c0f9765cb7f4aba0c854f71328fa7d1b9dc6afb.yml
@@ -0,0 +1,88 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0
+    body:
+    headers:
+      x-auth-user:
+      - mfojtik
+      x-auth-key:
+      - test
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 204
+      message: No Content
+    headers:
+      x-auth-token:
+      - mfojtik:admin
+      content-type:
+      - text/plain; charset=UTF-8
+      date:
+      - Mon, 24 Oct 2011 15:32:48 GMT
+      x-server-management-url:
+      - http://mfojtik-2.brq.redhat.com:8774/v1.0
+      x-cdn-management-url:
+      - ""
+      content-length:
+      - "0"
+      x-storage-url:
+      - ""
+    body:
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :post
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers
+    body: "{\"server\":{\"imageId\":4,\"personality\":null,\"flavorId\":2,\"name\":\"Mon Oct 24 17:42:41 +0200 2011\"}}"
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      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:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:19 GMT
+      content-length:
+      - "311"
+    body: "{\"server\": {\"status\": \"BUILD\", \"hostId\": \"\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:41 +0200 2011\", \"addresses\": {\"public\": [], \"private\": []}, \"tenant_id\": \"admin\", \"adminPass\": \"K7wKc6YSfJJdtMzB\", \"uuid\": \"ca4fa9ac-785f-4cc5-9116-6bb0a0cd635e\", \"imageId\": 4, \"flavorId\": 2, \"id\": 19, \"metadata\": {}}}"
+    http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+  request: !ruby/struct:VCR::Request
+    method: :get
+    uri: http://mfojtik-2.brq.redhat.com:8774/v1.0/servers/19
+    body:
+    headers:
+      accept:
+      - application/json
+      x-auth-token:
+      - mfojtik:admin
+      user-agent:
+      - CloudServers Ruby API 0.4.1
+  response: !ruby/struct:VCR::Response
+    status: !ruby/struct:VCR::ResponseStatus
+      code: 200
+      message: OK
+    headers:
+      connection:
+      - keep-alive
+      content-type:
+      - application/json
+      date:
+      - Mon, 24 Oct 2011 15:33:20 GMT
+      content-length:
+      - "278"
+    body: "{\"server\": {\"status\": \"BUILD\", \"hostId\": \"\", \"user_id\": \"mfojtik\", \"name\": \"Mon Oct 24 17:42:41 +0200 2011\", \"addresses\": {\"public\": [], \"private\": []}, \"tenant_id\": \"admin\", \"uuid\": \"ca4fa9ac-785f-4cc5-9116-6bb0a0cd635e\", \"imageId\": 4, \"flavorId\": 2, \"id\": 19, \"metadata\": {}}}"
+    http_version: "1.1"
diff --git a/server/tests/drivers/openstack/hardware_profiles_test.rb b/server/tests/drivers/openstack/hardware_profiles_test.rb
new file mode 100644
index 0000000..ed0cd16
--- /dev/null
+++ b/server/tests/drivers/openstack/hardware_profiles_test.rb
@@ -0,0 +1,53 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module OpenstackTest
+
+  class HardwareProfilesTest < Test::Unit::TestCase
+    include Rack::Test::Methods
+
+    def app
+      Sinatra::Application
+    end
+
+    def test_01_it_returns_hardware_profiles
+      get_auth_url '/api;driver=openstack/hardware_profiles'
+      (last_xml_response/'hardware_profiles/hardware_profile').length.should == 5
+    end
+
+    def test_02_each_hardware_profile_has_a_name
+      get_auth_url '/api;driver=openstack/hardware_profiles'
+      (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
+      get_auth_url '/api;driver=openstack/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'
+        (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
+      get_auth_url '/api;driver=openstack/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 == '512'
+      (last_xml_response/'hardware_profile/property[@name="storage"]').first[:value].should == '0'
+    end
+
+    def test_05_it_filter_hardware_profiles
+      get_auth_url '/api;driver=openstack/hardware_profiles?architecture=i386'
+      (last_xml_response/'hardware_profiles/hardware_profile').length.should == 0
+      get_auth_url '/api;driver=openstack/hardware_profiles?architecture=x86_64'
+      (last_xml_response/'hardware_profiles/hardware_profile').length.should == 5
+    end
+
+  end
+end
diff --git a/server/tests/drivers/openstack/images_test.rb b/server/tests/drivers/openstack/images_test.rb
new file mode 100644
index 0000000..8b16f93
--- /dev/null
+++ b/server/tests/drivers/openstack/images_test.rb
@@ -0,0 +1,40 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module OpenstackTest
+
+  class ImagesTest < Test::Unit::TestCase
+    include Rack::Test::Methods
+
+    def app
+      Sinatra::Application
+    end
+
+    def test_01_it_returns_images
+      get_auth_url '/api;driver=openstack/images'
+      (last_xml_response/'images/image').length.should > 0
+    end
+
+    def test_02_each_image_has_correct_properties
+      get_auth_url '/api;driver=openstack/images'
+      (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
+      get_auth_url '/api;driver=openstack/images/1'
+      (last_xml_response/'image').length.should == 1
+    end
+
+  end
+end
diff --git a/server/tests/drivers/openstack/instances_test.rb b/server/tests/drivers/openstack/instances_test.rb
new file mode 100644
index 0000000..8020092
--- /dev/null
+++ b/server/tests/drivers/openstack/instances_test.rb
@@ -0,0 +1,163 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module OpenstackTest
+
+  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 => '4',
+        :'api[driver]' => 'openstack',
+      }
+      post_url '/api/instances', params
+      last_response.status.should == 201 # Created
+      @@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
+      (@@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 => '4',
+        :hwp_id => '2',
+        :'api[driver]' => 'openstack',
+      }
+      post_url '/api/instances', params
+      last_response.status.should == 201 # Created
+      @@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
+      (@@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
+=begin
+    TODO: Disabled since our testing setup doesn't return IP addresses yet ;-)
+    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
+=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 |tick|
+        get_auth_url "/api;driver=openstack/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
+      get_auth_url "/api;driver=openstack/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
+      (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 |tick|
+        get_auth_url "/api;driver=openstack/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
+      get_auth_url "/api;driver=openstack/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
+      (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_01_created_instance_can_be_rebooted
+      params = {
+        :'api[driver]' => 'openstack',
+      }
+      post_url "/api/instances/#{(@@instance/'instance').first[:id]}/reboot", params
+      last_response.status.should == 200
+      20.times do |tick|
+        get_auth_url "/api;driver=openstack/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
+    end
+
+    def test_06_01_created_instance_can_be_destroyed
+      params = {
+        :'api[driver]' => 'openstack',
+      }
+      post_url "/api/instances/#{(@@instance/'instance').first[:id]}/stop", params
+      last_response.status.should == 200
+      20.times do |tick|
+        get_auth_url "/api;driver=openstack/instances/#{(@@instance/'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
+
+    def test_06_02_created_instance_can_be_destroyed
+      params = {
+        :'api[driver]' => 'openstack',
+      }
+      post_url "/api/instances/#{(@@instance2/'instance').first[:id]}/stop", params, authenticate
+      last_response.status.should == 200
+      20.times do |tick|
+        get_auth_url "/api;driver=openstack/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/openstack/realms_test.rb b/server/tests/drivers/openstack/realms_test.rb
new file mode 100644
index 0000000..7929099
--- /dev/null
+++ b/server/tests/drivers/openstack/realms_test.rb
@@ -0,0 +1,36 @@
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
+require 'tests/common'
+
+module OpenstackTest
+
+  class RealmsTest < Test::Unit::TestCase
+    include Rack::Test::Methods
+
+    def app
+      Sinatra::Application
+    end
+
+    def test_01_it_returns_realms
+      get_auth_url '/api;driver=openstack/realms'
+      (last_xml_response/'realms/realm').length.should == 1
+    end
+
+    def test_02_each_realm_has_a_name
+      get_auth_url '/api;driver=openstack/realms'
+      (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
+      get_auth_url '/api;driver=openstack/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'
+      (last_xml_response/'realm/limit').first.text.should == ''
+    end
+
+  end
+end
diff --git a/server/tests/drivers/openstack/setup.rb b/server/tests/drivers/openstack/setup.rb
new file mode 100644
index 0000000..3e3645a
--- /dev/null
+++ b/server/tests/drivers/openstack/setup.rb
@@ -0,0 +1,20 @@
+ENV.delete 'API_VERBOSE'
+ENV['API_DRIVER']   = "openstack"
+ENV['API_USER']     = 'mfojtik'
+ENV['API_PASSWORD'] = 'test'
+ENV['API_PROVIDER'] = 'http://mfojtik-2.brq.redhat.com:8774/auth/1.1'
+
+require 'vcr'
+DeltacloudTestCommon::record!
+
+VCR.config do |c|
+  c.cassette_library_dir = "#{File.dirname(__FILE__)}/../../../tests/drivers/openstack/fixtures/"
+  c.stub_with :webmock
+  c.default_cassette_options = { :record => :new_episodes }
+end
+
+class WebMock::Config
+  def net_http_connect_on_start
+    true
+  end
+end
-- 
1.7.4.4


Mime
View raw message