providers/virtualbox: network config uses proper format, tests [GH-2854]
This commit is contained in:
parent
5bc96ad4bf
commit
dd33a26422
|
@ -71,6 +71,8 @@ BUG FIXES:
|
||||||
- providers/virtualbox: Make more internal interactions with VBoxManage
|
- providers/virtualbox: Make more internal interactions with VBoxManage
|
||||||
retryable to avoid spurious VirtualBox errors. [GH-2831]
|
retryable to avoid spurious VirtualBox errors. [GH-2831]
|
||||||
- providers/virtualbox: Config validation catches invalid keys. [GH-2843]
|
- providers/virtualbox: Config validation catches invalid keys. [GH-2843]
|
||||||
|
- providers/virtualbox: Fix network adapter configuration issue if using
|
||||||
|
provider-specific config. [GH-2854]
|
||||||
- provisioners/chef: When chowning folders, don't follow symlinks.
|
- provisioners/chef: When chowning folders, don't follow symlinks.
|
||||||
- provisioners/docker: Only add SSH user to docker group if the user
|
- provisioners/docker: Only add SSH user to docker group if the user
|
||||||
isn't already in it. [GH-2838]
|
isn't already in it. [GH-2838]
|
||||||
|
|
|
@ -72,8 +72,8 @@ module VagrantPlugins
|
||||||
#
|
#
|
||||||
# @param [Integer] slot The slot for this network adapter.
|
# @param [Integer] slot The slot for this network adapter.
|
||||||
# @param [Symbol] type The type of adapter.
|
# @param [Symbol] type The type of adapter.
|
||||||
def network_adapter(slot, type, *args)
|
def network_adapter(slot, type, **opts)
|
||||||
@network_adapters[slot] = [type, args]
|
@network_adapters[slot] = [type, opts]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Shortcut for setting memory size for the virtual machine.
|
# Shortcut for setting memory size for the virtual machine.
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
require_relative "../../../base"
|
||||||
|
|
||||||
|
require Vagrant.source_root.join("plugins/providers/virtualbox/config")
|
||||||
|
|
||||||
|
describe VagrantPlugins::ProviderVirtualBox::Config do
|
||||||
|
context "defaults" do
|
||||||
|
before { subject.finalize! }
|
||||||
|
|
||||||
|
it "should have one NAT adapter" do
|
||||||
|
expect(subject.network_adapters).to eql({
|
||||||
|
1 => [:nat, {}],
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#network_adapter" do
|
||||||
|
it "configures additional adapters" do
|
||||||
|
subject.network_adapter(2, :bridged, auto_config: true)
|
||||||
|
expect(subject.network_adapters[2]).to eql(
|
||||||
|
[:bridged, auto_config: true])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -3,7 +3,6 @@ require Vagrant.source_root.join("test/unit/base")
|
||||||
|
|
||||||
require Vagrant.source_root.join("plugins/providers/virtualbox/synced_folder")
|
require Vagrant.source_root.join("plugins/providers/virtualbox/synced_folder")
|
||||||
|
|
||||||
# TODO(mitchellh): tag with v2
|
|
||||||
describe VagrantPlugins::ProviderVirtualBox::SyncedFolder do
|
describe VagrantPlugins::ProviderVirtualBox::SyncedFolder do
|
||||||
let(:machine) do
|
let(:machine) do
|
||||||
double("machine").tap do |m|
|
double("machine").tap do |m|
|
||||||
|
|
Loading…
Reference in New Issue