Skip to content

Commit

Permalink
Replaced TheIP by 1.2.3.4 as proposed in CR.
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Feb 1, 2016
1 parent 8877d22 commit cf01518
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/yapi_network_test.rb
Expand Up @@ -59,7 +59,7 @@
context "with a gateway in the default route" do

context "if it's a valid IP4" do
let(:route) { { "default" => { "via" => "10.0.0.1" } } }
let(:route) { { "default" => { "via" => "1.2.3.4" } } }

it "returns success" do
expect(subject.Write("route" => route)).to eq success
Expand All @@ -70,7 +70,7 @@
[
{
"destination" => "default",
"gateway" => "10.0.0.1",
"gateway" => "1.2.3.4",
"netmask" => "-",
"device" => "-"
}
Expand Down Expand Up @@ -120,7 +120,7 @@
end

context("setting IP address and netmask") do
let(:interface) { { "eth0" => { "ipaddr" => "TheIP/#{netmask}" } } }
let(:interface) { { "eth0" => { "ipaddr" => "1.2.3.4/#{netmask}" } } }

context("with valid netmask in dot notation") do
let(:netmask) { "255.255.255.0" }
Expand All @@ -129,7 +129,7 @@
expect(network_interfaces).to receive(:Current=).with(
"BOOTPROTO" => "static",
"STARTMODE" => "auto",
"IPADDR" => "TheIP/24"
"IPADDR" => "1.2.3.4/24"
)
stub_write_interfaces
subject.Write("interface" => interface)
Expand All @@ -143,7 +143,7 @@
expect(network_interfaces).to receive(:Current=).with(
"BOOTPROTO" => "static",
"STARTMODE" => "auto",
"IPADDR" => "TheIP/#{netmask}"
"IPADDR" => "1.2.3.4/#{netmask}"
)
stub_write_interfaces
subject.Write("interface" => interface)
Expand Down Expand Up @@ -230,7 +230,7 @@
{
startmode: "manual",
bootproto: "static",
ipaddr: "TheIP",
ipaddr: "1.2.3.4",
prefix: "24",
mtu: "1234"
}.merge(context_attributes)
Expand All @@ -239,7 +239,7 @@

before do
stub_network_reads
allow(Yast::Routing).to receive(:GetGateway).and_return "TheIP"
allow(Yast::Routing).to receive(:GetGateway).and_return "1.2.3.4"
allow(Yast::Hostname).to receive(:CurrentHostname).and_return "Hostname"
allow(Yast::Hostname).to receive(:CurrentDomain).and_return "TheDomain"
allow(Yast::DNS).to receive(:dhcp_hostname).and_return "Hostname"
Expand All @@ -251,7 +251,7 @@
{
"routes" => {
"default" => {
"via" => "TheIP"
"via" => "1.2.3.4"
}
},
"dns" => {
Expand Down Expand Up @@ -293,7 +293,7 @@
"eth5.23" => {
"startmode" => "manual",
"bootproto" => "static",
"ipaddr" => "TheIP/24",
"ipaddr" => "1.2.3.4/24",
"mtu" => "1234",
"vlan_id" => "42",
"vlan_etherdevice" => "eth5",
Expand Down Expand Up @@ -336,7 +336,7 @@
"bond0" => {
"startmode" => "manual",
"bootproto" => "static",
"ipaddr" => "TheIP/24",
"ipaddr" => "1.2.3.4/24",
"mtu" => "1234",
"bond_slaves" => ["eth1", "eth2", "eth3"],
"bond_option" => "mode=active-backup miimon=100"
Expand Down

0 comments on commit cf01518

Please sign in to comment.