- Timestamp:
- 01/16/26 13:22:15 (13 days ago)
- Location:
- branches/cname-collision/t
- Files:
-
- 3 edited
-
cname.t (modified) (1 diff)
-
dns-unitbase.sql (modified) (5 diffs)
-
test-cname-timestamps.sql (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/cname-collision/t/cname.t
r993 r994 318 318 } 319 319 }; 320 subtest 'collision with expired record' => sub { 321 $newname = 'expires-at5.expiry2.test'; 322 ($code, $msg) = $dnsdb->addRec('n', 'n', 5, \$newname, \$rectype, \$newval, 900, undef, 't', $expirystamp); 323 ok( $code eq 'OK', "addRec() claimed success" ); 324 if ($code eq 'OK') { 325 # crosscheck in the DB 326 ($rcount) = $dbh->selectrow_array("SELECT count(*) FROM records WHERE domain_id = 5 AND host = '$newname'"); 327 ok( $rcount == 2, " ... [$rcount] correct number of records for $newname" ); 328 my ($newstamp) = $dbh->selectrow_array("SELECT extract(epoch from stamp) FROM records WHERE domain_id = 5 AND host = '$newname' ". 329 "AND stampactive = 't' AND expires = 't' AND stamp >= now()"); 330 my ($oldstamp) = $dbh->selectrow_array("SELECT extract(epoch from stamp) FROM records WHERE domain_id = 5 AND host = '$newname' ". 331 "AND stampactive = 't' AND expires = 't' AND stamp <= now()"); 332 ok( $newstamp > $oldstamp, " ... added record expires after existing, already-expired record" ); 333 } else { 334 print "not ok: $msg"; 335 } 336 }; 320 337 }; # add expiring CNAME 321 338 -
branches/cname-collision/t/dns-unitbase.sql
r992 r994 658 658 3 example.net 1 1 2025121800 D f ab 659 659 4 expiry1.test 1 1 2026011400 D t 660 5 expiry2.test 1 1 2026011 503D t660 5 expiry2.test 1 1 2026011600 D t 661 661 \. 662 662 … … 778 778 70 5 1 1 admin Initial User Added record 'expires-at3.expiry2.test TXT active after pending expiry', TTL 5400, expires at 2026-01-15 18:00 2026-01-15 13:21:31.833257-05 0 0 779 779 71 5 1 1 admin Initial User Added record 'expires-at4.expiry2.test TXT active before pending expiry', TTL 5400, expires at 2026-01-15 18:00 2026-01-15 17:59:01.61806-05 0 0 780 72 5 1 1 admin Initial User Added record 'expires-at5.expiry2.test TXT expired before now', TTL 5400, expires at 2026-01-15 18:00 2026-01-16 11:50:43.678446-05 0 0 780 781 \. 781 782 … … 785 786 -- 786 787 787 SELECT pg_catalog.setval('public.log_log_id_seq', 7 1, true);788 SELECT pg_catalog.setval('public.log_log_id_seq', 72, true); 788 789 789 790 … … 887 888 5 60 expires-at3.expiry2.test 16 active after pending expiry 0 0 0 5400 \N 0 2026-01-15 18:00:00-05 f t \N 888 889 5 61 expires-at4.expiry2.test 16 active before pending expiry 0 0 0 5400 \N 0 2026-01-15 18:00:00-05 f t \N 890 5 62 expires-at5.expiry2.test 16 expired before now 0 0 0 5400 \N 0 2026-01-15 18:00:00-05 t t \N 889 891 \. 890 892 … … 894 896 -- 895 897 896 SELECT pg_catalog.setval('public.records_record_id_seq', 6 1, true);898 SELECT pg_catalog.setval('public.records_record_id_seq', 62, true); 897 899 898 900 -
branches/cname-collision/t/test-cname-timestamps.sql
r992 r994 11 11 UPDATE records SET stamp = date_trunc('day', now() + interval '4 day') + '11:30' WHERE record_id = 60; 12 12 UPDATE records SET stamp = date_trunc('day', now() + interval '2 day') + '11:30' WHERE record_id = 61; 13 UPDATE records SET stamp = date_trunc('day', now() - interval '2 day') + '11:30' WHERE record_id = 62;
Note:
See TracChangeset
for help on using the changeset viewer.
![[ DNS Administrator ]](/fx/dnsadmin-logo.png)