deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [1/5] git commit: [Core] Unit tests - updated fixtures for Openstack realms tests (1.1.1 release)
Date Wed, 13 Feb 2013 11:45:59 GMT
[Core] Unit tests - updated fixtures for Openstack realms tests (1.1.1 release)


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

Branch: refs/heads/master
Commit: ee7536c5e349fe6fc300d76248de788dceb7a178
Parents: b8f07f4
Author: marios <marios@redhat.com>
Authored: Wed Feb 13 12:36:53 2013 +0200
Committer: marios <marios@redhat.com>
Committed: Wed Feb 13 12:36:53 2013 +0200

----------------------------------------------------------------------
 .../drivers/openstack/openstack_driver.rb          |    2 +-
 ...rror_when_GET_Realms_with_wrong_credentials.yml |   44 ++
 .../test_0002_must_return_list_of_realms.yml       |  338 ++++++++-------
 ...st_0003_must_allow_to_retrieve_single_realm.yml |  342 +++++++++++++++
 server/tests/drivers/openstack/realms_test.rb      |   26 +-
 5 files changed, 581 insertions(+), 171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/ee7536c5/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
index bb4210b..ec5cd67 100644
--- a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
+++ b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
@@ -120,7 +120,7 @@ module Deltacloud
           realms = []
           if opts[:id]
             resource_types = []
-            os.connection.regions_list[opts[:id]].each do |service|
+            (os.connection.regions_list[opts[:id]] || []).each do |service|
               resource_types << service[:service] if ["compute", "volume", "object-store"].include?(service[:service])
               realms << Realm.new( {  :id => opts[:id],
                                     :name => opts[:id],

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/ee7536c5/server/tests/drivers/openstack/fixtures/test_0001_must_throw_error_when_GET_Realms_with_wrong_credentials.yml
----------------------------------------------------------------------
diff --git a/server/tests/drivers/openstack/fixtures/test_0001_must_throw_error_when_GET_Realms_with_wrong_credentials.yml b/server/tests/drivers/openstack/fixtures/test_0001_must_throw_error_when_GET_Realms_with_wrong_credentials.yml
new file mode 100644
index 0000000..0298ce4
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/test_0001_must_throw_error_when_GET_Realms_with_wrong_credentials.yml
@@ -0,0 +1,44 @@
+---
+http_interactions:
+- request:
+    method: post
+    uri: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens
+    body:
+      encoding: UTF-8
+      string: ! '{"auth":{"passwordCredentials":{"username":"unknown","password":"wrong"},"tenantName":"wrong"}}'
+    headers:
+      Content-Type:
+      - application/json
+      Accept:
+      - ! '*/*'
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 401
+      message: Unauthorized
+    headers:
+      Cneonction:
+      - close
+      Content-Length:
+      - '149'
+      Content-Type:
+      - application/json
+      Date:
+      - Wed, 13 Feb 2013 10:22:53 GMT
+      Cache-Control:
+      - no-cache
+      Expires:
+      - '-1'
+      Pragma:
+      - no-cache
+      Server:
+      - Apache-Coyote/1.1
+    body:
+      encoding: US-ASCII
+      string: ! "{\n  \"unauthorized\" : {\n    \"code\" : 401,\n    \"details\" :
+        \"Invalid credentials\",\n    \"message\" : \"UNAUTHORIZED\",\n    \"otherAttributes\"
+        : {\n    }\n  }\n}"
+    http_version: 
+  recorded_at: Wed, 13 Feb 2013 10:22:54 GMT
+recorded_with: VCR 2.4.0

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/ee7536c5/server/tests/drivers/openstack/fixtures/test_0002_must_return_list_of_realms.yml
----------------------------------------------------------------------
diff --git a/server/tests/drivers/openstack/fixtures/test_0002_must_return_list_of_realms.yml b/server/tests/drivers/openstack/fixtures/test_0002_must_return_list_of_realms.yml
index b3eaf18..122cd6b 100644
--- a/server/tests/drivers/openstack/fixtures/test_0002_must_return_list_of_realms.yml
+++ b/server/tests/drivers/openstack/fixtures/test_0002_must_return_list_of_realms.yml
@@ -2,10 +2,10 @@
 http_interactions:
 - request:
     method: post
-    uri: http://10.34.32.211:5000/v2.0/tokens
+    uri: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens
     body:
       encoding: UTF-8
-      string: ! '{"auth":{"passwordCredentials":{"username":"admin","password":"password"},"tenantName":"admin"}}'
+      string: ! '{"auth":{"passwordCredentials":{"username":"foo@fakedomain.eu","password":"1234fake56789"},"tenantName":"foo@fakedomain.eu-default-tenant"}}'
     headers:
       Content-Type:
       - application/json
@@ -18,95 +18,107 @@ http_interactions:
       code: 200
       message: OK
     headers:
-      Content-Type:
-      - application/json
-      Vary:
-      - X-Auth-Token
       Content-Length:
