test-kitchen 3.9.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +5 -4
- data/lib/kitchen/collection.rb +1 -1
- data/lib/kitchen/configurable.rb +4 -4
- data/lib/kitchen/data_munger.rb +7 -9
- data/lib/kitchen/driver/proxy.rb +11 -6
- data/lib/kitchen/generator/init.rb +1 -1
- data/lib/kitchen/instance.rb +6 -103
- data/lib/kitchen/lazy_hash.rb +1 -1
- data/lib/kitchen/logger.rb +1 -1
- data/lib/kitchen/metadata_chopper.rb +1 -1
- data/lib/kitchen/provisioner/base.rb +0 -18
- data/lib/kitchen/provisioner.rb +1 -2
- data/lib/kitchen/transport/winrm.rb +8 -8
- data/lib/kitchen/util.rb +1 -1
- data/lib/kitchen/version.rb +1 -1
- data/lib/kitchen.rb +0 -2
- data/lib/vendor/hash_recursive_merge.rb +2 -2
- data/templates/driver/driver.rb.erb +1 -1
- data/test-kitchen.gemspec +4 -6
- metadata +26 -39
- data/lib/kitchen/driver/ssh_base.rb +0 -346
- data/lib/kitchen/provisioner/chef/berkshelf.rb +0 -116
- data/lib/kitchen/provisioner/chef/common_sandbox.rb +0 -352
- data/lib/kitchen/provisioner/chef/policyfile.rb +0 -173
- data/lib/kitchen/provisioner/chef_apply.rb +0 -121
- data/lib/kitchen/provisioner/chef_base.rb +0 -723
- data/lib/kitchen/provisioner/chef_infra.rb +0 -167
- data/lib/kitchen/provisioner/chef_solo.rb +0 -82
- data/lib/kitchen/provisioner/chef_target.rb +0 -130
- data/lib/kitchen/provisioner/chef_zero.rb +0 -12
- data/lib/kitchen/ssh.rb +0 -296
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80afb157c2779c990f0194d9711cf3a35d949a1916515fbaf722056306314a6d
|
|
4
|
+
data.tar.gz: d06ecf45e9c7c2288a772c2202505f2d5cdd722b357fb7fa9cf0433e06eec725
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 323e94d69dfadaa75a6214b504f47c7114227ee5ce98ae5dcdd64f9961945caf8212d9ef015a778ace055b6b63eb6fa5917dc072aa7f977a9da2a734ccfa66cd
|
|
7
|
+
data.tar.gz: fcf0647d42a9482a9da0656ed68b90b6cc17eb8a14cd999a6316b3be4a2cc02796a3ef4a0ccf7ee8938a0cd92bb8910efb7243342f6677f63b624f8b9756cb64
|
data/Gemfile
CHANGED
|
@@ -6,19 +6,20 @@ group :test do
|
|
|
6
6
|
gem "rake"
|
|
7
7
|
gem "rb-readline"
|
|
8
8
|
gem "aruba", ">= 0.11", "< 3.0"
|
|
9
|
-
gem "chef-cli"
|
|
10
9
|
gem "countloc", "~> 0.4"
|
|
11
10
|
gem "cucumber", ">= 9.2", "< 11"
|
|
12
11
|
gem "fakefs", "~> 3.0"
|
|
13
|
-
gem "kitchen-inspec"
|
|
14
12
|
gem "maruku", "~> 0.7"
|
|
15
|
-
gem "minitest", "~>
|
|
16
|
-
gem "mocha", "~>
|
|
13
|
+
gem "minitest", "~> 6.0", "< 6.1"
|
|
14
|
+
gem "mocha", "~> 3.0"
|
|
17
15
|
end
|
|
18
16
|
|
|
19
17
|
group :integration do
|
|
18
|
+
gem "chef-cli"
|
|
20
19
|
gem "kitchen-dokken"
|
|
21
20
|
gem "kitchen-vagrant"
|
|
21
|
+
gem "kitchen-inspec"
|
|
22
|
+
gem "kitchen-omnibus-chef", ">= 1.0"
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
group :linting do
|
data/lib/kitchen/collection.rb
CHANGED
data/lib/kitchen/configurable.rb
CHANGED
|
@@ -180,7 +180,7 @@ module Kitchen
|
|
|
180
180
|
|
|
181
181
|
private
|
|
182
182
|
|
|
183
|
-
# @return [
|
|
183
|
+
# @return [LazyHash] a configuration hash
|
|
184
184
|
# @api private
|
|
185
185
|
attr_reader :config
|
|
186
186
|
|
|
@@ -472,7 +472,7 @@ module Kitchen
|
|
|
472
472
|
# easier to debug and diagnose.
|
|
473
473
|
#
|
|
474
474
|
# Note that the file path expansion is only intended for paths on the
|
|
475
|
-
# local workstation
|
|
475
|
+
# local workstation invoking the Test Kitchen code.
|
|
476
476
|
#
|
|
477
477
|
# @example the default usage
|
|
478
478
|
#
|
|
@@ -598,8 +598,8 @@ module Kitchen
|
|
|
598
598
|
end
|
|
599
599
|
end
|
|
600
600
|
|
|
601
|
-
# @return [Hash] a hash of attribute keys and
|
|
602
|
-
# which has been merged with any superclass
|
|
601
|
+
# @return [Hash] a hash of attribute keys and validation callable blocks
|
|
602
|
+
# which has been merged with any superclass validations
|
|
603
603
|
# @api private
|
|
604
604
|
def validations
|
|
605
605
|
@validations ||= {}.merge(super_validations)
|
data/lib/kitchen/data_munger.rb
CHANGED
|
@@ -231,7 +231,7 @@ module Kitchen
|
|
|
231
231
|
# platforms, or the like, just a vanilla hash.
|
|
232
232
|
#
|
|
233
233
|
# @param root [Hash] a hash to use as the root of the conversion
|
|
234
|
-
# @deprecated The following configuration
|
|
234
|
+
# @deprecated The following configuration hashes should no longer be
|
|
235
235
|
# created in a Test Kitchen hash: `:busser`. Use a `:verifier` hash
|
|
236
236
|
# block in their place.
|
|
237
237
|
# @api private
|
|
@@ -378,7 +378,7 @@ module Kitchen
|
|
|
378
378
|
#
|
|
379
379
|
# @param root [Hash] a hash to use as the root of the conversion
|
|
380
380
|
# @deprecated The following configuration hashes should no longer be
|
|
381
|
-
# created in a Test
|
|
381
|
+
# created in a Test Kitchen hash: [`:driver_plugin`, `:driver_config`].
|
|
382
382
|
# Use a `:driver` hash block in their place.
|
|
383
383
|
# @api private
|
|
384
384
|
def convert_legacy_driver_format_at!(root)
|
|
@@ -396,9 +396,7 @@ module Kitchen
|
|
|
396
396
|
end
|
|
397
397
|
|
|
398
398
|
# Copies `:http_proxy` and `:https_proxy` values in a driver hash into the
|
|
399
|
-
# provisioner and verifier hashes.
|
|
400
|
-
# Drivers (those inheriting directly from `SSHBase`), the original
|
|
401
|
-
# values are maintained in the driver hash.
|
|
399
|
+
# provisioner and verifier hashes.
|
|
402
400
|
#
|
|
403
401
|
# This method converts the following:
|
|
404
402
|
#
|
|
@@ -589,9 +587,9 @@ module Kitchen
|
|
|
589
587
|
end
|
|
590
588
|
|
|
591
589
|
# Destructively moves a `:require_chef_omnibus` key/value pair from a
|
|
592
|
-
# `:driver` hash block to a `:provisioner` hash block in the first
|
|
590
|
+
# `:driver` hash block to a `:provisioner` hash block in the first level
|
|
593
591
|
# depth of a hash. This method has no knowledge of suites, platforms, or
|
|
594
|
-
# the like, just a vanilla
|
|
592
|
+
# the like, just a vanilla hash.
|
|
595
593
|
#
|
|
596
594
|
# @param root [Hash] a hash to use as the root of the conversion
|
|
597
595
|
# @deprecated The `:require_chef_omnibus` key/value pair should no longer
|
|
@@ -753,9 +751,9 @@ module Kitchen
|
|
|
753
751
|
# takes an array value and transforms it into a hash with a bucket name
|
|
754
752
|
# containing the original Array. This way semantic Hash merging will do
|
|
755
753
|
# its thing and another process can collapse the hash into a flat array
|
|
756
|
-
# afterwards, given a strategy (like use the array
|
|
754
|
+
# afterwards, given a strategy (like use the array segment from one
|
|
757
755
|
# bucket first, then another one second). To anyone who made it this far,
|
|
758
|
-
# Fletcher
|
|
756
|
+
# Fletcher apologizes.
|
|
759
757
|
#
|
|
760
758
|
# @param root [Hash] a hash to use as the root of the conversion
|
|
761
759
|
# @param key [Symbol] a key in the root hash that, if exists, has its
|
data/lib/kitchen/driver/proxy.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# limitations under the License.
|
|
12
12
|
#
|
|
13
13
|
|
|
14
|
-
require_relative "
|
|
14
|
+
require_relative "base"
|
|
15
15
|
require_relative "../version"
|
|
16
16
|
|
|
17
17
|
module Kitchen
|
|
@@ -23,7 +23,7 @@ module Kitchen
|
|
|
23
23
|
# the driver was created.
|
|
24
24
|
#
|
|
25
25
|
# @author Seth Chisamore <schisamo@opscode.com>
|
|
26
|
-
class Proxy < Kitchen::Driver::
|
|
26
|
+
class Proxy < Kitchen::Driver::Base
|
|
27
27
|
plugin_version Kitchen::VERSION
|
|
28
28
|
|
|
29
29
|
required_config :host
|
|
@@ -33,8 +33,11 @@ module Kitchen
|
|
|
33
33
|
|
|
34
34
|
# (see Base#create)
|
|
35
35
|
def create(state)
|
|
36
|
-
|
|
36
|
+
super
|
|
37
37
|
state[:hostname] = config[:host]
|
|
38
|
+
state[:port] = config[:port] if config[:port]
|
|
39
|
+
state[:username] = config[:username] if config[:username]
|
|
40
|
+
state[:password] = config[:password] if config[:password]
|
|
38
41
|
reset_instance(state)
|
|
39
42
|
end
|
|
40
43
|
|
|
@@ -48,15 +51,17 @@ module Kitchen
|
|
|
48
51
|
|
|
49
52
|
private
|
|
50
53
|
|
|
51
|
-
# Resets the non-Kitchen managed instance
|
|
52
|
-
# over
|
|
54
|
+
# Resets the non-Kitchen managed instance by issuing a command
|
|
55
|
+
# over the transport.
|
|
53
56
|
#
|
|
54
57
|
# @param state [Hash] the state hash
|
|
55
58
|
# @api private
|
|
56
59
|
def reset_instance(state)
|
|
57
60
|
if (cmd = config[:reset_command])
|
|
58
61
|
info("Resetting instance state with command: #{cmd}")
|
|
59
|
-
|
|
62
|
+
instance.transport.connection(state) do |conn|
|
|
63
|
+
conn.execute(cmd)
|
|
64
|
+
end
|
|
60
65
|
end
|
|
61
66
|
end
|
|
62
67
|
end
|
data/lib/kitchen/instance.rb
CHANGED
|
@@ -210,11 +210,7 @@ module Kitchen
|
|
|
210
210
|
raise UserError, "Instance #{to_str} has not yet been created"
|
|
211
211
|
end
|
|
212
212
|
|
|
213
|
-
lc =
|
|
214
|
-
legacy_ssh_base_login(state)
|
|
215
|
-
else
|
|
216
|
-
transport.connection(state).login_command
|
|
217
|
-
end
|
|
213
|
+
lc = transport.connection(state).login_command
|
|
218
214
|
|
|
219
215
|
debug(%{Login command: #{lc.command} #{lc.arguments.join(" ")} } \
|
|
220
216
|
"(Options: #{lc.options})")
|
|
@@ -412,13 +408,8 @@ module Kitchen
|
|
|
412
408
|
def converge_action
|
|
413
409
|
banner "Converging #{to_str}..."
|
|
414
410
|
elapsed = action(:converge) do |state|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
legacy_ssh_base_converge(state)
|
|
418
|
-
else
|
|
419
|
-
provisioner.check_license
|
|
420
|
-
provisioner.call(state)
|
|
421
|
-
end
|
|
411
|
+
provisioner.check_license
|
|
412
|
+
provisioner.call(state)
|
|
422
413
|
end
|
|
423
414
|
info("Finished converging #{to_str} #{Util.duration(elapsed.real)}.")
|
|
424
415
|
self
|
|
@@ -432,26 +423,11 @@ module Kitchen
|
|
|
432
423
|
def setup_action
|
|
433
424
|
banner "Setting up #{to_str}..."
|
|
434
425
|
elapsed = action(:setup) do |state|
|
|
435
|
-
legacy_ssh_base_setup(state) if legacy_ssh_base_driver?
|
|
436
426
|
end
|
|
437
427
|
info("Finished setting up #{to_str} #{Util.duration(elapsed.real)}.")
|
|
438
428
|
self
|
|
439
429
|
end
|
|
440
430
|
|
|
441
|
-
# returns true, if the verifier is busser
|
|
442
|
-
def verifier_busser?(verifier)
|
|
443
|
-
!defined?(Kitchen::Verifier::Busser).nil? && verifier.is_a?(Kitchen::Verifier::Busser)
|
|
444
|
-
end
|
|
445
|
-
|
|
446
|
-
# returns true, if the verifier is dummy
|
|
447
|
-
def verifier_dummy?(verifier)
|
|
448
|
-
!defined?(Kitchen::Verifier::Dummy).nil? && verifier.is_a?(Kitchen::Verifier::Dummy)
|
|
449
|
-
end
|
|
450
|
-
|
|
451
|
-
def use_legacy_ssh_verifier?(verifier)
|
|
452
|
-
verifier_busser?(verifier) || verifier_dummy?(verifier)
|
|
453
|
-
end
|
|
454
|
-
|
|
455
431
|
# Perform the verify action.
|
|
456
432
|
#
|
|
457
433
|
# @see Driver::Base#verify
|
|
@@ -460,15 +436,7 @@ module Kitchen
|
|
|
460
436
|
def verify_action
|
|
461
437
|
banner "Verifying #{to_str}..."
|
|
462
438
|
elapsed = action(:verify) do |state|
|
|
463
|
-
|
|
464
|
-
if legacy_ssh_base_driver? && use_legacy_ssh_verifier?(verifier)
|
|
465
|
-
legacy_ssh_base_verify(state)
|
|
466
|
-
elsif legacy_ssh_base_driver?
|
|
467
|
-
# read ssh options from legacy driver
|
|
468
|
-
verifier.call(driver.legacy_state(state))
|
|
469
|
-
else
|
|
470
|
-
verifier.call(state)
|
|
471
|
-
end
|
|
439
|
+
verifier.call(state)
|
|
472
440
|
end
|
|
473
441
|
info("Finished verifying #{to_str} #{Util.duration(elapsed.real)}.")
|
|
474
442
|
self
|
|
@@ -488,7 +456,7 @@ module Kitchen
|
|
|
488
456
|
# @param verb [Symbol] the action to be performed
|
|
489
457
|
# @param output_verb [String] a verb representing the action, suitable for
|
|
490
458
|
# use in output logging
|
|
491
|
-
# @yield perform optional work just after action has
|
|
459
|
+
# @yield perform optional work just after action has completed
|
|
492
460
|
# @return [self] this instance, used to chain actions
|
|
493
461
|
# @api private
|
|
494
462
|
def perform_action(verb, output_verb)
|
|
@@ -617,71 +585,6 @@ module Kitchen
|
|
|
617
585
|
"#{what.capitalize} failed on instance #{to_str}."
|
|
618
586
|
end
|
|
619
587
|
|
|
620
|
-
# Invokes `Driver#converge` on a legacy Driver, which inherits from
|
|
621
|
-
# `Kitchen::Driver::SSHBase`.
|
|
622
|
-
#
|
|
623
|
-
# @param state [Hash] mutable instance state
|
|
624
|
-
# @deprecated When legacy Driver::SSHBase support is removed, the
|
|
625
|
-
# `#converge` method will no longer be called on the Driver.
|
|
626
|
-
# @api private
|
|
627
|
-
def legacy_ssh_base_converge(state)
|
|
628
|
-
warn("Running legacy converge for '#{driver.name}' Driver")
|
|
629
|
-
# TODO: Document upgrade path and provide link
|
|
630
|
-
# warn("Driver authors: please read http://example.com for more details.")
|
|
631
|
-
driver.converge(state)
|
|
632
|
-
end
|
|
633
|
-
|
|
634
|
-
# @return [TrueClass,FalseClass] whether or not the Driver inherits from
|
|
635
|
-
# `Kitchen::Driver::SSHBase`
|
|
636
|
-
# @deprecated When legacy Driver::SSHBase support is removed, the
|
|
637
|
-
# `#converge` method will no longer be called on the Driver.
|
|
638
|
-
# @api private
|
|
639
|
-
def legacy_ssh_base_driver?
|
|
640
|
-
driver.class < Kitchen::Driver::SSHBase
|
|
641
|
-
end
|
|
642
|
-
|
|
643
|
-
# Invokes `Driver#login_command` on a legacy Driver, which inherits from
|
|
644
|
-
# `Kitchen::Driver::SSHBase`.
|
|
645
|
-
#
|
|
646
|
-
# @param state [Hash] mutable instance state
|
|
647
|
-
# @deprecated When legacy Driver::SSHBase support is removed, the
|
|
648
|
-
# `#login_command` method will no longer be called on the Driver.
|
|
649
|
-
# @api private
|
|
650
|
-
def legacy_ssh_base_login(state)
|
|
651
|
-
warn("Running legacy login for '#{driver.name}' Driver")
|
|
652
|
-
# TODO: Document upgrade path and provide link
|
|
653
|
-
# warn("Driver authors: please read http://example.com for more details.")
|
|
654
|
-
driver.login_command(state)
|
|
655
|
-
end
|
|
656
|
-
|
|
657
|
-
# Invokes `Driver#setup` on a legacy Driver, which inherits from
|
|
658
|
-
# `Kitchen::Driver::SSHBase`.
|
|
659
|
-
#
|
|
660
|
-
# @param state [Hash] mutable instance state
|
|
661
|
-
# @deprecated When legacy Driver::SSHBase support is removed, the
|
|
662
|
-
# `#setup` method will no longer be called on the Driver.
|
|
663
|
-
# @api private
|
|
664
|
-
def legacy_ssh_base_setup(state)
|
|
665
|
-
warn("Running legacy setup for '#{driver.name}' Driver")
|
|
666
|
-
# TODO: Document upgrade path and provide link
|
|
667
|
-
# warn("Driver authors: please read http://example.com for more details.")
|
|
668
|
-
driver.setup(state)
|
|
669
|
-
end
|
|
670
|
-
|
|
671
|
-
# Invokes `Driver#verify` on a legacy Driver, which inherits from
|
|
672
|
-
# `Kitchen::Driver::SSHBase`.
|
|
673
|
-
#
|
|
674
|
-
# @param state [Hash] mutable instance state
|
|
675
|
-
# @deprecated When legacy Driver::SSHBase support is removed, the
|
|
676
|
-
# `#verify` method will no longer be called on the Driver.
|
|
677
|
-
# @api private
|
|
678
|
-
def legacy_ssh_base_verify(state)
|
|
679
|
-
warn("Running legacy verify for '#{driver.name}' Driver")
|
|
680
|
-
# TODO: Document upgrade path and provide link
|
|
681
|
-
# warn("Driver authors: please read http://example.com for more details.")
|
|
682
|
-
driver.verify(state)
|
|
683
|
-
end
|
|
684
|
-
|
|
685
588
|
# The simplest finite state machine pseudo-implementation needed to manage
|
|
686
589
|
# an Instance.
|
|
687
590
|
#
|
|
@@ -689,7 +592,7 @@ module Kitchen
|
|
|
689
592
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
690
593
|
class FSM
|
|
691
594
|
# Returns an Array of all transitions to bring an Instance from its last
|
|
692
|
-
# reported
|
|
595
|
+
# reported transitioned state into the desired transitioned state.
|
|
693
596
|
#
|
|
694
597
|
# @param last [String,Symbol,nil] the last known transitioned state of
|
|
695
598
|
# the Instance, defaulting to `nil` (for unknown or no history)
|
data/lib/kitchen/lazy_hash.rb
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
require "delegate"
|
|
19
19
|
|
|
20
20
|
module Kitchen
|
|
21
|
-
# A
|
|
21
|
+
# A modified Hash object that may contain callables as a value which must be
|
|
22
22
|
# executed in the context of another object. This allows for delayed
|
|
23
23
|
# evaluation of a hash value while still looking and largely feeling like a
|
|
24
24
|
# normal Ruby Hash.
|
data/lib/kitchen/logger.rb
CHANGED
|
@@ -285,7 +285,7 @@ module Kitchen
|
|
|
285
285
|
# Construct a new standard out logger.
|
|
286
286
|
#
|
|
287
287
|
# @param stdout [IO] the IO object that represents stdout (or similar)
|
|
288
|
-
# @param color [Symbol] color to use when
|
|
288
|
+
# @param color [Symbol] color to use when outputting messages
|
|
289
289
|
# @param colorize [Boolean] whether to enable color
|
|
290
290
|
# @return [StdoutLogger] a new logger
|
|
291
291
|
# @api private
|
|
@@ -33,7 +33,7 @@ module Kitchen
|
|
|
33
33
|
[mc[:name], mc[:version]]
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
# Creates a new instances and loads in the contents of the
|
|
36
|
+
# Creates a new instances and loads in the contents of the metadata.rb
|
|
37
37
|
# file. If you value your life, you may want to avoid reading the
|
|
38
38
|
# implementation.
|
|
39
39
|
#
|
|
@@ -247,24 +247,6 @@ module Kitchen
|
|
|
247
247
|
|
|
248
248
|
private
|
|
249
249
|
|
|
250
|
-
# Builds a complete command given a variables String preamble and a file
|
|
251
|
-
# containing shell code.
|
|
252
|
-
#
|
|
253
|
-
# @param vars [String] shell variables, as a String
|
|
254
|
-
# @param file [String] file basename (without extension) containing
|
|
255
|
-
# shell code
|
|
256
|
-
# @return [String] command
|
|
257
|
-
# @api private
|
|
258
|
-
def shell_code_from_file(vars, file)
|
|
259
|
-
src_file = File.join(
|
|
260
|
-
File.dirname(__FILE__),
|
|
261
|
-
%w{.. .. .. support},
|
|
262
|
-
file + (powershell_shell? ? ".ps1" : ".sh")
|
|
263
|
-
)
|
|
264
|
-
|
|
265
|
-
wrap_shell_code([vars, "", File.read(src_file)].join("\n"))
|
|
266
|
-
end
|
|
267
|
-
|
|
268
250
|
# Conditionally prefixes a command with a sudo command.
|
|
269
251
|
#
|
|
270
252
|
# @param command [String] command to be prefixed
|
data/lib/kitchen/provisioner.rb
CHANGED
|
@@ -26,7 +26,7 @@ module Kitchen
|
|
|
26
26
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
27
27
|
module Provisioner
|
|
28
28
|
# Default provisioner to use
|
|
29
|
-
DEFAULT_PLUGIN = "
|
|
29
|
+
DEFAULT_PLUGIN = "shell".freeze
|
|
30
30
|
|
|
31
31
|
# Returns an instance of a provisioner given a plugin type string.
|
|
32
32
|
#
|
|
@@ -35,7 +35,6 @@ module Kitchen
|
|
|
35
35
|
# @return [Provisioner::Base] a provisioner instance
|
|
36
36
|
# @raise [ClientError] if a provisioner instance could not be created
|
|
37
37
|
def self.for_plugin(plugin, config)
|
|
38
|
-
plugin, config[:name] = "chef_infra", "chef_infra" if plugin == "chef_zero"
|
|
39
38
|
Kitchen::Plugin.load(self, plugin, config)
|
|
40
39
|
end
|
|
41
40
|
end
|
|
@@ -21,8 +21,8 @@ require "rbconfig" unless defined?(RbConfig)
|
|
|
21
21
|
require "uri" unless defined?(URI)
|
|
22
22
|
require_relative "../../kitchen"
|
|
23
23
|
require_relative "../util"
|
|
24
|
-
require "winrm" unless defined?(WinRM::Connection)
|
|
25
|
-
require "winrm/exceptions" unless defined?(WinRM::WinRMHTTPTransportError)
|
|
24
|
+
require "chef-winrm" unless defined?(WinRM::Connection)
|
|
25
|
+
require "chef-winrm/exceptions" unless defined?(WinRM::WinRMHTTPTransportError)
|
|
26
26
|
|
|
27
27
|
module Kitchen
|
|
28
28
|
module Transport
|
|
@@ -420,9 +420,9 @@ module Kitchen
|
|
|
420
420
|
|
|
421
421
|
private
|
|
422
422
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
423
|
+
CHEF_WINRM_SPEC_VERSION = ["~> 2.0"].freeze
|
|
424
|
+
CHEF_WINRM_FS_SPEC_VERSION = ["~> 1.0"].freeze
|
|
425
|
+
CHEF_WINRM_ELEVATED_SPEC_VERSION = ["~> 1.0"].freeze
|
|
426
426
|
|
|
427
427
|
# Builds the hash of options needed by the Connection object on
|
|
428
428
|
# construction.
|
|
@@ -515,9 +515,9 @@ module Kitchen
|
|
|
515
515
|
# (see Base#load_needed_dependencies!)
|
|
516
516
|
def load_needed_dependencies!
|
|
517
517
|
super
|
|
518
|
-
load_with_rescue!("winrm",
|
|
519
|
-
load_with_rescue!("winrm-fs",
|
|
520
|
-
load_with_rescue!("winrm-elevated",
|
|
518
|
+
load_with_rescue!("chef-winrm", CHEF_WINRM_SPEC_VERSION.dup)
|
|
519
|
+
load_with_rescue!("chef-winrm-fs", CHEF_WINRM_FS_SPEC_VERSION.dup)
|
|
520
|
+
load_with_rescue!("chef-winrm-elevated", CHEF_WINRM_ELEVATED_SPEC_VERSION.dup) if config[:elevated]
|
|
521
521
|
end
|
|
522
522
|
|
|
523
523
|
def load_with_rescue!(gem_name, spec_version)
|
data/lib/kitchen/util.rb
CHANGED
|
@@ -128,7 +128,7 @@ module Kitchen
|
|
|
128
128
|
"sh -c '\n#{cmd}\n'"
|
|
129
129
|
end
|
|
130
130
|
|
|
131
|
-
#
|
|
131
|
+
# Modifies the given string to strip leading whitespace on each line, the
|
|
132
132
|
# amount which is calculated by using the first line of text.
|
|
133
133
|
#
|
|
134
134
|
# @example
|
data/lib/kitchen/version.rb
CHANGED
data/lib/kitchen.rb
CHANGED
|
@@ -31,7 +31,6 @@ require_relative "kitchen/config"
|
|
|
31
31
|
require_relative "kitchen/data_munger"
|
|
32
32
|
require_relative "kitchen/driver"
|
|
33
33
|
require_relative "kitchen/driver/base"
|
|
34
|
-
require_relative "kitchen/driver/ssh_base"
|
|
35
34
|
require_relative "kitchen/driver/proxy"
|
|
36
35
|
require_relative "kitchen/instance"
|
|
37
36
|
require_relative "kitchen/lifecycle_hooks"
|
|
@@ -41,7 +40,6 @@ require_relative "kitchen/loader/yaml"
|
|
|
41
40
|
require_relative "kitchen/metadata_chopper"
|
|
42
41
|
require_relative "kitchen/platform"
|
|
43
42
|
require_relative "kitchen/state_file"
|
|
44
|
-
require_relative "kitchen/ssh"
|
|
45
43
|
require_relative "kitchen/suite"
|
|
46
44
|
require_relative "kitchen/verifier"
|
|
47
45
|
require_relative "kitchen/verifier/base"
|
|
@@ -48,8 +48,8 @@ module HashRecursiveMerge
|
|
|
48
48
|
# When both +hsh+ and +other_hash+ contains an entry with the same key,
|
|
49
49
|
# it merges and returns the values from both arrays.
|
|
50
50
|
#
|
|
51
|
-
# Compared with Hash#merge, this method provides a different
|
|
52
|
-
# for merging
|
|
51
|
+
# Compared with Hash#merge, this method provides a different approach
|
|
52
|
+
# for merging nested hashes.
|
|
53
53
|
# If the value of a given key is an Hash and both +other_hash+ abd +hsh
|
|
54
54
|
# includes the same key, the value is merged instead replaced with
|
|
55
55
|
# +other_hash+ value.
|
|
@@ -11,7 +11,7 @@ module Kitchen
|
|
|
11
11
|
# <%= config[:klass_name] %> driver for Kitchen.
|
|
12
12
|
#
|
|
13
13
|
# @author <%= config[:author] %> <<%= config[:email] %>>
|
|
14
|
-
class <%= config[:klass_name] %> < Kitchen::Driver::
|
|
14
|
+
class <%= config[:klass_name] %> < Kitchen::Driver::Base
|
|
15
15
|
|
|
16
16
|
def create(state)
|
|
17
17
|
end
|
data/test-kitchen.gemspec
CHANGED
|
@@ -35,10 +35,8 @@ Gem::Specification.new do |gem|
|
|
|
35
35
|
gem.add_dependency "ostruct", "~> 0.6"
|
|
36
36
|
gem.add_dependency "syslog", "~> 0.3"
|
|
37
37
|
gem.add_dependency "thor", ">= 0.19", "< 2.0"
|
|
38
|
-
|
|
39
|
-
gem.add_dependency "winrm
|
|
40
|
-
gem.add_dependency "winrm-
|
|
41
|
-
|
|
42
|
-
# TK is not under Chef EULA
|
|
43
|
-
gem.add_dependency "license-acceptance", ">= 1.0.11", "< 3.0" # pinning until we can confirm 3+ works
|
|
38
|
+
# Chef Forked versions with additional fixes since no one is maintining them upstream
|
|
39
|
+
gem.add_dependency "chef-winrm", ">= 2.5.0", "< 3.0"
|
|
40
|
+
gem.add_dependency "chef-winrm-elevated", ">= 1.0", "< 2.0"
|
|
41
|
+
gem.add_dependency "chef-winrm-fs", ">= 1.0", "< 2.0"
|
|
44
42
|
end
|