templates/general: Fix failing tests

This commit is contained in:
Seth Vargo 2016-06-06 12:34:45 -04:00
parent 4418efd4a4
commit 233120eebd
No known key found for this signature in database
GPG Key ID: 905A90C2949E8787
8 changed files with 42 additions and 43 deletions

View File

@ -7,11 +7,11 @@ describe "templates/guests/arch/network_dhcp" do
it "renders the template" do it "renders the template" do
result = Vagrant::Util::TemplateRenderer.render(template, options: { result = Vagrant::Util::TemplateRenderer.render(template, options: {
device: "en0", device: "eth1",
}) })
expect(result).to eq <<-EOH.gsub(/^ {6}/, "") expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
Description='A basic dhcp ethernet connection' Description='A basic dhcp ethernet connection'
Interface=en0 Interface=eth1
Connection=ethernet Connection=ethernet
IP=dhcp IP=dhcp
EOH EOH

View File

@ -7,13 +7,13 @@ describe "templates/guests/arch/network_static" do
it "renders the template" do it "renders the template" do
result = Vagrant::Util::TemplateRenderer.render(template, options: { result = Vagrant::Util::TemplateRenderer.render(template, options: {
device: "en0", device: "eth1",
ip: "1.1.1.1", ip: "1.1.1.1",
}) })
expect(result).to eq <<-EOH.gsub(/^ {6}/, "") expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
Connection=ethernet Connection=ethernet
Description='A basic static ethernet connection' Description='A basic static ethernet connection'
Interface=en0 Interface=eth1
IP=static IP=static
Address=('1.1.1.1/24') Address=('1.1.1.1/24')
EOH EOH
@ -21,14 +21,14 @@ describe "templates/guests/arch/network_static" do
it "includes the gateway" do it "includes the gateway" do
result = Vagrant::Util::TemplateRenderer.render(template, options: { result = Vagrant::Util::TemplateRenderer.render(template, options: {
device: "en0", device: "eth1",
ip: "1.1.1.1", ip: "1.1.1.1",
gateway: "1.2.3.4", gateway: "1.2.3.4",
}) })
expect(result).to eq <<-EOH.gsub(/^ {6}/, "") expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
Connection=ethernet Connection=ethernet
Description='A basic static ethernet connection' Description='A basic static ethernet connection'
Interface=en0 Interface=eth1
IP=static IP=static
Address=('1.1.1.1/24') Address=('1.1.1.1/24')
Gateway='1.2.3.4' Gateway='1.2.3.4'

View File

@ -7,13 +7,13 @@ describe "templates/guests/debian/network_dhcp" do
it "renders the template" do it "renders the template" do
result = Vagrant::Util::TemplateRenderer.render(template, options: { result = Vagrant::Util::TemplateRenderer.render(template, options: {
device: "en0", device: "eth1",
}) })
expect(result).to eq <<-EOH.gsub(/^ {6}/, "") expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
#VAGRANT-BEGIN #VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify. # The contents below are automatically generated by Vagrant. Do not modify.
auto eth auto eth1
iface eth inet dhcp iface eth1 inet dhcp
post-up route del default dev $IFACE || true post-up route del default dev $IFACE || true
#VAGRANT-END #VAGRANT-END
EOH EOH
@ -22,14 +22,14 @@ describe "templates/guests/debian/network_dhcp" do
context "when use_dhcp_assigned_default_route is set" do context "when use_dhcp_assigned_default_route is set" do
it "renders the template" do it "renders the template" do
result = Vagrant::Util::TemplateRenderer.render(template, options: { result = Vagrant::Util::TemplateRenderer.render(template, options: {
device: "en0", device: "eth1",
use_dhcp_assigned_default_route: true, use_dhcp_assigned_default_route: true,
}) })
expect(result).to eq <<-EOH.gsub(/^ {8}/, "") expect(result).to eq <<-EOH.gsub(/^ {8}/, "")
#VAGRANT-BEGIN #VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify. # The contents below are automatically generated by Vagrant. Do not modify.
auto eth auto eth1
iface eth inet dhcp iface eth1 inet dhcp
# We need to disable eth0, see GH-2648 # We need to disable eth0, see GH-2648
post-up route del default dev eth0 || true post-up route del default dev eth0 || true
post-up dhclient $IFACE post-up dhclient $IFACE

