]> granicus.if.org Git - pdns/commitdiff
add notified_serial range test to pdnsutil test-schema
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 18 Jul 2019 15:35:35 +0000 (17:35 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 26 Jul 2019 11:33:48 +0000 (13:33 +0200)
(cherry picked from commit afdeeff28bfdcbed5ce6fb19190e94ba4b10ccbd)

pdns/pdnsutil.cc

index ff4fcdb2c4dee8cd88038a6a6d75090817a6c592..0f749d9f29e4b1df88e5d28027dea00fe3abb7b7 100644 (file)
@@ -1867,6 +1867,20 @@ void testSchema(DNSSECKeeper& dk, const DNSName& zone)
     return;
   }
   cout<<"[+] ordername sorting is correct for names starting with _"<<endl;
+  cout<<"Setting low notified serial"<<endl;
+  db->setNotified(di.id, 500);
+  db->getDomainInfo(zone, di);
+  if(di.notified_serial != 500) {
+    cout<<"[-] Set serial 500, got back "<<di.notified_serial<<endl;
+  }
+  cout<<"Setting serial that needs 32 bits"<<endl;
+  db->setNotified(di.id, 2147484148);
+  db->getDomainInfo(zone, di);
+  if(di.notified_serial != 2147484148) {
+    cout<<"[-] Set serial 2147484148, got back "<<di.notified_serial<<endl;
+  } else {
+    cout<<"[+] Big serials work correctly"<<endl;
+  }
   cout<<endl;
   cout<<"End of tests, please remove "<<zone<<" from domains+records"<<endl;
 }