From 6fd22cc8000e4e5c034617cd02cbd432d673c446 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 6 Sep 2022 18:19:01 +0100 Subject: T4472: add an option for verifying IPv4 ranges (#6) --- tests/integration_tests.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/integration_tests.sh') diff --git a/tests/integration_tests.sh b/tests/integration_tests.sh index ccc7e3a..a679ea0 100755 --- a/tests/integration_tests.sh +++ b/tests/integration_tests.sh @@ -48,6 +48,16 @@ ipv4_cidr_negative=( 192.0.2.666/32 ) +ipv4_range_positive=( + 192.0.2.0-192.0.2.100 +) + +ipv4_range_negative=( + 192.0.2.-192.0.2.100 + 192.0.2.0- + 192.0.2.200-192.0.2.100 +) + ipv6_single_positive=( 2001:0db8:0000:0000:0000:ff00:0042:8329 2001:db8:0:0:0:ff00:42:8329 @@ -251,4 +261,17 @@ done # --is-ipv6-link-local # --is-valid-intf-address +# --is-ipv4-range +for range in \ + ${ipv4_range_positive[*]} +do + assert_raises "$IPADDRCHECK --is-ipv4-range $range" 0 +done + +for range in \ + ${ipv4_range_negative[*]} +do + assert_raises "$IPADDRCHECK --is-ipv4-range $range" 1 +done + assert_end ipaddrcheck_integration -- cgit v1.2.3