Changeset 1051 for trunk/t/DNSTest.pm


Ignore:
Timestamp:
03/06/26 11:33:19 (3 days ago)
Author:
Kris Deugau
Message:

/trunk

Reintegrate /branches/cname-collision
See #72

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/t/DNSTest.pm

    r985 r1051  
    55##
    66# $Id$
    7 # Copyright 2025 Kris Deugau <kdeugau@deepnet.cx>
     7# Copyright 2025,2026 Kris Deugau <kdeugau@deepnet.cx>
    88#
    99#    This program is free software: you can redistribute it and/or modify
     
    4848        dbuser => 'dnstest',
    4949        dbpass => 'dnstestpwd',
     50
     51        # This exercises more branches of the CNAME collision check with more fine-grained results.
     52        coerce_cname_timestamp => 'adjust',
    5053  );
    5154  ok( defined $dnsdb );
     
    6164
    6265  my ($dcount) = $dbh->selectrow_array("SELECT count(*) FROM domains WHERE NOT domain IN ".
    63         "('example.com','example.net','example.org','expiry1.test','expiry2.test')");
     66        "('example.com','example.net','example.org','expiry1.test','expiry2.test','expiry3.test','cname-blocks1.test')");
    6467  BAIL_OUT("# DB looks like it may not be a test DB, found $dcount > 0 non-test domains!\n")
    6568        if $dcount > 0;
     
    6871  my ($rcount) = $dbh->selectrow_array(qq{SELECT count(*) FROM records WHERE NOT (
    6972        host like '%example.com' or host like '%example.net' or host like '%example.org' or
    70         host like '%expiry1.test' or host like '%expiry2.test' or inetlazy(val) << '192.168.2.0/27'
     73        host like '%expiry_.test' or host like '%cname-blocks_.test' or
     74        inetlazy(val) << '192.168.2.0/27'
    7175        )});
    7276  my $maxrecs = 0;
    73   BAIL_OUT("# DB looks like it may not be a test DB, found $rcount > $maxrecs records!\n")
     77  BAIL_OUT("# DB looks like it may not be a test DB, found $rcount > $maxrecs non-test records!\n")
    7478        if $rcount > $maxrecs;
    7579  cmp_ok( $rcount, '<=', $maxrecs, "non-test record ($rcount): looks like a test DB" );
     
    8387  my $reload = qx( psql -h $dnsdb->{dbhost} -U $dnsdb->{dbuser} $dnsdb->{dbname} 2>&1 < t/dns-unitbase.sql );
    8488  diag( $reload ) if $debug;
     89  # Set timestamps to a sliding window
     90  my $stampwindow = qx( psql -h $dnsdb->{dbhost} -U $dnsdb->{dbuser} $dnsdb->{dbname} 2>&1 < t/test-cname-timestamps.sql );
     91  diag( $stampwindow ) if $debug;
    8592  undef $ENV{PGPASSWORD};
    8693} # new()
Note: See TracChangeset for help on using the changeset viewer.