diff --git a/plugins/providers/virtualbox/action/network.rb b/plugins/providers/virtualbox/action/network.rb index 56ada7a06..171ad734a 100644 --- a/plugins/providers/virtualbox/action/network.rb +++ b/plugins/providers/virtualbox/action/network.rb @@ -362,12 +362,15 @@ module VagrantPlugins end def intnet_adapter(config) + intnet_name = config[:intnet] + intnet_name = "intnet" if intnet_name == true + return { :adapter => config[:adapter], :type => :intnet, :mac_address => config[:mac], :nic_type => config[:nic_type], - :intnet => config[:intnet] + :intnet => intnet_name, } end diff --git a/test/acceptance/provider-virtualbox/network_intnet_spec.rb b/test/acceptance/provider-virtualbox/network_intnet_spec.rb new file mode 100644 index 000000000..1976ceea9 --- /dev/null +++ b/test/acceptance/provider-virtualbox/network_intnet_spec.rb @@ -0,0 +1,21 @@ +shared_examples "provider/network/intnet" do |provider, options| + if !options[:box] + raise ArgumentError, + "box option must be specified for provider: #{provider}" + end + + include_context "acceptance" + + before do + environment.skeleton("network_intnet") + assert_execute("vagrant", "box", "add", "box", options[:box]) + assert_execute("vagrant", "up", "--provider=#{provider}") + end + + after do + assert_execute("vagrant", "destroy", "--force", log: false) + end + + it "properly configures an internal network" do + end +end diff --git a/test/acceptance/skeletons/network_intnet/Vagrantfile b/test/acceptance/skeletons/network_intnet/Vagrantfile new file mode 100644 index 000000000..0ce1edf88 --- /dev/null +++ b/test/acceptance/skeletons/network_intnet/Vagrantfile @@ -0,0 +1,6 @@ +Vagrant.configure("2") do |config| + config.vm.box = "box" + config.vm.network "private_network", + ip: "192.168.50.4", + virtualbox__intnet: true +end diff --git a/vagrant-spec.config.example.rb b/vagrant-spec.config.example.rb index 77986bd76..59a39520d 100644 --- a/vagrant-spec.config.example.rb +++ b/vagrant-spec.config.example.rb @@ -1,6 +1,9 @@ require_relative "test/acceptance/base" Vagrant::Spec::Acceptance.configure do |c| + c.component_paths << File.expand_path("../test/acceptance", __FILE__) + c.skeleton_paths << File.expand_path("../test/acceptance/skeletons", __FILE__) + c.provider "virtualbox", box: "", contexts: ["provider-context/virtualbox"]