test-kitchen 2.3.4 → 2.5.3
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 +1 -12
- data/lib/kitchen.rb +30 -30
- data/lib/kitchen/cli.rb +2 -2
- data/lib/kitchen/command/action.rb +1 -1
- data/lib/kitchen/command/console.rb +1 -1
- data/lib/kitchen/command/diagnose.rb +2 -2
- data/lib/kitchen/command/doctor.rb +1 -1
- data/lib/kitchen/command/exec.rb +1 -1
- data/lib/kitchen/command/list.rb +1 -1
- data/lib/kitchen/command/login.rb +1 -1
- data/lib/kitchen/command/package.rb +1 -1
- data/lib/kitchen/command/sink.rb +1 -1
- data/lib/kitchen/command/test.rb +1 -1
- data/lib/kitchen/configurable.rb +7 -1
- data/lib/kitchen/data_munger.rb +1 -1
- data/lib/kitchen/diagnostic.rb +2 -2
- data/lib/kitchen/driver.rb +1 -1
- data/lib/kitchen/driver/base.rb +5 -5
- data/lib/kitchen/driver/dummy.rb +1 -1
- data/lib/kitchen/driver/exec.rb +4 -4
- data/lib/kitchen/driver/proxy.rb +2 -2
- data/lib/kitchen/driver/ssh_base.rb +1 -1
- data/lib/kitchen/generator/init.rb +2 -2
- data/lib/kitchen/lifecycle_hooks.rb +2 -2
- data/lib/kitchen/loader/yaml.rb +1 -1
- data/lib/kitchen/plugin.rb +2 -2
- data/lib/kitchen/provisioner.rb +1 -1
- data/lib/kitchen/provisioner/base.rb +3 -3
- data/lib/kitchen/provisioner/chef/berkshelf.rb +2 -2
- data/lib/kitchen/provisioner/chef/policyfile.rb +3 -3
- data/lib/kitchen/provisioner/chef_apply.rb +3 -3
- data/lib/kitchen/provisioner/chef_base.rb +26 -18
- data/lib/kitchen/provisioner/chef_solo.rb +1 -1
- data/lib/kitchen/provisioner/chef_zero.rb +1 -1
- data/lib/kitchen/provisioner/dummy.rb +1 -1
- data/lib/kitchen/provisioner/shell.rb +8 -4
- data/lib/kitchen/rake_tasks.rb +1 -1
- data/lib/kitchen/ssh.rb +2 -2
- data/lib/kitchen/thor_tasks.rb +1 -1
- data/lib/kitchen/transport.rb +1 -1
- data/lib/kitchen/transport/base.rb +5 -5
- data/lib/kitchen/transport/dummy.rb +1 -1
- data/lib/kitchen/transport/exec.rb +3 -3
- data/lib/kitchen/transport/ssh.rb +1 -1
- data/lib/kitchen/transport/winrm.rb +1 -1
- data/lib/kitchen/util.rb +1 -1
- data/lib/kitchen/verifier.rb +1 -1
- data/lib/kitchen/verifier/base.rb +10 -3
- data/lib/kitchen/verifier/busser.rb +1 -1
- data/lib/kitchen/verifier/dummy.rb +1 -1
- data/lib/kitchen/verifier/shell.rb +1 -1
- data/lib/kitchen/version.rb +1 -1
- data/support/chef_base_install_command.ps1 +3 -3
- data/support/chef_base_install_command.sh +2 -2
- data/templates/init/chefignore.erb +1 -0
- data/templates/init/kitchen.yml.erb +2 -2
- data/test-kitchen.gemspec +5 -5
- metadata +23 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 15da3669fff472ce1a908562922fa945e8e65a82657b360270e498f17493ace0
|
|
4
|
+
data.tar.gz: 663b1e2800aff7ae63a8c9b2d2333c5af41b69503e116014ea4fde9f2e212438
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f8fa9c1c41866ca32d894a8bd835ab80d389a9e9ea52839b8ec6f19f5a740837d9f57535c9f111d57a97c7649b7097440430ced07bd278e2c99d1f402fe486a0
|
|
7
|
+
data.tar.gz: e608e44111952e8b46486960a17b79b817b5adde8a83f17863d7332c0f408b11686290fc0ac385aa9dff1f2864495e5e5e9b27c0a489809109c08ad5f7c22ddc
|
data/Gemfile
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
1
|
source "https://rubygems.org"
|
|
3
2
|
gemspec
|
|
4
3
|
|
|
@@ -10,7 +9,7 @@ group :integration do
|
|
|
10
9
|
end
|
|
11
10
|
|
|
12
11
|
group :changelog do
|
|
13
|
-
gem "github_changelog_generator", "1.15.
|
|
12
|
+
gem "github_changelog_generator", "1.15.2"
|
|
14
13
|
end
|
|
15
14
|
|
|
16
15
|
group :debug do
|
|
@@ -26,13 +25,3 @@ end
|
|
|
26
25
|
group :docs do
|
|
27
26
|
gem "yard"
|
|
28
27
|
end
|
|
29
|
-
|
|
30
|
-
instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"]
|
|
31
|
-
|
|
32
|
-
# To avoid bringing in development or test dependencies that are not
|
|
33
|
-
# absolutely needed, if you want to load tools not present in the gemspec
|
|
34
|
-
# or this Gemfile, add those additional dependencies into a Gemfile.local
|
|
35
|
-
# file which is ignored by this repository.
|
|
36
|
-
# rubocop:disable Security/Eval
|
|
37
|
-
eval(IO.read(__FILE__ + ".local"), binding) if File.exist?(__FILE__ + ".local")
|
|
38
|
-
# rubocop:enable Security/Eval
|
data/lib/kitchen.rb
CHANGED
|
@@ -19,36 +19,36 @@
|
|
|
19
19
|
require "pathname"
|
|
20
20
|
require "thread"
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
22
|
+
require_relative "kitchen/errors"
|
|
23
|
+
require_relative "kitchen/logger"
|
|
24
|
+
require_relative "kitchen/logging"
|
|
25
|
+
require_relative "kitchen/shell_out"
|
|
26
|
+
require_relative "kitchen/configurable"
|
|
27
|
+
require_relative "kitchen/util"
|
|
28
|
+
|
|
29
|
+
require_relative "kitchen/provisioner"
|
|
30
|
+
require_relative "kitchen/provisioner/base"
|
|
31
|
+
require_relative "kitchen/color"
|
|
32
|
+
require_relative "kitchen/collection"
|
|
33
|
+
require_relative "kitchen/config"
|
|
34
|
+
require_relative "kitchen/data_munger"
|
|
35
|
+
require_relative "kitchen/driver"
|
|
36
|
+
require_relative "kitchen/driver/base"
|
|
37
|
+
require_relative "kitchen/driver/ssh_base"
|
|
38
|
+
require_relative "kitchen/driver/proxy"
|
|
39
|
+
require_relative "kitchen/instance"
|
|
40
|
+
require_relative "kitchen/lifecycle_hooks"
|
|
41
|
+
require_relative "kitchen/transport"
|
|
42
|
+
require_relative "kitchen/transport/base"
|
|
43
|
+
require_relative "kitchen/loader/yaml"
|
|
44
|
+
require_relative "kitchen/metadata_chopper"
|
|
45
|
+
require_relative "kitchen/platform"
|
|
46
|
+
require_relative "kitchen/state_file"
|
|
47
|
+
require_relative "kitchen/ssh"
|
|
48
|
+
require_relative "kitchen/suite"
|
|
49
|
+
require_relative "kitchen/verifier"
|
|
50
|
+
require_relative "kitchen/verifier/base"
|
|
51
|
+
require_relative "kitchen/version"
|
|
52
52
|
|
|
53
53
|
# Test Kitchen base module.
|
|
54
54
|
#
|
data/lib/kitchen/cli.rb
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
require_relative "../command"
|
|
20
|
+
require_relative "../diagnostic"
|
|
21
21
|
|
|
22
22
|
require "yaml"
|
|
23
23
|
|
data/lib/kitchen/command/exec.rb
CHANGED
data/lib/kitchen/command/list.rb
CHANGED
data/lib/kitchen/command/sink.rb
CHANGED
data/lib/kitchen/command/test.rb
CHANGED
data/lib/kitchen/configurable.rb
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
require "thor/util"
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
require_relative "lazy_hash"
|
|
22
22
|
|
|
23
23
|
module Kitchen
|
|
24
24
|
# A mixin for providing configuration-related behavior such as default
|
|
@@ -349,6 +349,12 @@ module Kitchen
|
|
|
349
349
|
code_parts = resolve_proxy_settings_from_config
|
|
350
350
|
code_parts << shell_env_var("TEST_KITCHEN", 1)
|
|
351
351
|
code_parts << shell_env_var("CI", ENV["CI"]) if ENV["CI"]
|
|
352
|
+
code_parts << shell_env_var("CHEF_LICENSE", ENV["CHEF_LICENSE"]) if ENV["CHEF_LICENSE"]
|
|
353
|
+
ENV.select { |key, value| key.start_with?("TKENV_") }.each do |key, value|
|
|
354
|
+
env_var_name = "#{key}".sub!("TKENV_", "")
|
|
355
|
+
code_parts << shell_env_var(env_var_name, value)
|
|
356
|
+
end
|
|
357
|
+
|
|
352
358
|
code_parts << code
|
|
353
359
|
code_parts.join("\n")
|
|
354
360
|
end
|
data/lib/kitchen/data_munger.rb
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
require_relative "../vendor/hash_recursive_merge"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
22
|
# Class to handle recursive merging of configuration between platforms,
|
data/lib/kitchen/diagnostic.rb
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
require_relative "util"
|
|
20
|
+
require_relative "version"
|
|
21
21
|
|
|
22
22
|
module Kitchen
|
|
23
23
|
# Combines and compiles diagnostic information about a Test Kitchen
|
data/lib/kitchen/driver.rb
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
require_relative "plugin"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
22
|
# A driver is responsible for carrying out the lifecycle activities of an
|
data/lib/kitchen/driver/base.rb
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
require_relative "../configurable"
|
|
20
|
+
require_relative "../errors"
|
|
21
|
+
require_relative "../lazy_hash"
|
|
22
|
+
require_relative "../logging"
|
|
23
|
+
require_relative "../shell_out"
|
|
24
24
|
|
|
25
25
|
module Kitchen
|
|
26
26
|
module Driver
|
data/lib/kitchen/driver/dummy.rb
CHANGED
data/lib/kitchen/driver/exec.rb
CHANGED
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
#
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
require_relative "base"
|
|
17
|
+
require_relative "../shell_out"
|
|
18
|
+
require_relative "../transport/exec"
|
|
19
|
+
require_relative "../version"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
22
|
module Driver
|
data/lib/kitchen/driver/proxy.rb
CHANGED
|
@@ -136,7 +136,7 @@ module Kitchen
|
|
|
136
136
|
rakedoc = <<-RAKE.gsub(/^ {10}/, "")
|
|
137
137
|
|
|
138
138
|
begin
|
|
139
|
-
|
|
139
|
+
require_relative '../rake_tasks'
|
|
140
140
|
Kitchen::RakeTasks.new
|
|
141
141
|
rescue LoadError
|
|
142
142
|
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
|
|
@@ -154,7 +154,7 @@ module Kitchen
|
|
|
154
154
|
thordoc = <<-THOR.gsub(/^ {10}/, "")
|
|
155
155
|
|
|
156
156
|
begin
|
|
157
|
-
|
|
157
|
+
require_relative '../thor_tasks'
|
|
158
158
|
Kitchen::ThorTasks.new
|
|
159
159
|
rescue LoadError
|
|
160
160
|
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
require_relative "errors"
|
|
20
|
+
require_relative "shell_out"
|
|
21
21
|
|
|
22
22
|
module Kitchen
|
|
23
23
|
# A helper object used by {Instance} to coordinate lifecycle hook calls from
|
data/lib/kitchen/loader/yaml.rb
CHANGED
data/lib/kitchen/plugin.rb
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
# See the License for the specific language governing permissions and
|
|
18
18
|
# limitations under the License.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
require_relative "errors"
|
|
21
|
+
require_relative "util"
|
|
22
22
|
|
|
23
23
|
module Kitchen
|
|
24
24
|
module Plugin
|
data/lib/kitchen/provisioner.rb
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
require_relative "plugin"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
22
|
# A provisioner is responsible for generating the commands necessary to
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
require_relative "../configurable"
|
|
20
|
+
require_relative "../errors"
|
|
21
|
+
require_relative "../logging"
|
|
22
22
|
|
|
23
23
|
module Kitchen
|
|
24
24
|
module Provisioner
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
require_relative "../../errors"
|
|
20
|
+
require_relative "../../logging"
|
|
21
21
|
|
|
22
22
|
module Kitchen
|
|
23
23
|
module Provisioner
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
require "shellwords"
|
|
20
20
|
require "rbconfig"
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
require_relative "../../errors"
|
|
23
|
+
require_relative "../../logging"
|
|
24
|
+
require_relative "../../shell_out"
|
|
25
25
|
|
|
26
26
|
module Kitchen
|
|
27
27
|
module Provisioner
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
# name: chef_apply
|
|
31
31
|
#
|
|
32
32
|
# platforms:
|
|
33
|
-
# - name: ubuntu-
|
|
34
|
-
# - name: centos-
|
|
33
|
+
# - name: ubuntu-20.04
|
|
34
|
+
# - name: centos-8
|
|
35
35
|
#
|
|
36
36
|
# suites:
|
|
37
37
|
# - name: default
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
# chef-apply apply/recipe1.rb
|
|
46
46
|
# chef-apply apply/recipe2.rb
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
require_relative "chef_base"
|
|
49
49
|
|
|
50
50
|
module Kitchen
|
|
51
51
|
module Provisioner
|
|
@@ -21,10 +21,10 @@ require "pathname"
|
|
|
21
21
|
require "json"
|
|
22
22
|
require "cgi"
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
require_relative "chef/policyfile"
|
|
25
|
+
require_relative "chef/berkshelf"
|
|
26
|
+
require_relative "chef/common_sandbox"
|
|
27
|
+
require_relative "../util"
|
|
28
28
|
require "mixlib/install"
|
|
29
29
|
require "mixlib/install/script_generator"
|
|
30
30
|
require "license_acceptance/acceptor"
|
|
@@ -69,6 +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
73
|
).join(",")
|
|
73
74
|
# to ease upgrades, allow the user to turn deprecation warnings into errors
|
|
74
75
|
default_config :deprecations_as_errors, false
|
|
@@ -153,7 +154,7 @@ module Kitchen
|
|
|
153
154
|
|
|
154
155
|
# New Usage #
|
|
155
156
|
provisioner:
|
|
156
|
-
product_name: <chef or
|
|
157
|
+
product_name: <chef or chef-workstation>
|
|
157
158
|
install_strategy: skip
|
|
158
159
|
MSG
|
|
159
160
|
when provisioner[:require_chef_omnibus].to_s.match(/\d/)
|
|
@@ -166,7 +167,7 @@ module Kitchen
|
|
|
166
167
|
|
|
167
168
|
# New Usage #
|
|
168
169
|
provisioner:
|
|
169
|
-
product_name: <chef or
|
|
170
|
+
product_name: <chef or chef-workstation>
|
|
170
171
|
product_version: #{provisioner[:require_chef_omnibus]}
|
|
171
172
|
MSG
|
|
172
173
|
when provisioner[:require_chef_omnibus] == "latest"
|
|
@@ -179,7 +180,7 @@ module Kitchen
|
|
|
179
180
|
|
|
180
181
|
# New Usage #
|
|
181
182
|
provisioner:
|
|
182
|
-
product_name: <chef or
|
|
183
|
+
product_name: <chef or chef-workstation>
|
|
183
184
|
install_strategy: always
|
|
184
185
|
MSG
|
|
185
186
|
end
|
|
@@ -199,11 +200,11 @@ module Kitchen
|
|
|
199
200
|
|
|
200
201
|
# Deprecated Example #
|
|
201
202
|
provisioner:
|
|
202
|
-
chef_omnibus_install_options: -P
|
|
203
|
+
chef_omnibus_install_options: -P chef-workstation -c current
|
|
203
204
|
|
|
204
205
|
# New Usage #
|
|
205
206
|
provisioner:
|
|
206
|
-
product_name:
|
|
207
|
+
product_name: chef-workstation
|
|
207
208
|
channel: current
|
|
208
209
|
MSG
|
|
209
210
|
|
|
@@ -216,7 +217,7 @@ module Kitchen
|
|
|
216
217
|
|
|
217
218
|
# New Usage #
|
|
218
219
|
provisioner:
|
|
219
|
-
product_name: <chef or
|
|
220
|
+
product_name: <chef or chef-workstation>
|
|
220
221
|
download_url: http://direct-download-url
|
|
221
222
|
MSG
|
|
222
223
|
|
|
@@ -225,9 +226,9 @@ module Kitchen
|
|
|
225
226
|
fully managed by using attribute settings.
|
|
226
227
|
MSG
|
|
227
228
|
|
|
228
|
-
# Reads the local Chef::Config object (if present).
|
|
229
|
-
# we want to start bring Chef config and
|
|
230
|
-
# together.
|
|
229
|
+
# Reads the local Chef::Config object (if present). We do this because
|
|
230
|
+
# we want to start bring Chef config and Chef Workstation config closer
|
|
231
|
+
# together. For example, we want to configure proxy settings in 1
|
|
231
232
|
# location instead of 3 configuration files.
|
|
232
233
|
#
|
|
233
234
|
# @param config [Hash] initial provided configuration
|
|
@@ -328,7 +329,7 @@ module Kitchen
|
|
|
328
329
|
return unless config[:require_chef_omnibus] || config[:product_name]
|
|
329
330
|
return if config[:product_name] && config[:install_strategy] == "skip"
|
|
330
331
|
|
|
331
|
-
prefix_command(
|
|
332
|
+
prefix_command(install_script_contents)
|
|
332
333
|
end
|
|
333
334
|
|
|
334
335
|
private
|
|
@@ -509,6 +510,8 @@ module Kitchen
|
|
|
509
510
|
channel: config[:channel].to_sym,
|
|
510
511
|
install_command_options: {
|
|
511
512
|
install_strategy: config[:install_strategy],
|
|
513
|
+
tmp_dir: config[:root_path],
|
|
514
|
+
"TMPDIR" => config[:root_path],
|
|
512
515
|
},
|
|
513
516
|
}.tap do |opts|
|
|
514
517
|
opts[:shell_type] = :ps1 if powershell_shell?
|
|
@@ -534,7 +537,6 @@ module Kitchen
|
|
|
534
537
|
# install.ps1 only supports http_proxy
|
|
535
538
|
prox.delete_if { |p| %i{https_proxy ftp_proxy no_proxy}.include?(p) } if powershell_shell?
|
|
536
539
|
end
|
|
537
|
-
|
|
538
540
|
opts[:install_command_options].merge!(proxies)
|
|
539
541
|
end)
|
|
540
542
|
config[:chef_omnibus_root] = installer.root
|
|
@@ -553,8 +555,14 @@ module Kitchen
|
|
|
553
555
|
end
|
|
554
556
|
|
|
555
557
|
def install_from_file(command)
|
|
556
|
-
install_file = "/
|
|
557
|
-
script = [
|
|
558
|
+
install_file = "#{config[:root_path]}/chef-installer.sh"
|
|
559
|
+
script = []
|
|
560
|
+
script << "mkdir -p #{config[:root_path]}"
|
|
561
|
+
script << "if [ $? -ne 0 ]; then"
|
|
562
|
+
script << " echo Kitchen config setting root_path: '#{config[:root_path]}' not creatable by regular user "
|
|
563
|
+
script << " exit 1"
|
|
564
|
+
script << "fi"
|
|
565
|
+
script << "cat > #{install_file} <<\"EOL\""
|
|
558
566
|
script << command
|
|
559
567
|
script << "EOL"
|
|
560
568
|
script << "chmod +x #{install_file}"
|
|
@@ -569,7 +577,7 @@ module Kitchen
|
|
|
569
577
|
config[:require_chef_omnibus], powershell_shell?, install_options
|
|
570
578
|
)
|
|
571
579
|
config[:chef_omnibus_root] = installer.root
|
|
572
|
-
installer.install_command
|
|
580
|
+
sudo(installer.install_command)
|
|
573
581
|
end
|
|
574
582
|
|
|
575
583
|
# Hook used in subclasses to indicate support for policyfiles.
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
require "shellwords"
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
require_relative "base"
|
|
22
|
+
require_relative "../version"
|
|
23
23
|
|
|
24
24
|
module Kitchen
|
|
25
25
|
module Provisioner
|
|
@@ -106,13 +106,17 @@ module Kitchen
|
|
|
106
106
|
|
|
107
107
|
if config[:arguments] && !config[:arguments].empty?
|
|
108
108
|
if config[:arguments].is_a?(Array)
|
|
109
|
-
|
|
109
|
+
if powershell_shell?
|
|
110
|
+
script = ([script] + config[:arguments]).join(" ")
|
|
111
|
+
else
|
|
112
|
+
script = Shellwords.join([script] + config[:arguments])
|
|
113
|
+
end
|
|
110
114
|
else
|
|
111
115
|
script.concat(" ").concat(config[:arguments].to_s)
|
|
112
116
|
end
|
|
113
117
|
end
|
|
114
118
|
|
|
115
|
-
code = powershell_shell? ? %{&
|
|
119
|
+
code = powershell_shell? ? %{& #{script}} : sudo(script)
|
|
116
120
|
|
|
117
121
|
prefix_command(wrap_shell_code(code))
|
|
118
122
|
end
|
data/lib/kitchen/rake_tasks.rb
CHANGED
data/lib/kitchen/ssh.rb
CHANGED
|
@@ -21,8 +21,8 @@ require "net/ssh"
|
|
|
21
21
|
require "net/scp"
|
|
22
22
|
require "socket"
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
require_relative "errors"
|
|
25
|
+
require_relative "login_command"
|
|
26
26
|
|
|
27
27
|
module Kitchen
|
|
28
28
|
# Wrapped exception for any internally raised SSH-related errors.
|
data/lib/kitchen/thor_tasks.rb
CHANGED
data/lib/kitchen/transport.rb
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
require_relative "plugin"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
22
|
# A transport is responsible for the communication with an instance,
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
# See the License for the specific language governing permissions and
|
|
18
18
|
# limitations under the License.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
require_relative "../configurable"
|
|
21
|
+
require_relative "../errors"
|
|
22
|
+
require_relative "../lazy_hash"
|
|
23
|
+
require_relative "../logging"
|
|
24
|
+
require_relative "../login_command"
|
|
25
25
|
|
|
26
26
|
module Kitchen
|
|
27
27
|
module Transport
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
require "fileutils"
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
require_relative "../shell_out"
|
|
18
|
+
require_relative "base"
|
|
19
|
+
require_relative "../version"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
22
|
module Transport
|
data/lib/kitchen/util.rb
CHANGED
data/lib/kitchen/verifier.rb
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
require_relative "plugin"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
22
|
# A verifier is responsible for running tests post-converge to confirm that
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
require_relative "../errors"
|
|
20
|
+
require_relative "../configurable"
|
|
21
|
+
require_relative "../logging"
|
|
22
22
|
|
|
23
23
|
module Kitchen
|
|
24
24
|
module Verifier
|
|
@@ -75,6 +75,13 @@ module Kitchen
|
|
|
75
75
|
debug("Transfer complete")
|
|
76
76
|
conn.execute(prepare_command)
|
|
77
77
|
conn.execute(run_command)
|
|
78
|
+
|
|
79
|
+
info("Downloading files from #{instance.to_str}")
|
|
80
|
+
config[:downloads].to_h.each do |remotes, local|
|
|
81
|
+
debug("Downloading #{Array(remotes).join(", ")} to #{local}")
|
|
82
|
+
conn.download(remotes, local)
|
|
83
|
+
end
|
|
84
|
+
debug("Download complete")
|
|
78
85
|
end
|
|
79
86
|
rescue Kitchen::Transport::TransportFailed => ex
|
|
80
87
|
raise ActionFailed, ex.message
|
data/lib/kitchen/version.rb
CHANGED
|
@@ -44,7 +44,7 @@ Function Download-Chef($md_url, $dst) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
Function Install-Chef($msi) {
|
|
47
|
-
Log "Installing Chef package $msi"
|
|
47
|
+
Log "Installing Chef Infra Client package $msi"
|
|
48
48
|
$p = Start-Process -FilePath "msiexec.exe" -ArgumentList "/qn /i $msi" -Passthru -Wait
|
|
49
49
|
|
|
50
50
|
if ($p.ExitCode -ne 0) { throw "msiexec was not successful. Received exit code $($p.ExitCode)" }
|
|
@@ -73,11 +73,11 @@ Try {
|
|
|
73
73
|
$msi = Unresolve-Path $msi
|
|
74
74
|
|
|
75
75
|
if (Check-UpdateChef $chef_omnibus_root $version) {
|
|
76
|
-
Write-Host "-----> Installing Chef package ($pretty_version)`n"
|
|
76
|
+
Write-Host "-----> Installing Chef Infra Client package ($pretty_version)`n"
|
|
77
77
|
Download-Chef "$chef_metadata_url" $msi
|
|
78
78
|
Install-Chef $msi
|
|
79
79
|
} else {
|
|
80
|
-
Write-Host "-----> Chef package installation detected ($pretty_version)`n"
|
|
80
|
+
Write-Host "-----> Chef Infra Client package installation detected ($pretty_version)`n"
|
|
81
81
|
}
|
|
82
82
|
Catch {
|
|
83
83
|
Write-Error ($_ | ft -Property * | out-string) -ErrorAction Continue
|
|
@@ -206,7 +206,7 @@ unable_to_download() {
|
|
|
206
206
|
main() {
|
|
207
207
|
should_update_chef "$chef_omnibus_root" "$version"
|
|
208
208
|
if test $? -eq 0; then
|
|
209
|
-
echo "-----> Installing Chef package (${pretty_version})";
|
|
209
|
+
echo "-----> Installing Chef Infra Client package (${pretty_version})";
|
|
210
210
|
|
|
211
211
|
# solaris 10 lacks recent enough credentials, so http url is used
|
|
212
212
|
platform="`/usr/bin/uname -s 2>/dev/null`";
|
|
@@ -218,7 +218,7 @@ main() {
|
|
|
218
218
|
do_download "$chef_omnibus_url" /tmp/install.sh;
|
|
219
219
|
$sudo_sh /tmp/install.sh $install_flags;
|
|
220
220
|
else
|
|
221
|
-
echo "-----> Chef package installation detected (${pretty_version})";
|
|
221
|
+
echo "-----> Chef Infra Client package installation detected (${pretty_version})";
|
|
222
222
|
fi
|
|
223
223
|
}
|
|
224
224
|
|
data/test-kitchen.gemspec
CHANGED
|
@@ -24,12 +24,12 @@ Gem::Specification.new do |gem|
|
|
|
24
24
|
gem.required_ruby_version = ">= 2.3"
|
|
25
25
|
|
|
26
26
|
gem.add_dependency "mixlib-shellout", ">= 1.2", "< 4.0"
|
|
27
|
-
gem.add_dependency "net-scp", ">= 1.1", "<
|
|
28
|
-
gem.add_dependency "net-ssh", ">= 2.9", "<
|
|
27
|
+
gem.add_dependency "net-scp", ">= 1.1", "< 4.0" # pinning until we can confirm 4+ works
|
|
28
|
+
gem.add_dependency "net-ssh", ">= 2.9", "< 7.0" # pinning until we can confirm 7+ works
|
|
29
29
|
gem.add_dependency "net-ssh-gateway", ">= 1.2", "< 3.0" # pinning until we can confirm 3+ works
|
|
30
30
|
gem.add_dependency "ed25519", "~> 1.2" # ed25519 ssh key support
|
|
31
31
|
gem.add_dependency "bcrypt_pbkdf", "~> 1.0" # ed25519 ssh key support
|
|
32
|
-
gem.add_dependency "thor", "
|
|
32
|
+
gem.add_dependency "thor", ">= 0.19", "< 2.0"
|
|
33
33
|
gem.add_dependency "mixlib-install", "~> 3.6"
|
|
34
34
|
gem.add_dependency "winrm", "~> 2.0"
|
|
35
35
|
gem.add_dependency "winrm-elevated", "~> 1.0"
|
|
@@ -42,8 +42,8 @@ Gem::Specification.new do |gem|
|
|
|
42
42
|
gem.add_development_dependency "bundler"
|
|
43
43
|
gem.add_development_dependency "rake"
|
|
44
44
|
|
|
45
|
-
gem.add_development_dependency "aruba", "~> 0.11"
|
|
46
|
-
gem.add_development_dependency "fakefs", "~> 0
|
|
45
|
+
gem.add_development_dependency "aruba", "~> 0.11", "< 1.0"
|
|
46
|
+
gem.add_development_dependency "fakefs", "~> 1.0"
|
|
47
47
|
gem.add_development_dependency "minitest", "~> 5.3", "< 5.12"
|
|
48
48
|
gem.add_development_dependency "mocha", "~> 1.1"
|
|
49
49
|
gem.add_development_dependency "cucumber", ">= 2.1", "< 4.0" # we just need to validate 4.0 when it comes out
|
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: 2.3
|
|
4
|
+
version: 2.5.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fletcher Nichol
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mixlib-shellout
|
|
@@ -39,7 +39,7 @@ dependencies:
|
|
|
39
39
|
version: '1.1'
|
|
40
40
|
- - "<"
|
|
41
41
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: '
|
|
42
|
+
version: '4.0'
|
|
43
43
|
type: :runtime
|
|
44
44
|
prerelease: false
|
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -49,7 +49,7 @@ dependencies:
|
|
|
49
49
|
version: '1.1'
|
|
50
50
|
- - "<"
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
|
-
version: '
|
|
52
|
+
version: '4.0'
|
|
53
53
|
- !ruby/object:Gem::Dependency
|
|
54
54
|
name: net-ssh
|
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -59,7 +59,7 @@ dependencies:
|
|
|
59
59
|
version: '2.9'
|
|
60
60
|
- - "<"
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: '
|
|
62
|
+
version: '7.0'
|
|
63
63
|
type: :runtime
|
|
64
64
|
prerelease: false
|
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -69,7 +69,7 @@ dependencies:
|
|
|
69
69
|
version: '2.9'
|
|
70
70
|
- - "<"
|
|
71
71
|
- !ruby/object:Gem::Version
|
|
72
|
-
version: '
|
|
72
|
+
version: '7.0'
|
|
73
73
|
- !ruby/object:Gem::Dependency
|
|
74
74
|
name: net-ssh-gateway
|
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -122,16 +122,22 @@ dependencies:
|
|
|
122
122
|
name: thor
|
|
123
123
|
requirement: !ruby/object:Gem::Requirement
|
|
124
124
|
requirements:
|
|
125
|
-
- - "
|
|
125
|
+
- - ">="
|
|
126
126
|
- !ruby/object:Gem::Version
|
|
127
127
|
version: '0.19'
|
|
128
|
+
- - "<"
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '2.0'
|
|
128
131
|
type: :runtime
|
|
129
132
|
prerelease: false
|
|
130
133
|
version_requirements: !ruby/object:Gem::Requirement
|
|
131
134
|
requirements:
|
|
132
|
-
- - "
|
|
135
|
+
- - ">="
|
|
133
136
|
- !ruby/object:Gem::Version
|
|
134
137
|
version: '0.19'
|
|
138
|
+
- - "<"
|
|
139
|
+
- !ruby/object:Gem::Version
|
|
140
|
+
version: '2.0'
|
|
135
141
|
- !ruby/object:Gem::Dependency
|
|
136
142
|
name: mixlib-install
|
|
137
143
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -257,6 +263,9 @@ dependencies:
|
|
|
257
263
|
- - "~>"
|
|
258
264
|
- !ruby/object:Gem::Version
|
|
259
265
|
version: '0.11'
|
|
266
|
+
- - "<"
|
|
267
|
+
- !ruby/object:Gem::Version
|
|
268
|
+
version: '1.0'
|
|
260
269
|
type: :development
|
|
261
270
|
prerelease: false
|
|
262
271
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -264,20 +273,23 @@ dependencies:
|
|
|
264
273
|
- - "~>"
|
|
265
274
|
- !ruby/object:Gem::Version
|
|
266
275
|
version: '0.11'
|
|
276
|
+
- - "<"
|
|
277
|
+
- !ruby/object:Gem::Version
|
|
278
|
+
version: '1.0'
|
|
267
279
|
- !ruby/object:Gem::Dependency
|
|
268
280
|
name: fakefs
|
|
269
281
|
requirement: !ruby/object:Gem::Requirement
|
|
270
282
|
requirements:
|
|
271
283
|
- - "~>"
|
|
272
284
|
- !ruby/object:Gem::Version
|
|
273
|
-
version: '0
|
|
285
|
+
version: '1.0'
|
|
274
286
|
type: :development
|
|
275
287
|
prerelease: false
|
|
276
288
|
version_requirements: !ruby/object:Gem::Requirement
|
|
277
289
|
requirements:
|
|
278
290
|
- - "~>"
|
|
279
291
|
- !ruby/object:Gem::Version
|
|
280
|
-
version: '0
|
|
292
|
+
version: '1.0'
|
|
281
293
|
- !ruby/object:Gem::Dependency
|
|
282
294
|
name: minitest
|
|
283
295
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -487,7 +499,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
487
499
|
- !ruby/object:Gem::Version
|
|
488
500
|
version: '0'
|
|
489
501
|
requirements: []
|
|
490
|
-
rubygems_version: 3.
|
|
502
|
+
rubygems_version: 3.1.2
|
|
491
503
|
signing_key:
|
|
492
504
|
specification_version: 4
|
|
493
505
|
summary: Test Kitchen is an integration tool for developing and testing infrastructure
|