From 87ee57d94aee47b8ee86ec938696c163a9dfea21 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Mon, 30 Jul 2018 15:16:50 -0700 Subject: [PATCH] Add test coverage on link-local skip for ipv6 in vbox --- .../virtualbox/action/network_fix_ipv6_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/unit/plugins/providers/virtualbox/action/network_fix_ipv6_test.rb b/test/unit/plugins/providers/virtualbox/action/network_fix_ipv6_test.rb index f12261de5..618c024a8 100644 --- a/test/unit/plugins/providers/virtualbox/action/network_fix_ipv6_test.rb +++ b/test/unit/plugins/providers/virtualbox/action/network_fix_ipv6_test.rb @@ -123,6 +123,23 @@ describe VagrantPlugins::ProviderVirtualBox::Action::NetworkFixIPv6 do expect(socket).to_not have_received(:connect) end + it "should ignore interfaces with link-local IPv6 address" do + all_networks = [{name: "vboxnet0", + ipv6: "fe80::ffff:ffff:ffff:ffff", + ipv6_prefix: 64, + status: 'Up' + } + ] + ifaces = { 1 => {type: :hostonly, hostonly: "vboxnet0"} + } + allow(machine.provider.driver).to receive(:read_network_interfaces) + .and_return(ifaces) + allow(machine.provider.driver).to receive(:read_host_only_interfaces) + .and_return(all_networks) + subject.call(env) + expect(socket).to_not have_received(:connect) + end + it "should ignore nat interfaces" do all_networks = [{name: "vboxnet0", ipv6: "",