test-kitchen 1.20.0 → 1.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitattributes +0 -0
- data/.github/ISSUE_TEMPLATE.md +0 -0
- data/.gitignore +0 -0
- data/.kitchen.ci.yml +0 -0
- data/.kitchen.dokken.yml +0 -0
- data/.kitchen.proxy.yml +1 -1
- data/.rubocop.yml +1 -1
- data/.travis.yml +6 -2
- data/.yardopts +0 -0
- data/Berksfile +0 -0
- data/CHANGELOG.md +26 -0
- data/CONTRIBUTING.md +0 -0
- data/ECOSYSTEM.md +0 -0
- data/Gemfile +6 -2
- data/Gemfile.proxy_tests +0 -0
- data/Guardfile +0 -0
- data/LICENSE +0 -0
- data/MAINTAINERS.md +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/appveyor.yml +4 -3
- data/features/kitchen_action_commands.feature +0 -0
- data/features/kitchen_command.feature +0 -0
- data/features/kitchen_console_command.feature +0 -0
- data/features/kitchen_defaults.feature +2 -2
- data/features/kitchen_diagnose_command.feature +0 -0
- data/features/kitchen_help_command.feature +0 -0
- data/features/kitchen_init_command.feature +19 -39
- data/features/kitchen_list_command.feature +3 -3
- data/features/kitchen_login_command.feature +0 -0
- data/features/kitchen_sink_command.feature +0 -0
- data/features/kitchen_test_command.feature +0 -0
- data/features/step_definitions/gem_steps.rb +0 -12
- data/features/step_definitions/git_steps.rb +0 -0
- data/features/step_definitions/output_steps.rb +0 -0
- data/features/support/env.rb +0 -0
- data/lib/kitchen.rb +0 -0
- data/lib/kitchen/base64_stream.rb +0 -0
- data/lib/kitchen/cli.rb +15 -11
- data/lib/kitchen/collection.rb +0 -0
- data/lib/kitchen/color.rb +0 -0
- data/lib/kitchen/command.rb +1 -1
- data/lib/kitchen/command/action.rb +0 -0
- data/lib/kitchen/command/console.rb +0 -0
- data/lib/kitchen/command/diagnose.rb +0 -0
- data/lib/kitchen/command/doctor.rb +0 -0
- data/lib/kitchen/command/exec.rb +0 -0
- data/lib/kitchen/command/list.rb +0 -0
- data/lib/kitchen/command/login.rb +0 -0
- data/lib/kitchen/command/package.rb +0 -0
- data/lib/kitchen/command/sink.rb +0 -0
- data/lib/kitchen/command/test.rb +0 -0
- data/lib/kitchen/config.rb +1 -1
- data/lib/kitchen/configurable.rb +0 -0
- data/lib/kitchen/data_munger.rb +10 -10
- data/lib/kitchen/diagnostic.rb +0 -0
- data/lib/kitchen/driver.rb +0 -0
- data/lib/kitchen/driver/base.rb +0 -0
- data/lib/kitchen/driver/dummy.rb +0 -0
- data/lib/kitchen/driver/exec.rb +1 -1
- data/lib/kitchen/driver/proxy.rb +1 -1
- data/lib/kitchen/driver/ssh_base.rb +0 -0
- data/lib/kitchen/errors.rb +0 -0
- data/lib/kitchen/generator/init.rb +1 -36
- data/lib/kitchen/instance.rb +0 -0
- data/lib/kitchen/lazy_hash.rb +1 -1
- data/lib/kitchen/loader/yaml.rb +31 -6
- data/lib/kitchen/logger.rb +1 -1
- data/lib/kitchen/logging.rb +0 -0
- data/lib/kitchen/login_command.rb +0 -0
- data/lib/kitchen/metadata_chopper.rb +0 -0
- data/lib/kitchen/platform.rb +0 -0
- data/lib/kitchen/provisioner.rb +0 -0
- data/lib/kitchen/provisioner/base.rb +0 -0
- data/lib/kitchen/provisioner/chef/berkshelf.rb +23 -19
- data/lib/kitchen/provisioner/chef/common_sandbox.rb +0 -0
- data/lib/kitchen/provisioner/chef/librarian.rb +25 -21
- data/lib/kitchen/provisioner/chef/policyfile.rb +23 -18
- data/lib/kitchen/provisioner/chef_apply.rb +2 -2
- data/lib/kitchen/provisioner/chef_base.rb +3 -2
- data/lib/kitchen/provisioner/chef_solo.rb +1 -1
- data/lib/kitchen/provisioner/chef_zero.rb +0 -0
- data/lib/kitchen/provisioner/dummy.rb +0 -0
- data/lib/kitchen/provisioner/shell.rb +0 -0
- data/lib/kitchen/rake_tasks.rb +0 -0
- data/lib/kitchen/shell_out.rb +0 -0
- data/lib/kitchen/ssh.rb +0 -0
- data/lib/kitchen/state_file.rb +0 -0
- data/lib/kitchen/suite.rb +0 -0
- data/lib/kitchen/thor_tasks.rb +0 -0
- data/lib/kitchen/transport.rb +0 -0
- data/lib/kitchen/transport/base.rb +0 -0
- data/lib/kitchen/transport/dummy.rb +0 -0
- data/lib/kitchen/transport/exec.rb +0 -0
- data/lib/kitchen/transport/ssh.rb +0 -0
- data/lib/kitchen/transport/winrm.rb +11 -5
- data/lib/kitchen/util.rb +0 -0
- data/lib/kitchen/verifier.rb +0 -0
- data/lib/kitchen/verifier/base.rb +0 -0
- data/lib/kitchen/verifier/busser.rb +0 -0
- data/lib/kitchen/verifier/dummy.rb +0 -0
- data/lib/kitchen/verifier/shell.rb +0 -0
- data/lib/kitchen/version.rb +1 -1
- data/lib/vendor/hash_recursive_merge.rb +0 -0
- data/spec/kitchen/base64_stream_spec.rb +0 -0
- data/spec/kitchen/cli_spec.rb +0 -0
- data/spec/kitchen/collection_spec.rb +0 -0
- data/spec/kitchen/color_spec.rb +0 -0
- data/spec/kitchen/config_spec.rb +0 -0
- data/spec/kitchen/configurable_spec.rb +0 -0
- data/spec/kitchen/data_munger_spec.rb +0 -0
- data/spec/kitchen/diagnostic_spec.rb +0 -0
- data/spec/kitchen/driver/base_spec.rb +0 -0
- data/spec/kitchen/driver/dummy_spec.rb +0 -0
- data/spec/kitchen/driver/exec_spec.rb +0 -0
- data/spec/kitchen/driver/proxy_spec.rb +0 -0
- data/spec/kitchen/driver/ssh_base_spec.rb +0 -0
- data/spec/kitchen/driver_spec.rb +0 -0
- data/spec/kitchen/errors_spec.rb +0 -0
- data/spec/kitchen/instance_spec.rb +0 -0
- data/spec/kitchen/lazy_hash_spec.rb +0 -0
- data/spec/kitchen/loader/yaml_spec.rb +43 -0
- data/spec/kitchen/logger_spec.rb +6 -1
- data/spec/kitchen/logging_spec.rb +0 -0
- data/spec/kitchen/login_command_spec.rb +0 -0
- data/spec/kitchen/metadata_chopper_spec.rb +0 -0
- data/spec/kitchen/platform_spec.rb +0 -0
- data/spec/kitchen/provisioner/base_spec.rb +0 -0
- data/spec/kitchen/provisioner/chef/policyfile_spec.rb +0 -0
- data/spec/kitchen/provisioner/chef_apply_spec.rb +0 -0
- data/spec/kitchen/provisioner/chef_base_spec.rb +6 -6
- data/spec/kitchen/provisioner/chef_solo_spec.rb +0 -0
- data/spec/kitchen/provisioner/chef_zero_spec.rb +0 -0
- data/spec/kitchen/provisioner/dummy_spec.rb +0 -0
- data/spec/kitchen/provisioner/shell_spec.rb +0 -0
- data/spec/kitchen/provisioner_spec.rb +0 -0
- data/spec/kitchen/shell_out_spec.rb +0 -0
- data/spec/kitchen/ssh_spec.rb +0 -0
- data/spec/kitchen/state_file_spec.rb +0 -0
- data/spec/kitchen/suite_spec.rb +0 -0
- data/spec/kitchen/transport/base_spec.rb +0 -0
- data/spec/kitchen/transport/exec_spec.rb +0 -0
- data/spec/kitchen/transport/ssh_spec.rb +0 -0
- data/spec/kitchen/transport/winrm_spec.rb +22 -13
- data/spec/kitchen/transport_spec.rb +0 -0
- data/spec/kitchen/util_spec.rb +0 -0
- data/spec/kitchen/verifier/base_spec.rb +0 -0
- data/spec/kitchen/verifier/busser_spec.rb +0 -0
- data/spec/kitchen/verifier/dummy_spec.rb +0 -0
- data/spec/kitchen/verifier/shell_spec.rb +0 -0
- data/spec/kitchen/verifier_spec.rb +0 -0
- data/spec/kitchen_spec.rb +0 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/support/powershell_max_size_spec.rb +0 -0
- data/support/busser_install_command.ps1 +0 -0
- data/support/busser_install_command.sh +0 -0
- data/support/chef-client-fail-if-update-handler.rb +0 -0
- data/support/chef_base_init_command.ps1 +0 -0
- data/support/chef_base_init_command.sh +0 -0
- data/support/chef_base_install_command.ps1 +0 -0
- data/support/chef_base_install_command.sh +0 -0
- data/support/chef_zero_prepare_command_legacy.ps1 +0 -0
- data/support/chef_zero_prepare_command_legacy.sh +0 -0
- data/support/download_helpers.sh +0 -0
- data/support/dummy-validation.pem +0 -0
- data/templates/driver/CHANGELOG.md.erb +0 -0
- data/templates/driver/Gemfile.erb +0 -0
- data/templates/driver/README.md.erb +0 -0
- data/templates/driver/Rakefile.erb +0 -0
- data/templates/driver/driver.rb.erb +0 -0
- data/templates/driver/gemspec.erb +0 -0
- data/templates/driver/gitignore.erb +0 -0
- data/templates/driver/license_apachev2.erb +0 -0
- data/templates/driver/license_lgplv3.erb +0 -0
- data/templates/driver/license_mit.erb +0 -0
- data/templates/driver/license_reserved.erb +0 -0
- data/templates/driver/tailor.erb +0 -0
- data/templates/driver/travis.yml.erb +0 -0
- data/templates/driver/version.rb.erb +0 -0
- data/templates/init/chefignore.erb +0 -0
- data/templates/init/kitchen.yml.erb +2 -2
- data/test-kitchen.gemspec +1 -1
- data/test/cookbooks/test_cookbook/metadata.rb +0 -0
- data/test/cookbooks/test_cookbook/recipes/default.rb +0 -0
- data/test/integration/default/default_spec.rb +0 -0
- data/testing_windows.md +0 -0
- metadata +5 -5
@@ -103,24 +103,6 @@ module Kitchen
|
|
103
103
|
# @api private
|
104
104
|
attr_reader :always_update
|
105
105
|
|
106
|
-
# Ensure the `chef` command is in the path.
|
107
|
-
#
|
108
|
-
# @param logger [Kitchen::Logger] the logger to use
|
109
|
-
# @raise [UserError] if the `chef` command is not in the PATH
|
110
|
-
# @api private
|
111
|
-
def self.detect_chef_command!(logger)
|
112
|
-
unless ENV["PATH"].split(File::PATH_SEPARATOR).any? do |p|
|
113
|
-
File.exist?(File.join(p, "chef"))
|
114
|
-
end
|
115
|
-
logger.fatal("The `chef` executable cannot be found in your " \
|
116
|
-
"PATH. Ensure you have installed ChefDK from " \
|
117
|
-
"https://downloads.chef.io and that your PATH " \
|
118
|
-
"setting includes the path to the `chef` comand.")
|
119
|
-
raise UserError,
|
120
|
-
"Could not find the chef executable in your PATH."
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
106
|
# Escape spaces in a path in way that works with both Sh (Unix) and
|
125
107
|
# Windows.
|
126
108
|
#
|
@@ -143,6 +125,29 @@ module Kitchen
|
|
143
125
|
Shellwords.escape(path)
|
144
126
|
end
|
145
127
|
end
|
128
|
+
|
129
|
+
class << self
|
130
|
+
private
|
131
|
+
|
132
|
+
# Ensure the `chef` command is in the path.
|
133
|
+
#
|
134
|
+
# @param logger [Kitchen::Logger] the logger to use
|
135
|
+
# @raise [UserError] if the `chef` command is not in the PATH
|
136
|
+
# @api private
|
137
|
+
def detect_chef_command!(logger)
|
138
|
+
unless ENV["PATH"].split(File::PATH_SEPARATOR).any? do |p|
|
139
|
+
File.exist?(File.join(p, "chef"))
|
140
|
+
end
|
141
|
+
logger.fatal("The `chef` executable cannot be found in your " \
|
142
|
+
"PATH. Ensure you have installed ChefDK from " \
|
143
|
+
"https://downloads.chef.io and that your PATH " \
|
144
|
+
"setting includes the path to the `chef` comand.")
|
145
|
+
raise UserError,
|
146
|
+
"Could not find the chef executable in your PATH."
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
146
151
|
end
|
147
152
|
end
|
148
153
|
end
|
@@ -503,8 +503,9 @@ module Kitchen
|
|
503
503
|
end
|
504
504
|
|
505
505
|
def install_from_file(command)
|
506
|
-
install_file = "/
|
507
|
-
script = ["
|
506
|
+
install_file = "#{config[:root_path]}/chef-installer.sh"
|
507
|
+
script = ["mkdir -p #{config[:root_path]}"]
|
508
|
+
script << "cat > #{install_file} <<\"EOL\""
|
508
509
|
script << command
|
509
510
|
script << "EOL"
|
510
511
|
script << "chmod +x #{install_file}"
|
@@ -64,7 +64,7 @@ module Kitchen
|
|
64
64
|
|
65
65
|
# (see Base#run_command)
|
66
66
|
def run_command
|
67
|
-
config[:log_level] = "info" if !modern? && config[:log_level]
|
67
|
+
config[:log_level] = "info" if !modern? && config[:log_level] == "auto"
|
68
68
|
cmd = sudo(config[:chef_solo_path]).dup
|
69
69
|
.tap { |str| str.insert(0, "& ") if powershell_shell? }
|
70
70
|
|
File without changes
|
File without changes
|
File without changes
|
data/lib/kitchen/rake_tasks.rb
CHANGED
File without changes
|
data/lib/kitchen/shell_out.rb
CHANGED
File without changes
|
data/lib/kitchen/ssh.rb
CHANGED
File without changes
|
data/lib/kitchen/state_file.rb
CHANGED
File without changes
|
data/lib/kitchen/suite.rb
CHANGED
File without changes
|
data/lib/kitchen/thor_tasks.rb
CHANGED
File without changes
|
data/lib/kitchen/transport.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -48,13 +48,12 @@ module Kitchen
|
|
48
48
|
default_config :connection_retry_sleep, 1
|
49
49
|
default_config :max_wait_until_ready, 600
|
50
50
|
default_config :winrm_transport, :negotiate
|
51
|
+
default_config :scheme do |transport|
|
52
|
+
transport[:winrm_transport] == :ssl ? "https" : "http"
|
53
|
+
end
|
51
54
|
default_config :port do |transport|
|
52
55
|
transport[:winrm_transport] == :ssl ? 5986 : 5985
|
53
56
|
end
|
54
|
-
default_config :endpoint_template do |transport|
|
55
|
-
scheme = transport[:winrm_transport] == :ssl ? "https" : "http"
|
56
|
-
"#{scheme}://%{hostname}:%{port}/wsman"
|
57
|
-
end
|
58
57
|
|
59
58
|
def finalize_config!(instance)
|
60
59
|
super
|
@@ -388,6 +387,13 @@ module Kitchen
|
|
388
387
|
# @return [Hash] hash of connection options
|
389
388
|
# @api private
|
390
389
|
def connection_options(data)
|
390
|
+
endpoint = URI::Generic.build(
|
391
|
+
scheme: data.fetch(:scheme),
|
392
|
+
host: data.fetch(:hostname),
|
393
|
+
port: data.fetch(:port),
|
394
|
+
path: "/wsman"
|
395
|
+
).to_s
|
396
|
+
|
391
397
|
elevated_password = data[:password]
|
392
398
|
elevated_password = data[:elevated_password] if data.key?(:elevated_password)
|
393
399
|
|
@@ -395,7 +401,7 @@ module Kitchen
|
|
395
401
|
instance_name: instance.name,
|
396
402
|
kitchen_root: data[:kitchen_root],
|
397
403
|
logger: logger,
|
398
|
-
endpoint:
|
404
|
+
endpoint: endpoint,
|
399
405
|
user: data[:username],
|
400
406
|
password: data[:password],
|
401
407
|
rdp_port: data[:rdp_port],
|
data/lib/kitchen/util.rb
CHANGED
File without changes
|
data/lib/kitchen/verifier.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/kitchen/version.rb
CHANGED
File without changes
|
File without changes
|
data/spec/kitchen/cli_spec.rb
CHANGED
File without changes
|
File without changes
|
data/spec/kitchen/color_spec.rb
CHANGED
File without changes
|
data/spec/kitchen/config_spec.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/kitchen/driver_spec.rb
CHANGED
File without changes
|
data/spec/kitchen/errors_spec.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -43,6 +43,14 @@ describe Kitchen::Loader::YAML do
|
|
43
43
|
|
44
44
|
describe ".initialize" do
|
45
45
|
it "sets project_config based on Dir.pwd by default" do
|
46
|
+
stub_file(File.join(Dir.pwd, "kitchen.yml"), {})
|
47
|
+
loader = Kitchen::Loader::YAML.new
|
48
|
+
|
49
|
+
loader.diagnose[:project_config][:filename]
|
50
|
+
.must_equal File.expand_path(File.join(Dir.pwd, "kitchen.yml"))
|
51
|
+
end
|
52
|
+
|
53
|
+
it "when kitchen.yml not present, falls back to .kitchen.yml" do
|
46
54
|
stub_file(File.join(Dir.pwd, ".kitchen.yml"), {})
|
47
55
|
loader = Kitchen::Loader::YAML.new
|
48
56
|
|
@@ -50,6 +58,20 @@ describe Kitchen::Loader::YAML do
|
|
50
58
|
.must_equal File.expand_path(File.join(Dir.pwd, ".kitchen.yml"))
|
51
59
|
end
|
52
60
|
|
61
|
+
it "prefers kitchen.yml to .kitchen.yml" do
|
62
|
+
stub_file(File.join(Dir.pwd, "kitchen.yml"), {})
|
63
|
+
loader = Kitchen::Loader::YAML.new
|
64
|
+
|
65
|
+
loader.diagnose[:project_config][:filename]
|
66
|
+
.must_equal File.expand_path(File.join(Dir.pwd, "kitchen.yml"))
|
67
|
+
end
|
68
|
+
|
69
|
+
it "errors when kitchen.yml and .kitchen.yml are both present" do
|
70
|
+
stub_file(File.join(Dir.pwd, "kitchen.yml"), {})
|
71
|
+
stub_file(File.join(Dir.pwd, ".kitchen.yml"), {})
|
72
|
+
proc { Kitchen::Loader::YAML.new }.must_raise Kitchen::UserError
|
73
|
+
end
|
74
|
+
|
53
75
|
it "sets project_config from parameter, if given" do
|
54
76
|
stub_file("/tmp/crazyfunkytown.file", {})
|
55
77
|
loader = Kitchen::Loader::YAML.new(
|
@@ -76,6 +98,13 @@ describe Kitchen::Loader::YAML do
|
|
76
98
|
.must_match %r{/tmp/.kitchen.local.yml$}
|
77
99
|
end
|
78
100
|
|
101
|
+
it "errors if both visible and hidden copies of default local_config exist" do
|
102
|
+
stub_file("/tmp/kitchen.local.yml", {})
|
103
|
+
stub_file("/tmp/.kitchen.local.yml", {})
|
104
|
+
proc { Kitchen::Loader::YAML.new(project_config: "/tmp/.kitchen.yml") }
|
105
|
+
.must_raise Kitchen::UserError
|
106
|
+
end
|
107
|
+
|
79
108
|
it "sets local_config from parameter, if given" do
|
80
109
|
stub_file("/tmp/crazyfunkytown.file", {})
|
81
110
|
loader = Kitchen::Loader::YAML.new(
|
@@ -405,6 +434,20 @@ describe Kitchen::Loader::YAML do
|
|
405
434
|
loader.read.must_equal(name: "ahhchoo")
|
406
435
|
end
|
407
436
|
|
437
|
+
it "accepts kitchen.yml with alias" do
|
438
|
+
FileUtils.mkdir_p "/tmp"
|
439
|
+
File.open("/tmp/.kitchen.yml", "wb") do |f|
|
440
|
+
f.write <<-'YAML'.gsub(/^ {10}/, "")
|
441
|
+
---
|
442
|
+
xxx: &k
|
443
|
+
foo: bar
|
444
|
+
yyy: *k
|
445
|
+
YAML
|
446
|
+
end
|
447
|
+
|
448
|
+
loader.read[:yyy].must_equal(foo: "bar")
|
449
|
+
end
|
450
|
+
|
408
451
|
it "raises a UserError if there is an ERB processing error" do
|
409
452
|
FileUtils.mkdir_p "/tmp"
|
410
453
|
File.open("/tmp/.kitchen.yml", "wb") do |f|
|
data/spec/kitchen/logger_spec.rb
CHANGED
@@ -34,6 +34,11 @@ describe Kitchen::Logger do
|
|
34
34
|
Kitchen::Color.colorize(*args)
|
35
35
|
end
|
36
36
|
|
37
|
+
def log_tmpname
|
38
|
+
t = Time.now.strftime("%Y%m%d")
|
39
|
+
"kitchen-#{t}-#{$$}-#{rand(0x100000000).to_s(36)}.log"
|
40
|
+
end
|
41
|
+
|
37
42
|
let(:opts) do
|
38
43
|
{ color: :red, colorize: true }
|
39
44
|
end
|
@@ -356,7 +361,7 @@ describe Kitchen::Logger do
|
|
356
361
|
end
|
357
362
|
|
358
363
|
describe "file IO logdev-based logger" do
|
359
|
-
let(:logfile) {
|
364
|
+
let(:logfile) { File.join Dir.tmpdir, log_tmpname }
|
360
365
|
|
361
366
|
before do
|
362
367
|
opts[:logdev] = logfile
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -768,13 +768,13 @@ describe Kitchen::Provisioner::ChefBase do
|
|
768
768
|
|
769
769
|
it "sets chef component dirs for deletion" do
|
770
770
|
config[:root_path] = '\\route'
|
771
|
-
dirs = %w{
|
772
|
-
|
773
|
-
|
774
|
-
"\\route
|
775
|
-
|
771
|
+
dirs = %w{ clients cookbooks data data_bags encrypted_data_bag_secret
|
772
|
+
environments roles
|
773
|
+
}.map do |dir|
|
774
|
+
"\\route\\#{dir}"
|
775
|
+
end.join(", ")
|
776
776
|
|
777
|
-
cmd.
|
777
|
+
cmd.include? "$dirs = @(#{dirs})"
|
778
778
|
end
|
779
779
|
|
780
780
|
it "sets the root_path from :root_path" do
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/kitchen/ssh_spec.rb
CHANGED
File without changes
|
File without changes
|
data/spec/kitchen/suite_spec.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -68,6 +68,10 @@ describe Kitchen::Transport::Winrm do
|
|
68
68
|
end
|
69
69
|
|
70
70
|
describe "default_config" do
|
71
|
+
it "sets :scheme to http by default" do
|
72
|
+
transport[:scheme].must_equal "http"
|
73
|
+
end
|
74
|
+
|
71
75
|
it "sets :port to 5985 by default" do
|
72
76
|
transport[:port].must_equal 5985
|
73
77
|
end
|
@@ -80,11 +84,6 @@ describe Kitchen::Transport::Winrm do
|
|
80
84
|
transport[:password].must_be_nil
|
81
85
|
end
|
82
86
|
|
83
|
-
it "sets a default :endpoint_template value" do
|
84
|
-
transport[:endpoint_template]
|
85
|
-
.must_equal "http://%{hostname}:%{port}/wsman"
|
86
|
-
end
|
87
|
-
|
88
87
|
it "sets :rdp_port to 3389 by default" do
|
89
88
|
transport[:rdp_port].must_equal 3389
|
90
89
|
end
|
@@ -164,27 +163,37 @@ describe Kitchen::Transport::Winrm do
|
|
164
163
|
make_connection
|
165
164
|
end
|
166
165
|
|
166
|
+
it "sets :endpoint when hostname is an IPv6 address" do
|
167
|
+
config[:hostname] = "caec:cec6:c4ef:bb7b:1a78:d055:216d:3a78"
|
168
|
+
|
169
|
+
klass.expects(:new).with do |hash|
|
170
|
+
hash[:endpoint] == "http://[caec:cec6:c4ef:bb7b:1a78:d055:216d:3a78]:5985/wsman"
|
171
|
+
end
|
172
|
+
|
173
|
+
make_connection
|
174
|
+
end
|
175
|
+
|
167
176
|
it "sets :endpoint from data in config" do
|
168
|
-
config[:hostname] = "
|
169
|
-
config[:port] = "
|
177
|
+
config[:hostname] = "host-from-config"
|
178
|
+
config[:port] = "42"
|
170
179
|
config[:winrm_transport] = "ssl"
|
171
180
|
|
172
181
|
klass.expects(:new).with do |hash|
|
173
|
-
hash[:endpoint] == "https://
|
182
|
+
hash[:endpoint] == "https://host-from-config:42/wsman"
|
174
183
|
end
|
175
184
|
|
176
185
|
make_connection
|
177
186
|
end
|
178
187
|
|
179
188
|
it "sets :endpoint from data in state over config data" do
|
180
|
-
state[:hostname] = "
|
181
|
-
config[:hostname] = "
|
182
|
-
state[:port] = "
|
183
|
-
config[:port] = "
|
189
|
+
state[:hostname] = "host-from-state"
|
190
|
+
config[:hostname] = "host-from-config"
|
191
|
+
state[:port] = "42"
|
192
|
+
config[:port] = "43"
|
184
193
|
config[:winrm_transport] = "ssl"
|
185
194
|
|
186
195
|
klass.expects(:new).with do |hash|
|
187
|
-
hash[:endpoint] == "https://
|
196
|
+
hash[:endpoint] == "https://host-from-state:42/wsman"
|
188
197
|
end
|
189
198
|
|
190
199
|
make_connection
|