From fa44214c610876bb1e39e5561d6ef38c0e9dcd5f Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Thu, 24 May 2007 13:41:30 +0000 Subject: [PATCH] tests need forwarding mode enabled. git-svn-id: file:///svn/unbound/trunk@337 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/worker.c | 2 +- doc/Changelog | 1 + iterator/iter_hints.h | 9 +++++---- iterator/iterator.c | 4 +++- testdata/fwd.rpl | 1 + testdata/fwd_cached.rpl | 1 + testdata/fwd_error.rpl | 1 + testdata/fwd_lrudrop.rpl | 1 + testdata/fwd_notcached.rpl | 1 + testdata/fwd_timeout.rpl | 1 + testdata/fwd_two.rpl | 1 + testdata/rrset_rettl.rpl | 1 + testdata/rrset_untrusted.rpl | 1 + testdata/rrset_updated.rpl | 1 + 14 files changed, 20 insertions(+), 6 deletions(-) diff --git a/daemon/worker.c b/daemon/worker.c index 908939583..5824171e0 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -196,8 +196,8 @@ worker_process_query(struct worker* worker, struct work_query* w, } /* request done */ if(s == module_error) { - qstate_free(worker, qstate); replyerror(LDNS_RCODE_SERVFAIL, w); + qstate_free(worker, qstate); return; } if(s == module_finished) { diff --git a/doc/Changelog b/doc/Changelog index b7178909f..3a089a518 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -3,6 +3,7 @@ - iterator forwarder feature separated out. - iterator hints stub code, config file stub code, so that first testing can proceed locally. + - replay tests now have config option to enable forwarding mode. 23 May 2007: Wouter - outside network does precise timers for roundtrip estimates for rtt diff --git a/iterator/iter_hints.h b/iterator/iter_hints.h index 6b8d106e7..36d01b00d 100644 --- a/iterator/iter_hints.h +++ b/iterator/iter_hints.h @@ -117,10 +117,11 @@ struct delegpt* hints_lookup_root(struct iter_hints* hints, uint16_t qclass); * for this qname/qclass, determine if this combination indicates that a * stub hint exists and must be primed. * - * @param qname The qname that generated the delegation point. - * @param qclass The qclass that generated the delegation point. - * @param dp The cache generated delegation point. - * @return A priming delegation point if there is a stub hint that must + * @param hints: hint storage. + * @param qname: The qname that generated the delegation point. + * @param qclass: The qclass that generated the delegation point. + * @param dp: The cache generated delegation point. + * @return: A priming delegation point if there is a stub hint that must * be primed, otherwise null. */ struct delegpt* hints_lookup_stub(struct iter_hints* hints, diff --git a/iterator/iterator.c b/iterator/iterator.c index 0dc26bdb7..2e425761e 100644 --- a/iterator/iterator.c +++ b/iterator/iterator.c @@ -201,7 +201,7 @@ perform_forward(struct module_qstate* qstate, enum module_ev event, int id, qstate->ext_state[id] = module_error; return; } - log_err("bad event for iterator"); + log_err("bad event for iterator[forwarding]"); qstate->ext_state[id] = module_error; } @@ -222,6 +222,8 @@ iter_operate(struct module_qstate* qstate, enum module_ev event, int id, perform_forward(qstate, event, id, outbound); return; } + log_err("bad event for iterator"); + qstate->ext_state[id] = module_error; } /** iterator cleanup query state */ diff --git a/testdata/fwd.rpl b/testdata/fwd.rpl index a9c65df24..85212f11b 100644 --- a/testdata/fwd.rpl +++ b/testdata/fwd.rpl @@ -1,5 +1,6 @@ ; This is a comment. ; config options go here. +server: forward-to: "127.0.0.1" CONFIG_END SCENARIO_BEGIN Sample of a valid query diff --git a/testdata/fwd_cached.rpl b/testdata/fwd_cached.rpl index 9408730b0..001783e6e 100644 --- a/testdata/fwd_cached.rpl +++ b/testdata/fwd_cached.rpl @@ -1,5 +1,6 @@ ; This is a comment. ; config options go here. +server: forward-to: "127.0.0.1" CONFIG_END SCENARIO_BEGIN Query receives answer from the cache diff --git a/testdata/fwd_error.rpl b/testdata/fwd_error.rpl index 55f9e87fd..44fd6a277 100644 --- a/testdata/fwd_error.rpl +++ b/testdata/fwd_error.rpl @@ -1,4 +1,5 @@ ; config options go here. +server: forward-to: "127.0.0.1" CONFIG_END SCENARIO_BEGIN Forwarder and an error happens on server query. STEP 1 QUERY diff --git a/testdata/fwd_lrudrop.rpl b/testdata/fwd_lrudrop.rpl index de393e614..06f7c2c9e 100644 --- a/testdata/fwd_lrudrop.rpl +++ b/testdata/fwd_lrudrop.rpl @@ -4,6 +4,7 @@ server: msg-cache-size: 1 # one whole byte! msg-cache-slabs: 1 + forward-to: "127.0.0.1" CONFIG_END SCENARIO_BEGIN Old answer is dropped from the cache diff --git a/testdata/fwd_notcached.rpl b/testdata/fwd_notcached.rpl index 3c771448c..1a2cd8127 100644 --- a/testdata/fwd_notcached.rpl +++ b/testdata/fwd_notcached.rpl @@ -5,6 +5,7 @@ ; here config file options: server: msg-cache-size: 1024 + forward-to: "127.0.0.1" CONFIG_END SCENARIO_BEGIN Query receives answer not from the cache diff --git a/testdata/fwd_timeout.rpl b/testdata/fwd_timeout.rpl index 27678c3de..979fd3802 100644 --- a/testdata/fwd_timeout.rpl +++ b/testdata/fwd_timeout.rpl @@ -1,4 +1,5 @@ ; config options go here. +server: forward-to: "127.0.0.1" CONFIG_END SCENARIO_BEGIN Forwarder and a timeout happens on server query. STEP 1 QUERY diff --git a/testdata/fwd_two.rpl b/testdata/fwd_two.rpl index 2e1354d06..7142d6639 100644 --- a/testdata/fwd_two.rpl +++ b/testdata/fwd_two.rpl @@ -1,6 +1,7 @@ ; config options go here. server: num-queries-per-thread: 1 + forward-to: "127.0.0.1" CONFIG_END SCENARIO_BEGIN Sample of a valid query diff --git a/testdata/rrset_rettl.rpl b/testdata/rrset_rettl.rpl index 8177dcad1..6ececeb7a 100644 --- a/testdata/rrset_rettl.rpl +++ b/testdata/rrset_rettl.rpl @@ -1,5 +1,6 @@ ; This is a comment. ; config options go here. +server: forward-to: "127.0.0.1" CONFIG_END SCENARIO_BEGIN RRset TTL is updated from message. diff --git a/testdata/rrset_untrusted.rpl b/testdata/rrset_untrusted.rpl index 868ea113a..b044f992c 100644 --- a/testdata/rrset_untrusted.rpl +++ b/testdata/rrset_untrusted.rpl @@ -1,5 +1,6 @@ ; This is a comment. ; config options go here. +server: forward-to: "127.0.0.1" CONFIG_END SCENARIO_BEGIN Untrusted rrset not used for update diff --git a/testdata/rrset_updated.rpl b/testdata/rrset_updated.rpl index 146c287be..da4135882 100644 --- a/testdata/rrset_updated.rpl +++ b/testdata/rrset_updated.rpl @@ -1,5 +1,6 @@ ; This is a comment. ; config options go here. +server: forward-to: "127.0.0.1" CONFIG_END SCENARIO_BEGIN RRset is updated from other message that passes by. -- 2.47.2