test-kitchen 1.14.1 → 1.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Berksfile +1 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/Guardfile +5 -5
- data/Rakefile +5 -5
- data/bin/kitchen +1 -1
- data/features/step_definitions/gem_steps.rb +6 -6
- data/features/support/env.rb +6 -7
- data/lib/kitchen.rb +5 -7
- data/lib/kitchen/base64_stream.rb +2 -8
- data/lib/kitchen/cli.rb +76 -80
- data/lib/kitchen/collection.rb +0 -2
- data/lib/kitchen/color.rb +7 -9
- data/lib/kitchen/command.rb +0 -4
- data/lib/kitchen/command/action.rb +0 -3
- data/lib/kitchen/command/console.rb +4 -7
- data/lib/kitchen/command/diagnose.rb +7 -14
- data/lib/kitchen/command/driver_discover.rb +1 -4
- data/lib/kitchen/command/exec.rb +0 -3
- data/lib/kitchen/command/list.rb +9 -12
- data/lib/kitchen/command/login.rb +0 -3
- data/lib/kitchen/command/package.rb +0 -3
- data/lib/kitchen/command/sink.rb +6 -9
- data/lib/kitchen/command/test.rb +1 -4
- data/lib/kitchen/config.rb +25 -27
- data/lib/kitchen/configurable.rb +26 -31
- data/lib/kitchen/data_munger.rb +34 -36
- data/lib/kitchen/diagnostic.rb +5 -7
- data/lib/kitchen/driver.rb +3 -5
- data/lib/kitchen/driver/base.rb +0 -3
- data/lib/kitchen/driver/dummy.rb +0 -3
- data/lib/kitchen/driver/proxy.rb +0 -3
- data/lib/kitchen/driver/ssh_base.rb +13 -16
- data/lib/kitchen/errors.rb +11 -16
- data/lib/kitchen/generator/driver_create.rb +18 -21
- data/lib/kitchen/generator/init.rb +21 -26
- data/lib/kitchen/instance.rb +19 -23
- data/lib/kitchen/lazy_hash.rb +1 -2
- data/lib/kitchen/loader/yaml.rb +22 -25
- data/lib/kitchen/logger.rb +9 -14
- data/lib/kitchen/logging.rb +0 -3
- data/lib/kitchen/login_command.rb +0 -2
- data/lib/kitchen/metadata_chopper.rb +0 -2
- data/lib/kitchen/platform.rb +1 -3
- data/lib/kitchen/provisioner.rb +3 -5
- data/lib/kitchen/provisioner/base.rb +2 -5
- data/lib/kitchen/provisioner/chef/berkshelf.rb +1 -5
- data/lib/kitchen/provisioner/chef/common_sandbox.rb +24 -29
- data/lib/kitchen/provisioner/chef/librarian.rb +2 -6
- data/lib/kitchen/provisioner/chef/policyfile.rb +4 -8
- data/lib/kitchen/provisioner/chef_apply.rb +14 -17
- data/lib/kitchen/provisioner/chef_base.rb +43 -46
- data/lib/kitchen/provisioner/chef_solo.rb +10 -13
- data/lib/kitchen/provisioner/chef_zero.rb +22 -29
- data/lib/kitchen/provisioner/dummy.rb +0 -3
- data/lib/kitchen/provisioner/shell.rb +6 -9
- data/lib/kitchen/rake_tasks.rb +4 -6
- data/lib/kitchen/shell_out.rb +3 -5
- data/lib/kitchen/ssh.rb +16 -22
- data/lib/kitchen/state_file.rb +3 -5
- data/lib/kitchen/suite.rb +0 -2
- data/lib/kitchen/thor_tasks.rb +2 -4
- data/lib/kitchen/transport.rb +3 -5
- data/lib/kitchen/transport/base.rb +1 -7
- data/lib/kitchen/transport/dummy.rb +0 -4
- data/lib/kitchen/transport/ssh.rb +41 -47
- data/lib/kitchen/transport/winrm.rb +41 -40
- data/lib/kitchen/util.rb +1 -3
- data/lib/kitchen/verifier.rb +3 -5
- data/lib/kitchen/verifier/base.rb +2 -5
- data/lib/kitchen/verifier/busser.rb +24 -24
- data/lib/kitchen/verifier/dummy.rb +0 -3
- data/lib/kitchen/verifier/shell.rb +1 -3
- data/lib/kitchen/version.rb +1 -1
- data/lib/vendor/hash_recursive_merge.rb +0 -2
- data/spec/kitchen/base64_stream_spec.rb +3 -6
- data/spec/kitchen/cli_spec.rb +0 -2
- data/spec/kitchen/collection_spec.rb +4 -8
- data/spec/kitchen/color_spec.rb +0 -3
- data/spec/kitchen/config_spec.rb +91 -106
- data/spec/kitchen/configurable_spec.rb +44 -76
- data/spec/kitchen/data_munger_spec.rb +1178 -1247
- data/spec/kitchen/diagnostic_spec.rb +37 -38
- data/spec/kitchen/driver/base_spec.rb +7 -14
- data/spec/kitchen/driver/dummy_spec.rb +1 -7
- data/spec/kitchen/driver/proxy_spec.rb +2 -7
- data/spec/kitchen/driver/ssh_base_spec.rb +128 -149
- data/spec/kitchen/driver_spec.rb +7 -13
- data/spec/kitchen/errors_spec.rb +50 -60
- data/spec/kitchen/instance_spec.rb +217 -294
- data/spec/kitchen/lazy_hash_spec.rb +14 -18
- data/spec/kitchen/loader/yaml_spec.rb +201 -227
- data/spec/kitchen/logger_spec.rb +7 -15
- data/spec/kitchen/logging_spec.rb +1 -4
- data/spec/kitchen/login_command_spec.rb +3 -4
- data/spec/kitchen/metadata_chopper_spec.rb +0 -3
- data/spec/kitchen/platform_spec.rb +31 -32
- data/spec/kitchen/provisioner/base_spec.rb +22 -41
- data/spec/kitchen/provisioner/chef/policyfile_spec.rb +15 -15
- data/spec/kitchen/provisioner/chef_apply_spec.rb +8 -13
- data/spec/kitchen/provisioner/chef_base_spec.rb +150 -182
- data/spec/kitchen/provisioner/chef_solo_spec.rb +58 -72
- data/spec/kitchen/provisioner/chef_zero_spec.rb +99 -125
- data/spec/kitchen/provisioner/dummy_spec.rb +8 -11
- data/spec/kitchen/provisioner/shell_spec.rb +86 -103
- data/spec/kitchen/provisioner_spec.rb +5 -11
- data/spec/kitchen/shell_out_spec.rb +15 -19
- data/spec/kitchen/ssh_spec.rb +16 -35
- data/spec/kitchen/state_file_spec.rb +6 -11
- data/spec/kitchen/suite_spec.rb +5 -6
- data/spec/kitchen/transport/base_spec.rb +6 -14
- data/spec/kitchen/transport/ssh_spec.rb +39 -64
- data/spec/kitchen/transport/winrm_spec.rb +99 -127
- data/spec/kitchen/transport_spec.rb +7 -13
- data/spec/kitchen/util_spec.rb +17 -26
- data/spec/kitchen/verifier/base_spec.rb +24 -40
- data/spec/kitchen/verifier/busser_spec.rb +38 -68
- data/spec/kitchen/verifier/dummy_spec.rb +8 -11
- data/spec/kitchen/verifier/shell_spec.rb +14 -17
- data/spec/kitchen/verifier_spec.rb +7 -13
- data/spec/kitchen_spec.rb +4 -6
- data/spec/spec_helper.rb +1 -1
- data/spec/support/powershell_max_size_spec.rb +1 -2
- data/support/chef-client-zero.rb +3 -4
- data/test-kitchen.gemspec +4 -6
- metadata +9 -9
@@ -120,8 +120,8 @@ module Kitchen
|
|
120
120
|
when /linux/
|
121
121
|
login_command_for_linux
|
122
122
|
else
|
123
|
-
|
124
|
-
"from host OS '#{RbConfig::CONFIG[
|
123
|
+
raise ActionFailed, "Remote login not supported in #{self.class} " \
|
124
|
+
"from host OS '#{RbConfig::CONFIG['host_os']}'."
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
@@ -134,8 +134,8 @@ module Kitchen
|
|
134
134
|
def wait_until_ready
|
135
135
|
delay = 3
|
136
136
|
unelevated_session(
|
137
|
-
:
|
138
|
-
:
|
137
|
+
retry_limit: max_wait_until_ready / delay,
|
138
|
+
retry_delay: delay
|
139
139
|
)
|
140
140
|
execute(PING_COMMAND.dup)
|
141
141
|
end
|
@@ -195,7 +195,7 @@ module Kitchen
|
|
195
195
|
if logger.debug?
|
196
196
|
debug("Creating RDP document for #{instance_name} (#{rdp_doc_path})")
|
197
197
|
debug("------------")
|
198
|
-
IO.read(rdp_doc_path).each_line { |l| debug(
|
198
|
+
IO.read(rdp_doc_path).each_line { |l| debug(l.chomp.to_s) }
|
199
199
|
debug("------------")
|
200
200
|
end
|
201
201
|
end
|
@@ -251,14 +251,14 @@ module Kitchen
|
|
251
251
|
error_regexp = /<S S=\"Error\">/
|
252
252
|
|
253
253
|
if error_regexp.match(stderr)
|
254
|
-
stderr
|
255
|
-
split(error_regexp)[1..-2]
|
256
|
-
map! { |line| line.sub(/_x000D__x000A_<\/S>/, "").rstrip }
|
257
|
-
each { |line| logger.warn(line) }
|
254
|
+
stderr
|
255
|
+
.split(error_regexp)[1..-2]
|
256
|
+
.map! { |line| line.sub(/_x000D__x000A_<\/S>/, "").rstrip }
|
257
|
+
.each { |line| logger.warn(line) }
|
258
258
|
else
|
259
|
-
stderr
|
260
|
-
split("\r\n")
|
261
|
-
each { |line| logger.warn(line) }
|
259
|
+
stderr
|
260
|
+
.split("\r\n")
|
261
|
+
.each { |line| logger.warn(line) }
|
262
262
|
end
|
263
263
|
end
|
264
264
|
|
@@ -269,9 +269,9 @@ module Kitchen
|
|
269
269
|
# @return [LoginCommand] a login command
|
270
270
|
# @api private
|
271
271
|
def login_command_for_linux
|
272
|
-
args = %W
|
273
|
-
args += %W
|
274
|
-
args += %W
|
272
|
+
args = %W{-u #{options[:user]}}
|
273
|
+
args += %W{-p #{options[:password]}} if options.key?(:password)
|
274
|
+
args += %W{#{URI.parse(options[:endpoint]).host}:#{rdp_port}}
|
275
275
|
|
276
276
|
LoginCommand.new("rdesktop", args)
|
277
277
|
end
|
@@ -281,7 +281,7 @@ module Kitchen
|
|
281
281
|
# @return [LoginCommand] a login command
|
282
282
|
# @api private
|
283
283
|
def login_command_for_mac
|
284
|
-
create_rdp_doc(:
|
284
|
+
create_rdp_doc(mac: true)
|
285
285
|
|
286
286
|
LoginCommand.new("open", rdp_doc_path)
|
287
287
|
end
|
@@ -333,8 +333,8 @@ module Kitchen
|
|
333
333
|
def connection(retry_options = {})
|
334
334
|
@connection ||= begin
|
335
335
|
opts = {
|
336
|
-
:
|
337
|
-
:
|
336
|
+
retry_limit: connection_retries.to_i,
|
337
|
+
retry_delay: connection_retry_sleep.to_i,
|
338
338
|
}.merge(retry_options)
|
339
339
|
|
340
340
|
::WinRM::Connection.new(options.merge(opts)).tap do |conn|
|
@@ -369,20 +369,20 @@ module Kitchen
|
|
369
369
|
elevated_password = data[:elevated_password] if data.key?(:elevated_password)
|
370
370
|
|
371
371
|
opts = {
|
372
|
-
:
|
373
|
-
:
|
374
|
-
:
|
375
|
-
:
|
376
|
-
:
|
377
|
-
:
|
378
|
-
:
|
379
|
-
:
|
380
|
-
:
|
381
|
-
:
|
382
|
-
:
|
383
|
-
:
|
384
|
-
:
|
385
|
-
:
|
372
|
+
instance_name: instance.name,
|
373
|
+
kitchen_root: data[:kitchen_root],
|
374
|
+
logger: logger,
|
375
|
+
endpoint: data[:endpoint_template] % data,
|
376
|
+
user: data[:username],
|
377
|
+
password: data[:password],
|
378
|
+
rdp_port: data[:rdp_port],
|
379
|
+
connection_retries: data[:connection_retries],
|
380
|
+
connection_retry_sleep: data[:connection_retry_sleep],
|
381
|
+
max_wait_until_ready: data[:max_wait_until_ready],
|
382
|
+
transport: data[:winrm_transport],
|
383
|
+
elevated: data[:elevated],
|
384
|
+
elevated_username: data[:elevated_username] || data[:username],
|
385
|
+
elevated_password: elevated_password,
|
386
386
|
}
|
387
387
|
opts.merge!(additional_transport_args(opts[:transport]))
|
388
388
|
opts
|
@@ -392,14 +392,14 @@ module Kitchen
|
|
392
392
|
case transport_type.to_sym
|
393
393
|
when :ssl, :negotiate
|
394
394
|
{
|
395
|
-
:
|
396
|
-
:
|
397
|
-
:
|
395
|
+
no_ssl_peer_verification: true,
|
396
|
+
disable_sspi: false,
|
397
|
+
basic_auth_only: false,
|
398
398
|
}
|
399
399
|
when :plaintext
|
400
400
|
{
|
401
|
-
:
|
402
|
-
:
|
401
|
+
disable_sspi: true,
|
402
|
+
basic_auth_only: true,
|
403
403
|
}
|
404
404
|
else
|
405
405
|
{}
|
@@ -443,10 +443,10 @@ module Kitchen
|
|
443
443
|
end
|
444
444
|
rescue LoadError => e
|
445
445
|
message = fail_to_load_gem_message(gem_name,
|
446
|
-
|
446
|
+
spec_version)
|
447
447
|
logger.fatal(message)
|
448
448
|
raise UserError,
|
449
|
-
|
449
|
+
"Could not load or activate #{gem_name}. (#{e.message})"
|
450
450
|
end
|
451
451
|
|
452
452
|
def fail_to_load_gem_message(name, version = nil)
|
@@ -480,7 +480,8 @@ module Kitchen
|
|
480
480
|
end
|
481
481
|
|
482
482
|
def silence_warnings
|
483
|
-
old_verbose
|
483
|
+
old_verbose = $VERBOSE
|
484
|
+
$VERBOSE = nil
|
484
485
|
yield
|
485
486
|
ensure
|
486
487
|
$VERBOSE = old_verbose
|
data/lib/kitchen/util.rb
CHANGED
@@ -17,13 +17,11 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
|
19
19
|
module Kitchen
|
20
|
-
|
21
20
|
# Stateless utility methods used in different contexts. Essentially a mini
|
22
21
|
# PassiveSupport library.
|
23
22
|
#
|
24
23
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
25
24
|
module Util
|
26
|
-
|
27
25
|
# Returns the standard library Logger level constants for a given symbol
|
28
26
|
# representation.
|
29
27
|
#
|
@@ -140,7 +138,7 @@ module Kitchen
|
|
140
138
|
# @return [String] a string representation of useful helper functions
|
141
139
|
def self.shell_helpers
|
142
140
|
IO.read(File.join(
|
143
|
-
|
141
|
+
File.dirname(__FILE__), %w{.. .. support download_helpers.sh}
|
144
142
|
))
|
145
143
|
end
|
146
144
|
end
|
data/lib/kitchen/verifier.rb
CHANGED
@@ -21,13 +21,11 @@ require "thor/util"
|
|
21
21
|
require "kitchen/errors"
|
22
22
|
|
23
23
|
module Kitchen
|
24
|
-
|
25
24
|
# A verifier is responsible for running tests post-converge to confirm that
|
26
25
|
# the instance is in a known/consistent state.
|
27
26
|
#
|
28
27
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
29
28
|
module Verifier
|
30
|
-
|
31
29
|
# Default verifier to use
|
32
30
|
DEFAULT_PLUGIN = "busser".freeze
|
33
31
|
|
@@ -47,9 +45,9 @@ module Kitchen
|
|
47
45
|
object
|
48
46
|
rescue LoadError, NameError
|
49
47
|
raise ClientError,
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
"Could not load the '#{plugin}' verifier from the load path." \
|
49
|
+
" Please ensure that your transport is installed as a gem or" \
|
50
|
+
" included in your Gemfile if using Bundler."
|
53
51
|
end
|
54
52
|
end
|
55
53
|
end
|
@@ -21,14 +21,11 @@ require "kitchen/configurable"
|
|
21
21
|
require "kitchen/logging"
|
22
22
|
|
23
23
|
module Kitchen
|
24
|
-
|
25
24
|
module Verifier
|
26
|
-
|
27
25
|
# Base class for a verifier.
|
28
26
|
#
|
29
27
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
30
28
|
class Base
|
31
|
-
|
32
29
|
include Configurable
|
33
30
|
include Logging
|
34
31
|
|
@@ -37,7 +34,7 @@ module Kitchen
|
|
37
34
|
default_config :ftp_proxy, nil
|
38
35
|
|
39
36
|
default_config :root_path do |verifier|
|
40
|
-
verifier.windows_os? ?
|
37
|
+
verifier.windows_os? ? '$env:TEMP\\verifier' : "/tmp/verifier"
|
41
38
|
end
|
42
39
|
|
43
40
|
default_config :sudo do |verifier|
|
@@ -202,7 +199,7 @@ module Kitchen
|
|
202
199
|
def shell_code_from_file(vars, file)
|
203
200
|
src_file = File.join(
|
204
201
|
File.dirname(__FILE__),
|
205
|
-
%w
|
202
|
+
%w{.. .. .. support},
|
206
203
|
file + (powershell_shell? ? ".ps1" : ".sh")
|
207
204
|
)
|
208
205
|
|
@@ -22,31 +22,28 @@ require "digest"
|
|
22
22
|
require "kitchen/verifier/base"
|
23
23
|
|
24
24
|
module Kitchen
|
25
|
-
|
26
25
|
module Verifier
|
27
|
-
|
28
26
|
# Command string generator to interface with Busser. The commands that are
|
29
27
|
# generated are safe to pass to an SSH command or as an unix command
|
30
28
|
# argument (escaped in single quotes).
|
31
29
|
#
|
32
30
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
33
31
|
class Busser < Kitchen::Verifier::Base
|
34
|
-
|
35
32
|
kitchen_verifier_api_version 1
|
36
33
|
|
37
34
|
plugin_version Kitchen::VERSION
|
38
35
|
|
39
36
|
default_config :busser_bin do |verifier|
|
40
|
-
verifier
|
41
|
-
remote_path_join(%W
|
42
|
-
tap { |path| path.concat(".bat") if verifier.windows_os? }
|
37
|
+
verifier
|
38
|
+
.remote_path_join(%W{#{verifier[:root_path]} bin busser})
|
39
|
+
.tap { |path| path.concat(".bat") if verifier.windows_os? }
|
43
40
|
end
|
44
41
|
|
45
42
|
default_config :ruby_bindir do |verifier|
|
46
43
|
if verifier.windows_os?
|
47
|
-
|
44
|
+
'$env:systemdrive\\opscode\\chef\\embedded\\bin'
|
48
45
|
else
|
49
|
-
verifier.remote_path_join(%W
|
46
|
+
verifier.remote_path_join(%W{#{verifier[:chef_omnibus_root]} embedded bin})
|
50
47
|
end
|
51
48
|
end
|
52
49
|
|
@@ -73,8 +70,8 @@ module Kitchen
|
|
73
70
|
def init_command
|
74
71
|
return if local_suite_files.empty?
|
75
72
|
|
76
|
-
cmd = sudo(config[:busser_bin]).dup
|
77
|
-
|
73
|
+
cmd = sudo(config[:busser_bin]).dup
|
74
|
+
.tap { |str| str.insert(0, "& ") if powershell_shell? }
|
78
75
|
|
79
76
|
prefix_command(wrap_shell_code(Util.outdent!(<<-CMD)))
|
80
77
|
#{busser_env}
|
@@ -96,8 +93,8 @@ module Kitchen
|
|
96
93
|
def run_command
|
97
94
|
return if local_suite_files.empty?
|
98
95
|
|
99
|
-
cmd = sudo(config[:busser_bin]).dup
|
100
|
-
|
96
|
+
cmd = sudo(config[:busser_bin]).dup
|
97
|
+
.tap { |str| str.insert(0, "& ") if powershell_shell? }
|
101
98
|
|
102
99
|
prefix_command(wrap_shell_code(Util.outdent!(<<-CMD)))
|
103
100
|
#{busser_env}
|
@@ -150,9 +147,9 @@ module Kitchen
|
|
150
147
|
shell_env_var("BUSSER_ROOT", root),
|
151
148
|
shell_env_var("GEM_HOME", gem_home),
|
152
149
|
shell_env_var("GEM_PATH", gem_path),
|
153
|
-
shell_env_var("GEM_CACHE", gem_cache)
|
154
|
-
].join("\n")
|
155
|
-
tap { |str| str.insert(0, reload_ps1_path) if windows_os? }
|
150
|
+
shell_env_var("GEM_CACHE", gem_cache),
|
151
|
+
].join("\n")
|
152
|
+
.tap { |str| str.insert(0, reload_ps1_path) if windows_os? }
|
156
153
|
end
|
157
154
|
|
158
155
|
# Determines whether or not a local workstation file exists under a
|
@@ -172,7 +169,10 @@ module Kitchen
|
|
172
169
|
# @api private
|
173
170
|
def gem_install_args
|
174
171
|
gem, version = config[:version].split("@")
|
175
|
-
|
172
|
+
if gem =~ /^\d+\.\d+\.\d+/
|
173
|
+
version = gem
|
174
|
+
gem = "busser"
|
175
|
+
end
|
176
176
|
|
177
177
|
root = config[:root_path]
|
178
178
|
gem_bin = remote_path_join(root, "bin")
|
@@ -198,8 +198,8 @@ module Kitchen
|
|
198
198
|
end
|
199
199
|
|
200
200
|
def install_command_vars
|
201
|
-
ruby = remote_path_join(config[:ruby_bindir], "ruby")
|
202
|
-
|
201
|
+
ruby = remote_path_join(config[:ruby_bindir], "ruby")
|
202
|
+
.tap { |path| path.concat(".exe") if windows_os? }
|
203
203
|
gem = remote_path_join(config[:ruby_bindir], "gem")
|
204
204
|
|
205
205
|
[
|
@@ -209,7 +209,7 @@ module Kitchen
|
|
209
209
|
shell_var("version", config[:version]),
|
210
210
|
shell_var("gem_install_args", gem_install_args),
|
211
211
|
shell_var("busser", sudo(config[:busser_bin])),
|
212
|
-
shell_var("plugins", plugins.join(" "))
|
212
|
+
shell_var("plugins", plugins.join(" ")),
|
213
213
|
].join("\n")
|
214
214
|
end
|
215
215
|
|
@@ -234,11 +234,11 @@ module Kitchen
|
|
234
234
|
# plugin gem names
|
235
235
|
# @api private
|
236
236
|
def plugins
|
237
|
-
non_suite_dirs = %w
|
237
|
+
non_suite_dirs = %w{data data_bags environments nodes roles}
|
238
238
|
glob = File.join(config[:test_base_path], config[:suite_name], "*")
|
239
|
-
Dir.glob(glob).reject
|
239
|
+
Dir.glob(glob).reject do |d|
|
240
240
|
!File.directory?(d) || non_suite_dirs.include?(File.basename(d))
|
241
|
-
|
241
|
+
end.map { |d| "busser-#{File.basename(d)}" }.sort.uniq
|
242
242
|
end
|
243
243
|
|
244
244
|
# Copies all common testing helper files into the suites directory in
|
@@ -251,7 +251,7 @@ module Kitchen
|
|
251
251
|
helper_files.each do |src|
|
252
252
|
dest = File.join(sandbox_suites_dir, src.sub("#{base}/", ""))
|
253
253
|
FileUtils.mkdir_p(File.dirname(dest))
|
254
|
-
FileUtils.cp(src, dest, :
|
254
|
+
FileUtils.cp(src, dest, preserve: true)
|
255
255
|
end
|
256
256
|
end
|
257
257
|
|
@@ -264,7 +264,7 @@ module Kitchen
|
|
264
264
|
local_suite_files.each do |src|
|
265
265
|
dest = File.join(sandbox_suites_dir, src.sub("#{base}/", ""))
|
266
266
|
FileUtils.mkdir_p(File.dirname(dest))
|
267
|
-
FileUtils.cp(src, dest, :
|
267
|
+
FileUtils.cp(src, dest, preserve: true)
|
268
268
|
end
|
269
269
|
end
|
270
270
|
|
@@ -19,9 +19,7 @@
|
|
19
19
|
require "kitchen/verifier/base"
|
20
20
|
|
21
21
|
module Kitchen
|
22
|
-
|
23
22
|
module Verifier
|
24
|
-
|
25
23
|
# Dummy verifier for Kitchen. This verifier does nothing but report what
|
26
24
|
# would happen if this verifier did anything of consequence. As a result
|
27
25
|
# it may be a useful verifier to use when debugging or developing new
|
@@ -29,7 +27,6 @@ module Kitchen
|
|
29
27
|
#
|
30
28
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
31
29
|
class Dummy < Kitchen::Verifier::Base
|
32
|
-
|
33
30
|
kitchen_verifier_api_version 1
|
34
31
|
|
35
32
|
plugin_version Kitchen::VERSION
|
@@ -19,9 +19,7 @@
|
|
19
19
|
require "kitchen/verifier/base"
|
20
20
|
|
21
21
|
module Kitchen
|
22
|
-
|
23
22
|
module Verifier
|
24
|
-
|
25
23
|
# Shell verifier for Kitchen. This verifier just execute shell command from local.
|
26
24
|
#
|
27
25
|
# @author SAWANOBORI Yukihiko (<sawanoboriyu@higanworks.com>)
|
@@ -87,7 +85,7 @@ module Kitchen
|
|
87
85
|
end
|
88
86
|
|
89
87
|
def merge_state_to_env(state)
|
90
|
-
env_state = { :
|
88
|
+
env_state = { environment: {} }
|
91
89
|
env_state[:environment]["KITCHEN_INSTANCE"] = instance.name
|
92
90
|
env_state[:environment]["KITCHEN_PLATFORM"] = instance.platform.name
|
93
91
|
env_state[:environment]["KITCHEN_SUITE"] = instance.suite.name
|
data/lib/kitchen/version.rb
CHANGED
@@ -14,7 +14,6 @@
|
|
14
14
|
# Source:: http://gist.github.com/gists/6391/
|
15
15
|
#
|
16
16
|
module HashRecursiveMerge
|
17
|
-
|
18
17
|
#
|
19
18
|
# Recursive version of Hash#merge!
|
20
19
|
#
|
@@ -74,7 +73,6 @@ module HashRecursiveMerge
|
|
74
73
|
r[key] = oldval.class == self.class ? oldval.rmerge(newval) : newval
|
75
74
|
end
|
76
75
|
end
|
77
|
-
|
78
76
|
end
|
79
77
|
|
80
78
|
class Hash
|
@@ -24,11 +24,9 @@ require "securerandom"
|
|
24
24
|
require "kitchen/base64_stream"
|
25
25
|
|
26
26
|
describe Kitchen::Base64Stream do
|
27
|
-
|
28
|
-
SHORT_BODIES = %w[you test wakkawakkawakka]
|
27
|
+
SHORT_BODIES = %w{you test wakkawakkawakka}.freeze
|
29
28
|
|
30
29
|
describe ".strict_encode" do
|
31
|
-
|
32
30
|
SHORT_BODIES.each do |body|
|
33
31
|
it "encodes short payload ('#{body}') from input IO to output IO" do
|
34
32
|
output = StringIO.new("", "wb")
|
@@ -41,7 +39,7 @@ describe Kitchen::Base64Stream do
|
|
41
39
|
end
|
42
40
|
|
43
41
|
it "encodes a large payload from input IO to output IO" do
|
44
|
-
body = SecureRandom.random_bytes(
|
42
|
+
body = SecureRandom.random_bytes(1_048_576 * 8)
|
45
43
|
output = StringIO.new("", "wb")
|
46
44
|
StringIO.open(body) do |input|
|
47
45
|
Kitchen::Base64Stream.strict_encode(input, output)
|
@@ -52,7 +50,6 @@ describe Kitchen::Base64Stream do
|
|
52
50
|
end
|
53
51
|
|
54
52
|
describe ".strict_decode" do
|
55
|
-
|
56
53
|
SHORT_BODIES.map { |b| Base64.strict_encode64(b) }.each do |body|
|
57
54
|
it "decodes short payload ('#{body}') from input IO to output IO" do
|
58
55
|
output = StringIO.new("", "wb")
|
@@ -65,7 +62,7 @@ describe Kitchen::Base64Stream do
|
|
65
62
|
end
|
66
63
|
|
67
64
|
it "decodes a large payload from input IO to output IO" do
|
68
|
-
body = Base64.strict_encode64(SecureRandom.hex(
|
65
|
+
body = Base64.strict_encode64(SecureRandom.hex(1_048_576 * 8))
|
69
66
|
output = StringIO.new("", "wb")
|
70
67
|
StringIO.open(body) do |input|
|
71
68
|
Kitchen::Base64Stream.strict_decode(input, output)
|