From: Michael Tremer Date: Wed, 11 Jan 2017 17:18:46 +0000 (+0000) Subject: network-functions.pl: Add tests for the new equals function X-Git-Tag: v2.19-core109^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3713af1e276dfb167abf29783ee85a64e865e845;p=ipfire-2.x.git network-functions.pl: Add tests for the new equals function Signed-off-by: Michael Tremer --- diff --git a/config/cfgroot/network-functions.pl b/config/cfgroot/network-functions.pl index db9d7dbfc3..5f53704cd1 100644 --- a/config/cfgroot/network-functions.pl +++ b/config/cfgroot/network-functions.pl @@ -368,12 +368,26 @@ sub testsuite() { $result = &find_next_ip_address("1.2.3.4", 2); assert($result eq "1.2.3.6"); + $result = &network_equal("192.168.0.0/24", "192.168.0.0/255.255.255.0"); + assert($result); + + $result = &network_equal("192.168.0.0/24", "192.168.0.0/25"); + assert(!$result); + + $result = &network_equal("192.168.0.0/24", "192.168.0.128/25"); + assert(!$result); + + $result = &network_equal("192.168.0.1/24", "192.168.0.XXX/24"); + assert($result); + $result = &ip_address_in_network("10.0.1.4", "10.0.0.0/8"); assert($result); $result = &ip_address_in_network("192.168.30.11", "192.168.30.0/255.255.255.0"); assert($result); + print "Testsuite completed successfully!\n"; + return 0; }