test-kitchen 3.8.0 → 3.8.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2b9e6d594b61d9e569f8051f34251c4c1c4c531618c70d382558f34c2b4fbdb
4
- data.tar.gz: 6703f8a68a196806e858011fdc1a7695e5e48c936a8e86c550ce8369aba82174
3
+ metadata.gz: ba3fe607706ce3ef90092722eb9c1e6a687f8eb55e8cd4e9fef82e9b24666517
4
+ data.tar.gz: 3be60ac0bbb386924f6013eb757f46c08af31f568cb878e189da0246f9f4f684
5
5
  SHA512:
6
- metadata.gz: 36e39c93bc5d66d0d46b790f927ee54c412c6467fd61c72a981721511814c1681925232851a437013a1a4c3ee250cc73ae251b057931db9024dab20596c31db9
7
- data.tar.gz: 930266c1bc9c86e98def9eb3e78cf9bde2d8106a13fa831f1f56a88a3ca3d9b48f2c9508df077a4e414add79ef792b47255870c0ff7a12351f238501cdb138f8
6
+ metadata.gz: 4a6cb06303ca237abbcded23088db2e657de019d0cafb780bc5e78c8b02f493fe52bebec01c51527b1123f48f176fba2c41961594ad13addcf2a830de4e1b51a
7
+ data.tar.gz: '0819c669fc524ea36a24d2a14530e202c92da5656d9b1f78080b1e3138cf20d348afa1b38a356f5c053bfe7508beebd58bf3d93eea9434ee45cd62cec3d5920c'
data/Gemfile CHANGED
@@ -19,6 +19,8 @@ group :integration do
19
19
  gem "kitchen-dokken"
20
20
  gem "kitchen-inspec"
21
21
  gem "kitchen-vagrant"
22
+ gem "inspec", "~> 5.22" # Fix dependency conflicts for ruby < 3.4
23
+ gem "train", "~> 3.10" # Fix dependency conflicts for ruby < 3.4
22
24
  end
23
25
 
24
26
  group :linting do
@@ -98,7 +98,7 @@ module Kitchen
98
98
  # directory containing test suites and other testing-related files and
99
99
  # directories (default: `"#{kitchen_root}/test/integration"`)
100
100
  # @option options [Symbol] :log_level the log level verbosity that the
101
- # loggers will use when outputing information (default: `:info`)
101
+ # loggers will use when outputting information (default: `:info`)
102
102
  def initialize(options = {})
103
103
  @loader = options.fetch(:loader) { Kitchen::Loader::YAML.new }
104
104
  @kitchen_root = options.fetch(:kitchen_root) { Dir.pwd }
@@ -65,7 +65,8 @@ module Kitchen
65
65
  # @return [TrueClass,FalseClass] true if `:shell_type` is `"bourne"` (or
66
66
  # unset, for backwards compatibility)
67
67
  def bourne_shell?
68
- ["bourne", nil].include?(instance.platform.shell_type)
68
+ shell_type = instance.platform.respond_to?(:shell_type) ? instance.platform.shell_type : nil
69
+ ["bourne", nil].include?(shell_type)
69
70
  end
70
71
 
71
72
  # Find an appropriate path to a file or directory, based on graceful
@@ -141,7 +142,8 @@ module Kitchen
141
142
 
142
143
  # @return [TrueClass,FalseClass] true if `:shell_type` is `"powershell"`
143
144
  def powershell_shell?
144
- ["powershell"].include?(instance.platform.shell_type)
145
+ shell_type = instance.platform.respond_to?(:shell_type) ? instance.platform.shell_type : nil
146
+ ["powershell"].include?(shell_type)
145
147
  end
146
148
 
147
149
  # Builds a file path based on the `:os_type` (`"windows"` or `"unix"`).
@@ -155,7 +157,8 @@ module Kitchen
155
157
  # @return [TrueClass,FalseClass] true if `:os_type` is `"unix"` (or
156
158
  # unset, for backwards compatibility)
157
159
  def unix_os?
158
- ["unix", nil].include?(instance.platform.os_type)
160
+ os_type = instance.platform.respond_to?(:os_type) ? instance.platform.os_type : nil
161
+ ["unix", nil].include?(os_type)
159
162
  end
160
163
 
161
164
  # Performs whatever tests that may be required to ensure that this plugin
@@ -171,7 +174,8 @@ module Kitchen
171
174
 
172
175
  # @return [TrueClass,FalseClass] true if `:os_type` is `"windows"`
173
176
  def windows_os?
174
- ["windows"].include?(instance.platform.os_type)
177
+ os_type = instance.platform.respond_to?(:os_type) ? instance.platform.os_type : nil
178
+ ["windows"].include?(os_type)
175
179
  end
176
180
 
177
181
  private
@@ -485,7 +489,7 @@ module Kitchen
485
489
  # end
486
490
  #
487
491
  # @param attr [String] configuration attribute name
488
- # @param value [Object, nil] whether or not to exand the file path
492
+ # @param value [Object, nil] whether or not to expand the file path
489
493
  # @yieldparam object [Object] a reference to the instantiated object
490
494
  # @yieldreturn [Object, nil] dynamically compute whether or not to
491
495
  # perform the file expansion
@@ -1,8 +1,3 @@
1
- #
2
- # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
3
- #
4
- # Copyright (C) 2012, Fletcher Nichol
5
- #
6
1
  # Licensed under the Apache License, Version 2.0 (the "License");
7
2
  # you may not use this file except in compliance with the License.
8
3
  # You may obtain a copy of the License at
@@ -25,8 +20,6 @@ require_relative "../shell_out"
25
20
  module Kitchen
26
21
  module Driver
27
22
  # Base class for a driver.
28
- #
29
- # @author Fletcher Nichol <fnichol@nichol.ca>
30
23
  class Base < Kitchen::Plugin::Base
31
24
  include Configurable
32
25
  include Logging
@@ -1,8 +1,3 @@
1
- #
2
- # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
3
- #
4
- # Copyright (C) 2012, 2013, 2014 Fletcher Nichol
5
- #
6
1
  # Licensed under the Apache License, Version 2.0 (the "License");
7
2
  # you may not use this file except in compliance with the License.
8
3
  # You may obtain a copy of the License at
@@ -1,4 +1,3 @@
1
- #
2
1
  # Licensed under the Apache License, Version 2.0 (the "License");
3
2
  # you may not use this file except in compliance with the License.
4
3
  # You may obtain a copy of the License at
@@ -1,9 +1,3 @@
1
- #
2
- # Author:: Seth Chisamore <schisamo@opscode.com>
3
- #
4
- # Copyright:: Copyright (c) 2013 Opscode, Inc.
5
- # License:: Apache License, Version 2.0
6
- #
7
1
  # Licensed under the Apache License, Version 2.0 (the "License");
8
2
  # you may not use this file except in compliance with the License.
9
3
  # You may obtain a copy of the License at
@@ -1,8 +1,3 @@
1
- #
2
- # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
3
- #
4
- # Copyright (C) 2012, Fletcher Nichol
5
- #
6
1
  # Licensed under the Apache License, Version 2.0 (the "License");
7
2
  # you may not use this file except in compliance with the License.
8
3
  # You may obtain a copy of the License at
@@ -303,7 +298,7 @@ module Kitchen
303
298
  pseudo_state[:username] = username if username
304
299
  pseudo_state.merge!(options)
305
300
 
306
- instance.transport.connection(backcompat_merged_state(pseudo_state))
301
+ instance.transport.connection(**backcompat_merged_state(pseudo_state))
307
302
  .wait_until_ready
308
303
  end
309
304
 
@@ -185,7 +185,7 @@ module Kitchen
185
185
  def append_to_gitignore(line)
186
186
  create_file(".gitignore") unless File.exist?(File.join(destination_root, ".gitignore"))
187
187
 
188
- if IO.readlines(File.join(destination_root, ".gitignore")).grep(/^#{line}/).empty?
188
+ if File.readlines(File.join(destination_root, ".gitignore")).grep(/^#{line}/).empty?
189
189
  append_to_file(".gitignore", "#{line}\n")
190
190
  end
191
191
  end
@@ -235,7 +235,7 @@ module Kitchen
235
235
  # @return [true,false] whether or not a pattern is found in a file
236
236
  # @api private
237
237
  def not_in_file?(filename, regexp)
238
- IO.readlines(File.join(destination_root, filename)).grep(regexp).empty?
238
+ File.readlines(File.join(destination_root, filename)).grep(regexp).empty?
239
239
  end
240
240
 
241
241
  # Save off any Bundler/Ruby-related environment variables so that the
@@ -182,7 +182,7 @@ module Kitchen
182
182
  # does not exist
183
183
  # @api private
184
184
  def read_file(file)
185
- File.exist?(file.to_s) ? IO.read(file) : ""
185
+ File.exist?(file.to_s) ? File.read(file) : ""
186
186
  end
187
187
 
188
188
  # Determines the default absolute path to the Kitchen config YAML file,
@@ -277,7 +277,7 @@ module Kitchen
277
277
  backtrace: e.backtrace,
278
278
  },
279
279
  }
280
- result[:error][:raw_file] = IO.read(file) unless file.nil?
280
+ result[:error][:raw_file] = File.read(file) unless file.nil?
281
281
  result
282
282
  end
283
283
 
@@ -39,7 +39,7 @@ module Kitchen
39
39
  #
40
40
  # @param metadata_file [String] path to a metadata.rb file
41
41
  def initialize(metadata_file)
42
- instance_eval(IO.read(metadata_file), metadata_file)
42
+ instance_eval(File.read(metadata_file), metadata_file)
43
43
  end
44
44
 
45
45
  def method_missing(meth, *args, &_block)
@@ -79,7 +79,7 @@ module Kitchen
79
79
  end
80
80
 
81
81
  # Run the init command to create the kitchen tmp directory
82
- conn.execute(init_command)
82
+ conn.execute(encode_for_powershell(init_command))
83
83
 
84
84
  # Upload the install script instead of directly executing the command
85
85
  if install_command
@@ -258,7 +258,7 @@ module Kitchen
258
258
  file + (powershell_shell? ? ".ps1" : ".sh")
259
259
  )
260
260
 
261
- wrap_shell_code([vars, "", IO.read(src_file)].join("\n"))
261
+ wrap_shell_code([vars, "", File.read(src_file)].join("\n"))
262
262
  end
263
263
 
264
264
  # Conditionally prefixes a command with a sudo command.
@@ -293,6 +293,7 @@ module Kitchen
293
293
 
294
294
  def encode_for_powershell(script)
295
295
  return script unless windows_os?
296
+ return script if script.nil? || script.empty?
296
297
 
297
298
  utf16le = script.encode(Encoding::UTF_16LE)
298
299
  encoded = [utf16le].pack("m0")
@@ -295,7 +295,7 @@ module Kitchen
295
295
  Kitchen.mutex.synchronize do
296
296
  policy.compile
297
297
  end
298
- policy_name = JSON.parse(IO.read(policy.lockfile))["name"]
298
+ policy_name = JSON.parse(File.read(policy.lockfile))["name"]
299
299
  policy_group = config[:policy_group] || "local"
300
300
  config[:attributes].merge(policy_name:, policy_group:)
301
301
  end
@@ -322,7 +322,7 @@ module Kitchen
322
322
  init_command_vars_for_bourne(dirs)
323
323
  end
324
324
 
325
- encode_for_powershell(prefix_command(shell_code_from_file(vars, "chef_base_init_command")))
325
+ prefix_command(shell_code_from_file(vars, "chef_base_init_command"))
326
326
  end
327
327
 
328
328
  # (see Base#install_command)
@@ -115,7 +115,7 @@ module Kitchen
115
115
  end
116
116
  end
117
117
 
118
- code = powershell_shell? ? %{& #{script}} : sudo(script)
118
+ code = powershell_shell? ? %{& "#{script}"} : sudo(script)
119
119
 
120
120
  prefix_command(wrap_shell_code(code))
121
121
  end
@@ -23,7 +23,7 @@ module Kitchen
23
23
  #
24
24
  # @author Fletcher Nichol <fnichol@nichol.ca>
25
25
  module ShellOut
26
- # Wrapped exception for any interally raised shell out commands.
26
+ # Wrapped exception for any internally raised shell out commands.
27
27
  class ShellCommandFailed < TransientFailure; end
28
28
 
29
29
  # Executes a command in a subshell on the local running system.
@@ -85,7 +85,7 @@ module Kitchen
85
85
  # @return [String] a string representation of the yaml state file
86
86
  # @api private
87
87
  def read_file
88
- IO.read(file_name)
88
+ File.read(file_name)
89
89
  end
90
90
 
91
91
  # Parses a YAML string and returns a Hash.
@@ -253,7 +253,7 @@ module Kitchen
253
253
  if logger.debug?
254
254
  debug("Creating RDP document for #{instance_name} (#{rdp_doc_path})")
255
255
  debug("------------")
256
- IO.read(rdp_doc_path).each_line { |l| debug(l.chomp.to_s) }
256
+ File.read(rdp_doc_path).each_line { |l| debug(l.chomp.to_s) }
257
257
  debug("------------")
258
258
  end
259
259
  end
data/lib/kitchen/util.rb CHANGED
@@ -152,7 +152,7 @@ module Kitchen
152
152
  #
153
153
  # @return [String] a string representation of useful helper functions
154
154
  def self.shell_helpers
155
- IO.read(File.join(
155
+ File.read(File.join(
156
156
  File.dirname(__FILE__), %w{.. .. support download_helpers.sh}
157
157
  ))
158
158
  end
@@ -223,7 +223,7 @@ module Kitchen
223
223
  file + (powershell_shell? ? ".ps1" : ".sh")
224
224
  )
225
225
 
226
- wrap_shell_code([vars, "", IO.read(src_file)].join("\n"))
226
+ wrap_shell_code([vars, "", File.read(src_file)].join("\n"))
227
227
  end
228
228
 
229
229
  # Conditionally prefixes a command with a sudo command.
@@ -16,5 +16,5 @@
16
16
  # limitations under the License.
17
17
 
18
18
  module Kitchen
19
- VERSION = "3.8.0".freeze
19
+ VERSION = "3.8.2".freeze
20
20
  end
data/test-kitchen.gemspec CHANGED
@@ -24,12 +24,16 @@ Gem::Specification.new do |gem|
24
24
 
25
25
  gem.add_dependency "bcrypt_pbkdf", "~> 1.0" # ed25519 ssh key support
26
26
  gem.add_dependency "chef-utils", ">= 16.4.35"
27
+ gem.add_dependency "csv", "~> 3.3"
27
28
  gem.add_dependency "ed25519", "~> 1.3" # ed25519 ssh key support
29
+ gem.add_dependency "irb", "~> 1.15"
28
30
  gem.add_dependency "mixlib-install", "~> 3.6"
29
31
  gem.add_dependency "mixlib-shellout", ">= 1.2", "< 4.0"
30
32
  gem.add_dependency "net-scp", ">= 1.1", "< 5.0" # pinning until we can confirm 4+ works
31
33
  gem.add_dependency "net-ssh", ">= 2.9", "< 8.0" # pinning until we can confirm 8+ works
32
34
  gem.add_dependency "net-ssh-gateway", ">= 1.2", "< 3.0" # pinning until we can confirm 3+ works
35
+ gem.add_dependency "ostruct", "~> 0.6"
36
+ gem.add_dependency "syslog", "~> 0.3"
33
37
  gem.add_dependency "thor", ">= 0.19", "< 2.0"
34
38
  gem.add_dependency "winrm", "~> 2.0"
35
39
  gem.add_dependency "winrm-elevated", "~> 1.0"
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.8.0
4
+ version: 3.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-12 00:00:00.000000000 Z
11
+ date: 2025-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt_pbkdf
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 16.4.35
41
+ - !ruby/object:Gem::Dependency
42
+ name: csv
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.3'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.3'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: ed25519
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +66,20 @@ dependencies:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
68
  version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: irb
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.15'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.15'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: mixlib-install
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -146,6 +174,34 @@ dependencies:
146
174
  - - "<"
147
175
  - !ruby/object:Gem::Version
148
176
  version: '3.0'
177
+ - !ruby/object:Gem::Dependency
178
+ name: ostruct
179
+ requirement: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - "~>"
182
+ - !ruby/object:Gem::Version
183
+ version: '0.6'
184
+ type: :runtime
185
+ prerelease: false
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - "~>"
189
+ - !ruby/object:Gem::Version
190
+ version: '0.6'
191
+ - !ruby/object:Gem::Dependency
192
+ name: syslog
193
+ requirement: !ruby/object:Gem::Requirement
194
+ requirements:
195
+ - - "~>"
196
+ - !ruby/object:Gem::Version
197
+ version: '0.3'
198
+ type: :runtime
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ requirements:
202
+ - - "~>"
203
+ - !ruby/object:Gem::Version
204
+ version: '0.3'
149
205
  - !ruby/object:Gem::Dependency
150
206
  name: thor
151
207
  requirement: !ruby/object:Gem::Requirement