-      - '2010'
-      Date:
-      - Mon, 27 Aug 2012 16:15:34 GMT
-    body:
-      encoding: US-ASCII
-      string: ! '{"access": {"token": {"expires": "2012-08-28T16:15:34Z", "id": "e92cde551ebf403c9824440f7edc47ca",
-        "tenant": {"description": null, "enabled": true, "id": "e827289fd66f4effb5b9b5012282fdb7",
-        "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://10.34.32.211:8776/v1/e827289fd66f4effb5b9b5012282fdb7",
-        "region": "RegionOne", "publicURL": "http://10.34.32.211:8776/v1/e827289fd66f4effb5b9b5012282fdb7",
-        "internalURL": "http://10.34.32.211:8776/v1/e827289fd66f4effb5b9b5012282fdb7"}],
-        "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints":
-        [{"adminURL": "http://10.34.32.211:9292/v1", "region": "RegionOne", "publicURL":
-        "http://10.34.32.211:9292/v1", "internalURL": "http://10.34.32.211:9292/v1"}],
-        "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints":
-        [{"adminURL": "http://10.34.32.211:8774/v1.1/e827289fd66f4effb5b9b5012282fdb7",
-        "region": "RegionOne", "publicURL": "http://10.34.32.211:8774/v1.1/e827289fd66f4effb5b9b5012282fdb7",
-        "internalURL": "http://10.34.32.211:8774/v1.1/e827289fd66f4effb5b9b5012282fdb7"}],
-        "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints":
-        [{"adminURL": "http://10.34.32.211:8773/services/Admin", "region": "RegionOne",
-        "publicURL": "http://10.34.32.211:8773/services/Cloud", "internalURL": "http://10.34.32.211:8773/services/Cloud"}],
-        "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints":
-        [{"adminURL": "http://10.34.32.211:35357/v2.0", "region": "RegionOne", "publicURL":
-        "http://10.34.32.211:5000/v2.0", "internalURL": "http://10.34.32.211:5000/v2.0"}],
-        "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user":
-        {"username": "admin", "roles_links": [], "id": "f2286a51122345cea7d216c120974b41",
-        "roles": [{"id": "e7e292b28c4b4befb06232fa935a3c48", "name": "KeystoneServiceAdmin"},
-        {"id": "7e716d5a52f348bb9a7fbbc230041b2a", "name": "admin"}, {"id": "bf2113c0cb924b34907521808ed9df13",
-        "name": "KeystoneAdmin"}], "name": "admin"}}}'
-    http_version: 
-  recorded_at: Mon, 27 Aug 2012 12:26:52 GMT
-- request:
-    method: get
-    uri: http://10.34.32.211:8774/v1.1/e827289fd66f4effb5b9b5012282fdb7/limits
-    body:
-      encoding: US-ASCII
-      string: ''
-    headers:
-      X-Auth-Token:
-      - e92cde551ebf403c9824440f7edc47ca
-      X-Storage-Token:
-      - e92cde551ebf403c9824440f7edc47ca
-      Connection:
-      - Keep-Alive
-      User-Agent:
-      - OpenStack Ruby API 1.0.3
-      Accept:
-      - application/json
-  response:
-    status:
-      code: 200
-      message: OK
-    headers:
-      X-Compute-Request-Id:
-      - req-6baf6807-52cd-4a74-b0a5-04aeff385b3e
+      - '5934'
       Content-Type:
       - application/json
-      Content-Length:
-      - '900'
       Date:
-      - Mon, 27 Aug 2012 16:15:34 GMT
-      Connection:
-      - keep-alive
+      - Wed, 13 Feb 2013 10:22:55 GMT
+      Cache-Control:
+      - no-cache
+      Expires:
+      - '-1'
+      Pragma:
+      - no-cache
+      Server:
+      - Apache-Coyote/1.1
     body:
       encoding: US-ASCII
