vcloud-core 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -0
- data/CHANGELOG.md +10 -1
- data/CONTRIBUTING.md +66 -0
- data/README.md +5 -5
- data/Rakefile +1 -1
- data/lib/vcloud/core/config_validator.rb +20 -20
- data/lib/vcloud/core/query_cli.rb +1 -1
- data/lib/vcloud/core/version.rb +1 -1
- data/lib/vcloud/core/vm.rb +2 -39
- data/lib/vcloud/fog/service_interface.rb +10 -5
- data/spec/integration/README.md +1 -1
- data/spec/integration/core/edge_gateway_spec.rb +133 -0
- data/spec/integration/core/query_runner_spec.rb +10 -4
- data/spec/integration/core/vapp_spec.rb +249 -0
- data/spec/integration/core/vdc_spec.rb +6 -4
- data/spec/integration/core/vm_spec.rb +24 -12
- data/spec/spec_helper.rb +21 -10
- data/spec/support/integration_helper.rb +27 -0
- data/spec/vcloud/core/config_loader_spec.rb +10 -10
- data/spec/vcloud/core/config_validator_spec.rb +7 -0
- data/spec/vcloud/core/edge_gateway_spec.rb +10 -10
- data/spec/vcloud/core/metadata_helper_spec.rb +2 -2
- data/spec/vcloud/core/org_vdc_network_spec.rb +15 -15
- data/spec/vcloud/core/query_runner_spec.rb +13 -13
- data/spec/vcloud/core/query_spec.rb +9 -9
- data/spec/vcloud/core/vapp_spec.rb +19 -19
- data/spec/vcloud/core/vapp_template_spec.rb +9 -9
- data/spec/vcloud/core/vdc_spec.rb +6 -6
- data/spec/vcloud/core/vm_spec.rb +50 -118
- data/spec/vcloud/fog/fog_model_interface_spec.rb +3 -3
- data/spec/vcloud/fog/service_interface_spec.rb +9 -9
- data/vcloud-core.gemspec +6 -6
- metadata +36 -35
- data/spec/integration/edge_gateway/configure_edge_gateway_services_spec.rb +0 -55
- data/spec/integration/edge_gateway/edge_gateway_spec.rb +0 -45
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vcloud-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-07-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog
|
@@ -43,6 +43,22 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: gem_publisher
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.2.0
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.2.0
|
46
62
|
- !ruby/object:Gem::Dependency
|
47
63
|
name: pry
|
48
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,17 +112,17 @@ dependencies:
|
|
96
112
|
requirement: !ruby/object:Gem::Requirement
|
97
113
|
none: false
|
98
114
|
requirements:
|
99
|
-
- -
|
115
|
+
- - ~>
|
100
116
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
117
|
+
version: 0.23.0
|
102
118
|
type: :development
|
103
119
|
prerelease: false
|
104
120
|
version_requirements: !ruby/object:Gem::Requirement
|
105
121
|
none: false
|
106
122
|
requirements:
|
107
|
-
- -
|
123
|
+
- - ~>
|
108
124
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
125
|
+
version: 0.23.0
|
110
126
|
- !ruby/object:Gem::Dependency
|
111
127
|
name: simplecov
|
112
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +130,7 @@ dependencies:
|
|
114
130
|
requirements:
|
115
131
|
- - ~>
|
116
132
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
133
|
+
version: 0.7.1
|
118
134
|
type: :development
|
119
135
|
prerelease: false
|
120
136
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,39 +138,23 @@ dependencies:
|
|
122
138
|
requirements:
|
123
139
|
- - ~>
|
124
140
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: gem_publisher
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
|
-
requirements:
|
131
|
-
- - '='
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: 1.2.0
|
134
|
-
type: :development
|
135
|
-
prerelease: false
|
136
|
-
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
|
-
requirements:
|
139
|
-
- - '='
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
version: 1.2.0
|
141
|
+
version: 0.7.1
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
143
|
name: vcloud-tools-tester
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
145
145
|
none: false
|
146
146
|
requirements:
|
147
|
-
- -
|
147
|
+
- - ~>
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version: 0.0
|
149
|
+
version: 0.1.0
|
150
150
|
type: :development
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
153
|
none: false
|
154
154
|
requirements:
|
155
|
-
- -
|
155
|
+
- - ~>
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version: 0.0
|
157
|
+
version: 0.1.0
|
158
158
|
description: Core tools for interacting with VMware vCloud Director. Includes VCloud
|
159
159
|
Query, a light wrapper round the vCloud Query API.
|
160
160
|
email:
|
@@ -167,6 +167,7 @@ files:
|
|
167
167
|
- .gitignore
|
168
168
|
- .travis.yml
|
169
169
|
- CHANGELOG.md
|
170
|
+
- CONTRIBUTING.md
|
170
171
|
- Gemfile
|
171
172
|
- LICENSE.txt
|
172
173
|
- README.md
|
@@ -197,11 +198,11 @@ files:
|
|
197
198
|
- lib/vcloud/fog/relation.rb
|
198
199
|
- lib/vcloud/fog/service_interface.rb
|
199
200
|
- spec/integration/README.md
|
201
|
+
- spec/integration/core/edge_gateway_spec.rb
|
200
202
|
- spec/integration/core/query_runner_spec.rb
|
203
|
+
- spec/integration/core/vapp_spec.rb
|
201
204
|
- spec/integration/core/vdc_spec.rb
|
202
205
|
- spec/integration/core/vm_spec.rb
|
203
|
-
- spec/integration/edge_gateway/configure_edge_gateway_services_spec.rb
|
204
|
-
- spec/integration/edge_gateway/edge_gateway_spec.rb
|
205
206
|
- spec/integration/vcloud_tools_testing_config.yaml.template
|
206
207
|
- spec/spec_helper.rb
|
207
208
|
- spec/support/integration_helper.rb
|
@@ -231,7 +232,7 @@ files:
|
|
231
232
|
- spec/vcloud/fog/service_interface_spec.rb
|
232
233
|
- tools/fog_credentials.rb
|
233
234
|
- vcloud-core.gemspec
|
234
|
-
homepage: http://github.com/
|
235
|
+
homepage: http://github.com/gds-operations/vcloud-core
|
235
236
|
licenses:
|
236
237
|
- MIT
|
237
238
|
post_install_message:
|
@@ -243,7 +244,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
243
244
|
requirements:
|
244
245
|
- - ! '>='
|
245
246
|
- !ruby/object:Gem::Version
|
246
|
-
version: 1.9.
|
247
|
+
version: 1.9.3
|
247
248
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
248
249
|
none: false
|
249
250
|
requirements:
|
@@ -252,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
253
|
version: '0'
|
253
254
|
segments:
|
254
255
|
- 0
|
255
|
-
hash:
|
256
|
+
hash: 2096700488299728841
|
256
257
|
requirements: []
|
257
258
|
rubyforge_project:
|
258
259
|
rubygems_version: 1.8.23
|
@@ -261,11 +262,11 @@ specification_version: 3
|
|
261
262
|
summary: Core tools for interacting with VMware vCloud Director
|
262
263
|
test_files:
|
263
264
|
- spec/integration/README.md
|
265
|
+
- spec/integration/core/edge_gateway_spec.rb
|
264
266
|
- spec/integration/core/query_runner_spec.rb
|
267
|
+
- spec/integration/core/vapp_spec.rb
|
265
268
|
- spec/integration/core/vdc_spec.rb
|
266
269
|
- spec/integration/core/vm_spec.rb
|
267
|
-
- spec/integration/edge_gateway/configure_edge_gateway_services_spec.rb
|
268
|
-
- spec/integration/edge_gateway/edge_gateway_spec.rb
|
269
270
|
- spec/integration/vcloud_tools_testing_config.yaml.template
|
270
271
|
- spec/spec_helper.rb
|
271
272
|
- spec/support/integration_helper.rb
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Vcloud
|
4
|
-
module Core
|
5
|
-
describe EdgeGateway do
|
6
|
-
|
7
|
-
required_env = {
|
8
|
-
'VCLOUD_EDGE_GATEWAY' => 'to name of VSE',
|
9
|
-
}
|
10
|
-
|
11
|
-
error = false
|
12
|
-
required_env.each do |var,message|
|
13
|
-
unless ENV[var]
|
14
|
-
puts "Must set #{var} #{message}" unless ENV[var]
|
15
|
-
error = true
|
16
|
-
end
|
17
|
-
end
|
18
|
-
Kernel.exit(2) if error
|
19
|
-
|
20
|
-
it "configure firewall service" do
|
21
|
-
configuration = {
|
22
|
-
:FirewallService =>
|
23
|
-
{
|
24
|
-
:IsEnabled => "true",
|
25
|
-
:DefaultAction => "allow",
|
26
|
-
:LogDefaultAction => "false",
|
27
|
-
:FirewallRule =>
|
28
|
-
[
|
29
|
-
{
|
30
|
-
:Id => "999",
|
31
|
-
:IsEnabled => "false",
|
32
|
-
:MatchOnTranslate => "false",
|
33
|
-
:Description => "generated from edge_gateway_tests",
|
34
|
-
:Policy => "drop",
|
35
|
-
:Protocols => {:Tcp => "true"},
|
36
|
-
:Port => "3412",
|
37
|
-
:DestinationPortRange => "3412",
|
38
|
-
:DestinationIp => "internal",
|
39
|
-
:SourcePort => "3412",
|
40
|
-
:SourcePortRange => "3412",
|
41
|
-
:SourceIp => "internal",
|
42
|
-
:EnableLogging => "false"
|
43
|
-
}
|
44
|
-
]
|
45
|
-
}
|
46
|
-
}
|
47
|
-
edge_gateway = EdgeGateway.get_by_name(ENV['VCLOUD_EDGE_GATEWAY'])
|
48
|
-
edge_gateway.update_configuration(configuration)
|
49
|
-
|
50
|
-
actual_config = edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration]
|
51
|
-
actual_config[:FirewallService].should == configuration[:FirewallService]
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Vcloud
|
4
|
-
module Core
|
5
|
-
describe EdgeGateway do
|
6
|
-
|
7
|
-
required_env = {
|
8
|
-
'VCLOUD_EDGE_GATEWAY' => 'to name of VSE',
|
9
|
-
'VCLOUD_PROVIDER_NETWORK_ID' => 'to ID of VSE external network',
|
10
|
-
'VCLOUD_NETWORK1_ID' => 'to the ID of a VSE internal network',
|
11
|
-
}
|
12
|
-
|
13
|
-
error = false
|
14
|
-
required_env.each do |var,message|
|
15
|
-
unless ENV[var]
|
16
|
-
puts "Must set #{var} #{message}" unless ENV[var]
|
17
|
-
error = true
|
18
|
-
end
|
19
|
-
end
|
20
|
-
Kernel.exit(2) if error
|
21
|
-
|
22
|
-
context "get vcloud attributes for given gateway interface id " do
|
23
|
-
before(:all) do
|
24
|
-
@edge_gateway = EdgeGateway.get_by_name(ENV['VCLOUD_EDGE_GATEWAY'])
|
25
|
-
end
|
26
|
-
it "should return provider network" do
|
27
|
-
gateway_interface = @edge_gateway.vcloud_gateway_interface_by_id(ENV['VCLOUD_PROVIDER_NETWORK_ID'])
|
28
|
-
expect(gateway_interface[:Network]).not_to be_nil
|
29
|
-
expect(gateway_interface[:Network][:href]).to include(ENV['VCLOUD_PROVIDER_NETWORK_ID'])
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should return orgVdcNetwork" do
|
33
|
-
gateway_interface = @edge_gateway.vcloud_gateway_interface_by_id(ENV['VCLOUD_NETWORK1_ID'])
|
34
|
-
expect(gateway_interface[:Network]).not_to be_nil
|
35
|
-
expect(gateway_interface[:Network][:href]).to include(ENV['VCLOUD_NETWORK1_ID'])
|
36
|
-
end
|
37
|
-
|
38
|
-
it "return nil if network with given id is not found" do
|
39
|
-
gateway_interface = @edge_gateway.vcloud_gateway_interface_by_id(SecureRandom.uuid)
|
40
|
-
expect(gateway_interface).to be_nil
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|