From: Aram Sargsyan Date: Mon, 25 May 2026 14:17:26 +0000 (+0000) Subject: Add a new check for the 'geoip2' system test X-Git-Tag: v9.21.24~96^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdf4ab92805011e8946c264a6962f26e32a3bc12;p=thirdparty%2Fbind9.git Add a new check for the 'geoip2' system test Check that an ACL can't be matched by a substring in the GeoIP database, instead of the full string comparision. --- diff --git a/bin/tests/system/geoip2/data/GeoIP2-Domain.json b/bin/tests/system/geoip2/data/GeoIP2-Domain.json index fb8e914fe54..6786de7fa6a 100644 --- a/bin/tests/system/geoip2/data/GeoIP2-Domain.json +++ b/bin/tests/system/geoip2/data/GeoIP2-Domain.json @@ -34,6 +34,11 @@ "domain" : "seven.org" } }, + { + "::10.53.0.8/128" : { + "domain" : "seven" + } + }, { "fd92:7065:b8e:ffff::1/128" : { "domain" : "one.de" @@ -68,5 +73,10 @@ "fd92:7065:b8e:ffff::7/128" : { "domain" : "seven.org" } + }, + { + "fd92:7065:b8e:ffff::8/128" : { + "domain" : "seven" + } } ] diff --git a/bin/tests/system/geoip2/data/GeoIP2-Domain.mmdb b/bin/tests/system/geoip2/data/GeoIP2-Domain.mmdb index fe93decbbeb..a0ee647f16d 100644 Binary files a/bin/tests/system/geoip2/data/GeoIP2-Domain.mmdb and b/bin/tests/system/geoip2/data/GeoIP2-Domain.mmdb differ diff --git a/bin/tests/system/geoip2/ns2/named11.conf.j2 b/bin/tests/system/geoip2/ns2/named11.conf.j2 index 7cc64c3a07a..87c592d0b9d 100644 --- a/bin/tests/system/geoip2/ns2/named11.conf.j2 +++ b/bin/tests/system/geoip2/ns2/named11.conf.j2 @@ -78,6 +78,14 @@ view seven { }; }; +view eight { + match-clients { geoip domain seven; }; # non-matching name (a substring of the previous entry), see GL#6019 + zone "example" { + type primary; + file "example8.db"; + }; +}; + view none { match-clients { any; }; zone "example" { diff --git a/bin/tests/system/geoip2/setup.sh b/bin/tests/system/geoip2/setup.sh index f3acf988c5d..20b64462da5 100644 --- a/bin/tests/system/geoip2/setup.sh +++ b/bin/tests/system/geoip2/setup.sh @@ -13,7 +13,7 @@ . ../conf.sh -for i in 1 2 3 4 5 6 7 other bogus; do +for i in 1 2 3 4 5 6 7 8 other bogus; do cp ns2/example.db.in ns2/example${i}.db echo "@ IN TXT \"$i\"" >>ns2/example$i.db done diff --git a/bin/tests/system/geoip2/tests.sh b/bin/tests/system/geoip2/tests.sh index a8e8845a41b..b448694cf85 100644 --- a/bin/tests/system/geoip2/tests.sh +++ b/bin/tests/system/geoip2/tests.sh @@ -431,7 +431,7 @@ n=$((n + 1)) echo_i "checking Domain database using IPv4 ($n)" ret=0 lret=0 -for i in 1 2 3 4 5 6 7; do +for i in 1 2 3 4 5 6 7 8; do $DIG $DIGOPTS txt example -b 10.53.0.$i >dig.out.ns2.test$n.$i || lret=1 j=$(cat dig.out.ns2.test$n.$i | tr -d '"') [ "$i" = "$j" ] || lret=1 @@ -446,7 +446,7 @@ if testsock6 fd92:7065:b8e:ffff::3; then echo_i "checking Domain database using IPv6 ($n)" ret=0 lret=0 - for i in 1 2 3 4 5 6 7; do + for i in 1 2 3 4 5 6 7 8; do $DIG $DIGOPTS6 txt example -b fd92:7065:b8e:ffff::$i >dig.out.ns2.test$n.$i || lret=1 j=$(cat dig.out.ns2.test$n.$i | tr -d '"') [ "$i" = "$j" ] || lret=1