fog-profitbricks 2.0.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.travis.yml +11 -4
- data/README.md +8 -5
- data/Rakefile +1 -1
- data/examples/pb_demo.rb +49 -49
- data/fog-profitbricks.gemspec +4 -5
- data/gemfiles/Gemfile.1.9.2+ +1 -0
- data/lib/fog/bin/profitbricks.rb +5 -5
- data/lib/fog/profitbricks.rb +3 -3
- data/lib/fog/profitbricks/compute.rb +209 -204
- data/lib/fog/profitbricks/helpers/compute/data_helper.rb +1 -1
- data/lib/fog/profitbricks/models/compute/datacenter.rb +1 -1
- data/lib/fog/profitbricks/models/compute/datacenters.rb +6 -7
- data/lib/fog/profitbricks/models/compute/firewall_rule.rb +2 -2
- data/lib/fog/profitbricks/models/compute/firewall_rules.rb +5 -8
- data/lib/fog/profitbricks/models/compute/flavors.rb +1 -4
- data/lib/fog/profitbricks/models/compute/image.rb +4 -0
- data/lib/fog/profitbricks/models/compute/images.rb +2 -5
- data/lib/fog/profitbricks/models/compute/ip_block.rb +1 -1
- data/lib/fog/profitbricks/models/compute/ip_blocks.rb +3 -8
- data/lib/fog/profitbricks/models/compute/lan.rb +1 -1
- data/lib/fog/profitbricks/models/compute/lans.rb +4 -7
- data/lib/fog/profitbricks/models/compute/load_balancer.rb +6 -7
- data/lib/fog/profitbricks/models/compute/load_balancers.rb +5 -9
- data/lib/fog/profitbricks/models/compute/locations.rb +2 -5
- data/lib/fog/profitbricks/models/compute/nic.rb +6 -3
- data/lib/fog/profitbricks/models/compute/nics.rb +2 -5
- data/lib/fog/profitbricks/models/compute/regions.rb +1 -4
- data/lib/fog/profitbricks/models/compute/request.rb +0 -1
- data/lib/fog/profitbricks/models/compute/requests.rb +2 -4
- data/lib/fog/profitbricks/models/compute/server.rb +10 -13
- data/lib/fog/profitbricks/models/compute/servers.rb +3 -6
- data/lib/fog/profitbricks/models/compute/snapshot.rb +2 -2
- data/lib/fog/profitbricks/models/compute/snapshots.rb +3 -6
- data/lib/fog/profitbricks/models/compute/volume.rb +11 -9
- data/lib/fog/profitbricks/models/compute/volumes.rb +3 -6
- data/lib/fog/profitbricks/requests/compute/associate_nic_to_load_balancer.rb +26 -13
- data/lib/fog/profitbricks/requests/compute/attach_cdrom.rb +25 -16
- data/lib/fog/profitbricks/requests/compute/attach_volume.rb +25 -16
- data/lib/fog/profitbricks/requests/compute/create_datacenter.rb +22 -23
- data/lib/fog/profitbricks/requests/compute/create_firewall_rule.rb +24 -26
- data/lib/fog/profitbricks/requests/compute/create_flavor.rb +34 -34
- data/lib/fog/profitbricks/requests/compute/create_ip_block.rb +18 -20
- data/lib/fog/profitbricks/requests/compute/create_lan.rb +151 -150
- data/lib/fog/profitbricks/requests/compute/create_load_balancer.rb +67 -26
- data/lib/fog/profitbricks/requests/compute/create_nic.rb +24 -26
- data/lib/fog/profitbricks/requests/compute/create_server.rb +70 -61
- data/lib/fog/profitbricks/requests/compute/create_volume.rb +122 -122
- data/lib/fog/profitbricks/requests/compute/create_volume_snapshot.rb +42 -45
- data/lib/fog/profitbricks/requests/compute/delete_datacenter.rb +34 -36
- data/lib/fog/profitbricks/requests/compute/delete_firewall_rule.rb +8 -11
- data/lib/fog/profitbricks/requests/compute/delete_image.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/delete_ip_block.rb +8 -10
- data/lib/fog/profitbricks/requests/compute/delete_lan.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/delete_load_balancer.rb +8 -10
- data/lib/fog/profitbricks/requests/compute/delete_nic.rb +7 -10
- data/lib/fog/profitbricks/requests/compute/delete_server.rb +6 -10
- data/lib/fog/profitbricks/requests/compute/delete_snapshot.rb +7 -10
- data/lib/fog/profitbricks/requests/compute/delete_volume.rb +36 -38
- data/lib/fog/profitbricks/requests/compute/detach_cdrom.rb +11 -13
- data/lib/fog/profitbricks/requests/compute/detach_volume.rb +16 -13
- data/lib/fog/profitbricks/requests/compute/get_all_datacenters.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_all_firewall_rules.rb +6 -7
- data/lib/fog/profitbricks/requests/compute/get_all_flavors.rb +72 -72
- data/lib/fog/profitbricks/requests/compute/get_all_images.rb +62 -62
- data/lib/fog/profitbricks/requests/compute/get_all_ip_blocks.rb +5 -5
- data/lib/fog/profitbricks/requests/compute/get_all_lans.rb +113 -113
- data/lib/fog/profitbricks/requests/compute/get_all_load_balanced_nics.rb +15 -9
- data/lib/fog/profitbricks/requests/compute/get_all_load_balancers.rb +9 -9
- data/lib/fog/profitbricks/requests/compute/get_all_locations.rb +6 -6
- data/lib/fog/profitbricks/requests/compute/get_all_nic.rb +94 -94
- data/lib/fog/profitbricks/requests/compute/get_all_requests.rb +38 -38
- data/lib/fog/profitbricks/requests/compute/get_all_servers.rb +8 -9
- data/lib/fog/profitbricks/requests/compute/get_all_snapshots.rb +4 -4
- data/lib/fog/profitbricks/requests/compute/get_all_volumes.rb +71 -71
- data/lib/fog/profitbricks/requests/compute/get_attached_cdrom.rb +11 -11
- data/lib/fog/profitbricks/requests/compute/get_attached_volume.rb +16 -11
- data/lib/fog/profitbricks/requests/compute/get_datacenter.rb +4 -6
- data/lib/fog/profitbricks/requests/compute/get_firewall_rule.rb +8 -11
- data/lib/fog/profitbricks/requests/compute/get_flavor.rb +9 -9
- data/lib/fog/profitbricks/requests/compute/get_image.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/get_ip_block.rb +8 -10
- data/lib/fog/profitbricks/requests/compute/get_lan.rb +7 -10
- data/lib/fog/profitbricks/requests/compute/get_load_balanced_nic.rb +16 -12
- data/lib/fog/profitbricks/requests/compute/get_load_balancer.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/get_location.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/get_nic.rb +8 -11
- data/lib/fog/profitbricks/requests/compute/get_request.rb +55 -57
- data/lib/fog/profitbricks/requests/compute/get_request_status.rb +44 -46
- data/lib/fog/profitbricks/requests/compute/get_server.rb +7 -10
- data/lib/fog/profitbricks/requests/compute/get_snapshot.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/get_volume.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/list_attached_cdroms.rb +8 -8
- data/lib/fog/profitbricks/requests/compute/list_attached_volumes.rb +18 -8
- data/lib/fog/profitbricks/requests/compute/reboot_server.rb +7 -11
- data/lib/fog/profitbricks/requests/compute/remove_nic_association.rb +9 -11
- data/lib/fog/profitbricks/requests/compute/restore_volume_snapshot.rb +15 -17
- data/lib/fog/profitbricks/requests/compute/start_server.rb +7 -11
- data/lib/fog/profitbricks/requests/compute/stop_server.rb +7 -11
- data/lib/fog/profitbricks/requests/compute/update_datacenter.rb +20 -15
- data/lib/fog/profitbricks/requests/compute/update_firewall_rule.rb +9 -11
- data/lib/fog/profitbricks/requests/compute/update_image.rb +15 -15
- data/lib/fog/profitbricks/requests/compute/update_lan.rb +6 -8
- data/lib/fog/profitbricks/requests/compute/update_load_balancer.rb +10 -12
- data/lib/fog/profitbricks/requests/compute/update_nic.rb +10 -12
- data/lib/fog/profitbricks/requests/compute/update_server.rb +10 -13
- data/lib/fog/profitbricks/requests/compute/update_snapshot.rb +10 -13
- data/lib/fog/profitbricks/requests/compute/update_volume.rb +10 -13
- data/lib/fog/profitbricks/version.rb +1 -1
- data/spec/minitest_helper.rb +1 -3
- data/tests/helpers/formats_helper.rb +8 -8
- data/tests/profitbricks/models/compute/compute_tests.rb +529 -0
- data/tests/profitbricks/requests/compute/composite_create_tests.rb +16 -83
- data/tests/profitbricks/requests/compute/flavor_tests.rb +1 -4
- data/tests/profitbricks/requests/compute/location_tests.rb +14 -17
- data/tests/profitbricks/requests/compute/nic_tests.rb +60 -70
- data/tests/profitbricks/requests/compute/request_tests.rb +1 -3
- data/tests/profitbricks/requests/compute/server_tests.rb +163 -161
- metadata +5 -18
@@ -1,24 +1,22 @@
|
|
1
|
-
Shindo.tests('Fog::Compute[:profitbricks] | composite create server request',
|
2
|
-
|
1
|
+
Shindo.tests('Fog::Compute[:profitbricks] | composite create server request', %w(profitbricks compute)) do
|
3
2
|
@resource_schema = {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
'id' => String,
|
4
|
+
'type' => String,
|
5
|
+
'href' => String,
|
6
|
+
'metadata' => Hash,
|
7
|
+
'properties' => Hash
|
9
8
|
}
|
10
9
|
|
11
10
|
@minimal_schema_with_items = {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
'id' => String,
|
12
|
+
'type' => String,
|
13
|
+
'href' => String,
|
14
|
+
'items' => Array
|
16
15
|
}
|
17
16
|
|
18
17
|
service = Fog::Compute[:profitbricks]
|
19
18
|
|
20
19
|
tests('success') do
|
21
|
-
|
22
20
|
Excon.defaults[:connection_timeout] = 500
|
23
21
|
|
24
22
|
tests('#create_datacenter').data_matches_schema(@resource_schema) do
|
@@ -30,9 +28,7 @@ Shindo.tests('Fog::Compute[:profitbricks] | composite create server request', ['
|
|
30
28
|
createDatacenterResponse = service.create_datacenter(options)
|
31
29
|
@datacenter_id = createDatacenterResponse.body['id']
|
32
30
|
|
33
|
-
if ENV["FOG_MOCK"] != "true"
|
34
|
-
service.datacenters.get(@datacenter_id).wait_for { ready? }
|
35
|
-
end
|
31
|
+
sleep(60) if ENV["FOG_MOCK"] != "true"
|
36
32
|
|
37
33
|
createDatacenterResponse.body
|
38
34
|
end
|
@@ -56,10 +52,6 @@ Shindo.tests('Fog::Compute[:profitbricks] | composite create server request', ['
|
|
56
52
|
@datacenter_id, options
|
57
53
|
)
|
58
54
|
|
59
|
-
if ENV["FOG_MOCK"] != "true"
|
60
|
-
service.datacenters.get(@datacenter_id).wait_for { ready? }
|
61
|
-
end
|
62
|
-
|
63
55
|
updateDatacenterResponse.body
|
64
56
|
end
|
65
57
|
|
@@ -71,15 +63,7 @@ Shindo.tests('Fog::Compute[:profitbricks] | composite create server request', ['
|
|
71
63
|
createLanResponse = service.create_lan(@datacenter_id, options)
|
72
64
|
@lan_id = createLanResponse.body['id']
|
73
65
|
|
74
|
-
if ENV["FOG_MOCK"] != "true"
|
75
|
-
loop do
|
76
|
-
sleep(180)
|
77
|
-
lan = service.lans.get(@datacenter_id, @lan_id)
|
78
|
-
break unless !lan.ready?
|
79
|
-
end
|
80
|
-
|
81
|
-
service.datacenters.get(@datacenter_id).wait_for { ready? }
|
82
|
-
end
|
66
|
+
sleep(60) if ENV["FOG_MOCK"] != "true"
|
83
67
|
|
84
68
|
createLanResponse.body
|
85
69
|
end
|
@@ -105,7 +89,7 @@ Shindo.tests('Fog::Compute[:profitbricks] | composite create server request', ['
|
|
105
89
|
:size => 5,
|
106
90
|
:licenceType => 'LINUX',
|
107
91
|
:type => 'HDD'
|
108
|
-
}
|
92
|
+
}
|
109
93
|
}
|
110
94
|
]
|
111
95
|
|
@@ -117,7 +101,7 @@ Shindo.tests('Fog::Compute[:profitbricks] | composite create server request', ['
|
|
117
101
|
:lan => @lan_id
|
118
102
|
},
|
119
103
|
|
120
|
-
:entities
|
104
|
+
:entities => {
|
121
105
|
:firewallrules => {
|
122
106
|
:items => [
|
123
107
|
{
|
@@ -137,16 +121,7 @@ Shindo.tests('Fog::Compute[:profitbricks] | composite create server request', ['
|
|
137
121
|
createServerResponse = service.create_server(@datacenter_id, properties, entities)
|
138
122
|
@server_id = createServerResponse.body['id']
|
139
123
|
|
140
|
-
if ENV["FOG_MOCK"] != "true"
|
141
|
-
loop do
|
142
|
-
sleep(480)
|
143
|
-
server = service.servers.get(@datacenter_id, @server_id)
|
144
|
-
break unless !server.ready?
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
# Calling wait_for causes ArgumentError
|
149
|
-
# server.wait_for { ready? }
|
124
|
+
sleep(60) if ENV["FOG_MOCK"] != "true"
|
150
125
|
|
151
126
|
createServerResponse.body
|
152
127
|
end
|
@@ -157,18 +132,7 @@ Shindo.tests('Fog::Compute[:profitbricks] | composite create server request', ['
|
|
157
132
|
end
|
158
133
|
|
159
134
|
tests('#update_server').data_matches_schema(@resource_schema) do
|
160
|
-
updateServerResponse = service.update_server(@datacenter_id, @server_id,
|
161
|
-
|
162
|
-
if ENV["FOG_MOCK"] != "true"
|
163
|
-
loop do
|
164
|
-
server = service.servers.get(@datacenter_id, @server_id)
|
165
|
-
sleep(1)
|
166
|
-
break unless !server.ready?
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
# Calling wait_for causes ArgumentError
|
171
|
-
# server.wait_for { ready? }
|
135
|
+
updateServerResponse = service.update_server(@datacenter_id, @server_id, 'name' => 'FogTestServer_2_Rename')
|
172
136
|
|
173
137
|
updateServerResponse.body
|
174
138
|
end
|
@@ -182,48 +146,18 @@ Shindo.tests('Fog::Compute[:profitbricks] | composite create server request', ['
|
|
182
146
|
tests('#stop_server').succeeds do
|
183
147
|
stopServerResponse = service.stop_server(@datacenter_id, @server_id)
|
184
148
|
|
185
|
-
if ENV["FOG_MOCK"] != "true"
|
186
|
-
loop do
|
187
|
-
server = service.servers.get(@datacenter_id, @server_id)
|
188
|
-
sleep(1)
|
189
|
-
break unless !server.shutoff?
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
# Calling wait_for causes ArgumentError
|
194
|
-
# server.wait_for { shutoff? }
|
195
|
-
|
196
149
|
stopServerResponse.status == 202
|
197
150
|
end
|
198
151
|
|
199
152
|
tests('#start_server').succeeds do
|
200
153
|
startServerResponse = service.start_server(@datacenter_id, @server_id)
|
201
154
|
|
202
|
-
if ENV["FOG_MOCK"] != "true"
|
203
|
-
loop do
|
204
|
-
server = service.servers.get(@datacenter_id, @server_id)
|
205
|
-
sleep(1)
|
206
|
-
break unless !server.running?
|
207
|
-
end
|
208
|
-
end
|
209
|
-
|
210
|
-
# Calling wait_for causes ArgumentError
|
211
|
-
# server.wait_for { running? }
|
212
|
-
|
213
155
|
startServerResponse.status == 202
|
214
156
|
end
|
215
157
|
|
216
158
|
tests('#reboot_server').succeeds do
|
217
159
|
rebootServerResponse = service.reboot_server(@datacenter_id, @server_id)
|
218
160
|
|
219
|
-
if ENV["FOG_MOCK"] != "true"
|
220
|
-
loop do
|
221
|
-
server = service.servers.get(@datacenter_id, @server_id)
|
222
|
-
sleep(1)
|
223
|
-
break unless !server.running?
|
224
|
-
end
|
225
|
-
end
|
226
|
-
|
227
161
|
rebootServerResponse.status == 202
|
228
162
|
end
|
229
163
|
|
@@ -237,5 +171,4 @@ Shindo.tests('Fog::Compute[:profitbricks] | composite create server request', ['
|
|
237
171
|
deleteDatacenterResponse.status == 202
|
238
172
|
end
|
239
173
|
end
|
240
|
-
|
241
174
|
end
|
@@ -1,5 +1,4 @@
|
|
1
|
-
Shindo.tests('Fog::Compute[:profitbricks] | flavor request',
|
2
|
-
|
1
|
+
Shindo.tests('Fog::Compute[:profitbricks] | flavor request', %w(profitbricks compute)) do
|
3
2
|
@flavor_format = {
|
4
3
|
'flavorId' => String,
|
5
4
|
'flavorName' => String,
|
@@ -10,7 +9,6 @@ Shindo.tests('Fog::Compute[:profitbricks] | flavor request', ['profitbricks', 'c
|
|
10
9
|
service = Fog::Compute[:profitbricks]
|
11
10
|
|
12
11
|
tests('success') do
|
13
|
-
|
14
12
|
# Not yet implemented
|
15
13
|
# tests('#create_flavor').formats(@flavor_format) do
|
16
14
|
# puts '#create_flavor'
|
@@ -30,7 +28,6 @@ Shindo.tests('Fog::Compute[:profitbricks] | flavor request', ['profitbricks', 'c
|
|
30
28
|
data = service.get_flavor(@flavor_id)
|
31
29
|
data.body['getFlavorResponse']
|
32
30
|
end
|
33
|
-
|
34
31
|
end
|
35
32
|
|
36
33
|
tests('failure') do
|
@@ -1,5 +1,4 @@
|
|
1
|
-
Shindo.tests('Fog::Compute[:profitbricks] | location request',
|
2
|
-
|
1
|
+
Shindo.tests('Fog::Compute[:profitbricks] | location request', %w(profitbricks compute)) do
|
3
2
|
@locations_schema = {
|
4
3
|
'id' => String,
|
5
4
|
'type' => String,
|
@@ -8,19 +7,18 @@ Shindo.tests('Fog::Compute[:profitbricks] | location request', ['profitbricks',
|
|
8
7
|
}
|
9
8
|
|
10
9
|
@location_schema = {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
'id' => String,
|
11
|
+
'type' => String,
|
12
|
+
'href' => String,
|
13
|
+
'properties' => {
|
14
|
+
'name' => String,
|
15
|
+
'features' => Array
|
16
|
+
}
|
18
17
|
}
|
19
18
|
|
20
19
|
service = Fog::Compute[:profitbricks]
|
21
20
|
|
22
21
|
tests('success') do
|
23
|
-
|
24
22
|
Excon.defaults[:connection_timeout] = 500
|
25
23
|
|
26
24
|
tests('#get_all_locations').data_matches_schema(@locations_schema) do
|
@@ -30,16 +28,15 @@ Shindo.tests('Fog::Compute[:profitbricks] | location request', ['profitbricks',
|
|
30
28
|
data.body
|
31
29
|
end
|
32
30
|
|
33
|
-
tests('#get_location').data_matches_schema(@location_schema) do
|
34
|
-
|
35
|
-
|
36
|
-
end
|
37
|
-
|
31
|
+
# tests('#get_location').data_matches_schema(@location_schema) do
|
32
|
+
# data = service.get_location("us/las")
|
33
|
+
# data.body
|
34
|
+
# end
|
38
35
|
end
|
39
36
|
|
40
37
|
tests('failure') do
|
41
|
-
tests('#get_location').raises(
|
42
|
-
data = service.get_location('
|
38
|
+
tests('#get_location').raises(Excon::Error::HTTPStatus) do
|
39
|
+
data = service.get_location('oo/ooo')
|
43
40
|
end
|
44
41
|
end
|
45
42
|
end
|
@@ -1,33 +1,31 @@
|
|
1
|
-
Shindo.tests('Fog::Compute[:profitbricks] | nic request',
|
2
|
-
|
1
|
+
Shindo.tests('Fog::Compute[:profitbricks] | nic request', %w(profitbricks compute)) do
|
3
2
|
@resource_schema = {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
'id' => String,
|
4
|
+
'type' => String,
|
5
|
+
'href' => String,
|
6
|
+
'metadata' => Hash,
|
7
|
+
'properties' => Hash
|
9
8
|
}
|
10
9
|
|
11
10
|
@extended_resource_schema = {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
'id' => String,
|
12
|
+
'type' => String,
|
13
|
+
'href' => String,
|
14
|
+
'metadata' => Hash,
|
15
|
+
'properties' => Hash,
|
16
|
+
'entities' => Hash
|
18
17
|
}
|
19
18
|
|
20
19
|
@minimal_schema_with_items = {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
'id' => String,
|
21
|
+
'type' => String,
|
22
|
+
'href' => String,
|
23
|
+
'items' => Array
|
25
24
|
}
|
26
25
|
|
27
26
|
service = Fog::Compute[:profitbricks]
|
28
27
|
|
29
28
|
tests('success') do
|
30
|
-
|
31
29
|
Excon.defaults[:connection_timeout] = 200
|
32
30
|
|
33
31
|
tests('#create_datacenter').data_matches_schema(@resource_schema) do
|
@@ -39,20 +37,36 @@ Shindo.tests('Fog::Compute[:profitbricks] | nic request', ['profitbricks', 'comp
|
|
39
37
|
createDatacenterResponse = service.create_datacenter(options)
|
40
38
|
@datacenter_id = createDatacenterResponse.body['id']
|
41
39
|
|
42
|
-
if ENV["FOG_MOCK"] != "true"
|
43
|
-
service.datacenters.get(@datacenter_id).wait_for { ready? }
|
44
|
-
end
|
45
|
-
|
46
40
|
createDatacenterResponse.body
|
47
41
|
end
|
48
42
|
|
49
43
|
tests('#get_all_images').data_matches_schema(@minimal_schema_with_items) do
|
50
44
|
getAllImagesResponse = service.get_all_images
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
45
|
+
|
46
|
+
data = getAllImagesResponse.body['items'].find do |image|
|
47
|
+
if ENV["FOG_MOCK"] != "true"
|
48
|
+
if image['properties']
|
49
|
+
image['properties']['location'] == 'us/las' &&
|
50
|
+
image['properties']['imageType'] == 'CDROM' &&
|
51
|
+
image['properties']['licenceType'] == 'LINUX'
|
52
|
+
else
|
53
|
+
image['location'] == 'us/las' &&
|
54
|
+
image['imageType'] == 'CDROM' &&
|
55
|
+
image['licenceType'] == 'LINUX'
|
56
|
+
end
|
57
|
+
else
|
58
|
+
if image['properties']
|
59
|
+
image['properties']['location'] == 'us/las' &&
|
60
|
+
image['properties']['imageType'] == 'CDROM' &&
|
61
|
+
image['properties']['licenceType'] == 'UNKNOWN'
|
62
|
+
else
|
63
|
+
image['location'] == 'us/las' &&
|
64
|
+
image['imageType'] == 'CDROM' &&
|
65
|
+
image['licenceType'] == 'UNKNOWN'
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
56
70
|
@image_id = data['id']
|
57
71
|
getAllImagesResponse.body
|
58
72
|
end
|
@@ -66,29 +80,20 @@ Shindo.tests('Fog::Compute[:profitbricks] | nic request', ['profitbricks', 'comp
|
|
66
80
|
entities = {}
|
67
81
|
entities[:volumes] = {}
|
68
82
|
entities[:volumes]['items'] = [
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
}
|
83
|
+
{
|
84
|
+
'properties' => {
|
85
|
+
'size' => 5,
|
86
|
+
'name' => 'FogTestVolume',
|
87
|
+
'licenceType' => 'LINUX',
|
88
|
+
'type' => 'HDD'
|
76
89
|
}
|
90
|
+
}
|
77
91
|
]
|
78
92
|
|
79
93
|
createServerResponse = service.create_server(@datacenter_id, properties, entities)
|
80
94
|
@server_id = createServerResponse.body['id']
|
81
95
|
|
82
|
-
if ENV["FOG_MOCK"] != "true"
|
83
|
-
loop do
|
84
|
-
sleep(120)
|
85
|
-
server = service.servers.get(@datacenter_id, @server_id)
|
86
|
-
break unless !server.ready?
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
# Calling wait_for causes ArgumentError
|
91
|
-
# server.wait_for { ready? }
|
96
|
+
sleep(60) if ENV["FOG_MOCK"] != "true"
|
92
97
|
|
93
98
|
createServerResponse.body
|
94
99
|
end
|
@@ -106,21 +111,13 @@ Shindo.tests('Fog::Compute[:profitbricks] | nic request', ['profitbricks', 'comp
|
|
106
111
|
createLanResponse = service.create_lan(@datacenter_id, options)
|
107
112
|
@lan_id = createLanResponse.body['id']
|
108
113
|
|
109
|
-
if ENV["FOG_MOCK"] != "true"
|
110
|
-
loop do
|
111
|
-
sleep(180)
|
112
|
-
lan = service.lans.get(@datacenter_id, @lan_id)
|
113
|
-
break unless !lan.ready?
|
114
|
-
end
|
115
|
-
|
116
|
-
service.datacenters.get(@datacenter_id).wait_for { ready? }
|
117
|
-
end
|
114
|
+
sleep(60) if ENV["FOG_MOCK"] != "true"
|
118
115
|
|
119
116
|
createLanResponse.body
|
120
117
|
end
|
121
118
|
|
122
119
|
tests('#update_lan').data_matches_schema(@extended_resource_schema) do
|
123
|
-
updateLanResponse = service.update_lan(@datacenter_id, @lan_id,
|
120
|
+
updateLanResponse = service.update_lan(@datacenter_id, @lan_id, 'name' => 'FogLan_2_Rename')
|
124
121
|
updateLanResponse.body
|
125
122
|
end
|
126
123
|
|
@@ -132,6 +129,7 @@ Shindo.tests('Fog::Compute[:profitbricks] | nic request', ['profitbricks', 'comp
|
|
132
129
|
options = {}
|
133
130
|
options[:name] = 'FogTestNic_2'
|
134
131
|
options[:lan] = @lan_id
|
132
|
+
options[:nat] = false
|
135
133
|
|
136
134
|
createNicResponse = service.create_nic(@datacenter_id, @server_id, options, {})
|
137
135
|
@nic_id = createNicResponse.body['id']
|
@@ -140,16 +138,14 @@ Shindo.tests('Fog::Compute[:profitbricks] | nic request', ['profitbricks', 'comp
|
|
140
138
|
end
|
141
139
|
|
142
140
|
tests('#get_nic').data_matches_schema(@extended_resource_schema) do
|
143
|
-
if ENV["FOG_MOCK"] != "true"
|
144
|
-
sleep(180)
|
145
|
-
end
|
141
|
+
sleep(60) if ENV["FOG_MOCK"] != "true"
|
146
142
|
|
147
143
|
getNicResponse = service.get_nic(@datacenter_id, @server_id, @nic_id)
|
148
144
|
getNicResponse.body
|
149
145
|
end
|
150
146
|
|
151
147
|
tests('#update_nic').data_matches_schema(@extended_resource_schema) do
|
152
|
-
updateNicResponse = service.update_nic(@datacenter_id, @server_id, @nic_id,
|
148
|
+
updateNicResponse = service.update_nic(@datacenter_id, @server_id, @nic_id, 'name' => 'FogTestNic_2_Rename')
|
153
149
|
updateNicResponse.body
|
154
150
|
end
|
155
151
|
|
@@ -191,14 +187,12 @@ Shindo.tests('Fog::Compute[:profitbricks] | nic request', ['profitbricks', 'comp
|
|
191
187
|
end
|
192
188
|
|
193
189
|
tests('#get_firewall_rule').data_matches_schema(@resource_schema) do
|
194
|
-
if ENV["FOG_MOCK"] != "true"
|
195
|
-
sleep(180)
|
196
|
-
end
|
190
|
+
sleep(60) if ENV["FOG_MOCK"] != "true"
|
197
191
|
service.get_firewall_rule(@datacenter_id, @server_id, @nic_id, @firewall_rule_id).body
|
198
192
|
end
|
199
193
|
|
200
194
|
tests('#update_firewall_rule').data_matches_schema(@resource_schema) do
|
201
|
-
updateFirewallRuleResponse = service.update_firewall_rule(@datacenter_id, @server_id, @nic_id, @firewall_rule_id,
|
195
|
+
updateFirewallRuleResponse = service.update_firewall_rule(@datacenter_id, @server_id, @nic_id, @firewall_rule_id, 'name' => 'Fog test Firewall Rule 2 Rename')
|
202
196
|
updateFirewallRuleResponse.body
|
203
197
|
end
|
204
198
|
|
@@ -209,7 +203,7 @@ Shindo.tests('Fog::Compute[:profitbricks] | nic request', ['profitbricks', 'comp
|
|
209
203
|
|
210
204
|
tests('#create_load_balancer').data_matches_schema(@resource_schema) do
|
211
205
|
options = {}
|
212
|
-
options[:name]
|
206
|
+
options[:name] = 'FogTestLoadBalancer_2'
|
213
207
|
|
214
208
|
createLoadBalancerResponse = service.create_load_balancer(@datacenter_id, options, {})
|
215
209
|
@load_balancer_id = createLoadBalancerResponse.body['id']
|
@@ -217,15 +211,13 @@ Shindo.tests('Fog::Compute[:profitbricks] | nic request', ['profitbricks', 'comp
|
|
217
211
|
end
|
218
212
|
|
219
213
|
tests('#get_load_balancer').data_matches_schema(@resource_schema) do
|
220
|
-
if ENV["FOG_MOCK"] != "true"
|
221
|
-
sleep(60)
|
222
|
-
end
|
214
|
+
sleep(60) if ENV["FOG_MOCK"] != "true"
|
223
215
|
|
224
216
|
service.get_load_balancer(@datacenter_id, @load_balancer_id).body
|
225
217
|
end
|
226
218
|
|
227
219
|
tests('#update_load_balancer').data_matches_schema(@resource_schema) do
|
228
|
-
updateLoadBalancerResponse = service.update_load_balancer(@datacenter_id, @load_balancer_id,
|
220
|
+
updateLoadBalancerResponse = service.update_load_balancer(@datacenter_id, @load_balancer_id, 'name' => 'FogTestLoadBalancer_2_Rename')
|
229
221
|
updateLoadBalancerResponse.body
|
230
222
|
end
|
231
223
|
|
@@ -245,9 +237,7 @@ Shindo.tests('Fog::Compute[:profitbricks] | nic request', ['profitbricks', 'comp
|
|
245
237
|
end
|
246
238
|
|
247
239
|
tests('#get_load_balanced_nic').succeeds do
|
248
|
-
if ENV["FOG_MOCK"] != "true"
|
249
|
-
sleep(60)
|
250
|
-
end
|
240
|
+
sleep(60) if ENV["FOG_MOCK"] != "true"
|
251
241
|
getAllLoadBalancedNicsResponse = service.get_load_balanced_nic(@datacenter_id, @load_balancer_id, @nic_id)
|
252
242
|
getAllLoadBalancedNicsResponse.status == 200
|
253
243
|
end
|