From 3713af1e276dfb167abf29783ee85a64e865e845 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 11 Jan 2017 17:18:46 +0000 Subject: [PATCH] network-functions.pl: Add tests for the new equals function Signed-off-by: Michael Tremer --- config/cfgroot/network-functions.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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; } -- 2.39.5