]> granicus.if.org Git - pdns/commitdiff
rec: Normalize the TTLs for default.example.net. in the RPZ tests
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 30 Nov 2017 14:29:30 +0000 (15:29 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 30 Nov 2017 14:29:30 +0000 (15:29 +0100)
Since we ask for several records that are CNAME to default.example.net.
the TTL might have been decreased by the time we get to the last ones.
That's fine, the TTL we are interested in are for other records, so we
can just ignore the TTL for this exact record.

regression-tests.recursor/RPZ/command

index 6de706fe8a8347be2202e65ba032bd053ae103f2..2d54e2bcc7d13b77ba214fc62fdb08388c4f649f 100755 (executable)
@@ -21,11 +21,11 @@ $SDIG $nameserver 5301 capped-ttl.example.net a recurse 2>&1
 echo "==> defpol-with-ttl.example.net should use the default policy's TTL and not the zone one"
 $SDIG $nameserver 5301 defpol-with-ttl.example.net a recurse 2>&1
 echo "==> defpol-with-ttl-capped.example.net should use the default policy's TTL, but capped to maxTTL"
-$SDIG $nameserver 5301 defpol-with-ttl-capped.example.net a recurse 2>&1
+$SDIG $nameserver 5301 defpol-with-ttl-capped.example.net a recurse 2>&1 | sed 's/\(0\tdefault.example.net.\tIN\t[A-Z0-9]\+\t\)\([0-9]\+\)/\115/'
 echo "==> defpol-without-ttl.example.net should use the zone's TTL"
-$SDIG $nameserver 5301 defpol-without-ttl.example.net a recurse 2>&1
+$SDIG $nameserver 5301 defpol-without-ttl.example.net a recurse 2>&1 | sed 's/\(0\tdefault.example.net.\tIN\t[A-Z0-9]\+\t\)\([0-9]\+\)/\115/'
 echo "==> defpol-without-ttl-capped.example.net should use the zone's TTL but capped to maxTTL"
-$SDIG $nameserver 5301 defpol-without-ttl-capped.example.net a recurse 2>&1
+$SDIG $nameserver 5301 defpol-without-ttl-capped.example.net a recurse 2>&1 | sed 's/\(0\tdefault.example.net.\tIN\t[A-Z0-9]\+\t\)\([0-9]\+\)/\115/'
 echo "==> unsupported.example.net has an unsupported target, should be ignored from the RPZ zone"
 $SDIG $nameserver 5301 unsupported.example.net a recurse 2>&1
 echo "==> unsupported2.example.net has an unsupported target, should be ignored from the RPZ zone"