templates/general: Fix failing tests
This commit is contained in:
parent
4418efd4a4
commit
233120eebd
|
@ -7,11 +7,11 @@ describe "templates/guests/arch/network_dhcp" do
|
|||
|
||||
it "renders the template" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
device: "en0",
|
||||
device: "eth1",
|
||||
})
|
||||
expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
|
||||
Description='A basic dhcp ethernet connection'
|
||||
Interface=en0
|
||||
Interface=eth1
|
||||
Connection=ethernet
|
||||
IP=dhcp
|
||||
EOH
|
||||
|
|
|
@ -7,13 +7,13 @@ describe "templates/guests/arch/network_static" do
|
|||
|
||||
it "renders the template" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
device: "en0",
|
||||
device: "eth1",
|
||||
ip: "1.1.1.1",
|
||||
})
|
||||
expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
|
||||
Connection=ethernet
|
||||
Description='A basic static ethernet connection'
|
||||
Interface=en0
|
||||
Interface=eth1
|
||||
IP=static
|
||||
Address=('1.1.1.1/24')
|
||||
EOH
|
||||
|
@ -21,14 +21,14 @@ describe "templates/guests/arch/network_static" do
|
|||
|
||||
it "includes the gateway" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
device: "en0",
|
||||
device: "eth1",
|
||||
ip: "1.1.1.1",
|
||||
gateway: "1.2.3.4",
|
||||
})
|
||||
expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
|
||||
Connection=ethernet
|
||||
Description='A basic static ethernet connection'
|
||||
Interface=en0
|
||||
Interface=eth1
|
||||
IP=static
|
||||
Address=('1.1.1.1/24')
|
||||
Gateway='1.2.3.4'
|
||||
|
|
|
@ -7,13 +7,13 @@ describe "templates/guests/debian/network_dhcp" do
|
|||
|
||||
it "renders the template" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
device: "en0",
|
||||
device: "eth1",
|
||||
})
|
||||
expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
|
||||
#VAGRANT-BEGIN
|
||||
# The contents below are automatically generated by Vagrant. Do not modify.
|
||||
auto eth
|
||||
iface eth inet dhcp
|
||||
auto eth1
|
||||
iface eth1 inet dhcp
|
||||
post-up route del default dev $IFACE || true
|
||||
#VAGRANT-END
|
||||
EOH
|
||||
|
@ -22,14 +22,14 @@ describe "templates/guests/debian/network_dhcp" do
|
|||
context "when use_dhcp_assigned_default_route is set" do
|
||||
it "renders the template" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
device: "en0",
|
||||
device: "eth1",
|
||||
use_dhcp_assigned_default_route: true,
|
||||
})
|
||||
expect(result).to eq <<-EOH.gsub(/^ {8}/, "")
|
||||
#VAGRANT-BEGIN
|
||||
# The contents below are automatically generated by Vagrant. Do not modify.
|
||||
auto eth
|
||||
iface eth inet dhcp
|
||||
auto eth1
|
||||
iface eth1 inet dhcp
|
||||
# We need to disable eth0, see GH-2648
|
||||
post-up route del default dev eth0 || true
|
||||
post-up dhclient $IFACE
|
||||
|
|
|
@ -7,15 +7,15 @@ describe "templates/guests/debian/network_static" do
|
|||
|
||||
it "renders the template" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
device: "en0",
|
||||
device: "eth1",
|
||||
ip: "1.1.1.1",
|
||||
netmask: "255.255.0.0",
|
||||
})
|
||||
expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
|
||||
#VAGRANT-BEGIN
|
||||
# The contents below are automatically generated by Vagrant. Do not modify.
|
||||
auto eth
|
||||
iface eth inet static
|
||||
auto eth1
|
||||
iface eth1 inet static
|
||||
address 1.1.1.1
|
||||
netmask 255.255.0.0
|
||||
#VAGRANT-END
|
||||
|
@ -24,7 +24,7 @@ describe "templates/guests/debian/network_static" do
|
|||
|
||||
it "includes the gateway" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
device: "en0",
|
||||
device: "eth1",
|
||||
ip: "1.1.1.1",
|
||||
netmask: "255.255.0.0",
|
||||
gateway: "1.2.3.4",
|
||||
|
@ -32,8 +32,8 @@ describe "templates/guests/debian/network_static" do
|
|||
expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
|
||||
#VAGRANT-BEGIN
|
||||
# The contents below are automatically generated by Vagrant. Do not modify.
|
||||
auto eth
|
||||
iface eth inet static
|
||||
auto eth1
|
||||
iface eth1 inet static
|
||||
address 1.1.1.1
|
||||
netmask 255.255.0.0
|
||||
gateway 1.2.3.4
|
||||
|
|
|
@ -6,10 +6,13 @@ describe "templates/guests/freebsd/network_dhcp" do
|
|||
let(:template) { "guests/freebsd/network_dhcp" }
|
||||
|
||||
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}/, "")
|
||||
#VAGRANT-BEGIN
|
||||
ifconfig_vtneten0="DHCP"
|
||||
ifconfig_eth1="DHCP"
|
||||
synchronous_dhclient="YES"
|
||||
#VAGRANT-END
|
||||
EOH
|
||||
end
|
||||
|
|
|
@ -6,32 +6,28 @@ describe "templates/guests/freebsd/network_static" do
|
|||
let(:template) { "guests/freebsd/network_static" }
|
||||
|
||||
it "renders the template" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template,
|
||||
ifname: "vtneten0",
|
||||
options: {
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
device: "eth1",
|
||||
ip: "1.1.1.1",
|
||||
netmask: "255.255.0.0",
|
||||
},
|
||||
)
|
||||
})
|
||||
expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
|
||||
#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
|
||||
EOH
|
||||
end
|
||||
|
||||
it "includes the gateway" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template,
|
||||
ifname: "vtneten0",
|
||||
options: {
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
device: "eth1",
|
||||
ip: "1.1.1.1",
|
||||
netmask: "255.255.0.0",
|
||||
gateway: "1.2.3.4",
|
||||
},
|
||||
)
|
||||
})
|
||||
expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
|
||||
#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"
|
||||
#VAGRANT-END
|
||||
EOH
|
||||
|
|
|
@ -7,14 +7,14 @@ describe "templates/guests/suse/network_dhcp" do
|
|||
|
||||
it "renders the template" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
interface: "en0",
|
||||
device: "eth0"
|
||||
})
|
||||
expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
|
||||
#VAGRANT-BEGIN
|
||||
# The contents below are automatically generated by Vagrant. Do not modify.
|
||||
BOOTPROTO='dhcp'
|
||||
STARTMODE='auto'
|
||||
DEVICE='ethen0'
|
||||
DEVICE='eth0'
|
||||
#VAGRANT-END
|
||||
EOH
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ describe "templates/guests/suse/network_static" do
|
|||
|
||||
it "renders the template" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
interface: "en0",
|
||||
device: "eth1",
|
||||
ip: "1.1.1.1",
|
||||
netmask: "255.255.0.0",
|
||||
})
|
||||
|
@ -17,7 +17,7 @@ describe "templates/guests/suse/network_static" do
|
|||
BOOTPROTO='static'
|
||||
IPADDR='1.1.1.1'
|
||||
NETMASK='255.255.0.0'
|
||||
DEVICE='ethen0'
|
||||
DEVICE='eth1'
|
||||
PEERDNS='no'
|
||||
STARTMODE='auto'
|
||||
USERCONTROL='no'
|
||||
|
@ -27,7 +27,7 @@ describe "templates/guests/suse/network_static" do
|
|||
|
||||
it "includes the gateway" do
|
||||
result = Vagrant::Util::TemplateRenderer.render(template, options: {
|
||||
interface: "en0",
|
||||
device: "eth1",
|
||||
ip: "1.1.1.1",
|
||||
gateway: "1.2.3.4",
|
||||
netmask: "255.255.0.0",
|
||||
|
@ -38,7 +38,7 @@ describe "templates/guests/suse/network_static" do
|
|||
BOOTPROTO='static'
|
||||
IPADDR='1.1.1.1'
|
||||
NETMASK='255.255.0.0'
|
||||
DEVICE='ethen0'
|
||||
DEVICE='eth1'
|
||||
GATEWAY='1.2.3.4'
|
||||
PEERDNS='no'
|
||||
STARTMODE='auto'
|
||||
|
|
Loading…
Reference in New Issue