From: Alan T. DeKok Date: Thu, 7 Dec 2023 17:32:59 +0000 (-0500) Subject: add tests for combo-ip comparisons X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79a2b48ed2fa3e5016d978ad644c56d3363ba453;p=thirdparty%2Ffreeradius-server.git add tests for combo-ip comparisons --- diff --git a/src/tests/unit/calc.txt b/src/tests/unit/calc.txt index a63f254dcff..1418d418b4e 100644 --- a/src/tests/unit/calc.txt +++ b/src/tests/unit/calc.txt @@ -143,6 +143,33 @@ match 2001:d00::/24 calc ipv6addr 2001:DB8::1 & octets 0xffffffff000000000000000000000000 match 2001:db8::/32 +# +# Comparisons +# +calc ipv4prefix 127/8 > ipv4addr 127.0.0.1 -> bool +match yes + +calc ipv4prefix 127/8 > ipv4addr 192.168.0.1 -> bool +match no + +# +# combo-ip +# +calc combo-prefix 127/8 > ipv4addr 127.0.0.1 -> bool +match yes + +calc combo-prefix 127/8 > ipv4addr 192.168.0.1 -> bool +match no + +calc combo-prefix 127/8 > combo-ip 127.0.0.1 -> bool +match yes + +calc combo-prefix 127/8 > combo-ip 192.168.0.1 -> bool +match no + +calc combo-prefix 127/8 > ipv6addr 2001:DB8::1 -> bool +match Cannot compare IPv4 with IPv6 address + ###################################################################### # # Float @@ -173,4 +200,4 @@ calc string "2" += string "test" match 2test count -match 76 +match 90