-      string: ! '{"limits": {"rate": [{"regex": ".*", "limit": [{"next-available":
-        "2012-08-27T15:44:04Z", "unit": "MINUTE", "verb": "POST", "remaining": 9,
-        "value": 10}, {"next-available": "2012-08-27T16:15:34Z", "unit": "MINUTE",
-        "verb": "PUT", "remaining": 10, "value": 10}, {"next-available": "2012-08-27T15:39:45Z",
-        "unit": "MINUTE", "verb": "DELETE", "remaining": 99, "value": 100}], "uri":
-        "*"}, {"regex": "^/servers", "limit": [{"next-available": "2012-08-27T16:15:34Z",
-        "unit": "DAY", "verb": "POST", "remaining": 50, "value": 50}], "uri": "*/servers"},
-        {"regex": ".*changes-since.*", "limit": [{"next-available": "2012-08-27T16:15:34Z",
-        "unit": "MINUTE", "verb": "GET", "remaining": 3, "value": 3}], "uri": "*changes-since*"}],
-        "absolute": {"maxServerMeta": 128, "maxPersonality": 5, "maxImageMeta": 128,
-        "maxPersonalitySize": 10240, "maxTotalCores": 20, "maxTotalInstances": 10,
-        "maxTotalRAMSize": 51200}}}'
+      string: ! "{\"access\": {\n  \"token\": {\n    \"expires\": \"2013-02-13T22:22:55.724Z\",\n
+        \   \"id\": \"EUAuth_01d7206e81832d1ac45183ab9531ba4f6cdc231590a31d5a326aa3cac417cdd1\",\n
+        \   \"tenant\": {\n      \"id\": \"123456fake7890\",\n      \"name\": \"foo@fakedomain.eu-default-tenant\"\n
+        \   }\n  },\n  \"user\": {\n    \"id\": \"98765fake43210\",\n    \"name\":
+        \"foo@fakedomain.eu\",\n    \"roles\": [\n      {\n        \"id\": \"00000000004013\",\n
+        \       \"serviceId\": \"130\",\n        \"name\": \"block-admin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004025\",\n
+        \       \"serviceId\": \"120\",\n        \"name\": \"sysadmin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004024\",\n
+        \       \"serviceId\": \"140\",\n        \"name\": \"user\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004022\",\n
+        \       \"serviceId\": \"110\",\n        \"name\": \"Admin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004025\",\n
+        \       \"serviceId\": \"120\",\n        \"name\": \"sysadmin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004024\",\n
+        \       \"serviceId\": \"140\",\n        \"name\": \"user\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004003\",\n
+        \       \"serviceId\": \"100\",\n        \"name\": \"domainadmin\"\n      },\n
+        \     {\n        \"id\": \"00000000004016\",\n        \"serviceId\": \"120\",\n
+        \       \"name\": \"netadmin\",\n        \"tenantId\": \"123456fake7890\"\n
+        \     },\n      {\n        \"id\": \"00000000004004\",\n        \"serviceId\":
+        \"100\",\n        \"name\": \"domainuser\"\n      },\n      {\n        \"id\":
+        \"00000000004013\",\n        \"serviceId\": \"130\",\n        \"name\": \"block-admin\",\n
+        \       \"tenantId\": \"123456fake7890\"\n      },\n      {\n        \"id\":
+        \"00000000004016\",\n        \"serviceId\": \"120\",\n        \"name\": \"netadmin\",\n
+        \       \"tenantId\": \"123456fake7890\"\n      }\n    ]\n  },\n  \"serviceCatalog\":
+        [\n    {\n      \"name\": \"Object Storage\",\n      \"type\": \"object-store\",\n
+        \     \"endpoints\": [{\n        \"tenantId\": \"123456fake7890\",\n        \"publicURL\":
+        \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\\/v1\\/123456fake7890\",\n
+        \       \"region\": \"region-a.geo-1\",\n        \"versionId\": \"1.0\",\n
+        \       \"versionInfo\": \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\\/v1.0\\/\",\n
+        \       \"versionList\": \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\"\n
+        \     }]\n    },\n    {\n      \"name\": \"Identity\",\n      \"type\": \"identity\",\n
+        \     \"endpoints\": [\n        {\n          \"publicURL\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"region\": \"region-a.geo-1\",\n          \"versionId\": \"2.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\"\n
+        \       },\n        {\n          \"publicURL\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"region\": \"region-b.geo-1\",\n          \"versionId\": \"2.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\"\n
+        \       }\n      ]\n    },\n    {\n      \"name\": \"Image Management\",\n
+        \     \"type\": \"image\",\n      \"endpoints\": [\n        {\n          \"tenantId\":
+        \"123456fake7890\",\n          \"publicURL\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\\/v1.0\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\\/v1.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\\/v1.0\",\n          \"region\":
+        \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.0\",\n          \"versionInfo\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\\/v1.0\\/\",\n          \"versionList\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\"\n        }\n      ]\n    },\n
+        \   {\n      \"name\": \"Block Storage\",\n      \"type\": \"volume\",\n      \"endpoints\":
+        [\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"region\": \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       }\n      ]\n    },\n    {\n      \"name\": \"Compute\",\n      \"type\":
+        \"compute\",\n      \"endpoints\": [\n        {\n          \"tenantId\": \"123456fake7890\",\n
+        \         \"publicURL\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"publicURL2\": \"https:\\/\\/az-2.region-a.geo-1.ec2-compute.hpcloudsvc.com\\/services\\/Cloud\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"publicURL2\": \"https:\\/\\/az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com\\/services\\/Cloud\",\n
+        \         \"region\": \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       }\n      ]\n    }\n  ]\n}}"
     http_version: 
-  recorded_at: Mon, 27 Aug 2012 12:26:52 GMT
+  recorded_at: Wed, 13 Feb 2013 10:22:55 GMT
 - request:
     method: post
-    uri: http://10.34.32.211:5000/v2.0/tokens
+    uri: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens
     body:
       encoding: UTF-8
-      string: ! '{"auth":{"passwordCredentials":{"username":"admin","password":"password"},"tenantName":"admin"}}'
+      string: ! '{"auth":{"passwordCredentials":{"username":"foo@fakedomain.eu","password":"1234fake56789"},"tenantName":"foo@fakedomain.eu-default-tenant"}}'
     headers:
       Content-Type:
       - application/json
@@ -119,87 +131,99 @@ http_interactions:
       code: 200
       message: OK
     headers:
-      Content-Type:
-      - application/json
-      Vary:
-      - X-Auth-Token
       Content-Length:
-      - '2010'
-      Date:
-      - Mon, 27 Aug 2012 16:15:34 GMT
-    body:
-      encoding: US-ASCII
-      string: ! '{"access": {"token": {"expires": "2012-08-28T16:15:34Z", "id": "6366d82b5dd04fee88c37bf950f24172",
-        "tenant": {"description": null, "enabled": true, "id": "e827289fd66f4effb5b9b5012282fdb7",
-        "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://10.34.32.211:8776/v1/e827289fd66f4effb5b9b5012282fdb7",
-        "region": "RegionOne", "publicURL": "http://10.34.32.211:8776/v1/e827289fd66f4effb5b9b5012282fdb7",
-        "internalURL": "http://10.34.32.211:8776/v1/e827289fd66f4effb5b9b5012282fdb7"}],
-        "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints":
-        [{"adminURL": "http://10.34.32.211:9292/v1", "region": "RegionOne", "publicURL":
-        "http://10.34.32.211:9292/v1", "internalURL": "http://10.34.32.211:9292/v1"}],
-        "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints":
-        [{"adminURL": "http://10.34.32.211:8774/v1.1/e827289fd66f4effb5b9b5012282fdb7",
-        "region": "RegionOne", "publicURL": "http://10.34.32.211:8774/v1.1/e827289fd66f4effb5b9b5012282fdb7",
-        "internalURL": "http://10.34.32.211:8774/v1.1/e827289fd66f4effb5b9b5012282fdb7"}],
-        "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints":
-        [{"adminURL": "http://10.34.32.211:8773/services/Admin", "region": "RegionOne",
-        "publicURL": "http://10.34.32.211:8773/services/Cloud", "internalURL": "http://10.34.32.211:8773/services/Cloud"}],
-        "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints":
-        [{"adminURL": "http://10.34.32.211:35357/v2.0", "region": "RegionOne", "publicURL":
-        "http://10.34.32.211:5000/v2.0", "internalURL": "http://10.34.32.211:5000/v2.0"}],
-        "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user":
-        {"username": "admin", "roles_links": [], "id": "f2286a51122345cea7d216c120974b41",
-        "roles": [{"id": "e7e292b28c4b4befb06232fa935a3c48", "name": "KeystoneServiceAdmin"},
-        {"id": "7e716d5a52f348bb9a7fbbc230041b2a", "name": "admin"}, {"id": "bf2113c0cb924b34907521808ed9df13",
-        "name": "KeystoneAdmin"}], "name": "admin"}}}'
-    http_version: 
-  recorded_at: Mon, 27 Aug 2012 12:26:52 GMT
-- request:
-    method: get
-    uri: http://10.34.32.211:8774/v1.1/e827289fd66f4effb5b9b5012282fdb7/limits
-    body:
-      encoding: US-ASCII
-      string: ''
-    headers:
-      X-Auth-Token:
-      - 6366d82b5dd04fee88c37bf950f24172
-      X-Storage-Token:
-      - 6366d82b5dd04fee88c37bf950f24172
-      Connection:
-      - Keep-Alive
-      User-Agent:
-      - OpenStack Ruby API 1.0.3
-      Accept:
-      - application/json
-  response:
-    status:
-      code: 200
-      message: OK
-    headers:
-      X-Compute-Request-Id:
-      - req-96f38078-c22f-4fdf-a3f0-a2ec6bbb2212
+      - '5934'
       Content-Type:
       - application/json
