]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Extra replay tests: error and two messages at a time (first is answered, second is...
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 13 Feb 2007 15:58:39 +0000 (15:58 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 13 Feb 2007 15:58:39 +0000 (15:58 +0000)
git-svn-id: file:///svn/unbound/trunk@93 be551aaa-1e26-0410-a405-d3ace91eadb9

testcode/fake_event.c
testdata/fwd_error.rpl [new file with mode: 0644]
testdata/fwd_two.rpl [new file with mode: 0644]

index 5ede5bce6008ced6440d0532319dc0349a7f5a50..957944f3dad6d1369ab987b6ef44f132d38c18d6 100644 (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 ***********/
diff --git a/testdata/fwd_error.rpl b/testdata/fwd_error.rpl
new file mode 100644 (file)
index 0000000..753419e
--- /dev/null
@@ -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 (file)
index 0000000..29223fc
--- /dev/null
@@ -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.