From c41d12bb947f64ffc534520a8a067252e5285428 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Thu, 18 Oct 2007 09:24:57 +0000 Subject: [PATCH] Tests update. git-svn-id: file:///svn/unbound/trunk@693 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/worker.c | 3 +++ doc/Changelog | 3 +++ testcode/fake_event.c | 7 +++++-- testdata/fwd_error.rpl | 6 +++++- testdata/fwd_timeout.rpl | 6 +++++- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/daemon/worker.c b/daemon/worker.c index ebde077bc..a8bf661d6 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -796,6 +796,9 @@ void worker_sighandler(int sig, void* arg) { /* note that log, print, syscalls here give race conditions. */ + /* we still print DETAIL logs, because this is extensive per message + * logging anyway, and the operator may then have an interest + * in the cause for unbound to exit */ struct worker* worker = (struct worker*)arg; switch(sig) { case SIGHUP: diff --git a/doc/Changelog b/doc/Changelog index 1ce00179a..e515f9025 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,8 @@ 18 October 2007: Wouter - addresses are logged with errors. + - fixup testcode fake event to remove pending before callback + since the callback may create new pending items. + - tests updated because retries are now in iterator module. 17 October 2007: Wouter - fixup another cycle detect and ns-addr timeout resolution bug. diff --git a/testcode/fake_event.c b/testcode/fake_event.c index 261b012fb..971a02727 100644 --- a/testcode/fake_event.c +++ b/testcode/fake_event.c @@ -380,6 +380,9 @@ fake_pending_callback(struct replay_runtime* runtime, struct fake_pending* p = runtime->pending_list; struct comm_reply repinfo; struct comm_point c; + void* cb_arg = p->cb_arg; + comm_point_callback_t* cb = p->callback; + memset(&c, 0, sizeof(c)); if(!p) fatal_exit("No pending queries."); log_assert(todo->qname == NULL); /* or find that one */ @@ -393,12 +396,12 @@ fake_pending_callback(struct replay_runtime* runtime, repinfo.c = &c; repinfo.addrlen = p->addrlen; memcpy(&repinfo.addr, &p->addr, p->addrlen); - if((*p->callback)(&c, p->cb_arg, error, &repinfo)) { + pending_list_delete(runtime, p); + if((*cb)(&c, cb_arg, error, &repinfo)) { fatal_exit("unexpected: pending callback returned 1"); } /* delete the pending item. */ ldns_buffer_free(c.buffer); - pending_list_delete(runtime, p); } /** diff --git a/testdata/fwd_error.rpl b/testdata/fwd_error.rpl index c9deaeb09..73648c57c 100644 --- a/testdata/fwd_error.rpl +++ b/testdata/fwd_error.rpl @@ -8,9 +8,13 @@ SECTION QUESTION www.example.com. IN A ENTRY_END ; But the pending query fails due to error (say TCP failure or malloc or ...) +; This is iterator/iterator.h OUTBOUND_MSG_RETRY number of errors. STEP 2 ERROR +STEP 3 ERROR +STEP 4 ERROR +STEP 5 ERROR ; returns servfail -STEP 4 CHECK_ANSWER +STEP 14 CHECK_ANSWER ENTRY_BEGIN MATCH opcode qname qtype SECTION QUESTION diff --git a/testdata/fwd_timeout.rpl b/testdata/fwd_timeout.rpl index d4f8c60b0..c132eb3e6 100644 --- a/testdata/fwd_timeout.rpl +++ b/testdata/fwd_timeout.rpl @@ -8,9 +8,13 @@ SECTION QUESTION www.example.com. IN A ENTRY_END ; But the pending query times out! +; OUTBOUND_MSG_RETRY times timeout. STEP 2 TIMEOUT +STEP 3 TIMEOUT +STEP 4 TIMEOUT +STEP 5 TIMEOUT ; returns servfail -STEP 4 CHECK_ANSWER +STEP 14 CHECK_ANSWER ENTRY_BEGIN MATCH opcode qname qtype SECTION QUESTION -- 2.47.2