-      Content-Length:
-      - '900'
       Date:
-      - Mon, 27 Aug 2012 16:15:34 GMT
-      Connection:
-      - keep-alive
+      - Wed, 13 Feb 2013 10:22:57 GMT
+      Cache-Control:
+      - no-cache
+      Expires:
+      - '-1'
+      Pragma:
+      - no-cache
+      Server:
+      - Apache-Coyote/1.1
     body:
       encoding: US-ASCII
-      string: ! '{"limits": {"rate": [{"regex": ".*", "limit": [{"next-available":
-        "2012-08-27T15:44:04Z", "unit": "MINUTE", "verb": "POST", "remaining": 9,
-        "value": 10}, {"next-available": "2012-08-27T16:15:34Z", "unit": "MINUTE",
-        "verb": "PUT", "remaining": 10, "value": 10}, {"next-available": "2012-08-27T15:39:45Z",
-        "unit": "MINUTE", "verb": "DELETE", "remaining": 99, "value": 100}], "uri":
-        "*"}, {"regex": "^/servers", "limit": [{"next-available": "2012-08-27T16:15:34Z",
-        "unit": "DAY", "verb": "POST", "remaining": 50, "value": 50}], "uri": "*/servers"},
-        {"regex": ".*changes-since.*", "limit": [{"next-available": "2012-08-27T16:15:34Z",
-        "unit": "MINUTE", "verb": "GET", "remaining": 3, "value": 3}], "uri": "*changes-since*"}],
-        "absolute": {"maxServerMeta": 128, "maxPersonality": 5, "maxImageMeta": 128,
-        "maxPersonalitySize": 10240, "maxTotalCores": 20, "maxTotalInstances": 10,
-        "maxTotalRAMSize": 51200}}}'
+      string: ! "{\"access\": {\n  \"token\": {\n    \"expires\": \"2013-02-13T22:22:57.588Z\",\n
+        \   \"id\": \"EUAuth_01d7206e81832d1ac45183ab9531ba4f6cdc231590a31d5a326aa3cac417cdd1\",\n
+        \   \"tenant\": {\n      \"id\": \"123456fake7890\",\n      \"name\": \"foo@fakedomain.eu-default-tenant\"\n
+        \   }\n  },\n  \"user\": {\n    \"id\": \"98765fake43210\",\n    \"name\":
+        \"foo@fakedomain.eu\",\n    \"roles\": [\n      {\n        \"id\": \"00000000004013\",\n
+        \       \"serviceId\": \"130\",\n        \"name\": \"block-admin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004025\",\n
+        \       \"serviceId\": \"120\",\n        \"name\": \"sysadmin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004024\",\n
+        \       \"serviceId\": \"140\",\n        \"name\": \"user\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004022\",\n
+        \       \"serviceId\": \"110\",\n        \"name\": \"Admin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004025\",\n
+        \       \"serviceId\": \"120\",\n        \"name\": \"sysadmin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004024\",\n
+        \       \"serviceId\": \"140\",\n        \"name\": \"user\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004003\",\n
+        \       \"serviceId\": \"100\",\n        \"name\": \"domainadmin\"\n      },\n
+        \     {\n        \"id\": \"00000000004016\",\n        \"serviceId\": \"120\",\n
+        \       \"name\": \"netadmin\",\n        \"tenantId\": \"123456fake7890\"\n
+        \     },\n      {\n        \"id\": \"00000000004004\",\n        \"serviceId\":
+        \"100\",\n        \"name\": \"domainuser\"\n      },\n      {\n        \"id\":
+        \"00000000004013\",\n        \"serviceId\": \"130\",\n        \"name\": \"block-admin\",\n
+        \       \"tenantId\": \"123456fake7890\"\n      },\n      {\n        \"id\":
+        \"00000000004016\",\n        \"serviceId\": \"120\",\n        \"name\": \"netadmin\",\n
+        \       \"tenantId\": \"123456fake7890\"\n      }\n    ]\n  },\n  \"serviceCatalog\":
+        [\n    {\n      \"name\": \"Object Storage\",\n      \"type\": \"object-store\",\n
+        \     \"endpoints\": [{\n        \"tenantId\": \"123456fake7890\",\n        \"publicURL\":
+        \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\\/v1\\/123456fake7890\",\n
+        \       \"region\": \"region-a.geo-1\",\n        \"versionId\": \"1.0\",\n
+        \       \"versionInfo\": \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\\/v1.0\\/\",\n
+        \       \"versionList\": \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\"\n
+        \     }]\n    },\n    {\n      \"name\": \"Identity\",\n      \"type\": \"identity\",\n
+        \     \"endpoints\": [\n        {\n          \"publicURL\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"region\": \"region-a.geo-1\",\n          \"versionId\": \"2.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\"\n
+        \       },\n        {\n          \"publicURL\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"region\": \"region-b.geo-1\",\n          \"versionId\": \"2.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\"\n
+        \       }\n      ]\n    },\n    {\n      \"name\": \"Image Management\",\n
+        \     \"type\": \"image\",\n      \"endpoints\": [\n        {\n          \"tenantId\":
+        \"123456fake7890\",\n          \"publicURL\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\\/v1.0\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\\/v1.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\\/v1.0\",\n          \"region\":
+        \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.0\",\n          \"versionInfo\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\\/v1.0\\/\",\n          \"versionList\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\"\n        }\n      ]\n    },\n
+        \   {\n      \"name\": \"Block Storage\",\n      \"type\": \"volume\",\n      \"endpoints\":
+        [\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"region\": \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       }\n      ]\n    },\n    {\n      \"name\": \"Compute\",\n      \"type\":
+        \"compute\",\n      \"endpoints\": [\n        {\n          \"tenantId\": \"123456fake7890\",\n
+        \         \"publicURL\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"publicURL2\": \"https:\\/\\/az-2.region-a.geo-1.ec2-compute.hpcloudsvc.com\\/services\\/Cloud\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"publicURL2\": \"https:\\/\\/az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com\\/services\\/Cloud\",\n
+        \         \"region\": \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       }\n      ]\n    }\n  ]\n}}"
     http_version: 
-  recorded_at: Mon, 27 Aug 2012 12:26:52 GMT
-recorded_with: VCR 2.2.4
+  recorded_at: Wed, 13 Feb 2013 10:22:57 GMT
+recorded_with: VCR 2.4.0

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/ee7536c5/server/tests/drivers/openstack/fixtures/test_0003_must_allow_to_retrieve_single_realm.yml
----------------------------------------------------------------------
diff --git a/server/tests/drivers/openstack/fixtures/test_0003_must_allow_to_retrieve_single_realm.yml b/server/tests/drivers/openstack/fixtures/test_0003_must_allow_to_retrieve_single_realm.yml
new file mode 100644
index 0000000..cfbdd39
--- /dev/null
+++ b/server/tests/drivers/openstack/fixtures/test_0003_must_allow_to_retrieve_single_realm.yml
@@ -0,0 +1,342 @@
+---
+http_interactions:
+- request:
+    method: post
+    uri: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens
+    body:
+      encoding: UTF-8
+      string: ! '{"auth":{"passwordCredentials":{"username":"foo@fakedomain.eu","password":"1234fake56789"},"tenantName":"foo@fakedomain.eu-default-tenant"}}'
+    headers:
+      Content-Type:
+      - application/json
+      Accept:
+      - ! '*/*'
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Content-Length:
+      - '5934'
+      Content-Type:
+      - application/json
+      Date:
+      - Wed, 13 Feb 2013 10:22:46 GMT
+      Cache-Control:
+      - no-cache
+      Expires:
+      - '-1'
+      Pragma:
+      - no-cache
+      Server:
+      - Apache-Coyote/1.1
+    body:
+      encoding: US-ASCII
+      string: ! "{\"access\": {\n  \"token\": {\n    \"expires\": \"2013-02-13T22:22:46.922Z\",\n
+        \   \"id\": \"EUAuth_01d7206e81832d1ac45183ab9531ba4f6cdc231590a31d5a326aa3cac417cdd1\",\n
+        \   \"tenant\": {\n      \"id\": \"123456fake7890\",\n      \"name\": \"foo@fakedomain.eu-default-tenant\"\n
+        \   }\n  },\n  \"user\": {\n    \"id\": \"98765fake43210\",\n    \"name\":
+        \"foo@fakedomain.eu\",\n    \"roles\": [\n      {\n        \"id\": \"00000000004013\",\n
+        \       \"serviceId\": \"130\",\n        \"name\": \"block-admin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004025\",\n
+        \       \"serviceId\": \"120\",\n        \"name\": \"sysadmin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004024\",\n
+        \       \"serviceId\": \"140\",\n        \"name\": \"user\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004022\",\n
+        \       \"serviceId\": \"110\",\n        \"name\": \"Admin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004025\",\n
+        \       \"serviceId\": \"120\",\n        \"name\": \"sysadmin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004024\",\n
+        \       \"serviceId\": \"140\",\n        \"name\": \"user\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004003\",\n
+        \       \"serviceId\": \"100\",\n        \"name\": \"domainadmin\"\n      },\n
+        \     {\n        \"id\": \"00000000004016\",\n        \"serviceId\": \"120\",\n
+        \       \"name\": \"netadmin\",\n        \"tenantId\": \"123456fake7890\"\n
+        \     },\n      {\n        \"id\": \"00000000004004\",\n        \"serviceId\":
+        \"100\",\n        \"name\": \"domainuser\"\n      },\n      {\n        \"id\":
+        \"00000000004013\",\n        \"serviceId\": \"130\",\n        \"name\": \"block-admin\",\n
+        \       \"tenantId\": \"123456fake7890\"\n      },\n      {\n        \"id\":
+        \"00000000004016\",\n        \"serviceId\": \"120\",\n        \"name\": \"netadmin\",\n
+        \       \"tenantId\": \"123456fake7890\"\n      }\n    ]\n  },\n  \"serviceCatalog\":
+        [\n    {\n      \"name\": \"Object Storage\",\n      \"type\": \"object-store\",\n
+        \     \"endpoints\": [{\n        \"tenantId\": \"123456fake7890\",\n        \"publicURL\":
+        \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\\/v1\\/123456fake7890\",\n
+        \       \"region\": \"region-a.geo-1\",\n        \"versionId\": \"1.0\",\n
+        \       \"versionInfo\": \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\\/v1.0\\/\",\n
+        \       \"versionList\": \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\"\n
+        \     }]\n    },\n    {\n      \"name\": \"Identity\",\n      \"type\": \"identity\",\n
+        \     \"endpoints\": [\n        {\n          \"publicURL\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"region\": \"region-a.geo-1\",\n          \"versionId\": \"2.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\"\n
+        \       },\n        {\n          \"publicURL\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"region\": \"region-b.geo-1\",\n          \"versionId\": \"2.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\"\n
+        \       }\n      ]\n    },\n    {\n      \"name\": \"Image Management\",\n
+        \     \"type\": \"image\",\n      \"endpoints\": [\n        {\n          \"tenantId\":
+        \"123456fake7890\",\n          \"publicURL\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\\/v1.0\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\\/v1.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\\/v1.0\",\n          \"region\":
+        \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.0\",\n          \"versionInfo\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\\/v1.0\\/\",\n          \"versionList\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\"\n        }\n      ]\n    },\n
+        \   {\n      \"name\": \"Block Storage\",\n      \"type\": \"volume\",\n      \"endpoints\":
+        [\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"region\": \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       }\n      ]\n    },\n    {\n      \"name\": \"Compute\",\n      \"type\":
+        \"compute\",\n      \"endpoints\": [\n        {\n          \"tenantId\": \"123456fake7890\",\n
+        \         \"publicURL\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"publicURL2\": \"https:\\/\\/az-2.region-a.geo-1.ec2-compute.hpcloudsvc.com\\/services\\/Cloud\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"publicURL2\": \"https:\\/\\/az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com\\/services\\/Cloud\",\n
+        \         \"region\": \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       }\n      ]\n    }\n  ]\n}}"
+    http_version: 
+  recorded_at: Wed, 13 Feb 2013 10:22:47 GMT
+- request:
+    method: post
+    uri: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens
+    body:
+      encoding: UTF-8
+      string: ! '{"auth":{"passwordCredentials":{"username":"foo@fakedomain.eu","password":"1234fake56789"},"tenantName":"foo@fakedomain.eu-default-tenant"}}'
+    headers:
+      Content-Type:
+      - application/json
+      Accept:
+      - ! '*/*'
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Content-Length:
+      - '5934'
+      Content-Type:
+      - application/json
+      Date:
+      - Wed, 13 Feb 2013 10:22:49 GMT
+      Cache-Control:
+      - no-cache
+      Expires:
+      - '-1'
+      Pragma:
+      - no-cache
+      Server:
+      - Apache-Coyote/1.1
+    body:
+      encoding: US-ASCII
+      string: ! "{\"access\": {\n  \"token\": {\n    \"expires\": \"2013-02-13T22:22:49.316Z\",\n
+        \   \"id\": \"EUAuth_01d7206e81832d1ac45183ab9531ba4f6cdc231590a31d5a326aa3cac417cdd1\",\n
+        \   \"tenant\": {\n      \"id\": \"123456fake7890\",\n      \"name\": \"foo@fakedomain.eu-default-tenant\"\n
+        \   }\n  },\n  \"user\": {\n    \"id\": \"98765fake43210\",\n    \"name\":
+        \"foo@fakedomain.eu\",\n    \"roles\": [\n      {\n        \"id\": \"00000000004013\",\n
+        \       \"serviceId\": \"130\",\n        \"name\": \"block-admin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004025\",\n
+        \       \"serviceId\": \"120\",\n        \"name\": \"sysadmin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004024\",\n
+        \       \"serviceId\": \"140\",\n        \"name\": \"user\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004022\",\n
+        \       \"serviceId\": \"110\",\n        \"name\": \"Admin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004025\",\n
+        \       \"serviceId\": \"120\",\n        \"name\": \"sysadmin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004024\",\n
+        \       \"serviceId\": \"140\",\n        \"name\": \"user\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004003\",\n
+        \       \"serviceId\": \"100\",\n        \"name\": \"domainadmin\"\n      },\n
+        \     {\n        \"id\": \"00000000004016\",\n        \"serviceId\": \"120\",\n
+        \       \"name\": \"netadmin\",\n        \"tenantId\": \"123456fake7890\"\n
+        \     },\n      {\n        \"id\": \"00000000004004\",\n        \"serviceId\":
+        \"100\",\n        \"name\": \"domainuser\"\n      },\n      {\n        \"id\":
+        \"00000000004013\",\n        \"serviceId\": \"130\",\n        \"name\": \"block-admin\",\n
+        \       \"tenantId\": \"123456fake7890\"\n      },\n      {\n        \"id\":
+        \"00000000004016\",\n        \"serviceId\": \"120\",\n        \"name\": \"netadmin\",\n
+        \       \"tenantId\": \"123456fake7890\"\n      }\n    ]\n  },\n  \"serviceCatalog\":
+        [\n    {\n      \"name\": \"Object Storage\",\n      \"type\": \"object-store\",\n
+        \     \"endpoints\": [{\n        \"tenantId\": \"123456fake7890\",\n        \"publicURL\":
+        \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\\/v1\\/123456fake7890\",\n
+        \       \"region\": \"region-a.geo-1\",\n        \"versionId\": \"1.0\",\n
+        \       \"versionInfo\": \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\\/v1.0\\/\",\n
+        \       \"versionList\": \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\"\n
+        \     }]\n    },\n    {\n      \"name\": \"Identity\",\n      \"type\": \"identity\",\n
+        \     \"endpoints\": [\n        {\n          \"publicURL\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"region\": \"region-a.geo-1\",\n          \"versionId\": \"2.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\"\n
+        \       },\n        {\n          \"publicURL\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"region\": \"region-b.geo-1\",\n          \"versionId\": \"2.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\"\n
+        \       }\n      ]\n    },\n    {\n      \"name\": \"Image Management\",\n
+        \     \"type\": \"image\",\n      \"endpoints\": [\n        {\n          \"tenantId\":
+        \"123456fake7890\",\n          \"publicURL\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\\/v1.0\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\\/v1.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\\/v1.0\",\n          \"region\":
+        \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.0\",\n          \"versionInfo\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\\/v1.0\\/\",\n          \"versionList\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\"\n        }\n      ]\n    },\n
+        \   {\n      \"name\": \"Block Storage\",\n      \"type\": \"volume\",\n      \"endpoints\":
+        [\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"region\": \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       }\n      ]\n    },\n    {\n      \"name\": \"Compute\",\n      \"type\":
+        \"compute\",\n      \"endpoints\": [\n        {\n          \"tenantId\": \"123456fake7890\",\n
+        \         \"publicURL\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"publicURL2\": \"https:\\/\\/az-2.region-a.geo-1.ec2-compute.hpcloudsvc.com\\/services\\/Cloud\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"publicURL2\": \"https:\\/\\/az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com\\/services\\/Cloud\",\n
+        \         \"region\": \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       }\n      ]\n    }\n  ]\n}}"
+    http_version: 
+  recorded_at: Wed, 13 Feb 2013 10:22:49 GMT
+- request:
+    method: post
+    uri: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens
+    body:
+      encoding: UTF-8
+      string: ! '{"auth":{"passwordCredentials":{"username":"foo@fakedomain.eu","password":"1234fake56789"},"tenantName":"foo@fakedomain.eu-default-tenant"}}'
+    headers:
+      Content-Type:
+      - application/json
+      Accept:
+      - ! '*/*'
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Content-Length:
+      - '5934'
+      Content-Type:
+      - application/json
+      Date:
+      - Wed, 13 Feb 2013 10:22:51 GMT
+      Cache-Control:
+      - no-cache
+      Expires:
+      - '-1'
+      Pragma:
+      - no-cache
+      Server:
+      - Apache-Coyote/1.1
+    body:
+      encoding: US-ASCII
+      string: ! "{\"access\": {\n  \"token\": {\n    \"expires\": \"2013-02-13T22:22:52.152Z\",\n
+        \   \"id\": \"EUAuth_01d7206e81832d1ac45183ab9531ba4f6cdc231590a31d5a326aa3cac417cdd1\",\n
+        \   \"tenant\": {\n      \"id\": \"123456fake7890\",\n      \"name\": \"foo@fakedomain.eu-default-tenant\"\n
+        \   }\n  },\n  \"user\": {\n    \"id\": \"98765fake43210\",\n    \"name\":
+        \"foo@fakedomain.eu\",\n    \"roles\": [\n      {\n        \"id\": \"00000000004013\",\n
+        \       \"serviceId\": \"130\",\n        \"name\": \"block-admin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004025\",\n
+        \       \"serviceId\": \"120\",\n        \"name\": \"sysadmin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004024\",\n
+        \       \"serviceId\": \"140\",\n        \"name\": \"user\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004022\",\n
+        \       \"serviceId\": \"110\",\n        \"name\": \"Admin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004025\",\n
+        \       \"serviceId\": \"120\",\n        \"name\": \"sysadmin\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004024\",\n
+        \       \"serviceId\": \"140\",\n        \"name\": \"user\",\n        \"tenantId\":
+        \"123456fake7890\"\n      },\n      {\n        \"id\": \"00000000004003\",\n
+        \       \"serviceId\": \"100\",\n        \"name\": \"domainadmin\"\n      },\n
+        \     {\n        \"id\": \"00000000004016\",\n        \"serviceId\": \"120\",\n
+        \       \"name\": \"netadmin\",\n        \"tenantId\": \"123456fake7890\"\n
+        \     },\n      {\n        \"id\": \"00000000004004\",\n        \"serviceId\":
+        \"100\",\n        \"name\": \"domainuser\"\n      },\n      {\n        \"id\":
+        \"00000000004013\",\n        \"serviceId\": \"130\",\n        \"name\": \"block-admin\",\n
+        \       \"tenantId\": \"123456fake7890\"\n      },\n      {\n        \"id\":
+        \"00000000004016\",\n        \"serviceId\": \"120\",\n        \"name\": \"netadmin\",\n
+        \       \"tenantId\": \"123456fake7890\"\n      }\n    ]\n  },\n  \"serviceCatalog\":
+        [\n    {\n      \"name\": \"Object Storage\",\n      \"type\": \"object-store\",\n
+        \     \"endpoints\": [{\n        \"tenantId\": \"123456fake7890\",\n        \"publicURL\":
+        \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\\/v1\\/123456fake7890\",\n
+        \       \"region\": \"region-a.geo-1\",\n        \"versionId\": \"1.0\",\n
+        \       \"versionInfo\": \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\\/v1.0\\/\",\n
+        \       \"versionList\": \"https:\\/\\/region-a.geo-1.objects.hpcloudsvc.com\"\n
+        \     }]\n    },\n    {\n      \"name\": \"Identity\",\n      \"type\": \"identity\",\n
+        \     \"endpoints\": [\n        {\n          \"publicURL\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"region\": \"region-a.geo-1\",\n          \"versionId\": \"2.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/region-a.geo-1.identity.hpcloudsvc.com:35357\"\n
+        \       },\n        {\n          \"publicURL\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"region\": \"region-b.geo-1\",\n          \"versionId\": \"2.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\\/v2.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/region-b.geo-1.identity.hpcloudsvc.com:35357\"\n
+        \       }\n      ]\n    },\n    {\n      \"name\": \"Image Management\",\n
+        \     \"type\": \"image\",\n      \"endpoints\": [\n        {\n          \"tenantId\":
+        \"123456fake7890\",\n          \"publicURL\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\\/v1.0\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.0\",\n
+        \         \"versionInfo\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\\/v1.0\\/\",\n
+        \         \"versionList\": \"https:\\/\\/glance2.uswest.hpcloud.net:9292\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\\/v1.0\",\n          \"region\":
+        \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.0\",\n          \"versionInfo\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\\/v1.0\\/\",\n          \"versionList\":
+        \"https:\\/\\/glance1.uswest.hpcloud.net:9292\"\n        }\n      ]\n    },\n
+        \   {\n      \"name\": \"Block Storage\",\n      \"type\": \"volume\",\n      \"endpoints\":
+        [\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"region\": \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       }\n      ]\n    },\n    {\n      \"name\": \"Compute\",\n      \"type\":
+        \"compute\",\n      \"endpoints\": [\n        {\n          \"tenantId\": \"123456fake7890\",\n
+        \         \"publicURL\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"publicURL2\": \"https:\\/\\/az-2.region-a.geo-1.ec2-compute.hpcloudsvc.com\\/services\\/Cloud\",\n
+        \         \"region\": \"az-2.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-2.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       },\n        {\n          \"tenantId\": \"123456fake7890\",\n          \"publicURL\":
+        \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/123456fake7890\",\n
+        \         \"publicURL2\": \"https:\\/\\/az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com\\/services\\/Cloud\",\n
+        \         \"region\": \"az-1.region-a.geo-1\",\n          \"versionId\": \"1.1\",\n
+        \         \"versionInfo\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\\/v1.1\\/\",\n
+        \         \"versionList\": \"https:\\/\\/az-1.region-a.geo-1.compute.hpcloudsvc.com\"\n
+        \       }\n      ]\n    }\n  ]\n}}"
+    http_version: 
+  recorded_at: Wed, 13 Feb 2013 10:22:52 GMT
+recorded_with: VCR 2.4.0

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/ee7536c5/server/tests/drivers/openstack/realms_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/openstack/realms_test.rb b/server/tests/drivers/openstack/realms_test.rb
index 96f67b6..42c37bd 100644
--- a/server/tests/drivers/openstack/realms_test.rb
+++ b/server/tests/drivers/openstack/realms_test.rb
@@ -5,6 +5,15 @@ require_relative 'common.rb'
 
 describe 'OpenStackDriver Realms' do
 
