File: fwd_jostle_out.rpl

package info (click to toggle)
unbound 1.6.0-2~bpo8+1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 20,444 kB
  • sloc: ansic: 79,862; sh: 5,040; yacc: 1,900; makefile: 1,315; python: 1,302; perl: 141
file content (113 lines) | stat: -rw-r--r-- 2,161 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
; config options go here.
; This is one forever, one jostle.
server:
	num-queries-per-thread: 2
forward-zone: 
	name: "." 
	forward-addr: 216.0.0.1
CONFIG_END
SCENARIO_BEGIN Test too many queries asked, last one jostled out to make space

; fill the forever slot.
STEP 1 QUERY
ENTRY_BEGIN
REPLY RD
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

;something enters the jostle slot.
STEP 4 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
www.example.net. IN A
ENTRY_END

STEP 5 CHECK_OUT_QUERY
ENTRY_BEGIN
MATCH qname qtype opcode
SECTION QUESTION
www.example.net. IN A
ENTRY_END

; 300 msec passes
STEP 6 TIME_PASSES ELAPSE 0.300

; something else tries to replace the entry in the jostle slot.
; and it works because the entry is now too old.
STEP 8 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
www.example.org. IN A
ENTRY_END

; reply from latest query returns
STEP 9 REPLY
ENTRY_BEGIN
	MATCH opcode qtype qname
	ADJUST copy_id
	REPLY QR RD RA NOERROR
	SECTION QUESTION
www.example.org. IN A
	SECTION ANSWER
www.example.org. IN A 10.20.30.42
	SECTION AUTHORITY
www.example.org. IN NS ns.example.org.
	SECTION ADDITIONAL
ns.example.org. IN A 10.20.30.50
ENTRY_END

; answer to last query
STEP 10 CHECK_ANSWER
ENTRY_BEGIN
MATCH opcode qname qtype
SECTION QUESTION
www.example.org. IN A
SECTION ANSWER
www.example.org. IN A 10.20.30.42
ENTRY_END


; reply from first query returns
STEP 11 REPLY
ENTRY_BEGIN
	MATCH opcode qtype qname
	ADJUST copy_id
	REPLY QR RD RA NOERROR
	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

; answer to first query
STEP 12 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.