Skip to content

Commit

Permalink
Fix #175. Ability to set cpuidset for vbox
Browse files Browse the repository at this point in the history
Signed-off-by: Seth Thomas <[email protected]>
  • Loading branch information
Seth Thomas committed Jan 6, 2017
1 parent 2895280 commit cb89f82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/kitchen/driver/vagrant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,19 @@ def run_command(_cmd, options = {})
end
RUBY
end

it "adds a line for cpuidset in :customize" do
config[:customize] = {
:cpuidset => %w{00000001 00000002},
}
cmd

expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
c.vm.provider :virtualbox do |p|
p.customize ["modifyvm", :id, "--cpuidset", "00000001", "00000002"]
end
RUBY
end
end

context "for parallels provider" do
Expand Down
6 changes: 6 additions & 0 deletions templates/Vagrantfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ Vagrant.configure("2") do |c|
end
end %>
p.customize ["storageattach", :id, <%= options.join(', ') %>]
<% elsif key == :cpuidset %>
<% ids = [] %>
<% value.each do | id |
ids << "\"#{id}\""
end %>
p.customize ["modifyvm", :id, "--cpuidset", <%= ids.join(', ') %>]
<% else %>
p.customize ["modifyvm", :id, "--<%= key %>", "<%= value %>"]
<% end %>
Expand Down

0 comments on commit cb89f82

Please sign in to comment.