X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libevent%2Ftest%2Fregress_testutils.c;h=9b3046e0033fce15cd3d24247e00d9b08972343a;hb=3a84db87064922ad10ac10cc1d6833380e575995;hp=b5bef1abd7816c1011b6b182c4b43b7e3c21c3f3;hpb=cdb7047fb6897c1ad8b4ac264001d44154bf144d;p=netatalk.git diff --git a/libevent/test/regress_testutils.c b/libevent/test/regress_testutils.c index b5bef1ab..9b3046e0 100644 --- a/libevent/test/regress_testutils.c +++ b/libevent/test/regress_testutils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Niels Provos and Nick Mathewson + * Copyright (c) 2010-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -68,6 +68,8 @@ #include "regress.h" #include "regress_testutils.h" +#include "../util-internal.h" + /* globals */ static struct evdns_server_port *dns_port; evutil_socket_t dns_sock = -1; @@ -157,6 +159,23 @@ regress_dns_server_cb(struct evdns_server_request *req, void *data) int err = atoi(tab->ans); tt_assert(! evdns_server_request_respond(req, err)); return; + } else if (!strcmp(tab->anstype, "errsoa")) { + int err = atoi(tab->ans); + char soa_record[] = + "\x04" "dns1" "\x05" "icann" "\x03" "org" "\0" + "\x0a" "hostmaster" "\x05" "icann" "\x03" "org" "\0" + "\x77\xde\x5e\xba" /* serial */ + "\x00\x00\x1c\x20" /* refreshtime = 2h */ + "\x00\x00\x0e\x10" /* retry = 1h */ + "\x00\x12\x75\x00" /* expiration = 14d */ + "\x00\x00\x0e\x10" /* min.ttl = 1h */ + ; + evdns_server_request_add_reply( + req, EVDNS_AUTHORITY_SECTION, + "example.com", EVDNS_TYPE_SOA, EVDNS_CLASS_INET, + 42, sizeof(soa_record) - 1, 0, soa_record); + tt_assert(! evdns_server_request_respond(req, err)); + return; } else if (!strcmp(tab->anstype, "A")) { struct in_addr in; evutil_inet_pton(AF_INET, tab->ans, &in);