Extra replay tests: error and two messages at a time (first is answered, second is not).

git-svn-id: file:///svn/unbound/trunk@93 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-02-13 15:58:39 +00:00
parent 5e4b3dab44
commit fec4a4efba
3 changed files with 92 additions and 6 deletions

View File

@ -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 ***********/

18
testdata/fwd_error.rpl vendored Normal file
View File

@ -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

69
testdata/fwd_two.rpl vendored Normal file
View File

@ -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.