]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - testdata/serve_expired_servfail.rpl
Apply upstream fix 08968baec1122a58bb90d8f97ad948a75f8a5d69:
[FreeBSD/FreeBSD.git] / testdata / serve_expired_servfail.rpl
1 ; config options
2 server:
3         module-config: "validator iterator"
4         qname-minimisation: "no"
5         minimal-responses: no
6         serve-expired: yes
7         serve-expired-client-timeout: 1800
8         serve-expired-reply-ttl: 123
9         log-servfail: yes
10
11
12 stub-zone:
13         name: "example.com"
14         stub-addr: 1.2.3.4
15 CONFIG_END
16
17 SCENARIO_BEGIN Test serve-expired with client-timeout and a SERVFAIL upstream reply
18 ; Scenario overview:
19 ; - query for example.com. IN A
20 ; - check that we get an answer for example.com. IN A with the correct TTL
21 ; - query again right after the TTL expired
22 ; - answer from upstream is servfail
23 ; - check that we get the expired cached answer instead
24
25 ; ns.example.com.
26 RANGE_BEGIN 0 20
27         ADDRESS 1.2.3.4
28         ENTRY_BEGIN
29                 MATCH opcode qtype qname
30                 ADJUST copy_id
31                 REPLY QR NOERROR
32                 SECTION QUESTION
33                         example.com. IN NS
34                 SECTION ANSWER
35                         example.com. IN NS ns.example.com.
36                 SECTION ADDITIONAL
37                         ns.example.com. IN A 1.2.3.4
38         ENTRY_END
39
40         ENTRY_BEGIN
41                 MATCH opcode qtype qname
42                 ADJUST copy_id
43                 REPLY QR NOERROR
44                 SECTION QUESTION
45                         example.com. IN A
46                 SECTION ANSWER
47                         example.com. 10 IN A 5.6.7.8
48                 SECTION AUTHORITY
49                         example.com. IN NS ns.example.com.
50                 SECTION ADDITIONAL
51                         ns.example.com. IN A 1.2.3.4
52         ENTRY_END
53 RANGE_END
54
55 ; ns.example.com.
56 RANGE_BEGIN 30 100
57         ADDRESS 1.2.3.4
58         ; response to A query
59         ENTRY_BEGIN
60                 MATCH opcode qtype qname
61                 ADJUST copy_id
62                 REPLY QR AA SERVFAIL
63                 SECTION QUESTION
64                         example.com. IN A
65         ENTRY_END
66 RANGE_END
67
68 ; Query with RD flag
69 STEP 1 QUERY
70 ENTRY_BEGIN
71         REPLY RD
72         SECTION QUESTION
73                 example.com. IN A
74 ENTRY_END
75
76 ; Check that we got the correct answer (should be cached)
77 STEP 10 CHECK_ANSWER
78 ENTRY_BEGIN
79         MATCH all ttl
80         REPLY QR RD RA NOERROR
81         SECTION QUESTION
82                 example.com. IN A
83         SECTION ANSWER
84                 example.com. 10 IN A 5.6.7.8
85         SECTION AUTHORITY
86                 example.com. IN NS ns.example.com.
87         SECTION ADDITIONAL
88                 ns.example.com. IN A 1.2.3.4
89 ENTRY_END
90
91 ; Wait for the TTL to expire
92 STEP 11 TIME_PASSES ELAPSE 3601
93
94 ; Query again
95 STEP 30 QUERY
96 ENTRY_BEGIN
97         REPLY RD
98         SECTION QUESTION
99                 example.com. IN A
100 ENTRY_END
101
102 ; Check that we got a stale answer
103 STEP 40 CHECK_ANSWER
104 ENTRY_BEGIN
105         MATCH all ttl
106         REPLY QR RD RA NOERROR
107         SECTION QUESTION
108                 example.com. IN A
109         SECTION ANSWER
110                 example.com.  123 IN A 5.6.7.8
111         SECTION AUTHORITY
112                 example.com. 123 IN NS ns.example.com.
113         SECTION ADDITIONAL
114                 ns.example.com. 123 IN A 1.2.3.4
115 ENTRY_END
116
117 SCENARIO_END