test-kitchen 3.0.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cff7935683511121e07b20e636078776ae80c20fc007b5b08a922ce76e0ce94
4
- data.tar.gz: 8207e168e7faf42b8239438753c58f2a9a37fc4f4f2dcd9728948f67b4a5afb9
3
+ metadata.gz: d13b33db25f75d1d7f7a89d6da2a7eb2e78da9a8c7416ed6cf7a8d72e2e690a2
4
+ data.tar.gz: bb0352e0588277a0cff8d03364e09608cbd4f68218824a041d26d2f7c3c74a4b
5
5
  SHA512:
6
- metadata.gz: 46356119baf46a5ec115cc036c81778e8f17ac2dca6a21733d7bb4ef8779d7d23724ef295cd1f0557083abe577578ff28eec2bb5d9a4596359d8c5c34ea0379b
7
- data.tar.gz: 7770f0e415279795ecf2106a6005f7b1514bd692be9a5839d24e992ad4e03dcbbe33dd86892904b1dd87a73473a3484d3f44518f7b87211d1c340c3f94abd6a3
6
+ metadata.gz: 3d6cd7cdfff82e128a602f8eab578834168051940aadb50fdee9988f45ae9baa1b20053dc8580e69ce70ad160edb4d46e8bdf458cf36245a4dff97d13f128175
7
+ data.tar.gz: f05de5e3be22a367cdafb162e70651fcf9b9f881d8948654988c93648f650619ef63b2b2cf70d55b0818e94f057695c06465cf59f5a9168aa085ebb4710aa1f3
data/Gemfile CHANGED
@@ -17,5 +17,5 @@ group :debug do
17
17
  end
18
18
 
19
19
  group :chefstyle do
20
- gem "chefstyle", "2.0.5"
20
+ gem "chefstyle", "2.1.0"
21
21
  end
@@ -69,7 +69,7 @@ module Kitchen
69
69
  README.* VERSION metadata.{json,rb} attributes.rb recipe.rb
70
70
  attributes/**/* definitions/**/* files/**/* libraries/**/*
71
71
  providers/**/* recipes/**/* resources/**/* templates/**/*
72
- ohai/**/*
72
+ ohai/**/* compliance/**/*
73
73
  ).join(",")
74
74
  # to ease upgrades, allow the user to turn deprecation warnings into errors
75
75
  default_config :deprecations_as_errors, false
@@ -681,25 +681,42 @@ module Kitchen
681
681
  chef_cmds(base_cmd).join(separator)
682
682
  end
683
683
 
684
- # Gives an array of command
684
+ # Gives an array of commands
685
685
  # @api private
686
686
  def chef_cmds(base_cmd)
687
- cmd = prefix_command(wrap_shell_code(
688
- [base_cmd, *chef_args(config_filename), last_exit_code].join(" ")
689
- .tap { |str| str.insert(0, reload_ps1_path) if windows_os? }
690
- ))
691
-
692
- cmds = [cmd].cycle(config[:multiple_converge].to_i).to_a
693
-
694
- if config[:enforce_idempotency]
695
- idempotent_cmd = prefix_command(wrap_shell_code(
696
- [base_cmd, *chef_args("client_no_updated_resources.rb"), last_exit_code].join(" ")
697
- .tap { |str| str.insert(0, reload_ps1_path) if windows_os? }
698
- ))
699
- cmds[-1] = idempotent_cmd
687
+ cmds = []
688
+ num_converges = config[:multiple_converge].to_i
689
+ idempotency = config[:enforce_idempotency]
690
+
691
+ # Execute Chef Client n-1 times, without exiting
692
+ (num_converges - 1).times do
693
+ cmds << wrapped_chef_cmd(base_cmd, config_filename)
700
694
  end
695
+
696
+ # Append another execution with Windows specific Exit code helper or (for
697
+ # idempotency check) a specific config file which assures no changed resources.
698
+ cmds << unless idempotency
699
+ wrapped_chef_cmd(base_cmd, config_filename, append: last_exit_code)
700
+ else
701
+ wrapped_chef_cmd(base_cmd, "client_no_updated_resources.rb", append: last_exit_code)
702
+ end
701
703
  cmds
702
704
  end
705
+
706
+ # Concatenate all arguments and wrap it with shell-specifics
707
+ # @api private
708
+ def wrapped_chef_cmd(base_cmd, configfile, append: "")
709
+ args = []
710
+
711
+ args << base_cmd
712
+ args << chef_args(configfile)
713
+ args << append
714
+
715
+ shell_cmd = args.flatten.join(" ")
716
+ shell_cmd = shell_cmd.prepend(reload_ps1_path) if windows_os?
717
+
718
+ prefix_command(wrap_shell_code(shell_cmd))
719
+ end
703
720
  end
704
721
  end
705
722
  end
@@ -176,9 +176,11 @@ module Kitchen
176
176
  Array(locals).map do |local|
177
177
  opts = File.directory?(local) ? { recursive: true } : {}
178
178
 