+  def credentials
+  {
+    :user => "foo@fakedomain.eu+foo@fakedomain.eu-default-tenant",
+    :password => "1234fake56789",
+    :provider => "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/"
+  }
+  end
+
+
   before do
     @driver = Deltacloud::new(:openstack, credentials)
     VCR.insert_cassette __name__
@@ -14,7 +23,7 @@ describe 'OpenStackDriver Realms' do
     VCR.eject_cassette
   end
 
-  it 'must throw error when wrong credentials' do
+  it 'must throw error when GET Realms with wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown+wrong', :password => 'wrong'))
     end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
@@ -25,20 +34,11 @@ describe 'OpenStackDriver Realms' do
     @driver.realms.first.must_be_kind_of Realm
   end
 
-  it 'must allow to filter realms' do
-    realms = @driver.realms :id => 'default'
-    realms.wont_be_empty
-    realms.must_be_kind_of Array
-    realms.size.must_equal 1
-    realms.first.id.must_equal 'default'
-    @driver.realms(:id => 'unknown').must_be_empty
-  end
-
   it 'must allow to retrieve single realm' do
-    realm = @driver.realm :id => 'default'
+    realm_id = @driver.realms.first.id
+    realm = @driver.realm :id => realm_id
     realm.wont_be_nil
-    realm.id.must_equal 'default'
-    realm.limit.wont_be_empty
+    realm.id.must_equal realm_id
     realm.state.must_equal 'AVAILABLE'
     @driver.realm(:id => 'unknown').must_be_nil
   end


Mime
View raw message