diff --git a/testcode/fake_event.c b/testcode/fake_event.c index 5ede5bce6..957944f3d 100644 --- a/testcode/fake_event.c +++ b/testcode/fake_event.c @@ -665,12 +665,11 @@ pending_udp_query(struct outside_network* outnet, ldns_buffer* packet, log_info("testbound: do STEP %d %s", runtime->now->time_step, repevt_string(runtime->now->evt_type)); advance_moment(runtime); - } else { - log_info("testbound: created fake pending"); - /* add to list */ - pend->next = runtime->pending_list; - runtime->pending_list = pend; - } + } + log_info("testbound: created fake pending"); + /* add to list */ + pend->next = runtime->pending_list; + runtime->pending_list = pend; } /*********** End of Dummy routines ***********/ diff --git a/testdata/fwd_error.rpl b/testdata/fwd_error.rpl new file mode 100644 index 000000000..753419e23 --- /dev/null +++ b/testdata/fwd_error.rpl @@ -0,0 +1,18 @@ +SCENARIO_BEGIN Forwarder and a timeout happens on server query. +STEP 1 QUERY +ENTRY_BEGIN +SECTION QUESTION +www.example.com. IN A +ENTRY_END +; But the pending query fails due to error (say TCP failure or malloc or ...) +STEP 2 ERROR +; returns servfail +STEP 4 CHECK_ANSWER +ENTRY_BEGIN +MATCH opcode qname qtype +SECTION QUESTION +REPLY SERVFAIL QR +MATCH all +www.example.com. IN A +ENTRY_END +SCENARIO_END diff --git a/testdata/fwd_two.rpl b/testdata/fwd_two.rpl new file mode 100644 index 000000000..29223fccf --- /dev/null +++ b/testdata/fwd_two.rpl @@ -0,0 +1,69 @@ +SCENARIO_BEGIN Sample of a valid query + +; query responses from authority servers. +RANGE_BEGIN 0 100 +ENTRY_BEGIN + MATCH opcode qtype qname + ADJUST copy_id + SECTION QUESTION +www.example.net. IN A + SECTION ANSWER +www.example.net. IN A 10.20.30.40 + SECTION AUTHORITY +www.example.net. IN NS ns.example.net. + SECTION ADDITIONAL +ns.example.net. IN A 10.20.30.50 +ENTRY_END +RANGE_END + +STEP 1 QUERY +ENTRY_BEGIN +SECTION QUESTION +www.example.com. IN A +ENTRY_END + +STEP 2 CHECK_OUT_QUERY +ENTRY_BEGIN +MATCH qname qtype opcode +SECTION QUESTION +www.example.com. IN A +ENTRY_END + +; NO REPLY (this step is not needed) +STEP 3 NOTHING + +; another query +STEP 4 QUERY +ENTRY_BEGIN +SECTION QUESTION +www.example.net. IN A +ENTRY_END + +; reply from first query returns +STEP 5 REPLY +ENTRY_BEGIN + MATCH opcode qtype qname + ADJUST copy_id + SECTION QUESTION +www.example.com. IN A + SECTION ANSWER +www.example.com. IN A 10.20.30.40 + SECTION AUTHORITY +www.example.com. IN NS ns.example.com. + SECTION ADDITIONAL +ns.example.com. IN A 10.20.30.50 +ENTRY_END + +STEP 10 CHECK_ANSWER +ENTRY_BEGIN +MATCH opcode qname qtype +SECTION QUESTION +www.example.com. IN A +SECTION ANSWER +www.example.com. IN A 10.20.30.40 +ENTRY_END +SCENARIO_END + +; testbound checks before exit: +; * no more pending queries outstanding. +; * and no answers that have not been checked.