179
- waits.push session.scp.upload(local, remote, opts) do |_ch, name, sent, total|
180
- logger.debug("Async Uploaded #{name} (#{total} bytes)") if sent == total
181
- end
179
+ waits.push(
180
+ session.scp.upload(local, remote, opts) do |_ch, name, sent, total|
181
+ logger.debug("Async Uploaded #{name} (#{total} bytes)") if sent == total
182
+ end
183
+ )
182
184
  waits.shift.wait while waits.length >= max_ssh_sessions
183
185
  end
184
186
  waits.each(&:wait)
@@ -439,18 +439,31 @@ module Kitchen
439
439
  elevated_username: data[:elevated_username] || data[:username],
440
440
  elevated_password: elevated_password,
441
441
  }
442
- opts.merge!(additional_transport_args(opts[:transport]))
442
+ opts.merge!(additional_transport_args(data, opts[:transport]))
443
+ if opts[:transport].to_sym == :ssl && opts.key?(:client_cert) && opts.key?(:client_key)
444
+ opts.delete(:user)
445
+ opts.delete(:password)
446
+ end
443
447
  opts
444
448
  end
445
449
 
446
- def additional_transport_args(transport_type)
450
+ def additional_transport_args(data, transport_type)
451
+ opts = {
452
+ disable_sspi: false,
453
+ basic_auth_only: false,
454
+ }
455
+
447
456
  case transport_type.to_sym
448
- when :ssl, :negotiate
449
- {
450
- no_ssl_peer_verification: true,
451
- disable_sspi: false,
452
- basic_auth_only: false,
453
- }
457
+ when :ssl
458
+ if data.key?(:client_cert) && data.key?(:client_key)
459
+ opts[:client_cert] = data[:client_cert]
460
+ opts[:client_key] = data[:client_key]
461
+ end
462
+ opts[:no_ssl_peer_verification] = data.key?(:no_ssl_peer_verification) ? data[:no_ssl_peer_verification] : true
463
+ opts
464
+ when :negotiate
465
+ opts[:no_ssl_peer_verification] = true
466
+ opts
454
467
  when :plaintext
455
468
  {
456
469
  disable_sspi: true,
@@ -16,5 +16,5 @@
16
16
  # limitations under the License.
17
17
 
18
18
  module Kitchen
19
- VERSION = "3.0.0".freeze
19
+ VERSION = "3.2.1".freeze
20
20
  end
data/test-kitchen.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.executables = %w{kitchen}
21
21
  gem.require_paths = ["lib"]
22
22
 
23
- gem.required_ruby_version = ">= 2.5"
23
+ gem.required_ruby_version = ">= 2.6"
24
24
 
25
25
  gem.add_dependency "mixlib-shellout", ">= 1.2", "< 4.0"
26
26
  gem.add_dependency "net-scp", ">= 1.1", "< 4.0" # pinning until we can confirm 4+ works
@@ -46,7 +46,7 @@ Gem::Specification.new do |gem|
46
46
  gem.add_development_dependency "fakefs", "~> 1.0"
47
47
  gem.add_development_dependency "minitest", "~> 5.3", "< 5.15"
48
48
  gem.add_development_dependency "mocha", "~> 1.1"
49
- gem.add_development_dependency "cucumber", ">= 2.1", "< 4.0" # we just need to validate 4.0 when it comes out
49
+ gem.add_development_dependency "cucumber", ">= 2.1", "< 8.0"
50
50
  gem.add_development_dependency "countloc", "~> 0.4"
51
51
  gem.add_development_dependency "maruku", "~> 0.6"
52
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-kitchen
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-02 00:00:00.000000000 Z
11
+ date: 2021-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout
@@ -347,7 +347,7 @@ dependencies:
347
347
  version: '2.1'
348
348
  - - "<"
349
349
  - !ruby/object:Gem::Version
350
- version: '4.0'
350
+ version: '8.0'
351
351
  type: :development
352
352
  prerelease: false
353
353
  version_requirements: !ruby/object:Gem::Requirement
@@ -357,7 +357,7 @@ dependencies:
357
357
  version: '2.1'
358
358
  - - "<"
359
359
  - !ruby/object:Gem::Version
360
- version: '4.0'
360
+ version: '8.0'
361
361
  - !ruby/object:Gem::Dependency
362
362
  name: countloc
363
363
  requirement: !ruby/object:Gem::Requirement
@@ -513,14 +513,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
513
513
  requirements:
514
514
  - - ">="
515
515
  - !ruby/object:Gem::Version
516
- version: '2.5'
516
+ version: '2.6'
517
517
  required_rubygems_version: !ruby/object:Gem::Requirement
518
518
  requirements:
519
519
  - - ">="
520
520
  - !ruby/object:Gem::Version
521
521
  version: '0'
522
522
  requirements: []
523
- rubygems_version: 3.2.15
523
+ rubygems_version: 3.2.22
524
524
  signing_key:
525
525
  specification_version: 4
526
526
  summary: Test Kitchen is an integration tool for developing and testing infrastructure