diff options
Diffstat (limited to 'tests/integration_tests.sh')
| -rwxr-xr-x | tests/integration_tests.sh | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/integration_tests.sh b/tests/integration_tests.sh index a679ea0..8264960 100755 --- a/tests/integration_tests.sh +++ b/tests/integration_tests.sh @@ -3,7 +3,7 @@ # integration_tests.sh: ipaddrcheck integration tests # # Copyright (C) 2013 Daniil Baturin -# Copyright (C) 2018 VyOS maintainers and contributors +# Copyright (C) 2018-2024 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -58,6 +58,16 @@ ipv4_range_negative=( 192.0.2.200-192.0.2.100 ) +ipv6_range_positive=( + 2001:db8::1-2001:db8::99 +) + +ipv6_range_negative=( + 2001:db8:xx-2001:db8::99 + 2001:db:- + 2001:db8::99-2001:db8::1 +) + ipv6_single_positive=( 2001:0db8:0000:0000:0000:ff00:0042:8329 2001:db8:0:0:0:ff00:42:8329 @@ -274,4 +284,17 @@ do assert_raises "$IPADDRCHECK --is-ipv4-range $range" 1 done +# --is-ipv6-range +for range in \ + ${ipv6_range_positive[*]} +do + assert_raises "$IPADDRCHECK --is-ipv6-range $range" 0 +done + +for range in \ + ${ipv6_range_negative[*]} +do + assert_raises "$IPADDRCHECK --is-ipv6-range $range" 1 +done + assert_end ipaddrcheck_integration |
