deltacloud-core 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/config/drivers/aruba.yaml +3 -3
- data/deltacloud-core.gemspec +2 -2
- data/lib/cimi/collections/address_templates.rb +1 -2
- data/lib/cimi/collections/addresses.rb +1 -2
- data/lib/cimi/collections/base.rb +1 -1
- data/lib/cimi/collections/credentials.rb +2 -3
- data/lib/cimi/collections/forwarding_group_templates.rb +1 -2
- data/lib/cimi/collections/forwarding_groups.rb +1 -2
- data/lib/cimi/collections/machine_configurations.rb +1 -2
- data/lib/cimi/collections/machine_images.rb +1 -2
- data/lib/cimi/collections/machines.rb +9 -9
- data/lib/cimi/collections/network_configurations.rb +1 -2
- data/lib/cimi/collections/network_port_configurations.rb +1 -2
- data/lib/cimi/collections/network_port_templates.rb +1 -2
- data/lib/cimi/collections/network_ports.rb +1 -2
- data/lib/cimi/collections/network_templates.rb +1 -2
- data/lib/cimi/collections/networks.rb +2 -3
- data/lib/cimi/collections/volume_configurations.rb +1 -2
- data/lib/cimi/collections/volume_images.rb +1 -2
- data/lib/cimi/collections/volumes.rb +3 -4
- data/lib/cimi/helpers/cimi_helper.rb +7 -2
- data/lib/cimi/models.rb +6 -10
- data/lib/cimi/models/base.rb +48 -35
- data/lib/cimi/models/cloud_entry_point.rb +22 -1
- data/lib/cimi/models/collection.rb +42 -5
- data/lib/cimi/models/credential.rb +1 -1
- data/lib/cimi/models/disk.rb +39 -10
- data/lib/cimi/models/machine.rb +39 -22
- data/lib/cimi/models/machine_configuration.rb +4 -5
- data/lib/cimi/models/machine_image.rb +1 -1
- data/lib/cimi/models/machine_volume.rb +1 -1
- data/lib/cimi/models/network.rb +6 -3
- data/lib/cimi/models/network_port.rb +13 -2
- data/lib/cimi/models/schema.rb +66 -5
- data/lib/cimi/models/volume.rb +17 -16
- data/lib/cimi/models/volume_configuration.rb +7 -10
- data/lib/cimi/models/volume_image.rb +1 -1
- data/lib/deltacloud/collections/base.rb +1 -1
- data/lib/deltacloud/collections/firewalls.rb +2 -2
- data/lib/deltacloud/collections/load_balancers.rb +8 -2
- data/lib/deltacloud/core_ext.rb +1 -0
- data/lib/deltacloud/core_ext/base.rb +30 -0
- data/lib/deltacloud/drivers.rb +1 -1
- data/lib/deltacloud/drivers/base_driver.rb +1 -1
- data/lib/deltacloud/drivers/condor/condor_driver.rb +1 -1
- data/lib/deltacloud/drivers/exceptions.rb +24 -14
- data/lib/deltacloud/drivers/features.rb +3 -3
- data/lib/deltacloud/drivers/fgcp/fgcp_driver.rb +163 -92
- data/lib/deltacloud/drivers/mock/data/images/img1.yml +1 -0
- data/lib/deltacloud/drivers/mock/data/images/img2.yml +1 -0
- data/lib/deltacloud/drivers/mock/data/images/img3.yml +1 -0
- data/lib/deltacloud/drivers/mock/mock_client.rb +4 -4
- data/lib/deltacloud/drivers/mock/mock_driver.rb +16 -16
- data/lib/deltacloud/drivers/openstack/openstack_driver.rb +25 -9
- data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +2 -1
- data/lib/deltacloud/drivers/terremark/terremark_driver.rb +1 -1
- data/lib/deltacloud/drivers/vsphere/vsphere_driver.rb +2 -0
- data/lib/deltacloud/helpers/deltacloud_helper.rb +29 -8
- data/lib/deltacloud/models/image.rb +1 -0
- data/lib/deltacloud/models/instance_profile.rb +4 -0
- data/lib/deltacloud/version.rb +1 -1
- data/lib/ec2/query_parser.rb +1 -1
- data/lib/sinatra/rack_accept.rb +5 -1
- data/lib/sinatra/rack_logger.rb +9 -2
- data/tests/cimi/collections/machine_images_test.rb +23 -6
- data/tests/cimi/collections/machines_test.rb +39 -0
- data/tests/cimi/model/collection_spec.rb +109 -0
- data/tests/cimi/{spec/cimi/model → model}/credential_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/machine_configuration_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/machine_image_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/machine_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/machine_template_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/schema_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/volume_configuration_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/volume_image_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/volume_spec.rb +1 -1
- data/tests/cimi/{spec/cimi/model → model}/volume_template_spec.rb +1 -1
- data/tests/cimi/{spec/spec_helper.rb → spec_helper.rb} +7 -4
- data/tests/drivers/base/exceptions_test.rb +8 -8
- data/tests/drivers/ec2/buckets_test.rb +1 -1
- data/tests/drivers/ec2/images_test.rb +1 -1
- data/tests/drivers/ec2/instance_test.rb +1 -1
- data/tests/drivers/ec2/keys_test.rb +2 -2
- data/tests/drivers/ec2/realms_test.rb +1 -1
- data/tests/drivers/ec2/storage_snapshots_test.rb +1 -1
- data/tests/drivers/gogrid/hardware_profiles_test.rb +1 -1
- data/tests/drivers/gogrid/images_test.rb +1 -1
- data/tests/drivers/gogrid/instances_test.rb +1 -1
- data/tests/drivers/gogrid/realms_test.rb +1 -1
- data/tests/drivers/mock/images_test.rb +7 -2
- data/tests/drivers/mock/instances_test.rb +1 -1
- data/tests/drivers/mock/keys_test.rb +2 -2
- data/tests/drivers/mock/realms_test.rb +1 -1
- data/tests/drivers/mock/storage_snapshots_test.rb +1 -1
- data/tests/drivers/mock/storage_volumes_test.rb +1 -1
- data/tests/drivers/openstack/hardware_profiles_test.rb +3 -3
- data/tests/drivers/openstack/images_test.rb +1 -1
- data/tests/drivers/openstack/instances_test.rb +1 -1
- data/tests/drivers/openstack/keys_test.rb +2 -2
- data/tests/drivers/openstack/realms_test.rb +1 -1
- data/tests/drivers/rhevm/common.rb +3 -3
- data/tests/drivers/rhevm/images_test.rb +13 -13
- data/tests/drivers/rhevm/instance_test.rb +22 -22
- data/tests/drivers/rhevm/provider_test.rb +3 -3
- data/tests/drivers/rhevm/realms_test.rb +7 -7
- data/tests/test_helper.rb +0 -5
- data/views/api/show.xml.haml +6 -3
- data/views/errors/401.html.haml +0 -16
- data/views/errors/404.html.haml +2 -3
- data/views/errors/500.html.haml +6 -5
- data/views/images/show.html.haml +5 -1
- data/views/images/show.xml.haml +8 -3
- data/views/instances/new.html.haml +1 -1
- data/views/instances/show.xml.haml +1 -1
- data/views/load_balancers/show.html.haml +1 -1
- metadata +761 -778
- data/lib/cimi/models/disk_collection.rb +0 -37
- data/lib/cimi/models/machine_volume_collection.rb +0 -34
- data/lib/cimi/models/network_port_collection.rb +0 -51
- data/lib/cimi/models/network_port_configuration_collection.rb +0 -35
- data/lib/cimi/models/network_port_template_collection.rb +0 -37
@@ -5,6 +5,8 @@ require_relative './common.rb'
|
|
5
5
|
|
6
6
|
describe CIMI::Collections::Machines do
|
7
7
|
|
8
|
+
NS = { "c" => "http://schemas.dmtf.org/cimi/1" }
|
9
|
+
|
8
10
|
before do
|
9
11
|
def app; run_frontend(:cimi) end
|
10
12
|
authorize 'mockuser', 'mockpassword'
|
@@ -33,6 +35,43 @@ describe CIMI::Collections::Machines do
|
|
33
35
|
xml.root.name.must_equal 'Machine'
|
34
36
|
end
|
35
37
|
|
38
|
+
describe "$expand" do
|
39
|
+
def machine(*expand)
|
40
|
+
url = '/machines/inst1'
|
41
|
+
url += "?$expand=#{expand.join(",")}" unless expand.empty?
|
42
|
+
get root_url url
|
43
|
+
status.must_equal 200
|
44
|
+
end
|
45
|
+
|
46
|
+
def ids(coll)
|
47
|
+
xml.xpath("/c:Machine/c:#{coll}/c:id", NS)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should not expand collections when missing" do
|
51
|
+
machine
|
52
|
+
ids(:disks).must_be_empty
|
53
|
+
ids(:volumes).must_be_empty
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should expand named collections" do
|
57
|
+
machine :disks
|
58
|
+
ids(:disks).size.must_equal 1
|
59
|
+
ids(:volumes).must_be_empty
|
60
|
+
end
|
61
|
+
|
62
|
+
it "should expand multiple named collections" do
|
63
|
+
machine :disks, :volumes
|
64
|
+
ids(:disks).size.must_equal 1
|
65
|
+
ids(:volumes).size.must_equal 1
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should expand all collections with *" do
|
69
|
+
machine "*"
|
70
|
+
ids(:disks).size.must_equal 1
|
71
|
+
ids(:volumes).size.must_equal 1
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
36
75
|
it 'should not return non-existing machine' do
|
37
76
|
get root_url '/machines/unknown-machine'
|
38
77
|
status.must_equal 404
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright ownership. The
|
4
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
5
|
+
# "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
12
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
13
|
+
# License for the specific language governing permissions and limitations
|
14
|
+
# under the License.
|
15
|
+
#
|
16
|
+
require 'rubygems'
|
17
|
+
require 'require_relative' if RUBY_VERSION < '1.9'
|
18
|
+
|
19
|
+
require_relative '../spec_helper.rb' if require 'minitest/autorun'
|
20
|
+
|
21
|
+
require 'nokogiri'
|
22
|
+
require 'json'
|
23
|
+
|
24
|
+
describe "Collection class" do
|
25
|
+
|
26
|
+
BASE_URL = "http://example.com/cimi"
|
27
|
+
COLL_URL = BASE_URL + "/models"
|
28
|
+
|
29
|
+
class Model < CIMI::Model::Base
|
30
|
+
scalar :text
|
31
|
+
end
|
32
|
+
|
33
|
+
class Container < CIMI::Model::Base
|
34
|
+
collection :models, :class => Model
|
35
|
+
end
|
36
|
+
|
37
|
+
before do
|
38
|
+
@models = ["m1", "m2"].map { |s| Model.new(:text => s) }
|
39
|
+
@xml = IO::read(File::join(DATA_DIR, "container.xml"))
|
40
|
+
@json = IO::read(File::join(DATA_DIR, "container.json"))
|
41
|
+
end
|
42
|
+
|
43
|
+
describe "XML serialization" do
|
44
|
+
it "empty collection only has href" do
|
45
|
+
cont = Container.new(:id => BASE_URL)
|
46
|
+
doc = to_dom(cont)
|
47
|
+
|
48
|
+
(doc/"/c:Container/c:models/@href").text.must_equal COLL_URL
|
49
|
+
(doc/"/c:Container/c:models/c:id").size.must_equal 0
|
50
|
+
end
|
51
|
+
|
52
|
+
it "contains count of models" do
|
53
|
+
cont = Container.new(:id => BASE_URL, :models => @models)
|
54
|
+
doc = to_dom(cont)
|
55
|
+
|
56
|
+
(doc/"/c:Container/c:models/c:count").text.must_equal "2"
|
57
|
+
(doc/"/c:Container/c:models/c:Model").size.must_equal 2
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe "JSON serialization" do
|
62
|
+
it "empty collection only has href" do
|
63
|
+
cont = Container.new(:id => BASE_URL)
|
64
|
+
json = to_json(cont)
|
65
|
+
|
66
|
+
json["models"]["href"].must_equal COLL_URL
|
67
|
+
json["models"].keys.must_equal ["href"]
|
68
|
+
end
|
69
|
+
|
70
|
+
it "contains count of models" do
|
71
|
+
cont = Container.new(:id => BASE_URL, :models => @models)
|
72
|
+
json = to_json(cont)
|
73
|
+
|
74
|
+
json["models"]["count"].must_equal 2
|
75
|
+
json["models"]["models"].size.must_equal 2
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
it "deserializes from XML" do
|
80
|
+
cont = Container.from_xml(@xml)
|
81
|
+
cont.id.must_equal BASE_URL
|
82
|
+
cont.models.count.must_equal "2"
|
83
|
+
cont.models.entries.size.must_equal 2
|
84
|
+
cont.models.entries[0].text.must_equal "m1"
|
85
|
+
cont.models.entries[1].text.must_equal "m2"
|
86
|
+
end
|
87
|
+
|
88
|
+
it "deserializes from JSON" do
|
89
|
+
cont = Container.from_json(@json)
|
90
|
+
cont.id.must_equal BASE_URL
|
91
|
+
# FIXME: This is a very annoying difference between XML and JSON; in XML
|
92
|
+
# all scalars are strings, in JSON, strings that look like integers are
|
93
|
+
# converted to integer objects
|
94
|
+
cont.models.count.must_equal 2
|
95
|
+
cont.models.entries.size.must_equal 2
|
96
|
+
cont.models.entries[0].text.must_equal "m1"
|
97
|
+
cont.models.entries[1].text.must_equal "m2"
|
98
|
+
end
|
99
|
+
|
100
|
+
def to_dom(model)
|
101
|
+
doc = Nokogiri::XML(model.to_xml)
|
102
|
+
doc.root.add_namespace("c", doc.namespaces["xmlns"])
|
103
|
+
doc
|
104
|
+
end
|
105
|
+
|
106
|
+
def to_json(model)
|
107
|
+
JSON.parse(model.to_json)
|
108
|
+
end
|
109
|
+
end
|
@@ -15,7 +15,7 @@
|
|
15
15
|
#
|
16
16
|
require 'rubygems'
|
17
17
|
require 'require_relative' if RUBY_VERSION < '1.9'
|
18
|
-
require_relative '
|
18
|
+
require_relative '../spec_helper.rb' if require 'minitest/autorun'
|
19
19
|
|
20
20
|
describe "MachineConfiguration model" do
|
21
21
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
require 'rubygems'
|
17
17
|
require 'require_relative' if RUBY_VERSION < '1.9'
|
18
18
|
|
19
|
-
require_relative '
|
19
|
+
require_relative '../spec_helper.rb' if require 'minitest/autorun'
|
20
20
|
|
21
21
|
describe "MachineImage model" do
|
22
22
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
require 'rubygems'
|
17
17
|
require 'require_relative' if RUBY_VERSION < '1.9'
|
18
18
|
|
19
|
-
require_relative '
|
19
|
+
require_relative '../spec_helper.rb' if require 'minitest/autorun'
|
20
20
|
|
21
21
|
describe "MachineTemplate model" do
|
22
22
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
require 'rubygems'
|
17
17
|
require 'require_relative' if RUBY_VERSION < '1.9'
|
18
18
|
|
19
|
-
require_relative '
|
19
|
+
require_relative '../spec_helper.rb' if require 'minitest/autorun'
|
20
20
|
|
21
21
|
describe "Schema" do
|
22
22
|
before do
|
@@ -17,7 +17,7 @@
|
|
17
17
|
require 'rubygems'
|
18
18
|
require 'require_relative' if RUBY_VERSION < '1.9'
|
19
19
|
|
20
|
-
require_relative '
|
20
|
+
require_relative '../spec_helper.rb' if require 'minitest/autorun'
|
21
21
|
|
22
22
|
describe "Volume Configuration model" do
|
23
23
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
require 'rubygems'
|
17
17
|
require 'require_relative' if RUBY_VERSION < '1.9'
|
18
18
|
|
19
|
-
require_relative '
|
19
|
+
require_relative '../spec_helper.rb' if require 'minitest/autorun'
|
20
20
|
|
21
21
|
describe "Volume Image model" do
|
22
22
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
require 'rubygems'
|
17
17
|
require 'require_relative' if RUBY_VERSION < '1.9'
|
18
18
|
|
19
|
-
require_relative '
|
19
|
+
require_relative '../spec_helper.rb' if require 'minitest/autorun'
|
20
20
|
|
21
21
|
describe "Volume Template model" do
|
22
22
|
|
@@ -20,10 +20,10 @@ require 'minitest/spec'
|
|
20
20
|
require 'xmlsimple'
|
21
21
|
require 'require_relative' if RUBY_VERSION < '1.9'
|
22
22
|
|
23
|
-
require_relative '
|
24
|
-
require_relative '
|
23
|
+
require_relative '../../lib/deltacloud/core_ext.rb'
|
24
|
+
require_relative '../../lib/cimi/models.rb'
|
25
25
|
|
26
|
-
DATA_DIR = File::join(File::expand_path(File::dirname(__FILE__)), '
|
26
|
+
DATA_DIR = File::join(File::expand_path(File::dirname(__FILE__)), 'data')
|
27
27
|
|
28
28
|
def parse_xml(xml, opts = {})
|
29
29
|
opts[:force_content] = true
|
@@ -32,6 +32,9 @@ def parse_xml(xml, opts = {})
|
|
32
32
|
end
|
33
33
|
|
34
34
|
class HashCmp
|
35
|
+
|
36
|
+
IGNORED_KEYS = [ "resourceURI" ]
|
37
|
+
|
35
38
|
def initialize(exp, act)
|
36
39
|
@exp = exp
|
37
40
|
@act = act
|
@@ -77,7 +80,7 @@ class HashCmp
|
|
77
80
|
unless (missing = exp.keys - act.keys).empty?
|
78
81
|
error "Missing key(s) at /#{path.join("/")}: #{missing.inspect}"
|
79
82
|
end
|
80
|
-
unless (excess = act.keys - exp.keys).empty?
|
83
|
+
unless (excess = act.keys - exp.keys - IGNORED_KEYS).empty?
|
81
84
|
error "Excess key(s) at /#{path.join("/")}: #{excess.inspect}"
|
82
85
|
end
|
83
86
|
(exp.keys - missing - excess).each do |k|
|
@@ -6,7 +6,7 @@ require_relative '../../../lib/deltacloud/drivers/exceptions'
|
|
6
6
|
class TestException < StandardError; end
|
7
7
|
|
8
8
|
class ExceptionTestClass
|
9
|
-
include Deltacloud::
|
9
|
+
include Deltacloud::Exceptions
|
10
10
|
|
11
11
|
def raise_exception(id)
|
12
12
|
case id
|
@@ -30,12 +30,12 @@ end
|
|
30
30
|
|
31
31
|
def raise_error(id); ExceptionTestClass.new.raise_exception(id); end
|
32
32
|
|
33
|
-
describe Deltacloud::
|
33
|
+
describe Deltacloud::Exceptions do
|
34
34
|
|
35
35
|
it 'should capture exception when match the exception message' do
|
36
|
-
lambda { raise_error 1 }.must_raise Deltacloud::
|
36
|
+
lambda { raise_error 1 }.must_raise Deltacloud::Exceptions::BackendError
|
37
37
|
|
38
|
-
begin raise_error(1); rescue Deltacloud::
|
38
|
+
begin raise_error(1); rescue Deltacloud::Exceptions::BackendError => e
|
39
39
|
e.code.must_equal 500
|
40
40
|
e.message.must_equal 'Test1ErrorMessage'
|
41
41
|
e.backtrace.wont_be_empty
|
@@ -44,8 +44,8 @@ describe Deltacloud::ExceptionHandler do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'should capture exception when match the exception class' do
|
47
|
-
lambda { raise_error 2 }.must_raise Deltacloud::
|
48
|
-
begin raise_error(2); rescue Deltacloud::
|
47
|
+
lambda { raise_error 2 }.must_raise Deltacloud::Exceptions::ValidationFailure
|
48
|
+
begin raise_error(2); rescue Deltacloud::Exceptions::ValidationFailure => e
|
49
49
|
e.code.must_equal 400
|
50
50
|
e.message.must_equal 'StandardErrorTest'
|
51
51
|
e.backtrace.wont_be_empty
|
@@ -53,8 +53,8 @@ describe Deltacloud::ExceptionHandler do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'should capture exception when no match found' do
|
56
|
-
lambda { raise_error 3 }.must_raise Deltacloud::
|
57
|
-
begin raise_error(3); rescue Deltacloud::
|
56
|
+
lambda { raise_error 3 }.must_raise Deltacloud::Exceptions::BackendError
|
57
|
+
begin raise_error(3); rescue Deltacloud::Exceptions::BackendError => e
|
58
58
|
e.code.must_equal 500
|
59
59
|
e.message.must_equal 'Unhandled exception or status code (not captured)'
|
60
60
|
e.backtrace.wont_be_empty
|
@@ -24,7 +24,7 @@ describe 'Ec2Driver Buckets' do
|
|
24
24
|
it 'must throw error when wrong credentials for buckets' do
|
25
25
|
Proc.new do
|
26
26
|
@driver.backend.buckets(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
|
27
|
-
end.must_raise Deltacloud::
|
27
|
+
end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
|
28
28
|
end
|
29
29
|
|
30
30
|
|
@@ -17,7 +17,7 @@ describe 'Ec2Driver Images' do
|
|
17
17
|
it 'must throw error when wrong credentials' do
|
18
18
|
Proc.new do
|
19
19
|
@driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
|
20
|
-
end.must_raise Deltacloud::
|
20
|
+
end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'must return list of images' do
|
@@ -17,7 +17,7 @@ describe 'Ec2Driver Instances' do
|
|
17
17
|
it 'must throw error when wrong credentials' do
|
18
18
|
Proc.new do
|
19
19
|
@driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
|
20
|
-
end.must_raise Deltacloud::
|
20
|
+
end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'must return list of instances' do
|
@@ -17,7 +17,7 @@ describe 'Ec2Driver Keys' do
|
|
17
17
|
it 'must throw error when wrong credentials' do
|
18
18
|
Proc.new do
|
19
19
|
@driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
|
20
|
-
end.must_raise Deltacloud::
|
20
|
+
end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'must return list of keys' do
|
@@ -44,7 +44,7 @@ describe 'Ec2Driver Keys' do
|
|
44
44
|
key = @driver.create_key(:key_name => 'test-key-1')
|
45
45
|
key.wont_be_nil
|
46
46
|
key.must_be_kind_of Key
|
47
|
-
Proc.new { @driver.create_key(:key_name => 'test-key-1') }.must_raise Deltacloud::
|
47
|
+
Proc.new { @driver.create_key(:key_name => 'test-key-1') }.must_raise Deltacloud::Exceptions::ProviderError, 'KeyExist'
|
48
48
|
@driver.destroy_key :id => key.id
|
49
49
|
@driver.key(:id => key.id).must_be_nil
|
50
50
|
end
|
@@ -17,7 +17,7 @@ describe 'Ec2Driver Realms' do
|
|
17
17
|
it 'must throw error when wrong credentials' do
|
18
18
|
Proc.new do
|
19
19
|
@driver.backend.realms(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
|
20
|
-
end.must_raise Deltacloud::
|
20
|
+
end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'must return list of realms' do
|
@@ -16,7 +16,7 @@ describe 'Ec2Driver StorageSnapshots' do
|
|
16
16
|
it 'must throw error when wrong credentials' do
|
17
17
|
Proc.new do
|
18
18
|
@driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
|
19
|
-
end.must_raise Deltacloud::
|
19
|
+
end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'must return list of storage snapshots' do
|
@@ -17,7 +17,7 @@ describe 'GoGrid Hardware Profiles' do
|
|
17
17
|
it 'must throw error when wrong credentials' do
|
18
18
|
Proc.new do
|
19
19
|
@driver.backend.realms(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
|
20
|
-
end.must_raise Deltacloud::
|
20
|
+
end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'must return list of hardware profiles' do
|
@@ -17,7 +17,7 @@ describe 'GoGridDriver Images' do
|
|
17
17
|
it 'must throw error when wrong credentials' do
|
18
18
|
Proc.new do
|
19
19
|
@driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
|
20
|
-
end.must_raise Deltacloud::
|
20
|
+
end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'must return list of images' do
|
@@ -58,7 +58,7 @@ describe 'GoGridDriver Instances' do
|
|
58
58
|
it 'must throw error when wrong credentials' do
|
59
59
|
Proc.new do
|
60
60
|
@driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
|
61
|
-
end.must_raise Deltacloud::
|
61
|
+
end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'must return list of instances' do
|
@@ -17,7 +17,7 @@ describe 'GoGridDriver Realms' do
|
|
17
17
|
it 'must throw error when wrong credentials' do
|
18
18
|
Proc.new do
|
19
19
|
@driver.backend.realms(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
|
20
|
-
end.must_raise Deltacloud::
|
20
|
+
end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'must return list of realms' do
|