kitchen-vagrant 1.1.1 → 1.2.0
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/CHANGELOG.md +8 -0
- data/README.md +15 -8
- data/lib/kitchen/driver/vagrant.rb +14 -1
- data/lib/kitchen/driver/vagrant_version.rb +1 -1
- data/spec/kitchen/driver/vagrant_spec.rb +56 -4
- data/templates/Vagrantfile.erb +16 -10
- 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: 078a13d604dea258f0f18bb35b7fd8ab8d005227
|
|
4
|
+
data.tar.gz: 076909d85a9b05c2192aa4665dc4f45757815063
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f81440f12beb801b48b1c68718039d6d0ecba362b31a533ffb0005d21e729e326684ac535fcec85f7c622c2396c91d5c1be2045bf14fedd40c32da8a9578993
|
|
7
|
+
data.tar.gz: 2964f0f254af10b7191d1deebeab4eb33c0cae606f8157db893d801d0bf30e0929df217a7bb1c786600a6a9f7399239b883e330e368d275af4cff531898d90bb
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## [1.2.0](https://github.com/test-kitchen/kitchen-vagrant/tree/1.2.0) (2017-08-11)
|
|
4
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.1.1...1.2.0)
|
|
5
|
+
|
|
6
|
+
**Implemented enhancements:**
|
|
7
|
+
|
|
8
|
+
- Support to create/attach multiple additional VirtualBox disks [\#312](https://github.com/test-kitchen/kitchen-vagrant/pull/312) ([stissot](https://github.com/stissot))
|
|
9
|
+
- Parallel virtualbox [\#202](https://github.com/test-kitchen/kitchen-vagrant/pull/202) ([rveznaver](https://github.com/rveznaver))
|
|
10
|
+
|
|
3
11
|
## [v1.1.1](https://github.com/test-kitchen/kitchen-vagrant/tree/v1.1.1) (2017-07-26)
|
|
4
12
|
[Full Changelog](https://github.com/test-kitchen/kitchen-vagrant/compare/v1.1.0...v1.1.1)
|
|
5
13
|
|
data/README.md
CHANGED
|
@@ -269,7 +269,7 @@ and [VMware][vagrant_config_vmware] for more details.
|
|
|
269
269
|
#### <a name="config-customize-virtualbox-disk"></a> VirtualBox additional disk
|
|
270
270
|
|
|
271
271
|
Adding the `createhd` and `storageattach` keys in `customize` allows for creation
|
|
272
|
-
of
|
|
272
|
+
of additional disks in VirtualBox. Full paths must be used as required by VirtualBox.
|
|
273
273
|
|
|
274
274
|
*NOTE*: IDE Controller based drives always show up in the boot order first, regardless of if they
|
|
275
275
|
are [bootable][vbox_ide_boot].
|
|
@@ -278,14 +278,21 @@ are [bootable][vbox_ide_boot].
|
|
|
278
278
|
driver:
|
|
279
279
|
customize:
|
|
280
280
|
createhd:
|
|
281
|
-
filename: /tmp/disk1.vmdk
|
|
282
|
-
|
|
281
|
+
- filename: /tmp/disk1.vmdk
|
|
282
|
+
size: 1024
|
|
283
|
+
- filename: /tmp/disk2.vmdk
|
|
284
|
+
size: 2048
|
|
283
285
|
storageattach:
|
|
284
|
-
storagectl:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
- storagectl: IDE Controller
|
|
287
|
+
port: 1
|
|
288
|
+
device: 0
|
|
289
|
+
type: hdd
|
|
290
|
+
medium: /tmp/disk2.vmdk
|
|
291
|
+
- storagectl: IDE Controller
|
|
292
|
+
port: 1
|
|
293
|
+
device: 1
|
|
294
|
+
type: hdd
|
|
295
|
+
medium: /tmp/disk2.vmdk
|
|
289
296
|
```
|
|
290
297
|
|
|
291
298
|
will generate a Vagrantfile configuration similar to:
|
|
@@ -95,7 +95,7 @@ module Kitchen
|
|
|
95
95
|
|
|
96
96
|
default_config :cachier, nil
|
|
97
97
|
|
|
98
|
-
no_parallel_for :create, :destroy
|
|
98
|
+
# no_parallel_for :create, :destroy
|
|
99
99
|
|
|
100
100
|
# Creates a Vagrant VM instance.
|
|
101
101
|
#
|
|
@@ -378,6 +378,14 @@ module Kitchen
|
|
|
378
378
|
# @see Kitchen::ShellOut.run_command
|
|
379
379
|
# @api private
|
|
380
380
|
def run(cmd, options = {})
|
|
381
|
+
if vagrant_root && config[:provider] == "virtualbox"
|
|
382
|
+
require "digest"
|
|
383
|
+
options[:environment] = {} if options[:environment].nil?
|
|
384
|
+
options[:environment]["VBOX_IPC_SOCKETID"] =
|
|
385
|
+
Digest::SHA256.hexdigest(vagrant_root)
|
|
386
|
+
options[:environment]["VBOX_USER_HOME"] = vagrant_root
|
|
387
|
+
debug("Accessing isolated VirtualBox environment in #{vagrant_root}")
|
|
388
|
+
end
|
|
381
389
|
cmd = "echo #{cmd}" if config[:dry_run]
|
|
382
390
|
run_command(cmd, { :cwd => vagrant_root }.merge(options))
|
|
383
391
|
end
|
|
@@ -440,6 +448,11 @@ module Kitchen
|
|
|
440
448
|
#
|
|
441
449
|
# @api private
|
|
442
450
|
def run_pre_create_command
|
|
451
|
+
if vagrant_root && config[:provider] == "virtualbox"
|
|
452
|
+
run("vboxmanage setproperty machinefolder #{vagrant_root}",
|
|
453
|
+
:cwd => config[:kitchen_root])
|
|
454
|
+
debug("Set VirtualBox machinefolder to #{vagrant_root}")
|
|
455
|
+
end
|
|
443
456
|
if config[:pre_create_command]
|
|
444
457
|
run(config[:pre_create_command], :cwd => config[:kitchen_root])
|
|
445
458
|
end
|
|
@@ -1341,11 +1341,11 @@ describe Kitchen::Driver::Vagrant do
|
|
|
1341
1341
|
RUBY
|
|
1342
1342
|
end
|
|
1343
1343
|
|
|
1344
|
-
it "
|
|
1344
|
+
it "add line for single createhd in :customize" do
|
|
1345
1345
|
config[:customize] = {
|
|
1346
1346
|
:createhd => {
|
|
1347
|
-
|
|
1348
|
-
|
|
1347
|
+
:filename => "./d1.vmdk",
|
|
1348
|
+
:size => 10 * 1024,
|
|
1349
1349
|
},
|
|
1350
1350
|
}
|
|
1351
1351
|
cmd
|
|
@@ -1357,7 +1357,30 @@ describe Kitchen::Driver::Vagrant do
|
|
|
1357
1357
|
RUBY
|
|
1358
1358
|
end
|
|
1359
1359
|
|
|
1360
|
-
it "adds
|
|
1360
|
+
it "adds lines for multiple createhd in :customize" do
|
|
1361
|
+
config[:customize] = {
|
|
1362
|
+
:createhd => [
|
|
1363
|
+
{
|
|
1364
|
+
:filename => "./d1.vmdk",
|
|
1365
|
+
:size => 10 * 1024,
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
:filename => "./d2.vmdk",
|
|
1369
|
+
:size => 20 * 1024,
|
|
1370
|
+
},
|
|
1371
|
+
],
|
|
1372
|
+
}
|
|
1373
|
+
cmd
|
|
1374
|
+
|
|
1375
|
+
expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
|
|
1376
|
+
c.vm.provider :virtualbox do |p|
|
|
1377
|
+
p.customize ["createhd", "--filename", "./d1.vmdk", "--size", 10240]
|
|
1378
|
+
p.customize ["createhd", "--filename", "./d2.vmdk", "--size", 20480]
|
|
1379
|
+
end
|
|
1380
|
+
RUBY
|
|
1381
|
+
end
|
|
1382
|
+
|
|
1383
|
+
it "adds lines for single storageattach in :customize" do
|
|
1361
1384
|
config[:customize] = {
|
|
1362
1385
|
:storageattach => {
|
|
1363
1386
|
:type => "hdd",
|
|
@@ -1373,6 +1396,35 @@ describe Kitchen::Driver::Vagrant do
|
|
|
1373
1396
|
RUBY
|
|
1374
1397
|
end
|
|
1375
1398
|
|
|
1399
|
+
it "adds lines for multiple storageattach in :customize" do
|
|
1400
|
+
config[:customize] = {
|
|
1401
|
+
:storageattach => [
|
|
1402
|
+
{
|
|
1403
|
+
:storagectl => "SATA Controller",
|
|
1404
|
+
:port => 1,
|
|
1405
|
+
:device => 0,
|
|
1406
|
+
:type => "hdd",
|
|
1407
|
+
:medium => "./d1.vmdk",
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
:storagectl => "SATA Controller",
|
|
1411
|
+
:port => 1,
|
|
1412
|
+
:device => 1,
|
|
1413
|
+
:type => "hdd",
|
|
1414
|
+
:medium => "./d2.vmdk",
|
|
1415
|
+
},
|
|
1416
|
+
],
|
|
1417
|
+
}
|
|
1418
|
+
cmd
|
|
1419
|
+
|
|
1420
|
+
expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
|
|
1421
|
+
c.vm.provider :virtualbox do |p|
|
|
1422
|
+
p.customize ["storageattach", :id, "--storagectl", "SATA Controller", "--port", 1, "--device", 0, "--type", "hdd", "--medium", "./d1.vmdk"]
|
|
1423
|
+
p.customize ["storageattach", :id, "--storagectl", "SATA Controller", "--port", 1, "--device", 1, "--type", "hdd", "--medium", "./d2.vmdk"]
|
|
1424
|
+
end
|
|
1425
|
+
RUBY
|
|
1426
|
+
end
|
|
1427
|
+
|
|
1376
1428
|
it "adds a line for cpuidset in :customize" do
|
|
1377
1429
|
config[:customize] = {
|
|
1378
1430
|
:cpuidset => %w{00000001 00000002},
|
data/templates/Vagrantfile.erb
CHANGED
|
@@ -152,18 +152,24 @@ Vagrant.configure("2") do |c|
|
|
|
152
152
|
<% end %>
|
|
153
153
|
<% when "virtualbox" %>
|
|
154
154
|
<% if key == :createhd %>
|
|
155
|
-
|
|
155
|
+
<% value = [value] unless value.instance_of?(Array) %>
|
|
156
|
+
<% value.each do |item| %>
|
|
157
|
+
p.customize ["createhd", "--filename", "<%= item[:filename] %>", "--size", <%= item[:size] %>]
|
|
158
|
+
<% end %>
|
|
156
159
|
<% elsif key == :storageattach %>
|
|
157
|
-
<%
|
|
158
|
-
<% value.each do |
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
options <<
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
160
|
+
<% value = [value] unless value.instance_of?(Array) %>
|
|
161
|
+
<% value.each do |item| %>
|
|
162
|
+
<% options = [] %>
|
|
163
|
+
<% item.each do |storageattach_option_key, storageattach_option_value|
|
|
164
|
+
options << "\"--#{storageattach_option_key}\""
|
|
165
|
+
if storageattach_option_value.instance_of? Fixnum
|
|
166
|
+
options << storageattach_option_value
|
|
167
|
+
else
|
|
168
|
+
options << "\"#{storageattach_option_value}\""
|
|
169
|
+
end
|
|
170
|
+
end %>
|
|
166
171
|
p.customize ["storageattach", :id, <%= options.join(', ') %>]
|
|
172
|
+
<% end %>
|
|
167
173
|
<% elsif key == :cpuidset %>
|
|
168
174
|
<% ids = [] %>
|
|
169
175
|
<% value.each do | id |
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-vagrant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fletcher Nichol
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-08-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: test-kitchen
|