test-kitchen 1.14.1 → 1.14.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 +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
data/lib/kitchen/collection.rb
CHANGED
|
@@ -19,14 +19,12 @@
|
|
|
19
19
|
require "delegate"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
|
-
|
|
23
22
|
# Delegate class which adds the ability to find single and multiple
|
|
24
23
|
# objects by their #name in an Array. Hey, it's better than monkey-patching
|
|
25
24
|
# Array, right?
|
|
26
25
|
#
|
|
27
26
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
28
27
|
class Collection < SimpleDelegator
|
|
29
|
-
|
|
30
28
|
# Returns a single object by its name, or nil if none are found.
|
|
31
29
|
#
|
|
32
30
|
# @param name [String] name of object
|
data/lib/kitchen/color.rb
CHANGED
|
@@ -17,26 +17,24 @@
|
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
19
|
module Kitchen
|
|
20
|
-
|
|
21
20
|
# Utility methods to help ouput colorized text in a terminal. The
|
|
22
21
|
# implementation is a compressed mashup of code from the Thor and Foreman
|
|
23
22
|
# projects.
|
|
24
23
|
#
|
|
25
24
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
26
25
|
module Color
|
|
27
|
-
|
|
28
26
|
ANSI = {
|
|
29
|
-
:
|
|
30
|
-
:
|
|
31
|
-
:
|
|
32
|
-
:
|
|
33
|
-
:
|
|
27
|
+
reset: 0, black: 30, red: 31, green: 32, yellow: 33,
|
|
28
|
+
blue: 34, magenta: 35, cyan: 36, white: 37,
|
|
29
|
+
bright_black: 90, bright_red: 91, bright_green: 92,
|
|
30
|
+
bright_yellow: 93, bright_blue: 94, bright_magenta: 95,
|
|
31
|
+
bright_cyan: 96, bright_white: 97
|
|
34
32
|
}.freeze
|
|
35
33
|
|
|
36
|
-
COLORS = %w
|
|
34
|
+
COLORS = %w{
|
|
37
35
|
cyan yellow green magenta blue bright_cyan bright_yellow
|
|
38
36
|
bright_green bright_magenta bright_blue
|
|
39
|
-
|
|
37
|
+
}.freeze
|
|
40
38
|
|
|
41
39
|
# Returns an ansi escaped string representing a color control sequence.
|
|
42
40
|
#
|
data/lib/kitchen/command.rb
CHANGED
|
@@ -19,14 +19,11 @@
|
|
|
19
19
|
require "thread"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
|
-
|
|
23
22
|
module Command
|
|
24
|
-
|
|
25
23
|
# Base class for CLI commands.
|
|
26
24
|
#
|
|
27
25
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
28
26
|
class Base
|
|
29
|
-
|
|
30
27
|
include Logging
|
|
31
28
|
|
|
32
29
|
# Contstructs a new Command object.
|
|
@@ -150,7 +147,6 @@ module Kitchen
|
|
|
150
147
|
#
|
|
151
148
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
152
149
|
module RunAction
|
|
153
|
-
|
|
154
150
|
# Run an instance action (create, converge, setup, verify, destroy) on
|
|
155
151
|
# a collection of instances. The instance actions will take place in a
|
|
156
152
|
# seperate thread of execution which may or may not be running
|
|
@@ -21,14 +21,11 @@ require "kitchen/command"
|
|
|
21
21
|
require "benchmark"
|
|
22
22
|
|
|
23
23
|
module Kitchen
|
|
24
|
-
|
|
25
24
|
module Command
|
|
26
|
-
|
|
27
25
|
# Command to run a single action one or more instances.
|
|
28
26
|
#
|
|
29
27
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
30
28
|
class Action < Kitchen::Command::Base
|
|
31
|
-
|
|
32
29
|
include RunAction
|
|
33
30
|
|
|
34
31
|
# Invoke the command.
|
|
@@ -19,18 +19,15 @@
|
|
|
19
19
|
require "kitchen/command"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
|
-
|
|
23
22
|
module Command
|
|
24
|
-
|
|
25
23
|
# Command to launch a Pry-based Kitchen console..
|
|
26
24
|
#
|
|
27
25
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
28
26
|
class Console < Kitchen::Command::Base
|
|
29
|
-
|
|
30
27
|
# Invoke the command.
|
|
31
28
|
def call
|
|
32
29
|
require "pry"
|
|
33
|
-
Pry.start(@config, :
|
|
30
|
+
Pry.start(@config, prompt: [prompt(">"), prompt("*")])
|
|
34
31
|
rescue LoadError
|
|
35
32
|
warn %{Make sure you have the pry gem installed. You can install it with:}
|
|
36
33
|
warn %{`gem install pry` or including 'gem "pry"' in your Gemfile.}
|
|
@@ -45,13 +42,13 @@ module Kitchen
|
|
|
45
42
|
# @return [proc] a prompt proc
|
|
46
43
|
# @api private
|
|
47
44
|
def prompt(char)
|
|
48
|
-
proc
|
|
45
|
+
proc do |target_self, nest_level, pry|
|
|
49
46
|
[
|
|
50
47
|
"[#{pry.input_array.size}] ",
|
|
51
48
|
"kc(#{Pry.view_clip(target_self.class)})",
|
|
52
|
-
"#{":#{nest_level}" unless nest_level.zero?}#{char} "
|
|
49
|
+
"#{":#{nest_level}" unless nest_level.zero?}#{char} ",
|
|
53
50
|
].join
|
|
54
|
-
|
|
51
|
+
end
|
|
55
52
|
end
|
|
56
53
|
end
|
|
57
54
|
end
|
|
@@ -22,14 +22,11 @@ require "kitchen/diagnostic"
|
|
|
22
22
|
require "yaml"
|
|
23
23
|
|
|
24
24
|
module Kitchen
|
|
25
|
-
|
|
26
25
|
module Command
|
|
27
|
-
|
|
28
26
|
# Command to log into to instance.
|
|
29
27
|
#
|
|
30
28
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
31
29
|
class Diagnose < Kitchen::Command::Base
|
|
32
|
-
|
|
33
30
|
# Invoke the command.
|
|
34
31
|
def call
|
|
35
32
|
instances = record_failure { load_instances }
|
|
@@ -37,7 +34,7 @@ module Kitchen
|
|
|
37
34
|
loader = record_failure { load_loader }
|
|
38
35
|
|
|
39
36
|
puts Kitchen::Diagnostic.new(
|
|
40
|
-
:
|
|
37
|
+
loader: loader, instances: instances, plugins: plugins?
|
|
41
38
|
).read.to_yaml
|
|
42
39
|
end
|
|
43
40
|
|
|
@@ -64,11 +61,7 @@ module Kitchen
|
|
|
64
61
|
# @return [Hash,nil] a hash or nil
|
|
65
62
|
# @api private
|
|
66
63
|
def load_loader
|
|
67
|
-
if options[:all] || options[:loader]
|
|
68
|
-
@loader
|
|
69
|
-
else
|
|
70
|
-
nil
|
|
71
|
-
end
|
|
64
|
+
@loader if options[:all] || options[:loader]
|
|
72
65
|
end
|
|
73
66
|
|
|
74
67
|
# Returns a hash with exception detail if an exception is raised in the
|
|
@@ -80,11 +73,11 @@ module Kitchen
|
|
|
80
73
|
yield
|
|
81
74
|
rescue => e
|
|
82
75
|
{
|
|
83
|
-
:
|
|
84
|
-
:
|
|
85
|
-
:
|
|
86
|
-
:
|
|
87
|
-
}
|
|
76
|
+
error: {
|
|
77
|
+
exception: e.inspect,
|
|
78
|
+
message: e.message,
|
|
79
|
+
backtrace: e.backtrace,
|
|
80
|
+
},
|
|
88
81
|
}
|
|
89
82
|
end
|
|
90
83
|
end
|
|
@@ -27,14 +27,11 @@ rescue LoadError # rubocop:disable Lint/HandleExceptions
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
module Kitchen
|
|
30
|
-
|
|
31
30
|
module Command
|
|
32
|
-
|
|
33
31
|
# Command to discover drivers published on RubyGems.
|
|
34
32
|
#
|
|
35
33
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
36
34
|
class DriverDiscover < Kitchen::Command::Base
|
|
37
|
-
|
|
38
35
|
# Invoke the command.
|
|
39
36
|
def call
|
|
40
37
|
# We are introducing the idea of using the Chef configuration as a
|
|
@@ -48,7 +45,7 @@ module Kitchen
|
|
|
48
45
|
specs = fetch_gem_specs.sort { |x, y| x[0] <=> y[0] }
|
|
49
46
|
specs = specs[0, 49].push(["...", "..."]) if specs.size > 49
|
|
50
47
|
specs = specs.unshift(["Gem Name", "Latest Stable Release"])
|
|
51
|
-
print_table(specs, :
|
|
48
|
+
print_table(specs, indent: 4)
|
|
52
49
|
end
|
|
53
50
|
|
|
54
51
|
private
|
data/lib/kitchen/command/exec.rb
CHANGED
|
@@ -19,14 +19,11 @@
|
|
|
19
19
|
require "kitchen/command"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
|
-
|
|
23
22
|
module Command
|
|
24
|
-
|
|
25
23
|
# Execute command on remote instance.
|
|
26
24
|
#
|
|
27
25
|
# @author SAWANOBORI Yukihiko (<sawanoboriyu@higanworks.com>)
|
|
28
26
|
class Exec < Kitchen::Command::Base
|
|
29
|
-
|
|
30
27
|
# Invoke the command.
|
|
31
28
|
def call
|
|
32
29
|
results = parse_subcommand(args.first)
|
data/lib/kitchen/command/list.rb
CHANGED
|
@@ -20,14 +20,11 @@ require "kitchen/command"
|
|
|
20
20
|
require "json"
|
|
21
21
|
|
|
22
22
|
module Kitchen
|
|
23
|
-
|
|
24
23
|
module Command
|
|
25
|
-
|
|
26
24
|
# Command to list one or more instances.
|
|
27
25
|
#
|
|
28
26
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
29
27
|
class List < Kitchen::Command::Base
|
|
30
|
-
|
|
31
28
|
# Invoke the command.
|
|
32
29
|
def call
|
|
33
30
|
result = parse_subcommand(args.first)
|
|
@@ -68,7 +65,7 @@ module Kitchen
|
|
|
68
65
|
color_pad(instance.verifier.name),
|
|
69
66
|
color_pad(instance.transport.name),
|
|
70
67
|
format_last_action(instance.last_action),
|
|
71
|
-
format_last_error(instance.last_error)
|
|
68
|
+
format_last_error(instance.last_error),
|
|
72
69
|
]
|
|
73
70
|
end
|
|
74
71
|
|
|
@@ -111,7 +108,7 @@ module Kitchen
|
|
|
111
108
|
colorize("Provisioner", :green), colorize("Verifier", :green),
|
|
112
109
|
colorize("Transport", :green), colorize("Last Action", :green),
|
|
113
110
|
colorize("Last Error", :green)
|
|
114
|
-
]
|
|
111
|
+
],
|
|
115
112
|
]
|
|
116
113
|
table += Array(result).map { |i| display_instance(i) }
|
|
117
114
|
print_table(table)
|
|
@@ -123,13 +120,13 @@ module Kitchen
|
|
|
123
120
|
# @api private
|
|
124
121
|
def to_hash(result)
|
|
125
122
|
{
|
|
126
|
-
:
|
|
127
|
-
:
|
|
128
|
-
:
|
|
129
|
-
:
|
|
130
|
-
:
|
|
131
|
-
:
|
|
132
|
-
:
|
|
123
|
+
instance: result.name,
|
|
124
|
+
driver: result.driver.name,
|
|
125
|
+
provisioner: result.provisioner.name,
|
|
126
|
+
verifier: result.verifier.name,
|
|
127
|
+
transport: result.transport.name,
|
|
128
|
+
last_action: result.last_action,
|
|
129
|
+
last_error: result.last_error,
|
|
133
130
|
}
|
|
134
131
|
end
|
|
135
132
|
|
|
@@ -19,14 +19,11 @@
|
|
|
19
19
|
require "kitchen/command"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
|
-
|
|
23
22
|
module Command
|
|
24
|
-
|
|
25
23
|
# Command to log into to instance.
|
|
26
24
|
#
|
|
27
25
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
28
26
|
class Login < Kitchen::Command::Base
|
|
29
|
-
|
|
30
27
|
# Invoke the command.
|
|
31
28
|
def call
|
|
32
29
|
results = parse_subcommand(args.first)
|
data/lib/kitchen/command/sink.rb
CHANGED
|
@@ -19,34 +19,31 @@
|
|
|
19
19
|
require "kitchen/command"
|
|
20
20
|
|
|
21
21
|
module Kitchen
|
|
22
|
-
|
|
23
22
|
module Command
|
|
24
|
-
|
|
25
23
|
# Command to... include the sink.
|
|
26
24
|
#
|
|
27
25
|
# @author Seth Vargo <sethvargo@gmail.com>
|
|
28
26
|
class Sink < Kitchen::Command::Base
|
|
29
|
-
|
|
30
27
|
# Invoke the command.
|
|
31
28
|
def call
|
|
32
29
|
puts [
|
|
33
30
|
"",
|
|
34
31
|
" ___ ",
|
|
35
32
|
" ' _ '. ",
|
|
36
|
-
|
|
33
|
+
' / /` `\\ \\ ',
|
|
37
34
|
" | | [__] ",
|
|
38
35
|
" | | {{ ",
|
|
39
36
|
" | | }} ",
|
|
40
37
|
" _ | | _ {{ ",
|
|
41
38
|
" ___________<_>_| |_<_>}}________ ",
|
|
42
39
|
" .=======^=(___)=^={{====. ",
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
' / .----------------}}---. \\ ',
|
|
41
|
+
' / / {{ \\ \\ ',
|
|
42
|
+
' / / }} \\ \\ ',
|
|
46
43
|
" ( '=========================' ) ",
|
|
47
44
|
" '-----------------------------' ",
|
|
48
|
-
" ",
|
|
49
|
-
""
|
|
45
|
+
" ", # necessary newline
|
|
46
|
+
"",
|
|
50
47
|
].map(&:rstrip).join("\n")
|
|
51
48
|
end
|
|
52
49
|
end
|
data/lib/kitchen/command/test.rb
CHANGED
|
@@ -21,19 +21,16 @@ require "kitchen/command"
|
|
|
21
21
|
require "benchmark"
|
|
22
22
|
|
|
23
23
|
module Kitchen
|
|
24
|
-
|
|
25
24
|
module Command
|
|
26
|
-
|
|
27
25
|
# Command to test one or more instances.
|
|
28
26
|
#
|
|
29
27
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
30
28
|
class Test < Kitchen::Command::Base
|
|
31
|
-
|
|
32
29
|
include RunAction
|
|
33
30
|
|
|
34
31
|
# Invoke the command.
|
|
35
32
|
def call
|
|
36
|
-
|
|
33
|
+
unless %w{passing always never}.include?(options[:destroy])
|
|
37
34
|
raise ArgumentError, "Destroy mode must be passing, always, or never."
|
|
38
35
|
end
|
|
39
36
|
|
data/lib/kitchen/config.rb
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
|
|
19
19
|
module Kitchen
|
|
20
|
-
|
|
21
20
|
# Base configuration class for Kitchen. This class exposes configuration such
|
|
22
21
|
# as the location of the Kitchen config file, instances, log_levels, etc.
|
|
23
22
|
# This object is a factory object, meaning that it is responsible for
|
|
@@ -48,7 +47,6 @@ module Kitchen
|
|
|
48
47
|
#
|
|
49
48
|
# @author Fletcher Nichol <fnichol@nichol.ca>
|
|
50
49
|
class Config
|
|
51
|
-
|
|
52
50
|
# @return [String] the absolute path to the root of a Test Kitchen project
|
|
53
51
|
# @api private
|
|
54
52
|
attr_reader :kitchen_root
|
|
@@ -209,18 +207,18 @@ module Kitchen
|
|
|
209
207
|
# @api private
|
|
210
208
|
def kitchen_config
|
|
211
209
|
@kitchen_config ||= {
|
|
212
|
-
:
|
|
213
|
-
:
|
|
214
|
-
:
|
|
215
|
-
:
|
|
216
|
-
:
|
|
210
|
+
defaults: {
|
|
211
|
+
driver: Driver::DEFAULT_PLUGIN,
|
|
212
|
+
provisioner: Provisioner::DEFAULT_PLUGIN,
|
|
213
|
+
verifier: Verifier::DEFAULT_PLUGIN,
|
|
214
|
+
transport: lambda do |_suite, platform|
|
|
217
215
|
platform =~ /^win/i ? "winrm" : Transport::DEFAULT_PLUGIN
|
|
218
|
-
|
|
216
|
+
end,
|
|
219
217
|
},
|
|
220
|
-
:
|
|
221
|
-
:
|
|
222
|
-
:
|
|
223
|
-
:
|
|
218
|
+
kitchen_root: kitchen_root,
|
|
219
|
+
test_base_path: test_base_path,
|
|
220
|
+
log_level: log_level,
|
|
221
|
+
log_overwrite: log_overwrite,
|
|
224
222
|
}
|
|
225
223
|
end
|
|
226
224
|
|
|
@@ -245,14 +243,14 @@ module Kitchen
|
|
|
245
243
|
# @api private
|
|
246
244
|
def new_instance(suite, platform, index)
|
|
247
245
|
Instance.new(
|
|
248
|
-
:
|
|
249
|
-
:
|
|
250
|
-
:
|
|
251
|
-
:
|
|
252
|
-
:
|
|
253
|
-
:
|
|
254
|
-
:
|
|
255
|
-
:
|
|
246
|
+
driver: new_driver(suite, platform),
|
|
247
|
+
logger: new_instance_logger(suite, platform, index),
|
|
248
|
+
suite: suite,
|
|
249
|
+
platform: platform,
|
|
250
|
+
provisioner: new_provisioner(suite, platform),
|
|
251
|
+
transport: new_transport(suite, platform),
|
|
252
|
+
verifier: new_verifier(suite, platform),
|
|
253
|
+
state_file: new_state_file(suite, platform)
|
|
256
254
|
)
|
|
257
255
|
end
|
|
258
256
|
|
|
@@ -268,13 +266,13 @@ module Kitchen
|
|
|
268
266
|
name = instance_name(suite, platform)
|
|
269
267
|
log_location = File.join(log_root, "#{name}.log").to_s
|
|
270
268
|
Logger.new(
|
|
271
|
-
:
|
|
272
|
-
:
|
|
273
|
-
:
|
|
274
|
-
:
|
|
275
|
-
:
|
|
276
|
-
:
|
|
277
|
-
:
|
|
269
|
+
stdout: STDOUT,
|
|
270
|
+
color: Color::COLORS[index % Color::COLORS.size].to_sym,
|
|
271
|
+
logdev: log_location,
|
|
272
|
+
level: Util.to_logger_level(log_level),
|
|
273
|
+
log_overwrite: log_overwrite,
|
|
274
|
+
progname: name,
|
|
275
|
+
colorize: @colorize
|
|
278
276
|
)
|
|
279
277
|
end
|
|
280
278
|
|