test-kitchen 1.4.0.beta.1 → 1.4.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/kitchen/provisioner/shell.rb +6 -9
- data/lib/kitchen/version.rb +1 -1
- data/spec/kitchen/provisioner/shell_spec.rb +129 -1
- data/support/decode_files.ps1.erb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9849b2009d2b085667f5ec14e164878bcd272579
|
4
|
+
data.tar.gz: 2b8a47abba8c594d1a4365f21b335778b70a95dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 410c8df130d1b1ff99110b24ea196d665ec13a9a971ebfd05da44057f2166dd34d3761031c27519682d18ab8d49bb4bbc512cd379d0648305e12bfdbd1e99262
|
7
|
+
data.tar.gz: bcc27fddd397449694927037eafc5966757a462843afdf574338b860bfbf180bec21cca9da208cbfe83d2106d17da73c636c4d9e824e70c4204db86a7c30b19a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 1.4.0.beta.2 / 2015-03-25
|
2
|
+
|
3
|
+
### Potentially breaking changes
|
4
|
+
|
5
|
+
* Pull request [#649][]: Preserve Busser's #setup_cmd, #run_cmd, & #sync_cmd for better backwards compatibility. ([@fnichol][])
|
6
|
+
|
7
|
+
### Bug fixes
|
8
|
+
|
9
|
+
* Pull request [#648][]: Transport::Winrm: Truncate destination file for overwriting. ([@fnichol][])
|
10
|
+
|
11
|
+
|
1
12
|
## 1.4.0.beta.1 / 2015-03-24
|
2
13
|
|
3
14
|
### Potentially breaking changes
|
@@ -615,6 +626,8 @@ The initial release.
|
|
615
626
|
[#588]: https://github.com/test-kitchen/test-kitchen/issues/588
|
616
627
|
[#600]: https://github.com/test-kitchen/test-kitchen/issues/600
|
617
628
|
[#633]: https://github.com/test-kitchen/test-kitchen/issues/633
|
629
|
+
[#648]: https://github.com/test-kitchen/test-kitchen/issues/648
|
630
|
+
[#649]: https://github.com/test-kitchen/test-kitchen/issues/649
|
618
631
|
[@ChrisLundquist]: https://github.com/ChrisLundquist
|
619
632
|
[@MarkGibbons]: https://github.com/MarkGibbons
|
620
633
|
[@adamhjk]: https://github.com/adamhjk
|
@@ -50,7 +50,7 @@ module Kitchen
|
|
50
50
|
root = config[:root_path]
|
51
51
|
data = remote_path_join(root, "data")
|
52
52
|
|
53
|
-
if powershell_shell?
|
53
|
+
code = if powershell_shell?
|
54
54
|
Util.outdent!(<<-POWERSHELL)
|
55
55
|
if (Test-Path "#{data}") {
|
56
56
|
Remove-Item "#{data}" -Recurse -Force
|
@@ -60,10 +60,10 @@ module Kitchen
|
|
60
60
|
}
|
61
61
|
POWERSHELL
|
62
62
|
else
|
63
|
-
|
64
|
-
|
65
|
-
Util.wrap_command(cmd)
|
63
|
+
"#{sudo("rm")} -rf #{data} ; mkdir -p #{root}"
|
66
64
|
end
|
65
|
+
|
66
|
+
wrap_shell_code(code)
|
67
67
|
end
|
68
68
|
|
69
69
|
# (see Base#run_command)
|
@@ -72,12 +72,9 @@ module Kitchen
|
|
72
72
|
config[:root_path],
|
73
73
|
File.basename(config[:script])
|
74
74
|
)
|
75
|
+
code = powershell_shell? ? %{& "#{script}"} : sudo(script)
|
75
76
|
|
76
|
-
|
77
|
-
%{& "#{script}"}
|
78
|
-
else
|
79
|
-
Util.wrap_command(sudo(script))
|
80
|
-
end
|
77
|
+
wrap_shell_code(code)
|
81
78
|
end
|
82
79
|
|
83
80
|
private
|
data/lib/kitchen/version.rb
CHANGED
@@ -87,6 +87,40 @@ describe Kitchen::Provisioner::Shell do
|
|
87
87
|
cmd.must_match(/'\Z/)
|
88
88
|
end
|
89
89
|
|
90
|
+
it "ends with a single quote" do
|
91
|
+
cmd.must_match(/'\Z/)
|
92
|
+
end
|
93
|
+
|
94
|
+
it "exports http_proxy & HTTP_PROXY when :http_proxy is set" do
|
95
|
+
config[:http_proxy] = "http://proxy"
|
96
|
+
|
97
|
+
cmd.lines.to_a[1..2].must_equal([
|
98
|
+
%{http_proxy="http://proxy"; export http_proxy\n},
|
99
|
+
%{HTTP_PROXY="http://proxy"; export HTTP_PROXY\n}
|
100
|
+
])
|
101
|
+
end
|
102
|
+
|
103
|
+
it "exports https_proxy & HTTPS_PROXY when :https_proxy is set" do
|
104
|
+
config[:https_proxy] = "https://proxy"
|
105
|
+
|
106
|
+
cmd.lines.to_a[1..2].must_equal([
|
107
|
+
%{https_proxy="https://proxy"; export https_proxy\n},
|
108
|
+
%{HTTPS_PROXY="https://proxy"; export HTTPS_PROXY\n}
|
109
|
+
])
|
110
|
+
end
|
111
|
+
|
112
|
+
it "exports all http proxy variables when both are set" do
|
113
|
+
config[:http_proxy] = "http://proxy"
|
114
|
+
config[:https_proxy] = "https://proxy"
|
115
|
+
|
116
|
+
cmd.lines.to_a[1..4].must_equal([
|
117
|
+
%{http_proxy="http://proxy"; export http_proxy\n},
|
118
|
+
%{HTTP_PROXY="http://proxy"; export HTTP_PROXY\n},
|
119
|
+
%{https_proxy="https://proxy"; export https_proxy\n},
|
120
|
+
%{HTTPS_PROXY="https://proxy"; export HTTPS_PROXY\n}
|
121
|
+
])
|
122
|
+
end
|
123
|
+
|
90
124
|
it "uses sudo for rm when configured" do
|
91
125
|
config[:sudo] = true
|
92
126
|
|
@@ -122,6 +156,36 @@ describe Kitchen::Provisioner::Shell do
|
|
122
156
|
platform.stubs(:shell_type).returns("powershell")
|
123
157
|
end
|
124
158
|
|
159
|
+
it "exports http_proxy & HTTP_PROXY when :http_proxy is set" do
|
160
|
+
config[:http_proxy] = "http://proxy"
|
161
|
+
|
162
|
+
cmd.lines.to_a[0..1].must_equal([
|
163
|
+
%{$env:http_proxy = "http://proxy"\n},
|
164
|
+
%{$env:HTTP_PROXY = "http://proxy"\n}
|
165
|
+
])
|
166
|
+
end
|
167
|
+
|
168
|
+
it "exports https_proxy & HTTPS_PROXY when :https_proxy is set" do
|
169
|
+
config[:https_proxy] = "https://proxy"
|
170
|
+
|
171
|
+
cmd.lines.to_a[0..1].must_equal([
|
172
|
+
%{$env:https_proxy = "https://proxy"\n},
|
173
|
+
%{$env:HTTPS_PROXY = "https://proxy"\n}
|
174
|
+
])
|
175
|
+
end
|
176
|
+
|
177
|
+
it "exports all http proxy variables when both are set" do
|
178
|
+
config[:http_proxy] = "http://proxy"
|
179
|
+
config[:https_proxy] = "https://proxy"
|
180
|
+
|
181
|
+
cmd.lines.to_a[0..3].must_equal([
|
182
|
+
%{$env:http_proxy = "http://proxy"\n},
|
183
|
+
%{$env:HTTP_PROXY = "http://proxy"\n},
|
184
|
+
%{$env:https_proxy = "https://proxy"\n},
|
185
|
+
%{$env:HTTPS_PROXY = "https://proxy"\n}
|
186
|
+
])
|
187
|
+
end
|
188
|
+
|
125
189
|
it "removes the data directory" do
|
126
190
|
config[:root_path] = "\\route"
|
127
191
|
|
@@ -157,6 +221,40 @@ describe Kitchen::Provisioner::Shell do
|
|
157
221
|
cmd.must_match(/'\Z/)
|
158
222
|
end
|
159
223
|
|
224
|
+
it "ends with a single quote" do
|
225
|
+
cmd.must_match(/'\Z/)
|
226
|
+
end
|
227
|
+
|
228
|
+
it "exports http_proxy & HTTP_PROXY when :http_proxy is set" do
|
229
|
+
config[:http_proxy] = "http://proxy"
|
230
|
+
|
231
|
+
cmd.lines.to_a[1..2].must_equal([
|
232
|
+
%{http_proxy="http://proxy"; export http_proxy\n},
|
233
|
+
%{HTTP_PROXY="http://proxy"; export HTTP_PROXY\n}
|
234
|
+
])
|
235
|
+
end
|
236
|
+
|
237
|
+
it "exports https_proxy & HTTPS_PROXY when :https_proxy is set" do
|
238
|
+
config[:https_proxy] = "https://proxy"
|
239
|
+
|
240
|
+
cmd.lines.to_a[1..2].must_equal([
|
241
|
+
%{https_proxy="https://proxy"; export https_proxy\n},
|
242
|
+
%{HTTPS_PROXY="https://proxy"; export HTTPS_PROXY\n}
|
243
|
+
])
|
244
|
+
end
|
245
|
+
|
246
|
+
it "exports all http proxy variables when both are set" do
|
247
|
+
config[:http_proxy] = "http://proxy"
|
248
|
+
config[:https_proxy] = "https://proxy"
|
249
|
+
|
250
|
+
cmd.lines.to_a[1..4].must_equal([
|
251
|
+
%{http_proxy="http://proxy"; export http_proxy\n},
|
252
|
+
%{HTTP_PROXY="http://proxy"; export HTTP_PROXY\n},
|
253
|
+
%{https_proxy="https://proxy"; export https_proxy\n},
|
254
|
+
%{HTTPS_PROXY="https://proxy"; export HTTPS_PROXY\n}
|
255
|
+
])
|
256
|
+
end
|
257
|
+
|
160
258
|
it "uses sudo for script when configured" do
|
161
259
|
config[:root_path] = "/r"
|
162
260
|
config[:sudo] = true
|
@@ -180,10 +278,40 @@ describe Kitchen::Provisioner::Shell do
|
|
180
278
|
platform.stubs(:os_type).returns("windows")
|
181
279
|
end
|
182
280
|
|
281
|
+
it "exports http_proxy & HTTP_PROXY when :http_proxy is set" do
|
282
|
+
config[:http_proxy] = "http://proxy"
|
283
|
+
|
284
|
+
cmd.lines.to_a[0..1].must_equal([
|
285
|
+
%{$env:http_proxy = "http://proxy"\n},
|
286
|
+
%{$env:HTTP_PROXY = "http://proxy"\n}
|
287
|
+
])
|
288
|
+
end
|
289
|
+
|
290
|
+
it "exports https_proxy & HTTPS_PROXY when :https_proxy is set" do
|
291
|
+
config[:https_proxy] = "https://proxy"
|
292
|
+
|
293
|
+
cmd.lines.to_a[0..1].must_equal([
|
294
|
+
%{$env:https_proxy = "https://proxy"\n},
|
295
|
+
%{$env:HTTPS_PROXY = "https://proxy"\n}
|
296
|
+
])
|
297
|
+
end
|
298
|
+
|
299
|
+
it "exports all http proxy variables when both are set" do
|
300
|
+
config[:http_proxy] = "http://proxy"
|
301
|
+
config[:https_proxy] = "https://proxy"
|
302
|
+
|
303
|
+
cmd.lines.to_a[0..3].must_equal([
|
304
|
+
%{$env:http_proxy = "http://proxy"\n},
|
305
|
+
%{$env:HTTP_PROXY = "http://proxy"\n},
|
306
|
+
%{$env:https_proxy = "https://proxy"\n},
|
307
|
+
%{$env:HTTPS_PROXY = "https://proxy"\n}
|
308
|
+
])
|
309
|
+
end
|
310
|
+
|
183
311
|
it "invokes the bootstrap.ps1 script" do
|
184
312
|
config[:root_path] = "\\r"
|
185
313
|
|
186
|
-
cmd.
|
314
|
+
cmd.must_match regexify(%{& "\\r\\bootstrap.ps1"})
|
187
315
|
end
|
188
316
|
end
|
189
317
|
end
|
@@ -8,6 +8,7 @@ Function Decode-Base64File($src, $dst) {
|
|
8
8
|
$b64 = New-Object -TypeName System.Security.Cryptography.FromBase64Transform
|
9
9
|
$m = [System.Security.Cryptography.CryptoStreamMode]::Read
|
10
10
|
$d = New-Object -TypeName System.Security.Cryptography.CryptoStream $in,$b64,$m
|
11
|
+
echo $null > $dst
|
11
12
|
Copy-Stream $d ($out = [System.IO.File]::OpenWrite($dst))
|
12
13
|
} Finally { Cleanup $in; Cleanup $out; Cleanup $d }
|
13
14
|
}
|
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: 1.4.0.beta.
|
4
|
+
version: 1.4.0.beta.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: 2015-03-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|