test-kitchen 1.3.1 → 1.4.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.cane +2 -0
- data/.gitignore +4 -0
- data/CHANGELOG.md +45 -0
- data/Rakefile +15 -0
- data/features/kitchen_action_commands.feature +12 -9
- data/features/kitchen_defaults.feature +38 -0
- data/features/kitchen_init_command.feature +0 -1
- data/features/kitchen_list_command.feature +2 -2
- data/features/kitchen_login_command.feature +7 -1
- data/features/kitchen_test_command.feature +4 -4
- data/lib/kitchen.rb +40 -11
- data/lib/kitchen/cli.rb +38 -22
- data/lib/kitchen/command/list.rb +5 -2
- data/lib/kitchen/config.rb +45 -18
- data/lib/kitchen/configurable.rb +137 -1
- data/lib/kitchen/data_munger.rb +248 -17
- data/lib/kitchen/driver.rb +1 -1
- data/lib/kitchen/driver/base.rb +1 -83
- data/lib/kitchen/driver/dummy.rb +0 -5
- data/lib/kitchen/driver/ssh_base.rb +177 -22
- data/lib/kitchen/instance.rb +140 -20
- data/lib/kitchen/logger.rb +43 -8
- data/lib/kitchen/login_command.rb +14 -5
- data/lib/kitchen/platform.rb +19 -0
- data/lib/kitchen/provisioner.rb +5 -3
- data/lib/kitchen/provisioner/base.rb +46 -48
- data/lib/kitchen/provisioner/chef/common_sandbox.rb +322 -0
- data/lib/kitchen/provisioner/chef_base.rb +179 -286
- data/lib/kitchen/provisioner/chef_solo.rb +11 -5
- data/lib/kitchen/provisioner/chef_zero.rb +108 -94
- data/lib/kitchen/provisioner/dummy.rb +47 -0
- data/lib/kitchen/provisioner/shell.rb +45 -12
- data/lib/kitchen/rake_tasks.rb +1 -1
- data/lib/kitchen/ssh.rb +1 -1
- data/lib/kitchen/thor_tasks.rb +1 -1
- data/lib/kitchen/transport.rb +54 -0
- data/lib/kitchen/transport/base.rb +146 -0
- data/lib/kitchen/transport/dummy.rb +75 -0
- data/lib/kitchen/transport/ssh.rb +325 -0
- data/lib/kitchen/transport/winrm.rb +508 -0
- data/lib/kitchen/transport/winrm/command_executor.rb +188 -0
- data/lib/kitchen/transport/winrm/file_transporter.rb +454 -0
- data/lib/kitchen/transport/winrm/logging.rb +50 -0
- data/lib/kitchen/transport/winrm/template.rb +74 -0
- data/lib/kitchen/transport/winrm/tmp_zip.rb +187 -0
- data/lib/kitchen/verifier.rb +55 -0
- data/lib/kitchen/verifier/base.rb +191 -0
- data/lib/kitchen/verifier/busser.rb +266 -0
- data/lib/kitchen/verifier/dummy.rb +75 -0
- data/lib/kitchen/version.rb +1 -1
- data/spec/kitchen/cli_spec.rb +56 -0
- data/spec/kitchen/config_spec.rb +61 -20
- data/spec/kitchen/configurable_spec.rb +327 -1
- data/spec/kitchen/data_munger_spec.rb +777 -14
- data/spec/kitchen/driver/base_spec.rb +7 -38
- data/spec/kitchen/driver/dummy_spec.rb +0 -29
- data/spec/kitchen/driver/ssh_base_spec.rb +580 -236
- data/spec/kitchen/driver_spec.rb +1 -0
- data/spec/kitchen/instance_spec.rb +383 -83
- data/spec/kitchen/login_command_spec.rb +29 -10
- data/spec/kitchen/platform_spec.rb +58 -2
- data/spec/kitchen/provisioner/base_spec.rb +170 -18
- data/spec/kitchen/provisioner/chef_base_spec.rb +454 -104
- data/spec/kitchen/provisioner/chef_solo_spec.rb +307 -104
- data/spec/kitchen/provisioner/chef_zero_spec.rb +561 -230
- data/spec/kitchen/provisioner/dummy_spec.rb +91 -0
- data/spec/kitchen/provisioner/shell_spec.rb +158 -56
- data/spec/kitchen/provisioner_spec.rb +37 -0
- data/spec/kitchen/ssh_spec.rb +19 -19
- data/spec/kitchen/transport/base_spec.rb +89 -0
- data/spec/kitchen/transport/ssh_spec.rb +1147 -0
- data/spec/kitchen/transport/winrm/command_executor_spec.rb +400 -0
- data/spec/kitchen/transport/winrm/file_transporter_spec.rb +876 -0
- data/spec/kitchen/transport/winrm/logging_spec.rb +92 -0
- data/spec/kitchen/transport/winrm/template_spec.rb +51 -0
- data/spec/kitchen/transport/winrm/tmp_zip_spec.rb +132 -0
- data/spec/kitchen/transport/winrm_spec.rb +1069 -0
- data/spec/kitchen/transport_spec.rb +112 -0
- data/spec/kitchen/verifier/base_spec.rb +310 -0
- data/spec/kitchen/verifier/busser_spec.rb +540 -0
- data/spec/kitchen/verifier/dummy_spec.rb +91 -0
- data/spec/kitchen/verifier_spec.rb +120 -0
- data/spec/kitchen_spec.rb +7 -0
- data/spec/spec_helper.rb +8 -0
- data/spec/support/powershell_max_size_spec.rb +40 -0
- data/support/busser_install_command.ps1 +14 -0
- data/support/busser_install_command.sh +15 -0
- data/support/check_files.ps1.erb +48 -0
- data/support/chef_base_init_command.ps1 +18 -0
- data/support/chef_base_init_command.sh +2 -0
- data/support/chef_base_install_command.ps1 +76 -0
- data/support/chef_base_install_command.sh +137 -0
- data/support/chef_zero_prepare_command_legacy.ps1 +9 -0
- data/support/chef_zero_prepare_command_legacy.sh +10 -0
- data/support/decode_files.ps1.erb +61 -0
- data/test-kitchen.gemspec +2 -0
- metadata +97 -8
- data/lib/kitchen/busser.rb +0 -316
- data/spec/kitchen/busser_spec.rb +0 -490
- data/support/chef_helpers.sh +0 -16
@@ -25,17 +25,20 @@ describe Kitchen::Provisioner::ChefSolo do
|
|
25
25
|
|
26
26
|
let(:logged_output) { StringIO.new }
|
27
27
|
let(:logger) { Logger.new(logged_output) }
|
28
|
+
let(:platform) { stub(:os_type => nil) }
|
29
|
+
let(:suite) { stub(:name => "fries") }
|
28
30
|
|
29
31
|
let(:config) do
|
30
32
|
{ :test_base_path => "/b", :kitchen_root => "/r", :log_level => :info }
|
31
33
|
end
|
32
34
|
|
33
|
-
let(:suite) do
|
34
|
-
stub(:name => "fries")
|
35
|
-
end
|
36
|
-
|
37
35
|
let(:instance) do
|
38
|
-
stub(
|
36
|
+
stub(
|
37
|
+
:name => "coolbeans",
|
38
|
+
:logger => logger,
|
39
|
+
:suite => suite,
|
40
|
+
:platform => platform
|
41
|
+
)
|
39
42
|
end
|
40
43
|
|
41
44
|
let(:provisioner) do
|
@@ -44,14 +47,31 @@ describe Kitchen::Provisioner::ChefSolo do
|
|
44
47
|
|
45
48
|
describe "default config" do
|
46
49
|
|
47
|
-
|
48
|
-
|
50
|
+
describe "for unix operating systems" do
|
51
|
+
|
52
|
+
before { platform.stubs(:os_type).returns("unix") }
|
53
|
+
|
54
|
+
it "sets :chef_solo_path to a path using :chef_omnibus_root" do
|
55
|
+
config[:chef_omnibus_root] = "/nice/place"
|
56
|
+
|
57
|
+
provisioner[:chef_solo_path].must_equal "/nice/place/bin/chef-solo"
|
58
|
+
end
|
49
59
|
end
|
50
60
|
|
51
|
-
|
52
|
-
|
61
|
+
describe "for windows operating systems" do
|
62
|
+
|
63
|
+
before { platform.stubs(:os_type).returns("windows") }
|
53
64
|
|
54
|
-
|
65
|
+
it "sets :chef_solo_path to a path using :chef_omnibus_root" do
|
66
|
+
config[:chef_omnibus_root] = "$env:systemdrive\\nice\\place"
|
67
|
+
|
68
|
+
provisioner[:chef_solo_path].
|
69
|
+
must_equal "$env:systemdrive\\nice\\place\\bin\\chef-solo.bat"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
it "sets :solo_rb to an empty Hash" do
|
74
|
+
provisioner[:solo_rb].must_equal Hash.new
|
55
75
|
end
|
56
76
|
end
|
57
77
|
|
@@ -97,64 +117,104 @@ describe Kitchen::Provisioner::ChefSolo do
|
|
97
117
|
|
98
118
|
describe "defaults" do
|
99
119
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
120
|
+
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
121
|
+
def self.common_solo_rb_specs
|
122
|
+
it "sets node_name to the instance name" do
|
123
|
+
file.must_include %{node_name "#{instance.name}"}
|
124
|
+
end
|
125
|
+
|
126
|
+
it "sets checksum_path" do
|
127
|
+
file.must_include %{checksum_path "#{base}checksums"}
|
128
|
+
end
|
129
|
+
|
130
|
+
it "sets file_backup_path" do
|
131
|
+
file.must_include %{file_backup_path "#{base}backup"}
|
132
|
+
end
|
133
|
+
|
134
|
+
it "sets cookbook_path" do
|
135
|
+
file.must_include %{cookbook_path } +
|
136
|
+
%{["#{base}cookbooks", "#{base}site-cookbooks"]}
|
137
|
+
end
|
138
|
+
|
139
|
+
it "sets data_bag_path" do
|
140
|
+
file.must_include %{data_bag_path "#{base}data_bags"}
|
141
|
+
end
|
142
|
+
|
143
|
+
it "sets environment_path" do
|
144
|
+
file.must_include %{environment_path "#{base}environments"}
|
145
|
+
end
|
146
|
+
|
147
|
+
it "sets node_path" do
|
148
|
+
file.must_include %{node_path "#{base}nodes"}
|
149
|
+
end
|
150
|
+
|
151
|
+
it "sets role_path" do
|
152
|
+
file.must_include %{role_path "#{base}roles"}
|
153
|
+
end
|
154
|
+
|
155
|
+
it "sets client_path" do
|
156
|
+
file.must_include %{client_path "#{base}clients"}
|
157
|
+
end
|
158
|
+
|
159
|
+
it "sets user_path" do
|
160
|
+
file.must_include %{user_path "#{base}users"}
|
161
|
+
end
|
162
|
+
|
163
|
+
it "sets validation_key" do
|
164
|
+
file.must_include %{validation_key "#{base}validation.pem"}
|
165
|
+
end
|
166
|
+
|
167
|
+
it "sets client_key" do
|
168
|
+
file.must_include %{client_key "#{base}client.pem"}
|
169
|
+
end
|
170
|
+
|
171
|
+
it "sets chef_server_url" do
|
172
|
+
file.must_include %{chef_server_url "http://127.0.0.1:8889"}
|
173
|
+
end
|
174
|
+
|
175
|
+
it "sets encrypted_data_bag_secret" do
|
176
|
+
file.must_include %{encrypted_data_bag_secret } +
|
177
|
+
%{"#{base}encrypted_data_bag_secret"}
|
178
|
+
end
|
104
179
|
end
|
180
|
+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
105
181
|
|
106
|
-
|
107
|
-
file.must_include %{checksum_path "/tmp/kitchen/checksums"}
|
108
|
-
end
|
182
|
+
describe "for unix os types" do
|
109
183
|
|
110
|
-
|
111
|
-
|
112
|
-
|
184
|
+
before do
|
185
|
+
platform.stubs(:os_type).returns("unix")
|
186
|
+
provisioner.create_sandbox
|
187
|
+
end
|
113
188
|
|
114
|
-
|
115
|
-
file.must_include %{cookbook_path } +
|
116
|
-
%{["/tmp/kitchen/cookbooks", "/tmp/kitchen/site-cookbooks"]}
|
117
|
-
end
|
189
|
+
let(:base) { "/tmp/kitchen/" }
|
118
190
|
|
119
|
-
|
120
|
-
file.must_include %{data_bag_path "/tmp/kitchen/data_bags"}
|
191
|
+
common_solo_rb_specs
|
121
192
|
end
|
122
193
|
|
123
|
-
|
124
|
-
file.must_include %{environment_path "/tmp/kitchen/environments"}
|
125
|
-
end
|
194
|
+
describe "for windows os types with full path" do
|
126
195
|
|
127
|
-
|
128
|
-
|
129
|
-
|
196
|
+
before do
|
197
|
+
platform.stubs(:os_type).returns("windows")
|
198
|
+
config[:root_path] = "\\a\\b"
|
199
|
+
provisioner.create_sandbox
|
200
|
+
end
|
130
201
|
|
131
|
-
|
132
|
-
file.must_include %{role_path "/tmp/kitchen/roles"}
|
133
|
-
end
|
134
|
-
|
135
|
-
it "sets client_path" do
|
136
|
-
file.must_include %{client_path "/tmp/kitchen/clients"}
|
137
|
-
end
|
202
|
+
let(:base) { "\\\\a\\\\b\\\\" }
|
138
203
|
|
139
|
-
|
140
|
-
file.must_include %{user_path "/tmp/kitchen/users"}
|
204
|
+
common_solo_rb_specs
|
141
205
|
end
|
142
206
|
|
143
|
-
|
144
|
-
file.must_include %{validation_key "/tmp/kitchen/validation.pem"}
|
145
|
-
end
|
207
|
+
describe "for windows os types with $env:TEMP prefixed paths" do
|
146
208
|
|
147
|
-
|
148
|
-
|
149
|
-
|
209
|
+
before do
|
210
|
+
platform.stubs(:os_type).returns("windows")
|
211
|
+
config[:root_path] = "$env:TEMP\\a"
|
212
|
+
provisioner.create_sandbox
|
213
|
+
end
|
150
214
|
|
151
|
-
|
152
|
-
file.must_include %{chef_server_url "http://127.0.0.1:8889"}
|
153
|
-
end
|
215
|
+
let(:base) { "\#{ENV['TEMP']}\\\\a\\\\" }
|
154
216
|
|
155
|
-
|
156
|
-
file.must_include %{encrypted_data_bag_secret } +
|
157
|
-
%{"/tmp/kitchen/encrypted_data_bag_secret"}
|
217
|
+
common_solo_rb_specs
|
158
218
|
end
|
159
219
|
end
|
160
220
|
|
@@ -171,7 +231,7 @@ describe Kitchen::Provisioner::ChefSolo do
|
|
171
231
|
file.must_include %{client_key "lol"}
|
172
232
|
end
|
173
233
|
|
174
|
-
it "
|
234
|
+
it "supports adding new configuration" do
|
175
235
|
config[:solo_rb] = {
|
176
236
|
:dark_secret => "golang"
|
177
237
|
}
|
@@ -222,81 +282,224 @@ describe Kitchen::Provisioner::ChefSolo do
|
|
222
282
|
def sandbox_path(path)
|
223
283
|
Pathname.new(provisioner.sandbox_path).join(path)
|
224
284
|
end
|
225
|
-
|
226
285
|
end
|
227
286
|
|
228
287
|
describe "#run_command" do
|
229
288
|
|
230
289
|
let(:cmd) { provisioner.run_command }
|
231
290
|
|
232
|
-
|
233
|
-
cmd.must_match(/\Ash -c '$/)
|
234
|
-
cmd.must_match(/'\Z/)
|
235
|
-
end
|
291
|
+
describe "for bourne shells" do
|
236
292
|
|
237
|
-
|
238
|
-
config[:chef_omnibus_root] = "/c"
|
239
|
-
config[:sudo] = true
|
293
|
+
before { platform.stubs(:shell_type).returns("bourne") }
|
240
294
|
|
241
|
-
|
242
|
-
|
295
|
+
it "uses bourne shell" do
|
296
|
+
cmd.must_match(/\Ash -c '$/)
|
297
|
+
cmd.must_match(/'\Z/)
|
298
|
+
end
|
243
299
|
|
244
|
-
|
245
|
-
|
246
|
-
|
300
|
+
it "ends with a single quote" do
|
301
|
+
cmd.must_match(/'\Z/)
|
302
|
+
end
|
247
303
|
|
248
|
-
|
249
|
-
|
250
|
-
end
|
304
|
+
it "exports http_proxy & HTTP_PROXY when :http_proxy is set" do
|
305
|
+
config[:http_proxy] = "http://proxy"
|
251
306
|
|
252
|
-
|
253
|
-
|
254
|
-
|
307
|
+
cmd.lines.to_a[1..2].must_equal([
|
308
|
+
%{http_proxy="http://proxy"; export http_proxy\n},
|
309
|
+
%{HTTP_PROXY="http://proxy"; export HTTP_PROXY\n}
|
310
|
+
])
|
311
|
+
end
|
255
312
|
|
256
|
-
|
257
|
-
|
313
|
+
it "exports https_proxy & HTTPS_PROXY when :https_proxy is set" do
|
314
|
+
config[:https_proxy] = "https://proxy"
|
258
315
|
|
259
|
-
|
260
|
-
|
316
|
+
cmd.lines.to_a[1..2].must_equal([
|
317
|
+
%{https_proxy="https://proxy"; export https_proxy\n},
|
318
|
+
%{HTTPS_PROXY="https://proxy"; export HTTPS_PROXY\n}
|
319
|
+
])
|
320
|
+
end
|
261
321
|
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
end
|
322
|
+
it "exports all http proxy variables when both are set" do
|
323
|
+
config[:http_proxy] = "http://proxy"
|
324
|
+
config[:https_proxy] = "https://proxy"
|
266
325
|
|
267
|
-
|
268
|
-
|
326
|
+
cmd.lines.to_a[1..4].must_equal([
|
327
|
+
%{http_proxy="http://proxy"; export http_proxy\n},
|
328
|
+
%{HTTP_PROXY="http://proxy"; export HTTP_PROXY\n},
|
329
|
+
%{https_proxy="https://proxy"; export https_proxy\n},
|
330
|
+
%{HTTPS_PROXY="https://proxy"; export HTTPS_PROXY\n}
|
331
|
+
])
|
332
|
+
end
|
269
333
|
|
270
|
-
|
271
|
-
|
272
|
-
|
334
|
+
it "does no powershell PATH reloading for older chef omnibus packages" do
|
335
|
+
cmd.wont_match regexify(%{[System.Environment]::})
|
336
|
+
end
|
273
337
|
|
274
|
-
|
275
|
-
|
276
|
-
|
338
|
+
it "uses sudo for chef-solo when configured" do
|
339
|
+
config[:chef_omnibus_root] = "/c"
|
340
|
+
config[:sudo] = true
|
277
341
|
|
278
|
-
|
279
|
-
|
342
|
+
cmd.must_match regexify("sudo -E /c/bin/chef-solo ", :partial_line)
|
343
|
+
end
|
280
344
|
|
281
|
-
|
282
|
-
|
345
|
+
it "does not use sudo for chef-solo when configured" do
|
346
|
+
config[:chef_omnibus_root] = "/c"
|
347
|
+
config[:sudo] = false
|
283
348
|
|
284
|
-
|
285
|
-
|
286
|
-
|
349
|
+
cmd.must_match regexify("chef-solo ", :partial_line)
|
350
|
+
cmd.wont_match regexify("sudo -E /c/bin/chef-solo ", :partial_line)
|
351
|
+
end
|
287
352
|
|
288
|
-
|
289
|
-
|
290
|
-
|
353
|
+
it "sets config flag on chef-solo" do
|
354
|
+
cmd.must_match regexify(" --config /tmp/kitchen/solo.rb", :partial_line)
|
355
|
+
end
|
356
|
+
|
357
|
+
it "sets config flag for custom root_path" do
|
358
|
+
config[:root_path] = "/a/b"
|
359
|
+
|
360
|
+
cmd.must_match regexify(" --config /a/b/solo.rb", :partial_line)
|
361
|
+
end
|
362
|
+
|
363
|
+
it "sets json attributes flag on chef-solo" do
|
364
|
+
cmd.must_match regexify(
|
365
|
+
" --json-attributes /tmp/kitchen/dna.json", :partial_line)
|
366
|
+
end
|
367
|
+
|
368
|
+
it "sets json attribtes flag for custom root_path" do
|
369
|
+
config[:root_path] = "/booyah"
|
291
370
|
|
292
|
-
|
293
|
-
|
371
|
+
cmd.must_match regexify(
|
372
|
+
" --json-attributes /booyah/dna.json", :partial_line)
|
373
|
+
end
|
374
|
+
|
375
|
+
it "sets log level flag on chef-solo to auto by default" do
|
376
|
+
cmd.must_match regexify(" --log_level auto", :partial_line)
|
377
|
+
end
|
378
|
+
|
379
|
+
it "set log level flag for custom level" do
|
380
|
+
config[:log_level] = :extreme
|
381
|
+
|
382
|
+
cmd.must_match regexify(" --log_level extreme", :partial_line)
|
383
|
+
end
|
384
|
+
|
385
|
+
it "sets force formatter flag on chef-solo" do
|
386
|
+
cmd.must_match regexify(" --force-formatter", :partial_line)
|
387
|
+
end
|
388
|
+
|
389
|
+
it "sets no color flag on chef-solo" do
|
390
|
+
cmd.must_match regexify(" --no-color", :partial_line)
|
391
|
+
end
|
392
|
+
|
393
|
+
it "does not set logfile flag by default" do
|
394
|
+
cmd.wont_match regexify(" --logfile ", :partial_line)
|
395
|
+
end
|
396
|
+
|
397
|
+
it "sets logfile flag for custom value" do
|
398
|
+
config[:log_file] = "/a/out.log"
|
399
|
+
|
400
|
+
cmd.must_match regexify(" --logfile /a/out.log", :partial_line)
|
401
|
+
end
|
294
402
|
end
|
295
403
|
|
296
|
-
|
297
|
-
|
404
|
+
describe "for powershell shells on windows os types" do
|
405
|
+
|
406
|
+
before do
|
407
|
+
platform.stubs(:shell_type).returns("powershell")
|
408
|
+
platform.stubs(:os_type).returns("windows")
|
409
|
+
end
|
410
|
+
|
411
|
+
it "exports http_proxy & HTTP_PROXY when :http_proxy is set" do
|
412
|
+
config[:http_proxy] = "http://proxy"
|
413
|
+
|
414
|
+
cmd.lines.to_a[0..1].must_equal([
|
415
|
+
%{$env:http_proxy = "http://proxy"\n},
|
416
|
+
%{$env:HTTP_PROXY = "http://proxy"\n}
|
417
|
+
])
|
418
|
+
end
|
419
|
+
|
420
|
+
it "exports https_proxy & HTTPS_PROXY when :https_proxy is set" do
|
421
|
+
config[:https_proxy] = "https://proxy"
|
422
|
+
|
423
|
+
cmd.lines.to_a[0..1].must_equal([
|
424
|
+
%{$env:https_proxy = "https://proxy"\n},
|
425
|
+
%{$env:HTTPS_PROXY = "https://proxy"\n}
|
426
|
+
])
|
427
|
+
end
|
428
|
+
|
429
|
+
it "exports all http proxy variables when both are set" do
|
430
|
+
config[:http_proxy] = "http://proxy"
|
431
|
+
config[:https_proxy] = "https://proxy"
|
432
|
+
|
433
|
+
cmd.lines.to_a[0..3].must_equal([
|
434
|
+
%{$env:http_proxy = "http://proxy"\n},
|
435
|
+
%{$env:HTTP_PROXY = "http://proxy"\n},
|
436
|
+
%{$env:https_proxy = "https://proxy"\n},
|
437
|
+
%{$env:HTTPS_PROXY = "https://proxy"\n}
|
438
|
+
])
|
439
|
+
end
|
440
|
+
|
441
|
+
it "reloads PATH for older chef omnibus packages" do
|
442
|
+
cmd.must_match regexify("$env:PATH = " +
|
443
|
+
%{[System.Environment]::GetEnvironmentVariable("PATH","Machine")})
|
444
|
+
end
|
445
|
+
|
446
|
+
it "calls the chef-solo command from :chef_solo_path" do
|
447
|
+
config[:chef_solo_path] = "\\r\\chef-solo.bat"
|
448
|
+
|
449
|
+
cmd.must_match regexify("& \\r\\chef-solo.bat ", :partial_line)
|
450
|
+
end
|
451
|
+
|
452
|
+
it "sets config flag on chef-solo" do
|
453
|
+
cmd.must_match regexify(
|
454
|
+
" --config $env:TEMP\\kitchen\\solo.rb", :partial_line)
|
455
|
+
end
|
456
|
+
|
457
|
+
it "sets config flag for custom root_path" do
|
458
|
+
config[:root_path] = "\\a\\b"
|
459
|
+
|
460
|
+
cmd.must_match regexify(
|
461
|
+
" --config \\a\\b\\solo.rb", :partial_line)
|
462
|
+
end
|
463
|
+
|
464
|
+
it "sets json attributes flag on chef-solo" do
|
465
|
+
cmd.must_match regexify(
|
466
|
+
" --json-attributes $env:TEMP\\kitchen\\dna.json", :partial_line)
|
467
|
+
end
|
468
|
+
|
469
|
+
it "sets json attribtes flag for custom root_path" do
|
470
|
+
config[:root_path] = "\\booyah"
|
471
|
+
|
472
|
+
cmd.must_match regexify(
|
473
|
+
" --json-attributes \\booyah\\dna.json", :partial_line)
|
474
|
+
end
|
298
475
|
|
299
|
-
|
476
|
+
it "sets log level flag on chef-solo to auto by default" do
|
477
|
+
cmd.must_match regexify(" --log_level auto", :partial_line)
|
478
|
+
end
|
479
|
+
|
480
|
+
it "set log level flag for custom level" do
|
481
|
+
config[:log_level] = :extreme
|
482
|
+
|
483
|
+
cmd.must_match regexify(" --log_level extreme", :partial_line)
|
484
|
+
end
|
485
|
+
|
486
|
+
it "sets force formatter flag on chef-solo" do
|
487
|
+
cmd.must_match regexify(" --force-formatter", :partial_line)
|
488
|
+
end
|
489
|
+
|
490
|
+
it "sets no color flag on chef-solo" do
|
491
|
+
cmd.must_match regexify(" --no-color", :partial_line)
|
492
|
+
end
|
493
|
+
|
494
|
+
it "does not set logfile flag by default" do
|
495
|
+
cmd.wont_match regexify(" --logfile ", :partial_line)
|
496
|
+
end
|
497
|
+
|
498
|
+
it "sets logfile flag for custom value" do
|
499
|
+
config[:log_file] = "\\a\\out.log"
|
500
|
+
|
501
|
+
cmd.must_match regexify(" --logfile \\a\\out.log", :partial_line)
|
502
|
+
end
|
300
503
|
end
|
301
504
|
end
|
302
505
|
|