Changeset 1025


Ignore:
Timestamp:
02/05/26 13:34:40 (3 days ago)
Author:
Kris Deugau
Message:

/branches/cname-collision

Test with updating to a CNAME that expires:
Add test for expiry before pending valid-after record. Note this probes the
(corrected) revised handling in r1019.

See #72, #88

File:
1 edited

Legend:

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

    r1024 r1025  
    494494      }
    495495    };
    496   };
     496    subtest 'expire before valid-after record' => sub {
     497      $newname = 'expires6a.expiry3.test';
     498      ($code, $msg) = $dnsdb->updateRec('n', 'n', 94, 6, \$newname, \$rectype, \$newval, 900, undef, 't', $expirystamp);
     499      ok( $code eq 'OK', "updateRec() claimed success" );
     500      if ($code eq 'OK') {
     501        ($rcount) = $dbh->selectrow_array("SELECT count(*) FROM records WHERE domain_id = 6 AND host = '$newname'");
     502        ok( $rcount == 2, " ... [$rcount] correct number of records for $newname" );
     503        my ($newstamp) = $dbh->selectrow_array("SELECT extract(epoch from stamp) FROM records WHERE domain_id = 6 AND host = '$newname' ".
     504                "AND stampactive = 't' AND expires = 't'");
     505        my ($oldstamp) = $dbh->selectrow_array("SELECT extract(epoch from stamp) FROM records WHERE domain_id = 6 AND host = '$newname' ".
     506                "AND stampactive = 't' AND expires = 'f'");
     507        ok( $newstamp <= $oldstamp, " ... added record expires before existing active-after record goes active" );
     508      } else {
     509        print "not ok: $msg";
     510      }
     511    };
     512  }; # update to expiring CNAME
    497513
    498514}; # record expiry/valid-after
Note: See TracChangeset for help on using the changeset viewer.