Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated testsuite for CanonicalizeIP.
Ported existing tests from old testsuite into new one and added testcase based on bnc#837517
- Loading branch information
Showing
3 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#! /usr/bin/env ruby | ||
|
||
require "minitest/spec" | ||
require "minitest/autorun" | ||
|
||
require "yast" | ||
|
||
Yast.import "NetworkInterfaces" | ||
|
||
# mocked IPv6 relevant part of loaded ifcfg | ||
IPV6_IFCFG = [ | ||
{ | ||
:data => { "IPADDR" => "2001:15c0:668e::5", "PREFIXLEN" => "48" }, | ||
:expected => { "IPADDR" => "2001:15c0:668e::5", "PREFIXLEN" => "48", "NETMASK" => "" } | ||
}, | ||
{ | ||
:data => { "IPADDR" => "2001:15c0:668e::5/48", "PREFIXLEN" => "" }, | ||
:expected => { "IPADDR" => "2001:15c0:668e::5", "PREFIXLEN" => "48", "NETMASK" => "" } | ||
}, | ||
{ | ||
:data => { "IPADDR" => "2a00:8a00:6000:40::451", "PREFIXLEN" => "119" }, | ||
:expected => { "IPADDR" => "2a00:8a00:6000:40::451", "PREFIXLEN" => "119", "NETMASK" => "" } | ||
} | ||
] | ||
|
||
describe "When reading devices configuration with IPv6 setup" do | ||
it "Sets ipaddr, prefix and empty mask" do | ||
IPV6_IFCFG.each do |ipv6_ifcfg| | ||
canonical_ifcfg = Yast::NetworkInterfaces.CanonicalizeIP( ipv6_ifcfg[ :data]) | ||
canonical_ifcfg.must_equal( ipv6_ifcfg[ :expected]) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters