Merge pull request #11013 from dcermak/suse_ipv6_support

Add ipv6 network config templates for SUSE based distributions
This commit is contained in:
Brian Cain 2019-09-06 11:08:37 -07:00 committed by GitHub
commit 8abc0cc90c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
STARTMODE='auto'
BOOTPROTO='static'
IPADDR=<%= options[:ip] %>
<% if options[:netmask] -%>
NETMASK=<%= options[:netmask] %>
<% end -%>
DEVICE=<%= options[:device] %>
<% if options[:gateway] -%>
GATEWAY=<%= options[:gateway] %>
<% end -%>
<% if options[:prefix_length] -%>
PREFIXLEN=<%= options[:prefix_length] %>
<% end -%>
#VAGRANT-END

View File

@ -0,0 +1,43 @@
require_relative "../../../base"
require "vagrant/util/template_renderer"
describe "templates/guests/suse/network_static6" do
let(:template) { "guests/suse/network_static6" }
it "renders the template" do
result = Vagrant::Util::TemplateRenderer.render(template, options: {
device: "eth2",
ip: "fde4:8dba:82e1::c4",
})
expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
STARTMODE='auto'
BOOTPROTO='static'
IPADDR=fde4:8dba:82e1::c4
DEVICE=eth2
#VAGRANT-END
EOH
end
it "includes the prefix-length and gateway" do
result = Vagrant::Util::TemplateRenderer.render(template, options: {
device: "eth1",
ip: "fde4:8dba:82e1::c4",
gateway: "fde4:8dba:82e1::01",
prefix_length: "64",
})
expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
STARTMODE='auto'
BOOTPROTO='static'
IPADDR=fde4:8dba:82e1::c4
DEVICE=eth1
GATEWAY=fde4:8dba:82e1::01
PREFIXLEN=64
#VAGRANT-END
EOH
end
end