View File

@ -7,15 +7,15 @@ describe "templates/guests/debian/network_static" do
it "renders the template" do it "renders the template" do
result = Vagrant::Util::TemplateRenderer.render(template, options: { result = Vagrant::Util::TemplateRenderer.render(template, options: {
device: "en0", device: "eth1",
ip: "1.1.1.1", ip: "1.1.1.1",
netmask: "255.255.0.0", netmask: "255.255.0.0",
}) })
expect(result).to eq <<-EOH.gsub(/^ {6}/, "") expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
#VAGRANT-BEGIN #VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify. # The contents below are automatically generated by Vagrant. Do not modify.
auto eth auto eth1
iface eth inet static iface eth1 inet static
address 1.1.1.1 address 1.1.1.1
netmask 255.255.0.0 netmask 255.255.0.0
#VAGRANT-END #VAGRANT-END
@ -24,7 +24,7 @@ describe "templates/guests/debian/network_static" do
it "includes the gateway" do it "includes the gateway" do
result = Vagrant::Util::TemplateRenderer.render(template, options: { result = Vagrant::Util::TemplateRenderer.render(template, options: {
device: "en0", device: "eth1",
ip: "1.1.1.1", ip: "1.1.1.1",
netmask: "255.255.0.0", netmask: "255.255.0.0",
gateway: "1.2.3.4", gateway: "1.2.3.4",
@ -32,8 +32,8 @@ describe "templates/guests/debian/network_static" do
expect(result).to eq <<-EOH.gsub(/^ {6}/, "") expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
#VAGRANT-BEGIN #VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify. # The contents below are automatically generated by Vagrant. Do not modify.
auto eth auto eth1
iface eth inet static iface eth1 inet static
address 1.1.1.1 address 1.1.1.1
netmask 255.255.0.0 netmask 255.255.0.0
gateway 1.2.3.4 gateway 1.2.3.4

View File

@ -6,10 +6,13 @@ describe "templates/guests/freebsd/network_dhcp" do
let(:template) { "guests/freebsd/network_dhcp" } let(:template) { "guests/freebsd/network_dhcp" }
it "renders the template" do it "renders the template" do
result = Vagrant::Util::TemplateRenderer.render(template, ifname: "vtneten0") result = Vagrant::Util::TemplateRenderer.render(template, options: {
device: "eth1",
})
expect(result).to eq <<-EOH.gsub(/^ {6}/, "") expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
#VAGRANT-BEGIN #VAGRANT-BEGIN
ifconfig_vtneten0="DHCP" ifconfig_eth1="DHCP"
synchronous_dhclient="YES"
#VAGRANT-END #VAGRANT-END
EOH EOH
end end

View File

@ -6,32 +6,28 @@ describe "templates/guests/freebsd/network_static" do
let(:template) { "guests/freebsd/network_static" } let(:template) { "guests/freebsd/network_static" }
it "renders the template" do it "renders the template" do
result = Vagrant::Util::TemplateRenderer.render(template, result = Vagrant::Util::TemplateRenderer.render(template, options: {
ifname: "vtneten0", device: "eth1",
options: { ip: "1.1.1.1",
ip: "1.1.1.1", netmask: "255.255.0.0",
netmask: "255.255.0.0", })
},
)
expect(result).to eq <<-EOH.gsub(/^ {6}/, "") expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
#VAGRANT-BEGIN #VAGRANT-BEGIN
ifconfig_vtneten0="inet 1.1.1.1 netmask 255.255.0.0" ifconfig_eth1="inet 1.1.1.1 netmask 255.255.0.0"
#VAGRANT-END #VAGRANT-END
EOH EOH
end end
it "includes the gateway" do it "includes the gateway" do
result = Vagrant::Util::TemplateRenderer.render(template, result = Vagrant::Util::TemplateRenderer.render(template, options: {
ifname: "vtneten0", device: "eth1",
options: { ip: "1.1.1.1",
ip: "1.1.1.1", netmask: "255.255.0.0",
netmask: "255.255.0.0", gateway: "1.2.3.4",
gateway: "1.2.3.4", })
},
)
expect(result).to eq <<-EOH.gsub(/^ {6}/, "") expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
#VAGRANT-BEGIN #VAGRANT-BEGIN
ifconfig_vtneten0="inet 1.1.1.1 netmask 255.255.0.0" ifconfig_eth1="inet 1.1.1.1 netmask 255.255.0.0"
default_router="1.2.3.4" default_router="1.2.3.4"
#VAGRANT-END #VAGRANT-END
EOH EOH

View File

@ -7,14 +7,14 @@ describe "templates/guests/suse/network_dhcp" do
it "renders the template" do it "renders the template" do
result = Vagrant::Util::TemplateRenderer.render(template, options: { result = Vagrant::Util::TemplateRenderer.render(template, options: {
interface: "en0", device: "eth0"
}) })
expect(result).to eq <<-EOH.gsub(/^ {6}/, "") expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
#VAGRANT-BEGIN #VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify. # The contents below are automatically generated by Vagrant. Do not modify.
BOOTPROTO='dhcp' BOOTPROTO='dhcp'
STARTMODE='auto' STARTMODE='auto'
DEVICE='ethen0' DEVICE='eth0'
#VAGRANT-END #VAGRANT-END
EOH EOH
end end

View File

@ -7,7 +7,7 @@ describe "templates/guests/suse/network_static" do
it "renders the template" do it "renders the template" do
result = Vagrant::Util::TemplateRenderer.render(template, options: { result = Vagrant::Util::TemplateRenderer.render(template, options: {
interface: "en0", device: "eth1",
ip: "1.1.1.1", ip: "1.1.1.1",
netmask: "255.255.0.0", netmask: "255.255.0.0",
}) })
@ -17,7 +17,7 @@ describe "templates/guests/suse/network_static" do
BOOTPROTO='static' BOOTPROTO='static'
IPADDR='1.1.1.1' IPADDR='1.1.1.1'
NETMASK='255.255.0.0' NETMASK='255.255.0.0'
DEVICE='ethen0' DEVICE='eth1'
PEERDNS='no' PEERDNS='no'
STARTMODE='auto' STARTMODE='auto'
USERCONTROL='no' USERCONTROL='no'
@ -27,7 +27,7 @@ describe "templates/guests/suse/network_static" do
it "includes the gateway" do it "includes the gateway" do
result = Vagrant::Util::TemplateRenderer.render(template, options: { result = Vagrant::Util::TemplateRenderer.render(template, options: {
interface: "en0", device: "eth1",
ip: "1.1.1.1", ip: "1.1.1.1",
gateway: "1.2.3.4", gateway: "1.2.3.4",
netmask: "255.255.0.0", netmask: "255.255.0.0",
@ -38,7 +38,7 @@ describe "templates/guests/suse/network_static" do
BOOTPROTO='static' BOOTPROTO='static'
IPADDR='1.1.1.1' IPADDR='1.1.1.1'
NETMASK='255.255.0.0' NETMASK='255.255.0.0'
DEVICE='ethen0' DEVICE='eth1'
GATEWAY='1.2.3.4' GATEWAY='1.2.3.4'
PEERDNS='no' PEERDNS='no'
STARTMODE='auto' STARTMODE='auto'