fog 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +3 -3
- data/fog.gemspec +2 -2
- data/lib/fog.rb +1 -1
- data/lib/fog/cdn/aws.rb +4 -1
- data/lib/fog/compute/parsers/terremark_ecloud/get_ip_address.rb +23 -0
- data/lib/fog/compute/parsers/terremark_ecloud/get_task.rb +42 -0
- data/lib/fog/compute/parsers/terremark_ecloud/get_task_list.rb +51 -0
- data/lib/fog/compute/requests/terremark_ecloud/get_ip_address.rb +19 -0
- data/lib/fog/compute/requests/terremark_ecloud/get_task.rb +19 -0
- data/lib/fog/compute/requests/terremark_ecloud/get_task_list.rb +19 -0
- data/lib/fog/compute/requests/terremark_ecloud/get_versions.rb +4 -2
- data/lib/fog/compute/requests/terremark_ecloud/login.rb +29 -0
- data/lib/fog/compute/terremark_ecloud.rb +18 -34
- data/lib/fog/core/attributes.rb +1 -1
- data/lib/fog/core/collection.rb +1 -0
- data/lib/fog/core/credentials.rb +1 -1
- data/lib/fog/core/model.rb +1 -0
- data/lib/fog/dns/aws.rb +4 -1
- data/lib/fog/storage/aws.rb +4 -3
- data/lib/fog/storage/google.rb +4 -1
- data/lib/fog/vcloud/terremark/ecloud/models/internet_service.rb +23 -1
- data/lib/fog/vcloud/terremark/ecloud/requests/add_internet_service.rb +47 -35
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_internet_service.rb +5 -0
- data/spec/vcloud/models/vdc_spec.rb +7 -8
- data/spec/vcloud/requests/get_network_spec.rb +10 -10
- data/spec/vcloud/requests/get_organization_spec.rb +7 -8
- data/spec/vcloud/requests/get_vdc_spec.rb +4 -5
- data/spec/vcloud/requests/get_versions_spec.rb +2 -2
- data/spec/vcloud/spec_helper.rb +36 -32
- data/spec/vcloud/terremark/ecloud/models/backup_internet_service_spec.rb +3 -4
- data/spec/vcloud/terremark/ecloud/models/backup_internet_services_spec.rb +4 -5
- data/spec/vcloud/terremark/ecloud/models/internet_service_spec.rb +26 -3
- data/spec/vcloud/terremark/ecloud/models/internet_services_spec.rb +3 -3
- data/spec/vcloud/terremark/ecloud/models/ip_spec.rb +3 -3
- data/spec/vcloud/terremark/ecloud/models/ips_spec.rb +3 -3
- data/spec/vcloud/terremark/ecloud/models/network_spec.rb +4 -4
- data/spec/vcloud/terremark/ecloud/models/networks_spec.rb +3 -3
- data/spec/vcloud/terremark/ecloud/models/node_spec.rb +3 -3
- data/spec/vcloud/terremark/ecloud/models/nodes_spec.rb +3 -4
- data/spec/vcloud/terremark/ecloud/models/public_ip_spec.rb +3 -3
- data/spec/vcloud/terremark/ecloud/models/public_ips_spec.rb +3 -3
- data/spec/vcloud/terremark/ecloud/models/server_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/models/vdc_spec.rb +5 -5
- data/spec/vcloud/terremark/ecloud/models/vdcs_spec.rb +3 -3
- data/spec/vcloud/terremark/ecloud/requests/add_backup_internet_service_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/requests/add_internet_service_spec.rb +3 -3
- data/spec/vcloud/terremark/ecloud/requests/add_node_spec.rb +1 -1
- data/spec/vcloud/terremark/ecloud/requests/configure_internet_service_spec.rb +1 -1
- data/spec/vcloud/terremark/ecloud/requests/configure_network_ip_spec.rb +1 -1
- data/spec/vcloud/terremark/ecloud/requests/configure_node_spec.rb +1 -1
- data/spec/vcloud/terremark/ecloud/requests/configure_vapp_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/requests/delete_internet_service_spec.rb +1 -1
- data/spec/vcloud/terremark/ecloud/requests/delete_node_spec.rb +1 -1
- data/spec/vcloud/terremark/ecloud/requests/delete_vapp_spec.rb +4 -4
- data/spec/vcloud/terremark/ecloud/requests/get_catalog_item_spec.rb +7 -8
- data/spec/vcloud/terremark/ecloud/requests/get_catalog_spec.rb +3 -3
- data/spec/vcloud/terremark/ecloud/requests/get_customization_options_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/requests/get_internet_services_spec.rb +13 -13
- data/spec/vcloud/terremark/ecloud/requests/get_network_ip_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/requests/get_network_ips_spec.rb +3 -4
- data/spec/vcloud/terremark/ecloud/requests/get_network_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/requests/get_node_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/requests/get_nodes_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/requests/get_public_ip_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/requests/get_public_ips_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/requests/get_vapp_spec.rb +5 -6
- data/spec/vcloud/terremark/ecloud/requests/get_vdc_spec.rb +9 -10
- data/spec/vcloud/terremark/ecloud/requests/instantiate_vapp_template_spec.rb +5 -6
- data/spec/vcloud/terremark/ecloud/requests/power_off_spec.rb +1 -1
- data/spec/vcloud/terremark/ecloud/requests/power_on_spec.rb +1 -1
- data/spec/vcloud/vcloud_spec.rb +3 -3
- data/tests/compute/requests/terremark_ecloud/organization_tests.rb +5 -0
- data/tests/compute/requests/terremark_ecloud/task_tests.rb +39 -0
- data/tests/helpers/formats_helper.rb +5 -3
- metadata +47 -38
|
@@ -8,7 +8,7 @@ shared_examples_for "a successful configure vapp" do
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
describe "#headers" do
|
|
11
|
-
its(:headers) { should include
|
|
11
|
+
its(:headers) { should include("Location") }
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ if Fog.mocking?
|
|
|
16
16
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
17
17
|
subject { @vcloud }
|
|
18
18
|
|
|
19
|
-
it { should respond_to
|
|
19
|
+
it { should respond_to(:configure_vapp) }
|
|
20
20
|
|
|
21
21
|
let(:original_vapp_data) { vapp_data.dup }
|
|
22
22
|
let(:vapp_data) { @mock_vm.to_configure_vapp_hash }
|
|
@@ -5,7 +5,7 @@ if Fog.mocking?
|
|
|
5
5
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
6
6
|
subject { @vcloud }
|
|
7
7
|
|
|
8
|
-
it { should respond_to
|
|
8
|
+
it { should respond_to(:delete_internet_service) }
|
|
9
9
|
|
|
10
10
|
describe "#delete_internet_service" do
|
|
11
11
|
context "with a valid internet service uri" do
|
|
@@ -5,7 +5,7 @@ if Fog.mocking?
|
|
|
5
5
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
6
6
|
subject { @vcloud }
|
|
7
7
|
|
|
8
|
-
it { should respond_to
|
|
8
|
+
it { should respond_to(:delete_node) }
|
|
9
9
|
|
|
10
10
|
describe "#delete_node" do
|
|
11
11
|
context "with a valid node service uri" do
|
|
@@ -14,7 +14,7 @@ shared_examples_for "a failed vapp deletion" do
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
describe "#headers" do
|
|
17
|
-
its(:headers) { should_not include
|
|
17
|
+
its(:headers) { should_not include("Location") }
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
@@ -23,7 +23,7 @@ if Fog.mocking?
|
|
|
23
23
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
24
24
|
subject { @vcloud }
|
|
25
25
|
|
|
26
|
-
it { should respond_to
|
|
26
|
+
it { should respond_to(:delete_vapp) }
|
|
27
27
|
|
|
28
28
|
describe "#delete_vapp" do
|
|
29
29
|
context "with a valid vapp uri" do
|
|
@@ -31,7 +31,7 @@ if Fog.mocking?
|
|
|
31
31
|
let(:vdc) { @vcloud.vdcs.first }
|
|
32
32
|
|
|
33
33
|
context "when there are no internet service nodes attached" do
|
|
34
|
-
it_should_behave_like
|
|
34
|
+
it_should_behave_like("all delete responses")
|
|
35
35
|
|
|
36
36
|
it "should change the mock data" do
|
|
37
37
|
expect { subject }.to change { @mock_vdc.virtual_machines.count }.by(-1)
|
|
@@ -46,7 +46,7 @@ if Fog.mocking?
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
describe "#headers" do
|
|
49
|
-
its(:headers) { should include
|
|
49
|
+
its(:headers) { should include("Location") }
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_catalog_item) }
|
|
8
8
|
|
|
9
9
|
describe "#get_catalog_item" do
|
|
10
10
|
context "with a valid catalog_item_uri" do
|
|
@@ -13,20 +13,20 @@ if Fog.mocking?
|
|
|
13
13
|
let(:mock_data_catalog_item) { @mock_data.catalog_item_from_href(@catalog_item.body[:href]) }
|
|
14
14
|
|
|
15
15
|
it_should_behave_like "all responses"
|
|
16
|
-
it { should have_headers_denoting_a_content_type_of
|
|
16
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.catalogItem+xml") }
|
|
17
17
|
|
|
18
18
|
describe "#body" do
|
|
19
19
|
subject { @catalog_item.body }
|
|
20
20
|
|
|
21
21
|
it { should have(8).items }
|
|
22
22
|
|
|
23
|
-
it_should_behave_like
|
|
23
|
+
it_should_behave_like("it has the standard vcloud v0.8 xmlns attributes") # 3 keys
|
|
24
24
|
|
|
25
25
|
its(:name) { should == "Item 0" }
|
|
26
26
|
|
|
27
|
-
it { should include
|
|
28
|
-
it { should include
|
|
29
|
-
it { should include
|
|
27
|
+
it { should include(:Entity) }
|
|
28
|
+
it { should include(:Link) }
|
|
29
|
+
it { should include(:Property) }
|
|
30
30
|
|
|
31
31
|
describe "Entity" do
|
|
32
32
|
subject { @catalog_item.body[:Entity] }
|
|
@@ -55,9 +55,8 @@ if Fog.mocking?
|
|
|
55
55
|
context "with a catalog uri that doesn't exist" do
|
|
56
56
|
subject { lambda { @vcloud.get_catalog(URI.parse('https://www.fakey.com/api/v0.8/vdc/999/catalog')) } }
|
|
57
57
|
|
|
58
|
-
it_should_behave_like
|
|
58
|
+
it_should_behave_like("a request for a resource that doesn't exist")
|
|
59
59
|
end
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
|
-
else
|
|
63
62
|
end
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_catalog) }
|
|
8
8
|
|
|
9
9
|
describe "#get_catalog" do
|
|
10
10
|
context "with a valid vdc catalog_uri" do
|
|
@@ -12,7 +12,7 @@ if Fog.mocking?
|
|
|
12
12
|
subject { @catalog }
|
|
13
13
|
|
|
14
14
|
it_should_behave_like "all responses"
|
|
15
|
-
it { should have_headers_denoting_a_content_type_of
|
|
15
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.catalog+xml") }
|
|
16
16
|
|
|
17
17
|
describe "#body" do
|
|
18
18
|
subject { @catalog.body }
|
|
@@ -23,7 +23,7 @@ if Fog.mocking?
|
|
|
23
23
|
|
|
24
24
|
its(:name) { should == @mock_vdc.catalog.name }
|
|
25
25
|
|
|
26
|
-
it { should include
|
|
26
|
+
it { should include(:CatalogItems) }
|
|
27
27
|
|
|
28
28
|
describe "CatalogItems" do
|
|
29
29
|
subject { @catalog.body[:CatalogItems] }
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_customization_options) }
|
|
8
8
|
|
|
9
9
|
describe "#get_customization_options" do
|
|
10
10
|
context "with a valid catalog_item customizations uri" do
|
|
@@ -14,7 +14,7 @@ if Fog.mocking?
|
|
|
14
14
|
subject { @customization_options }
|
|
15
15
|
|
|
16
16
|
it_should_behave_like "all responses"
|
|
17
|
-
it { should have_headers_denoting_a_content_type_of
|
|
17
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.catalogItemCustomizationParameters+xml") }
|
|
18
18
|
|
|
19
19
|
describe "#body" do
|
|
20
20
|
subject { @customization_options.body }
|
|
@@ -2,13 +2,13 @@ require 'vcloud/spec_helper'
|
|
|
2
2
|
|
|
3
3
|
if Fog.mocking?
|
|
4
4
|
shared_examples_for "a basic internet service" do
|
|
5
|
-
specify { service.should be_an_instance_of
|
|
5
|
+
specify { service.should be_an_instance_of(Hash) }
|
|
6
6
|
specify { service.should have(14).attributes }
|
|
7
7
|
specify { service[:Name].should == mock_service.name }
|
|
8
8
|
specify { service[:Id].should == mock_service.object_id.to_s }
|
|
9
9
|
specify { service[:Href].should == mock_service.href }
|
|
10
10
|
|
|
11
|
-
specify { service[:PublicIpAddress].should be_an_instance_of
|
|
11
|
+
specify { service[:PublicIpAddress].should be_an_instance_of(Hash) }
|
|
12
12
|
specify { service[:PublicIpAddress].should have(3).attributes }
|
|
13
13
|
specify { service[:PublicIpAddress][:Name].should == mock_ip.name }
|
|
14
14
|
specify { service[:PublicIpAddress][:Href].should == mock_ip.href }
|
|
@@ -30,13 +30,13 @@ if Fog.mocking?
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
shared_examples_for "an internet service with a backup internet service set" do
|
|
33
|
-
specify { service[:BackupService].should be_an_instance_of
|
|
34
|
-
specify { service[:BackupService].should include
|
|
33
|
+
specify { service[:BackupService].should be_an_instance_of(Hash) }
|
|
34
|
+
specify { service[:BackupService].should include(:Href) }
|
|
35
35
|
specify { service[:BackupService][:Href].should == @mock_backup_service.href }
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
shared_examples_for "a backup internet service" do
|
|
39
|
-
specify { service.should be_an_instance_of
|
|
39
|
+
specify { service.should be_an_instance_of(Hash) }
|
|
40
40
|
specify { service.should have(14).attributes }
|
|
41
41
|
specify { service[:Name].should == mock_service.name }
|
|
42
42
|
specify { service[:Id].should == mock_service.object_id.to_s }
|
|
@@ -59,7 +59,7 @@ if Fog.mocking?
|
|
|
59
59
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
60
60
|
subject { @vcloud }
|
|
61
61
|
|
|
62
|
-
it { should respond_to
|
|
62
|
+
it { should respond_to(:get_internet_services) }
|
|
63
63
|
|
|
64
64
|
describe "#get_internet_services" do
|
|
65
65
|
context "with a valid VDC internet_services_uri" do
|
|
@@ -71,7 +71,7 @@ if Fog.mocking?
|
|
|
71
71
|
subject { @services }
|
|
72
72
|
|
|
73
73
|
it_should_behave_like "all responses"
|
|
74
|
-
it { should have_headers_denoting_a_content_type_of
|
|
74
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.internetServicesList+xml") }
|
|
75
75
|
|
|
76
76
|
describe "#body" do
|
|
77
77
|
subject { @services.body }
|
|
@@ -96,14 +96,14 @@ if Fog.mocking?
|
|
|
96
96
|
let(:mock_service) { @mock_vdc.internet_service_collection.items[3] }
|
|
97
97
|
let(:mock_ip) { mock_service._parent._parent }
|
|
98
98
|
|
|
99
|
-
it_should_behave_like
|
|
99
|
+
it_should_behave_like("an internet service with a backup internet service set")
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
context "for a backup internet service" do
|
|
103
103
|
let(:service) { subject[4] }
|
|
104
104
|
let(:mock_service) { @mock_vdc.internet_service_collection.backup_internet_services.first }
|
|
105
105
|
|
|
106
|
-
it_should_behave_like
|
|
106
|
+
it_should_behave_like("a backup internet service")
|
|
107
107
|
end
|
|
108
108
|
end
|
|
109
109
|
end
|
|
@@ -115,8 +115,8 @@ if Fog.mocking?
|
|
|
115
115
|
end
|
|
116
116
|
subject { @services }
|
|
117
117
|
|
|
118
|
-
it_should_behave_like
|
|
119
|
-
it { should have_headers_denoting_a_content_type_of
|
|
118
|
+
it_should_behave_like("all responses")
|
|
119
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.internetServicesList+xml") }
|
|
120
120
|
|
|
121
121
|
describe "#body" do
|
|
122
122
|
subject { @services.body }
|
|
@@ -133,7 +133,7 @@ if Fog.mocking?
|
|
|
133
133
|
let(:mock_service) { @mock_service_collection.items[idx] }
|
|
134
134
|
let(:mock_ip) { @mock_public_ip }
|
|
135
135
|
|
|
136
|
-
it_should_behave_like
|
|
136
|
+
it_should_behave_like("an internet service without a backup internet service set")
|
|
137
137
|
end
|
|
138
138
|
end
|
|
139
139
|
end
|
|
@@ -142,7 +142,7 @@ if Fog.mocking?
|
|
|
142
142
|
context "with a public_ips_uri that doesn't exist" do
|
|
143
143
|
subject { lambda { @vcloud.get_internet_services(URI.parse('https://www.fakey.c/piv8vc99')) } }
|
|
144
144
|
|
|
145
|
-
it_should_behave_like
|
|
145
|
+
it_should_behave_like("a request for a resource that doesn't exist")
|
|
146
146
|
end
|
|
147
147
|
end
|
|
148
148
|
end
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_network_ip) }
|
|
8
8
|
|
|
9
9
|
describe "#get_network_ip" do
|
|
10
10
|
context "with a valid ip_uri" do
|
|
@@ -15,7 +15,7 @@ if Fog.mocking?
|
|
|
15
15
|
subject { @ip }
|
|
16
16
|
|
|
17
17
|
it_should_behave_like "all responses"
|
|
18
|
-
it { should have_headers_denoting_a_content_type_of
|
|
18
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.ip+xml") }
|
|
19
19
|
|
|
20
20
|
describe "#body" do
|
|
21
21
|
subject { @ip.body }
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_network_ips) }
|
|
8
8
|
|
|
9
9
|
describe "#get_network_ips" do
|
|
10
10
|
context "with a valid VDC network ips_uri" do
|
|
@@ -12,7 +12,7 @@ if Fog.mocking?
|
|
|
12
12
|
subject { @ips }
|
|
13
13
|
|
|
14
14
|
it_should_behave_like "all responses"
|
|
15
|
-
it { should have_headers_denoting_a_content_type_of
|
|
15
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.ipAddressesList+xml") }
|
|
16
16
|
|
|
17
17
|
describe "#body" do
|
|
18
18
|
subject { @ips.body }
|
|
@@ -51,9 +51,8 @@ if Fog.mocking?
|
|
|
51
51
|
context "with a network ips uri that doesn't exist" do
|
|
52
52
|
subject { lambda { @vcloud.get_network_ips(URI.parse('https://www.fakey.c/piv8vc99')) } }
|
|
53
53
|
|
|
54
|
-
it_should_behave_like
|
|
54
|
+
it_should_behave_like("a request for a resource that doesn't exist")
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
|
-
else
|
|
59
58
|
end
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_network) }
|
|
8
8
|
|
|
9
9
|
describe "#get_network" do
|
|
10
10
|
context "with a valid network uri" do
|
|
@@ -12,7 +12,7 @@ if Fog.mocking?
|
|
|
12
12
|
subject { @network }
|
|
13
13
|
|
|
14
14
|
it_should_behave_like "all responses"
|
|
15
|
-
it { should have_headers_denoting_a_content_type_of
|
|
15
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.network+xml") }
|
|
16
16
|
|
|
17
17
|
describe "#body" do
|
|
18
18
|
subject { @network.body }
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_node) }
|
|
8
8
|
|
|
9
9
|
describe "#get_node" do
|
|
10
10
|
context "with a valid nodes_uri" do
|
|
@@ -12,7 +12,7 @@ if Fog.mocking?
|
|
|
12
12
|
subject { @node }
|
|
13
13
|
|
|
14
14
|
it_should_behave_like "all responses"
|
|
15
|
-
it { should have_headers_denoting_a_content_type_of
|
|
15
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.nodeService+xml") }
|
|
16
16
|
|
|
17
17
|
describe "#body" do
|
|
18
18
|
subject { @node.body }
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_nodes) }
|
|
8
8
|
|
|
9
9
|
describe "#get_nodes" do
|
|
10
10
|
context "with a valid nodes_uri" do
|
|
@@ -12,7 +12,7 @@ if Fog.mocking?
|
|
|
12
12
|
subject { @nodes }
|
|
13
13
|
|
|
14
14
|
it_should_behave_like "all responses"
|
|
15
|
-
it { should have_headers_denoting_a_content_type_of
|
|
15
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.nodeService+xml") }
|
|
16
16
|
|
|
17
17
|
describe "#body" do
|
|
18
18
|
subject { @nodes.body }
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_public_ip) }
|
|
8
8
|
|
|
9
9
|
describe "#get_public_ip" do
|
|
10
10
|
context "with a valid public_ip_uri" do
|
|
@@ -15,7 +15,7 @@ if Fog.mocking?
|
|
|
15
15
|
subject { @public_ip }
|
|
16
16
|
|
|
17
17
|
it_should_behave_like "all responses"
|
|
18
|
-
it { should have_headers_denoting_a_content_type_of
|
|
18
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.publicIp+xml") }
|
|
19
19
|
|
|
20
20
|
describe "#body" do
|
|
21
21
|
subject { @public_ip.body }
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_public_ips) }
|
|
8
8
|
|
|
9
9
|
describe "#get_public_ips" do
|
|
10
10
|
context "with a valid public_ips_uri" do
|
|
@@ -12,7 +12,7 @@ if Fog.mocking?
|
|
|
12
12
|
subject { @public_ips }
|
|
13
13
|
|
|
14
14
|
it_should_behave_like "all responses"
|
|
15
|
-
it { should have_headers_denoting_a_content_type_of
|
|
15
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.publicIpsList+xml") }
|
|
16
16
|
|
|
17
17
|
describe "#body" do
|
|
18
18
|
subject { @public_ips.body }
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_vapp) }
|
|
8
8
|
|
|
9
9
|
describe "#get_vapp" do
|
|
10
10
|
context "with a valid vapp_uri" do
|
|
@@ -13,7 +13,7 @@ if Fog.mocking?
|
|
|
13
13
|
let(:vapp_id) { @vapp.body[:href].split("/").last }
|
|
14
14
|
|
|
15
15
|
it_should_behave_like "all responses"
|
|
16
|
-
it { should have_headers_denoting_a_content_type_of
|
|
16
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.vApp+xml") }
|
|
17
17
|
|
|
18
18
|
describe "#body" do
|
|
19
19
|
subject { @vapp.body }
|
|
@@ -25,7 +25,7 @@ if Fog.mocking?
|
|
|
25
25
|
:type, :xmlns,
|
|
26
26
|
:xmlns_xsd, :xmlns_xsi] }
|
|
27
27
|
|
|
28
|
-
it_should_behave_like
|
|
28
|
+
it_should_behave_like("it has the standard vcloud v0.8 xmlns attributes") # 3 keys
|
|
29
29
|
|
|
30
30
|
its(:href) { should == @mock_vm.href }
|
|
31
31
|
its(:name) { should == @mock_vm.name }
|
|
@@ -43,7 +43,7 @@ if Fog.mocking?
|
|
|
43
43
|
describe "NetworkConnectionSection" do
|
|
44
44
|
subject { @vapp.body[:NetworkConnectionSection] }
|
|
45
45
|
|
|
46
|
-
it { should include
|
|
46
|
+
it { should include(:NetworkConnection) }
|
|
47
47
|
|
|
48
48
|
describe "NetworkConnection" do
|
|
49
49
|
subject { @vapp.body[:NetworkConnectionSection][:NetworkConnection] }
|
|
@@ -118,9 +118,8 @@ if Fog.mocking?
|
|
|
118
118
|
context "with a vapp uri that doesn't exist" do
|
|
119
119
|
subject { lambda { @vcloud.get_vapp(URI.parse('https://www.fakey.com/api/v0.8/vApp/99999')) } }
|
|
120
120
|
|
|
121
|
-
it_should_behave_like
|
|
121
|
+
it_should_behave_like("a request for a resource that doesn't exist")
|
|
122
122
|
end
|
|
123
123
|
end
|
|
124
124
|
end
|
|
125
|
-
else
|
|
126
125
|
end
|
|
@@ -4,7 +4,7 @@ if Fog.mocking?
|
|
|
4
4
|
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
|
5
5
|
subject { @vcloud }
|
|
6
6
|
|
|
7
|
-
it { should respond_to
|
|
7
|
+
it { should respond_to(:get_vdc) }
|
|
8
8
|
|
|
9
9
|
describe "#get_vdc" do
|
|
10
10
|
context "with a valid vdc uri" do
|
|
@@ -12,14 +12,14 @@ if Fog.mocking?
|
|
|
12
12
|
subject { @vdc }
|
|
13
13
|
|
|
14
14
|
it_should_behave_like "all responses"
|
|
15
|
-
it { should have_headers_denoting_a_content_type_of
|
|
15
|
+
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.vdc+xml") }
|
|
16
16
|
|
|
17
17
|
describe "#body" do
|
|
18
18
|
subject { @vdc.body }
|
|
19
19
|
|
|
20
20
|
it { should have(11).items }
|
|
21
21
|
|
|
22
|
-
it_should_behave_like
|
|
22
|
+
it_should_behave_like("it has the standard vcloud v0.8 xmlns attributes") # 3 keys
|
|
23
23
|
|
|
24
24
|
its(:href) { should == @mock_vdc.href }
|
|
25
25
|
its(:name) { should == @mock_vdc.name }
|
|
@@ -72,15 +72,15 @@ if Fog.mocking?
|
|
|
72
72
|
describe "[:ResourceEntities][:ResourceEntity]" do
|
|
73
73
|
context "[0]" do
|
|
74
74
|
subject { @vdc.body[:ResourceEntities][:ResourceEntity][0] }
|
|
75
|
-
it { should be_a_vapp_link_to
|
|
75
|
+
it { should be_a_vapp_link_to(@mock_vdc.virtual_machines[0]) }
|
|
76
76
|
end
|
|
77
77
|
context "[1]" do
|
|
78
78
|
subject { @vdc.body[:ResourceEntities][:ResourceEntity][1] }
|
|
79
|
-
it { should be_a_vapp_link_to
|
|
79
|
+
it { should be_a_vapp_link_to(@mock_vdc.virtual_machines[1]) }
|
|
80
80
|
end
|
|
81
81
|
context "[2]" do
|
|
82
82
|
subject { @vdc.body[:ResourceEntities][:ResourceEntity][2] }
|
|
83
|
-
it { should be_a_vapp_link_to
|
|
83
|
+
it { should be_a_vapp_link_to(@mock_vdc.virtual_machines[2]) }
|
|
84
84
|
end
|
|
85
85
|
end
|
|
86
86
|
|
|
@@ -92,11 +92,11 @@ if Fog.mocking?
|
|
|
92
92
|
describe "[:AvailableNetworks][:Network]" do
|
|
93
93
|
context "[0]" do
|
|
94
94
|
subject { @vdc.body[:AvailableNetworks][:Network][0] }
|
|
95
|
-
it { should be_a_network_link_to
|
|
95
|
+
it { should be_a_network_link_to(@mock_vdc.networks[0]) }
|
|
96
96
|
end
|
|
97
97
|
context "[1]" do
|
|
98
98
|
subject { @vdc.body[:AvailableNetworks][:Network][1] }
|
|
99
|
-
it { should be_a_network_link_to
|
|
99
|
+
it { should be_a_network_link_to(@mock_vdc.networks[1]) }
|
|
100
100
|
end
|
|
101
101
|
end
|
|
102
102
|
end
|
|
@@ -105,9 +105,8 @@ if Fog.mocking?
|
|
|
105
105
|
context "with a vdc uri that doesn't exist" do
|
|
106
106
|
subject { lambda { @vcloud.get_vdc(URI.parse('https://www.fakey.com/api/v0.8/vdc/999')) } }
|
|
107
107
|
|
|
108
|
-
it_should_behave_like
|
|
108
|
+
it_should_behave_like("a request for a resource that doesn't exist")
|
|
109
109
|
end
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
|
-
else
|
|
113
112
|
end
|