cout<<"Note: test-schema will try to create the zone, but it will not remove it."<<endl;
cout<<"Please clean up after this."<<endl;
cout<<endl;
+ cout<<"If this test reports an error and aborts, please check your database schema."<<endl;
cout<<"Constructing UeberBackend"<<endl;
UeberBackend B("default");
cout<<"Picking first backend - if this is not what you want, edit launch line!"<<endl;
if(db->get(rrthrowaway)) // should not touch rr but don't assume anything
{
cout<<"Expected one record, got multiple, aborting"<<endl;
- return;
+ exit(EXIT_FAILURE);
}
int size=rrget.content.size();
if(size != 302)
{
cout<<"Expected 302 bytes, got "<<size<<", aborting"<<endl;
- return;
+ exit(EXIT_FAILURE);
}
}
cout<<"[+] content field is over 255 bytes"<<endl;
if(before != DNSName("_underscore")+zone)
{
cout<<"before is wrong, got '"<<before.toString()<<"', expected '_underscore."<<zone.toString()<<"', aborting"<<endl;
- return;
+ exit(EXIT_FAILURE);
}
if(after != zone)
{
cout<<"after is wrong, got '"<<after.toString()<<"', expected '"<<zone.toString()<<"', aborting"<<endl;
- return;
+ exit(EXIT_FAILURE);
}
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<<"[-] Set serial 500, got back "<<di.notified_serial<<", aborting"<<endl;
+ exit(EXIT_FAILURE);
}
cout<<"Setting serial that needs 32 bits"<<endl;
- db->setNotified(di.id, 2147484148);
+ try {
+ db->setNotified(di.id, 2147484148);
+ } catch(const PDNSException &pe) {
+ cout<<"While setting serial, got error: "<<pe.reason<<endl;
+ cout<<"aborting"<<endl;
+ exit(EXIT_FAILURE);
+ }
db->getDomainInfo(zone, di);
if(di.notified_serial != 2147484148) {
- cout<<"[-] Set serial 2147484148, got back "<<di.notified_serial<<endl;
+ cout<<"[-] Set serial 2147484148, got back "<<di.notified_serial<<", aborting"<<endl;
+ exit(EXIT_FAILURE);
} else {
cout<<"[+] Big serials work correctly"<<endl;
}