kitchen-openstack 3.4.0 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/Rakefile +1 -1
- data/lib/kitchen/driver/openstack.rb +12 -9
- data/lib/kitchen/driver/openstack/volume.rb +3 -2
- data/lib/kitchen/driver/openstack_version.rb +2 -1
- data/spec/kitchen/driver/openstack_spec.rb +56 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b433d2d0a11684712ba845ba47b696cd2c6fde9
|
4
|
+
data.tar.gz: e59925c69ddc2d248af40de6d816ab61f3221364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64d46e0d70d2b65f9e555fb468c31b89ceeff651463204f6f0907686455124da4fdd52a157ba2b9b5379890e9c5c810f0bc6344c7696341ace61e38173ddf87e
|
7
|
+
data.tar.gz: 93ac9c600b157277deef7a491f5ec00ebc18cb089b7b638f29692f00f0ec79fa963652f41fedc4da419e9d62a88a3e3705e8fbe2ebe5c50070de11405a551bdc
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [v3.5.0](https://github.com/test-kitchen/kitchen-openstack/tree/v3.5.0)
|
4
4
|
|
5
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-openstack/compare/v3.4.0...v3.5.0)
|
6
|
+
|
7
|
+
**Merged pull requests:**
|
8
|
+
|
9
|
+
- Add metadata support [\#166](https://github.com/test-kitchen/kitchen-openstack/pull/166) ([akitada](https://github.com/akitada))
|
10
|
+
- Use new ohai config context [\#165](https://github.com/test-kitchen/kitchen-openstack/pull/165) ([akitada](https://github.com/akitada))
|
11
|
+
|
12
|
+
## [v3.4.0](https://github.com/test-kitchen/kitchen-openstack/tree/v3.4.0) (2017-03-27)
|
5
13
|
[Full Changelog](https://github.com/test-kitchen/kitchen-openstack/compare/v3.3.0...v3.4.0)
|
6
14
|
|
7
15
|
**Closed issues:**
|
data/Rakefile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# Encoding: UTF-8
|
2
|
+
|
2
3
|
#
|
3
4
|
# Author:: Jonathan Hartman (<j@p4nt5.com>)
|
4
5
|
# Author:: JJ Asghar (<jj@chef.io>)
|
@@ -59,6 +60,7 @@ module Kitchen
|
|
59
60
|
default_config :connect_timeout, 60
|
60
61
|
default_config :read_timeout, 60
|
61
62
|
default_config :write_timeout, 60
|
63
|
+
default_config :metadata, nil
|
62
64
|
|
63
65
|
# Set the proper server name in the config
|
64
66
|
def config_server_name
|
@@ -142,7 +144,7 @@ module Kitchen
|
|
142
144
|
end
|
143
145
|
|
144
146
|
def required_server_settings
|
145
|
-
|
147
|
+
%i(openstack_username openstack_api_key openstack_auth_url)
|
146
148
|
end
|
147
149
|
|
148
150
|
def optional_server_settings
|
@@ -152,7 +154,7 @@ module Kitchen
|
|
152
154
|
end
|
153
155
|
|
154
156
|
def connection_options
|
155
|
-
|
157
|
+
%i(read_timeout write_timeout connect_timeout)
|
156
158
|
end
|
157
159
|
|
158
160
|
def network
|
@@ -190,12 +192,13 @@ module Kitchen
|
|
190
192
|
server_def[:block_device_mapping] = get_bdm(config)
|
191
193
|
end
|
192
194
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
195
|
+
%i(
|
196
|
+
security_groups
|
197
|
+
key_name
|
198
|
+
user_data
|
199
|
+
config_drive
|
200
|
+
metadata
|
201
|
+
).each do |c|
|
199
202
|
server_def[c] = optional_config(c) if config[c]
|
200
203
|
end
|
201
204
|
|
@@ -401,7 +404,7 @@ module Kitchen
|
|
401
404
|
end
|
402
405
|
|
403
406
|
def hints_path
|
404
|
-
Ohai
|
407
|
+
Ohai.config[:hints_path][0]
|
405
408
|
end
|
406
409
|
|
407
410
|
def disable_ssl_validation
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# Encoding: UTF-8
|
2
|
+
|
2
3
|
#
|
3
4
|
# Author:: Jonathan Hartman (<j@p4nt5.com>)
|
4
5
|
#
|
@@ -40,8 +41,8 @@ module Kitchen
|
|
40
41
|
def create_volume(config, os)
|
41
42
|
opt = {}
|
42
43
|
bdm = config[:block_device_mapping]
|
43
|
-
vanilla_options =
|
44
|
-
|
44
|
+
vanilla_options = %i(snapshot_id imageRef volume_type
|
45
|
+
source_volid availability_zone)
|
45
46
|
vanilla_options.select { |o| bdm[o] }.each do |key|
|
46
47
|
opt[key] = bdm[key]
|
47
48
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# Encoding: UTF-8
|
2
|
+
|
2
3
|
#
|
3
4
|
# Author:: Jonathan Hartman (<j@p4nt5.com>)
|
4
5
|
#
|
@@ -22,6 +23,6 @@ module Kitchen
|
|
22
23
|
#
|
23
24
|
# @author Jonathan Hartman <j@p4nt5.com>
|
24
25
|
module Driver
|
25
|
-
OPENSTACK_VERSION = '3.
|
26
|
+
OPENSTACK_VERSION = '3.5.0'.freeze
|
26
27
|
end
|
27
28
|
end
|
@@ -18,8 +18,8 @@ require 'fog'
|
|
18
18
|
describe Kitchen::Driver::Openstack do
|
19
19
|
let(:logged_output) { StringIO.new }
|
20
20
|
let(:logger) { Logger.new(logged_output) }
|
21
|
-
let(:config) {
|
22
|
-
let(:state) {
|
21
|
+
let(:config) { {} }
|
22
|
+
let(:state) { {} }
|
23
23
|
let(:instance_name) { 'potatoes' }
|
24
24
|
let(:transport) { Kitchen::Transport::Dummy.new }
|
25
25
|
let(:platform) { Kitchen::Platform.new(name: 'fake_platform') }
|
@@ -69,17 +69,18 @@ describe Kitchen::Driver::Openstack do
|
|
69
69
|
expect(driver[:connect_timeout]).to eq(60)
|
70
70
|
end
|
71
71
|
|
72
|
-
nils =
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
72
|
+
nils = %i(
|
73
|
+
server_name
|
74
|
+
openstack_tenant
|
75
|
+
openstack_region
|
76
|
+
openstack_service_name
|
77
|
+
floating_ip_pool
|
78
|
+
floating_ip
|
79
|
+
availability_zone
|
80
|
+
security_groups
|
81
|
+
network_ref
|
82
|
+
metadata
|
83
|
+
)
|
83
84
|
nils.each do |i|
|
84
85
|
it "defaults to no #{i}" do
|
85
86
|
expect(driver[i]).to eq(nil)
|
@@ -117,6 +118,10 @@ describe Kitchen::Driver::Openstack do
|
|
117
118
|
volume_size: '5',
|
118
119
|
device_name: 'vda',
|
119
120
|
delete_on_termination: true
|
121
|
+
},
|
122
|
+
metadata: {
|
123
|
+
name: 'test',
|
124
|
+
ohai: 'chef'
|
120
125
|
}
|
121
126
|
}
|
122
127
|
end
|
@@ -232,7 +237,7 @@ describe Kitchen::Driver::Openstack do
|
|
232
237
|
end
|
233
238
|
|
234
239
|
context 'no server ID present' do
|
235
|
-
let(:state) {
|
240
|
+
let(:state) { {} }
|
236
241
|
|
237
242
|
it 'does nothing' do
|
238
243
|
allow(driver).to receive(:compute)
|
@@ -330,18 +335,18 @@ describe Kitchen::Driver::Openstack do
|
|
330
335
|
|
331
336
|
describe '#required_server_settings' do
|
332
337
|
it 'returns the required settings for an OpenStack server' do
|
333
|
-
expected =
|
334
|
-
|
335
|
-
|
338
|
+
expected = %i(
|
339
|
+
openstack_username openstack_api_key openstack_auth_url
|
340
|
+
)
|
336
341
|
expect(driver.send(:required_server_settings)).to eq(expected)
|
337
342
|
end
|
338
343
|
end
|
339
344
|
|
340
345
|
describe '#optional_server_settings' do
|
341
346
|
it 'returns the optional settings for an OpenStack server' do
|
342
|
-
excluded =
|
343
|
-
|
344
|
-
|
347
|
+
excluded = %i(
|
348
|
+
openstack_username openstack_api_key openstack_auth_url
|
349
|
+
)
|
345
350
|
expect(driver.send(:optional_server_settings)).not_to include(*excluded)
|
346
351
|
end
|
347
352
|
end
|
@@ -814,6 +819,37 @@ describe Kitchen::Driver::Openstack do
|
|
814
819
|
driver.send(:create_server)
|
815
820
|
end
|
816
821
|
end
|
822
|
+
|
823
|
+
context 'metadata specified' do
|
824
|
+
let(:config) do
|
825
|
+
{
|
826
|
+
server_name: 'hello',
|
827
|
+
image_ref: '111',
|
828
|
+
flavor_ref: '1',
|
829
|
+
metadata: {
|
830
|
+
name: 'hello',
|
831
|
+
ohai: 'chef'
|
832
|
+
}
|
833
|
+
}
|
834
|
+
end
|
835
|
+
let(:data) do
|
836
|
+
{
|
837
|
+
name: 'hello',
|
838
|
+
ohai: 'chef'
|
839
|
+
}
|
840
|
+
end
|
841
|
+
|
842
|
+
it 'passes metadata contents' do
|
843
|
+
expect(servers).to receive(:create).with(
|
844
|
+
name: 'hello',
|
845
|
+
image_ref: '111',
|
846
|
+
flavor_ref: '1',
|
847
|
+
availability_zone: nil,
|
848
|
+
metadata: data
|
849
|
+
)
|
850
|
+
driver.send(:create_server)
|
851
|
+
end
|
852
|
+
end
|
817
853
|
end
|
818
854
|
|
819
855
|
describe '#default_name' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-openstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Hartman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-04-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-kitchen
|