Ignore:
Timestamp:
02/03/26 11:29:50 (7 days ago)
Author:
Kris Deugau
Message:

/branches/cname-collision

Start adding tests calling updateRec() with new non-timestamp CNAME data
See #72, #88

File:
1 edited

Legend:

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

    r1012 r1015  
    206206subtest 'Record expiry/valid-after' => sub {
    207207
     208  ## Add new CNAME
    208209  subtest 'CNAME add - nonexpiring' => sub {
    209210    $newval = 'target.example.com';
     
    387388  }; # add valid-after CNAME
    388389
     390  ## Tests calling updateRec() instead of addRec()
     391  subtest 'Update to CNAME - no timestamp' => sub {
     392    $newval = 'target.example.com';
     393    subtest 'collision with expired record' => sub {
     394      $newname = 'nostamp1a.expiry3.test';
     395      ($code, $msg) = $dnsdb->updateRec('n', 'n', 79, 6, \$newname, \$rectype, \$newval, 900);
     396      ok( $code eq 'FAIL', "updateRec() claimed failure" );
     397      if ($code eq 'FAIL') {
     398        ($rcount) = $dbh->selectrow_array("SELECT count(*) FROM records WHERE domain_id = 6 AND host = '$newname'");
     399        ok( $rcount == 1, " ... [$rcount] yep, hostname only occurs once" );
     400        like( $msg, qr/non-CNAME records with timestamps already exist/, " ... returned matching error" );
     401      }
     402    };
     403  }; # update to CNAME with no timestamp
     404
    389405}; # record expiry/valid-after
    390406
Note: See TracChangeset for help on using the changeset viewer.