Ignore:
Timestamp:
01/30/26 13:50:32 (7 days ago)
Author:
Kris Deugau
Message:

/branches/cname-collision

Fix up test checking adjustment of valid-after timestamp when the requested
time is before an existing valid-after

  • Record count made more accurate by counting all records with the test name
  • Somehow missed checking the timestamp values in r1005

See #72, #88

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cname-collision/t/cname.t

    r1010 r1012  
    342342      cmp_ok( $code, 'eq', 'WARN', "addRec() claimed failure" );
    343343      if ($code eq 'WARN') {
    344         ($rcount) = $dbh->selectrow_array("SELECT count(*) FROM records WHERE domain_id = 5 AND host = '$newname' AND type <> 5");
    345         ok( $rcount == 1, " ... [$rcount] record(s) with $newname already exist" );
     344        ($rcount) = $dbh->selectrow_array("SELECT count(*) FROM records WHERE domain_id = 5 AND host = '$newname'");
     345        ok( $rcount == 2, " ... [$rcount] record(s) with $newname found" );
    346346        like( $msg, qr/modified valid-after time;  conflicting expiring record found/, " ... returned matching error" );
     347        my ($newstamp) = $dbh->selectrow_array("SELECT extract(epoch from stamp) FROM records WHERE domain_id = 5 ".
     348                "AND host = '$newname' AND stampactive = 't' AND expires = 't'");
     349        my ($oldstamp) = $dbh->selectrow_array("SELECT extract(epoch from stamp) FROM records WHERE domain_id = 5 ".
     350                "AND host = '$newname' AND stampactive = 't' AND expires = 'f'");
     351        cmp_ok( $newstamp, '>=', $oldstamp, " ... coerced timestamp equal or later than existing expiry timestamp" );
     352      } else {
     353        print "not ok: $msg";
    347354      }
    348355    };
Note: See TracChangeset for help on using the changeset viewer.