From 76e3ad988fac3cbd2406994a8d31a580ca0acab0 Mon Sep 17 00:00:00 2001 From: Ryan Heffernan Date: Sat, 30 Apr 2016 12:27:48 -0700 Subject: [PATCH 1/2] Adding static IPv6 address support for Fedora --- templates/guests/fedora/network_static6.erb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 templates/guests/fedora/network_static6.erb diff --git a/templates/guests/fedora/network_static6.erb b/templates/guests/fedora/network_static6.erb new file mode 100644 index 000000000..ff102a5c8 --- /dev/null +++ b/templates/guests/fedora/network_static6.erb @@ -0,0 +1,9 @@ +#VAGRANT-BEGIN +# The contents below are automatically generated by Vagrant. Do not modify. +NM_CONTROLLED=no +BOOTPROTO=none +ONBOOT=yes +IPV6INIT=yes +IPV6ADDR=<%= options[:ip] %> +DEVICE=<%= options[:device] %> +#VAGRANT-END From d7714f058ddc84fa3f17f9d3aaf0956e62139216 Mon Sep 17 00:00:00 2001 From: Ryan Heffernan Date: Sat, 30 Apr 2016 12:58:59 -0700 Subject: [PATCH 2/2] Added basic unit test --- templates/guests/fedora/network_static6.erb | 2 +- .../guests/fedora/network_static6_test.rb | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test/unit/templates/guests/fedora/network_static6_test.rb diff --git a/templates/guests/fedora/network_static6.erb b/templates/guests/fedora/network_static6.erb index ff102a5c8..9ca7821d8 100644 --- a/templates/guests/fedora/network_static6.erb +++ b/templates/guests/fedora/network_static6.erb @@ -1,7 +1,7 @@ #VAGRANT-BEGIN # The contents below are automatically generated by Vagrant. Do not modify. NM_CONTROLLED=no -BOOTPROTO=none +BOOTPROTO=static ONBOOT=yes IPV6INIT=yes IPV6ADDR=<%= options[:ip] %> diff --git a/test/unit/templates/guests/fedora/network_static6_test.rb b/test/unit/templates/guests/fedora/network_static6_test.rb new file mode 100644 index 000000000..bcd4076eb --- /dev/null +++ b/test/unit/templates/guests/fedora/network_static6_test.rb @@ -0,0 +1,25 @@ +require_relative "../../../base" + +require "vagrant/util/template_renderer" + +describe "templates/guests/fedora/network_static6" do + let(:template) { "guests/fedora/network_static6" } + + it "renders the template" do + result = Vagrant::Util::TemplateRenderer.render(template, options: { + device: "en0", + ip: "fc00::10/64" + }) + expect(result).to eq <<-EOH.gsub(/^ {6}/, "") + #VAGRANT-BEGIN + # The contents below are automatically generated by Vagrant. Do not modify. + NM_CONTROLLED=no + BOOTPROTO=static + ONBOOT=yes + IPV6INIT=yes + IPV6ADDR=fc00::10/64 + DEVICE=en0 + #VAGRANT-END + EOH + end +end