diff options
| author | Daniil Baturin <daniil@vyos.io> | 2022-09-06 18:19:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-06 18:19:01 +0100 |
| commit | 6fd22cc8000e4e5c034617cd02cbd432d673c446 (patch) | |
| tree | 6a83556b4eb30be9274661a3f94211c6f0eed699 /tests/integration_tests.sh | |
| parent | f84754f9b92bd136ae6fa01b80608d44a13bfff7 (diff) | |
| download | ipaddrcheck-6fd22cc8000e4e5c034617cd02cbd432d673c446.tar.gz ipaddrcheck-6fd22cc8000e4e5c034617cd02cbd432d673c446.zip | |
T4472: add an option for verifying IPv4 ranges (#6)
Diffstat (limited to 'tests/integration_tests.sh')
| -rwxr-xr-x | tests/integration_tests.sh | 23 |
1 files changed, 23 insertions, 0 deletions
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 |
