occi 3.0.0.beta.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -26
- data/Gemfile.lock +43 -35
- data/README.md +40 -4
- data/bin/occi +67 -64
- data/ext/mkrf_conf.rb +25 -0
- data/features/cassettes/Create_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +186 -0
- data/features/cassettes/Delete_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +186 -0
- data/features/cassettes/Discovery_Interface/Retrieving_all_OCCI_Categories_supported_by_the_OCCI_Server/_http_http___141_5_99_69__application_json_200_.yml +173 -0
- data/features/cassettes/Discovery_Interface/Retrieving_all_OCCI_Categories_supported_by_the_OCCI_Server/_http_http___141_5_99_69__text_plain_200_.yml +325 -0
- data/features/cassettes/Discovery_Interface/Retrieving_all_OCCI_Categories_supported_by_the_OCCI_Server/_http_http___141_5_99_69__text_plain_200_action_.yml +186 -0
- data/features/cassettes/Miscellaneous_operation_on_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +186 -0
- data/features/cassettes/Read_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +186 -0
- data/features/cassettes/Update_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +186 -0
- data/features/occi/core/create/create.feature +3 -2
- data/features/occi/core/delete/delete.feature +6 -2
- data/features/occi/core/discovery_interface/discovery_interface.feature +4 -2
- data/features/occi/core/miscellaneous/miscellaneous.feature +6 -2
- data/features/occi/core/read/read.feature +6 -2
- data/features/occi/core/update/update.feature +6 -2
- data/features/occi/infrastructure/create/create.feature +6 -2
- data/features/support/env.rb +13 -1
- data/lib/occi/api/client/client_http.rb +914 -820
- data/lib/occi/api/client/http/net_http_fix.rb +7 -36
- data/lib/occi/api/dsl.rb +32 -2
- data/lib/occi/bin/occi_opts.rb +15 -1
- data/lib/occi/collection.rb +26 -15
- data/lib/occi/core/categories.rb +9 -1
- data/lib/occi/core/category.rb +20 -11
- data/lib/occi/core/link.rb +4 -5
- data/lib/occi/model.rb +2 -2
- data/lib/occi/parser.rb +51 -49
- data/lib/occi/version.rb +1 -1
- data/occi.gemspec +16 -3
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/creates_a_new_compute_resource.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/creates_a_new_network_resource.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/creates_a_new_storage_resource.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deletes_a_compute_resource.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deletes_a_network_resource.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deletes_a_storage_resource.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deploys_an_instance_based_on_OVF_OVA_file.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_all_available_mixins.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_compute_resources.yml +324 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_network_resources.yml +326 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_os_tpl_mixins.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_resource_tpl_mixins.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_storage_resources.yml +386 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/establishes_connection.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_compute_resource_using_type_identifier.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_compute_resource_using_type_name.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_network_resource_using_type_identifier.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_network_resource_using_type_name.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_storage_resource_using_type_identifier.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_storage_resource_using_type_name.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_entity_type_identifiers.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_entity_types.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_link_type_identifiers.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_link_types.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_mixin_type_identifiers.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_mixin_types.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_mixins.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_resource_type_identifiers.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_resource_types.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_compute_resources.yml +264 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_network_resources.yml +264 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_os_tpl_mixins.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_resource_tpl_mixins.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_storage_resources.yml +266 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/refreshes_its_model.yml +397 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/triggers_an_action_on_a_compute_resource.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/triggers_an_action_on_a_network_resource.yml +222 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/triggers_an_action_on_a_storage_resource.yml +222 -0
- data/spec/occi/api/client/client_amqp_spec.rb +10 -2
- data/spec/occi/api/client/client_http_spec.rb +111 -117
- data/spec/occi/api/dsl_spec.rb +22 -0
- data/spec/occi/collection_spec.rb +11 -2
- data/spec/occi/core/resource_spec.rb +1 -1
- data/spec/occi/infrastructure/compute_spec.rb +3 -3
- data/spec/occi/log_spec.rb +1 -1
- data/spec/occi/model_spec.rb +4 -8
- data/spec/occi/parser_spec.rb +4 -4
- data/spec/spec_helper.rb +3 -2
- metadata +264 -12
- data/spec/cassettes/client_http_text_plain.yml +0 -1066
- data/spec/occi/api/client/client_http_0.5_spec.rb +0 -292
@@ -5,11 +5,10 @@ module Occi
|
|
5
5
|
module Api
|
6
6
|
module Client
|
7
7
|
|
8
|
-
|
8
|
+
vcr_options = { :record => :new_episodes }
|
9
|
+
describe ClientHttp, :vcr => vcr_options do
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
use_vcr_cassette "client_http_text_plain"
|
11
|
+
context "using media type text/plain" do
|
13
12
|
|
14
13
|
before(:each) do
|
15
14
|
@client = Occi::Api::Client::ClientHttp.new(
|
@@ -26,149 +25,168 @@ module Occi
|
|
26
25
|
@client.logger.close
|
27
26
|
end
|
28
27
|
|
29
|
-
it "
|
28
|
+
it "establishes connection" do
|
30
29
|
@client.connected.should be_true
|
31
30
|
end
|
32
31
|
|
33
|
-
it "
|
34
|
-
@client.get_resource "compute"
|
35
|
-
|
32
|
+
it "instantiates a compute resource using type name" do
|
33
|
+
compute = @client.get_resource "compute"
|
34
|
+
|
35
|
+
compute.should be_a_kind_of Occi::Core::Resource
|
36
|
+
compute.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#compute"
|
37
|
+
end
|
38
|
+
|
39
|
+
it "instantiates a compute resource using type identifier" do
|
40
|
+
compute = @client.get_resource "http://schemas.ogf.org/occi/infrastructure#compute"
|
41
|
+
|
42
|
+
compute.should be_a_kind_of Occi::Core::Resource
|
43
|
+
compute.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#compute"
|
44
|
+
end
|
45
|
+
|
46
|
+
it "instantiates a network resource using type name" do
|
47
|
+
network = @client.get_resource "network"
|
48
|
+
|
49
|
+
network.should be_a_kind_of Occi::Core::Resource
|
50
|
+
network.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#network"
|
51
|
+
end
|
52
|
+
|
53
|
+
it "instantiates a network resource using type identifier" do
|
54
|
+
network = @client.get_resource "http://schemas.ogf.org/occi/infrastructure#network"
|
55
|
+
|
56
|
+
network.should be_a_kind_of Occi::Core::Resource
|
57
|
+
network.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#network"
|
58
|
+
end
|
59
|
+
|
60
|
+
it "instantiates a storage resource using type name" do
|
61
|
+
storage = @client.get_resource "storage"
|
62
|
+
|
63
|
+
storage.should be_a_kind_of Occi::Core::Resource
|
64
|
+
storage.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#storage"
|
65
|
+
end
|
66
|
+
|
67
|
+
it "instantiates a storage resource using type identifier" do
|
68
|
+
storage = @client.get_resource "http://schemas.ogf.org/occi/infrastructure#storage"
|
69
|
+
|
70
|
+
storage.should be_a_kind_of Occi::Core::Resource
|
71
|
+
storage.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#storage"
|
72
|
+
end
|
73
|
+
|
74
|
+
it "lists all available resource types" do
|
75
|
+
@client.get_resource_types.should include("compute", "storage", "network")
|
36
76
|
end
|
37
77
|
|
38
|
-
it "
|
39
|
-
@client.
|
40
|
-
@client.get_resource "http://schemas.ogf.org/occi/infrastructure#network"
|
78
|
+
it "lists all available resource type identifiers" do
|
79
|
+
@client.get_resource_type_identifiers.should include("http://schemas.ogf.org/occi/infrastructure#compute", "http://schemas.ogf.org/occi/infrastructure#network", "http://schemas.ogf.org/occi/infrastructure#storage")
|
41
80
|
end
|
42
81
|
|
43
|
-
it "
|
44
|
-
@client.
|
45
|
-
@client.get_resource "http://schemas.ogf.org/occi/infrastructure#storage"
|
82
|
+
it "lists all available entity types" do
|
83
|
+
@client.get_entity_types.should include("entity", "resource", "link")
|
46
84
|
end
|
47
85
|
|
48
|
-
it "
|
49
|
-
@client.
|
86
|
+
it "lists all available entity type identifiers" do
|
87
|
+
@client.get_entity_type_identifiers.should include("http://schemas.ogf.org/occi/core#entity", "http://schemas.ogf.org/occi/core#resource", "http://schemas.ogf.org/occi/core#link")
|
50
88
|
end
|
51
89
|
|
52
|
-
it "
|
53
|
-
@client.
|
90
|
+
it "lists all available link types" do
|
91
|
+
@client.get_link_types.should include("storagelink", "networkinterface")
|
54
92
|
end
|
55
93
|
|
56
|
-
it "
|
57
|
-
@client.
|
94
|
+
it "lists all available link type identifiers" do
|
95
|
+
@client.get_link_type_identifiers.should include("http://schemas.ogf.org/occi/infrastructure#storagelink", "http://schemas.ogf.org/occi/infrastructure#networkinterface")
|
58
96
|
end
|
59
97
|
|
60
|
-
it "
|
61
|
-
@client.
|
98
|
+
it "lists all available mixin types" do
|
99
|
+
@client.get_mixin_types.should include("os_tpl", "resource_tpl")
|
62
100
|
end
|
63
101
|
|
64
|
-
it "
|
102
|
+
it "lists all available mixin type identifiers" do
|
103
|
+
@client.get_mixin_type_identifiers.should include("http://schemas.ogf.org/occi/infrastructure#os_tpl", "http://schemas.ogf.org/occi/infrastructure#resource_tpl")
|
104
|
+
end
|
105
|
+
|
106
|
+
it "lists compute resources" do
|
65
107
|
@client.list "compute"
|
66
108
|
end
|
67
109
|
|
68
|
-
it "
|
110
|
+
it "lists network resources" do
|
69
111
|
@client.list "network"
|
70
112
|
end
|
71
113
|
|
72
|
-
it "
|
114
|
+
it "lists storage resources" do
|
73
115
|
@client.list "storage"
|
74
116
|
end
|
75
117
|
|
76
|
-
it "
|
118
|
+
it "lists all available mixins" do
|
77
119
|
@client.get_mixins
|
78
120
|
end
|
79
121
|
|
80
|
-
it "
|
122
|
+
it "lists os_tpl mixins" do
|
81
123
|
@client.get_mixins "os_tpl"
|
82
124
|
end
|
83
125
|
|
84
|
-
it "
|
126
|
+
it "lists resource_tpl mixins" do
|
85
127
|
@client.get_mixins "resource_tpl"
|
86
128
|
end
|
87
129
|
|
88
|
-
it "
|
130
|
+
it "describes compute resources" do
|
89
131
|
@client.describe "compute"
|
90
132
|
end
|
91
133
|
|
92
|
-
it "
|
134
|
+
it "describes network resources" do
|
93
135
|
@client.describe "network"
|
94
136
|
end
|
95
137
|
|
96
|
-
it "
|
138
|
+
it "describes storage resources" do
|
97
139
|
@client.describe "storage"
|
98
140
|
end
|
99
141
|
|
100
|
-
it "
|
142
|
+
it "describes all available mixins" do
|
101
143
|
@client.get_mixins.each do |mixin|
|
102
144
|
mixin_short = mixin.split("/").last
|
103
145
|
@client.find_mixin mixin_short.split("#").last, mixin_short.split("#").first, true
|
104
146
|
end
|
105
147
|
end
|
106
148
|
|
107
|
-
it "
|
149
|
+
it "describes os_tpl mixins" do
|
108
150
|
@client.get_mixins("os_tpl").each do |mixin|
|
109
151
|
mixin_short = mixin.split("/").last
|
110
152
|
@client.find_mixin mixin_short.split("#").last, "os_tpl", true
|
111
153
|
end
|
112
154
|
end
|
113
155
|
|
114
|
-
it "
|
156
|
+
it "describes resource_tpl mixins" do
|
115
157
|
@client.get_mixins("resource_tpl").each do |mixin|
|
116
158
|
mixin_short = mixin.split("/").last
|
117
159
|
@client.find_mixin mixin_short.split("#").last, "resource_tpl", true
|
118
160
|
end
|
119
161
|
end
|
120
162
|
|
121
|
-
it "
|
122
|
-
end
|
163
|
+
it "creates a new compute resource"
|
123
164
|
|
124
|
-
it "
|
125
|
-
# TODO
|
126
|
-
end
|
165
|
+
it "creates a new storage resource"
|
127
166
|
|
128
|
-
it "
|
129
|
-
# TODO
|
130
|
-
end
|
167
|
+
it "creates a new network resource"
|
131
168
|
|
132
|
-
it "
|
133
|
-
# TODO
|
134
|
-
end
|
169
|
+
it "deploys an instance based on OVF/OVA file"
|
135
170
|
|
136
|
-
it "
|
137
|
-
end
|
171
|
+
it "deletes a compute resource"
|
138
172
|
|
139
|
-
it "
|
140
|
-
# TODO
|
141
|
-
end
|
173
|
+
it "deletes a network resource"
|
142
174
|
|
143
|
-
it "
|
144
|
-
# TODO
|
145
|
-
end
|
175
|
+
it "deletes a storage resource"
|
146
176
|
|
147
|
-
it "
|
148
|
-
# TODO
|
149
|
-
end
|
177
|
+
it "triggers an action on a compute resource"
|
150
178
|
|
151
|
-
it "
|
152
|
-
# TODO
|
153
|
-
end
|
179
|
+
it "triggers an action on a storage resource"
|
154
180
|
|
155
|
-
it "
|
156
|
-
# TODO
|
157
|
-
end
|
181
|
+
it "triggers an action on a network resource"
|
158
182
|
|
159
|
-
it "
|
183
|
+
it "refreshes its model" do
|
160
184
|
@client.refresh
|
161
185
|
end
|
162
186
|
|
163
187
|
end
|
164
188
|
|
165
|
-
|
166
|
-
|
167
|
-
describe ClientHttp do
|
168
|
-
|
169
|
-
describe "using media type application/occi+json" do
|
170
|
-
|
171
|
-
use_vcr_cassette "client_http_application_occi_json"
|
189
|
+
context "using media type application/occi+json" do
|
172
190
|
|
173
191
|
before(:each) do
|
174
192
|
#@client = Occi::Api::ClientHttp.new(
|
@@ -181,75 +199,51 @@ module Occi
|
|
181
199
|
#)
|
182
200
|
end
|
183
201
|
|
184
|
-
it "
|
185
|
-
# TODO
|
186
|
-
end
|
202
|
+
it "establishes connection"
|
187
203
|
|
188
|
-
it "
|
189
|
-
end
|
204
|
+
it "lists compute resources"
|
190
205
|
|
191
|
-
it "
|
192
|
-
end
|
206
|
+
it "lists network resources"
|
193
207
|
|
194
|
-
it "
|
195
|
-
end
|
208
|
+
it "lists storage resources"
|
196
209
|
|
197
|
-
it "
|
198
|
-
end
|
210
|
+
it "lists all available mixins"
|
199
211
|
|
200
|
-
it "
|
201
|
-
end
|
212
|
+
it "lists os_tpl mixins"
|
202
213
|
|
203
|
-
it "
|
204
|
-
end
|
214
|
+
it "lists resource_tpl mixins"
|
205
215
|
|
206
|
-
it "
|
207
|
-
end
|
216
|
+
it "describes compute resources"
|
208
217
|
|
209
|
-
it "
|
210
|
-
end
|
218
|
+
it "describes network resources"
|
211
219
|
|
212
|
-
it "
|
213
|
-
end
|
220
|
+
it "describes storage resources"
|
214
221
|
|
215
|
-
it "
|
216
|
-
end
|
222
|
+
it "describes all available mixins"
|
217
223
|
|
218
|
-
it "
|
219
|
-
end
|
224
|
+
it "describes os_tpl mixins"
|
220
225
|
|
221
|
-
it "
|
222
|
-
end
|
226
|
+
it "describes resource_tpl mixins"
|
223
227
|
|
224
|
-
it "
|
225
|
-
end
|
228
|
+
it "creates a new compute resource"
|
226
229
|
|
227
|
-
it "
|
228
|
-
end
|
230
|
+
it "creates a new storage resource"
|
229
231
|
|
230
|
-
it "
|
231
|
-
end
|
232
|
+
it "creates a new network resource"
|
232
233
|
|
233
|
-
it "
|
234
|
-
end
|
234
|
+
it "deletes a compute resource"
|
235
235
|
|
236
|
-
it "
|
237
|
-
end
|
236
|
+
it "deletes a network resource"
|
238
237
|
|
239
|
-
it "
|
240
|
-
end
|
238
|
+
it "deletes a storage resource"
|
241
239
|
|
242
|
-
it "
|
243
|
-
end
|
240
|
+
it "triggers an action on a compute resource"
|
244
241
|
|
245
|
-
it "
|
246
|
-
end
|
242
|
+
it "triggers an action on a storage resource"
|
247
243
|
|
248
|
-
it "
|
249
|
-
end
|
244
|
+
it "triggers an action on a network resource"
|
250
245
|
|
251
|
-
it "
|
252
|
-
end
|
246
|
+
it "refreshes its model"
|
253
247
|
|
254
248
|
end
|
255
249
|
end
|
data/spec/occi/api/dsl_spec.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'occi'
|
3
|
+
|
4
|
+
module Occi
|
5
|
+
module Api
|
6
|
+
describe Dsl do
|
7
|
+
|
8
|
+
context "using ClientHttp" do
|
9
|
+
|
10
|
+
it "does something"
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
context "using ClientAmqp" do
|
15
|
+
|
16
|
+
it "does something"
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -4,7 +4,7 @@ require 'occi'
|
|
4
4
|
module Occi
|
5
5
|
describe Collection do
|
6
6
|
|
7
|
-
it "
|
7
|
+
it "creates a new Occi collection including the Occi base objects" do
|
8
8
|
collection = Occi::Collection.new
|
9
9
|
collection.kinds << "http://schemas.ogf.org/occi/infrastructure#compute"
|
10
10
|
collection.mixins << "http://example.com/occi/tags#my_mixin"
|
@@ -28,5 +28,14 @@ module Occi
|
|
28
28
|
expect { collection.check }.to_not raise_error
|
29
29
|
end
|
30
30
|
|
31
|
+
it 'successfully gets all categories related to a category' do
|
32
|
+
collection = Occi::Collection.new
|
33
|
+
collection.kinds << Occi::Core::Resource.kind
|
34
|
+
collection.kinds << Occi::Core::Link.kind
|
35
|
+
collection.get_related_to(Occi::Core::Entity.kind).should == collection
|
36
|
+
collection.get_related_to(Occi::Core::Resource.kind).kinds.first.should == Occi::Core::Resource.kind
|
37
|
+
collection.get_related_to(Occi::Core::Link.kind).kinds.first.should == Occi::Core::Link.kind
|
38
|
+
end
|
39
|
+
|
31
40
|
end
|
32
|
-
end
|
41
|
+
end
|
@@ -5,7 +5,7 @@ module Occi
|
|
5
5
|
module Core
|
6
6
|
describe Resource do
|
7
7
|
|
8
|
-
it "
|
8
|
+
it "links another resource succesfully" do
|
9
9
|
resource = Occi::Core::Resource.new
|
10
10
|
target = Occi::Core::Resource.new
|
11
11
|
# create a random ID as the resource must already exist and therefore must have an ID assigned
|
@@ -5,7 +5,7 @@ module Occi
|
|
5
5
|
module Infrastructure
|
6
6
|
describe Compute do
|
7
7
|
|
8
|
-
it "
|
8
|
+
it "creates a storagelink to an existing storage resource" do
|
9
9
|
compute = Occi::Infrastructure::Compute.new
|
10
10
|
target = Occi::Infrastructure::Storage.new
|
11
11
|
# create a random ID as the storage resource must already exist and therefore must have an ID assigned
|
@@ -16,7 +16,7 @@ module Occi
|
|
16
16
|
compute.links.first.target.should be target
|
17
17
|
end
|
18
18
|
|
19
|
-
it "
|
19
|
+
it "creates a networkinterface to an existing network resource" do
|
20
20
|
compute = Occi::Infrastructure::Compute.new
|
21
21
|
target = Occi::Infrastructure::Network.new
|
22
22
|
# create a random ID as the network resource must already exist and therefore must have an ID assigned
|
@@ -29,4 +29,4 @@ module Occi
|
|
29
29
|
|
30
30
|
end
|
31
31
|
end
|
32
|
-
end
|
32
|
+
end
|
data/spec/occi/log_spec.rb
CHANGED
data/spec/occi/model_spec.rb
CHANGED
@@ -38,15 +38,11 @@ describe "Model" do
|
|
38
38
|
it "returns categories with filter" do
|
39
39
|
model = Occi::Model.new
|
40
40
|
model.register_infrastructure
|
41
|
-
compute = Occi::
|
42
|
-
|
43
|
-
filter = Occi::Collection.new
|
44
|
-
filter.kinds << compute
|
45
|
-
filter.mixins << ipnetwork
|
46
|
-
collection = model.get(filter)
|
41
|
+
compute = Occi::Infrastructure::Compute.kind
|
42
|
+
collection = model.get(compute)
|
47
43
|
collection.kind_of? Occi::Collection
|
48
|
-
collection.kinds.first.
|
49
|
-
collection.mixins.
|
44
|
+
collection.kinds.first.should == compute
|
45
|
+
collection.mixins.should have_at_least(2).mixins
|
50
46
|
collection.actions.should be_empty
|
51
47
|
collection.resources.should be_empty
|
52
48
|
collection.links.should be_empty
|