]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - testdata/serve_expired_ttl.rpl
Apply upstream fix 08968baec1122a58bb90d8f97ad948a75f8a5d69:
[FreeBSD/FreeBSD.git] / testdata / serve_expired_ttl.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-ttl: 10
8
9 stub-zone:
10         name: "example.com"
11         stub-addr: 1.2.3.4
12 CONFIG_END
13
14 SCENARIO_BEGIN Test serve-expired
15 ; Scenario overview:
16 ; - query for example.com. IN A
17 ; - check that we get an answer for example.com. IN A with the correct TTL
18 ; - query again right after the TTL expired + serve-expired-ttl
19 ; - check that we get an updated answer and not the cached one
20
21 ; ns.example.com.
22 RANGE_BEGIN 0 100
23         ADDRESS 1.2.3.4
24         ENTRY_BEGIN
25                 MATCH opcode qtype qname
26                 ADJUST copy_id
27                 REPLY QR NOERROR
28                 SECTION QUESTION
29                         example.com. IN NS
30                 SECTION ANSWER
31                         example.com. IN NS ns.example.com.
32                 SECTION ADDITIONAL
33                         ns.example.com. IN A 1.2.3.4
34         ENTRY_END
35
36         ENTRY_BEGIN
37                 MATCH opcode qtype qname
38                 ADJUST copy_id
39                 REPLY QR NOERROR
40                 SECTION QUESTION
41                         example.com. IN A
42                 SECTION ANSWER
43                         example.com. IN A 5.6.7.8
44                 SECTION AUTHORITY
45                         example.com. IN NS ns.example.com.
46                 SECTION ADDITIONAL
47                         ns.example.com. IN A 1.2.3.4
48         ENTRY_END
49 RANGE_END
50
51 ; Query with RD flag
52 STEP 1 QUERY
53 ENTRY_BEGIN
54         REPLY RD
55         SECTION QUESTION
56                 example.com. IN A
57 ENTRY_END
58
59 ; Check that we got the correct answer (should be cached)
60 STEP 10 CHECK_ANSWER
61 ENTRY_BEGIN
62         MATCH all ttl
63         REPLY QR RD RA NOERROR
64         SECTION QUESTION
65                 example.com. IN A
66         SECTION ANSWER
67                 example.com. IN A 5.6.7.8
68         SECTION AUTHORITY
69                 example.com. IN NS ns.example.com.
70         SECTION ADDITIONAL
71                 ns.example.com. IN A 1.2.3.4
72 ENTRY_END
73
74 ; Wait for the TTL to expire + serve-expired-ttl
75 STEP 11 TIME_PASSES ELAPSE 3611
76
77 ; Query again
78 STEP 30 QUERY
79 ENTRY_BEGIN
80         REPLY RD
81         SECTION QUESTION
82                 example.com. IN A
83 ENTRY_END
84
85 ; Check that we got an updated answer
86 STEP 40 CHECK_ANSWER
87 ENTRY_BEGIN
88         MATCH all ttl
89         REPLY QR RD RA NOERROR
90         SECTION QUESTION
91                 example.com. IN A
92         SECTION ANSWER
93                 example.com.  IN A 5.6.7.8
94         SECTION AUTHORITY
95                 example.com. IN NS ns.example.com.
96         SECTION ADDITIONAL
97                 ns.example.com. IN A 1.2.3.4
98 ENTRY_END
99
100 SCENARIO_END