Codebase list unbound / scrub-obsolete/main testdata / serve_expired_client_timeout_servfail.rpl
scrub-obsolete/main

Tree @scrub-obsolete/main (Download .tar.gz)

serve_expired_client_timeout_servfail.rpl @scrub-obsolete/mainraw · history · blame

; config options
server:
	module-config: "validator iterator"
	qname-minimisation: "no"
	minimal-responses: no
	serve-expired: yes
	serve-expired-client-timeout: 1
	serve-expired-reply-ttl: 123
	log-servfail: yes
	ede: yes
	ede-serve-expired: yes


stub-zone:
	name: "example.com"
	stub-addr: 1.2.3.4
CONFIG_END

SCENARIO_BEGIN Test serve-expired with client-timeout and a SERVFAIL upstream reply
; Scenario overview:
; - query for example.com. IN A
; - check that we get an answer for example.com. IN A with the correct TTL
; - query again right after the TTL expired
; - answer from upstream is servfail
; - check that we get the expired cached answer instead

; ns.example.com.
RANGE_BEGIN 0 20
	ADDRESS 1.2.3.4
	ENTRY_BEGIN
		MATCH opcode qtype qname
		ADJUST copy_id
		REPLY QR NOERROR
		SECTION QUESTION
			example.com. 10 IN NS
		SECTION ANSWER
			example.com. 10 IN NS ns.example.com.
		SECTION ADDITIONAL
			ns.example.com. 10 IN A 1.2.3.4
	ENTRY_END

	ENTRY_BEGIN
		MATCH opcode qtype qname
		ADJUST copy_id
		REPLY QR NOERROR
		SECTION QUESTION
			example.com. IN A
		SECTION ANSWER
			example.com. 10 IN A 5.6.7.8
		SECTION AUTHORITY
			example.com. 10 IN NS ns.example.com.
		SECTION ADDITIONAL
			ns.example.com. 10 IN A 1.2.3.4
	ENTRY_END
RANGE_END

; ns.example.com.
RANGE_BEGIN 30 70
	ADDRESS 1.2.3.4
	; response to A query
	ENTRY_BEGIN
		MATCH opcode qtype qname
		ADJUST copy_id
		REPLY QR AA SERVFAIL
		SECTION QUESTION
			example.com. IN A
	ENTRY_END
RANGE_END

; Query with RD flag
STEP 1 QUERY
ENTRY_BEGIN
	REPLY RD
	SECTION QUESTION
		example.com. IN A
ENTRY_END

; Check that we got the correct answer (should be cached)
STEP 10 CHECK_ANSWER
ENTRY_BEGIN
	MATCH all ttl
	REPLY QR RD RA NOERROR
	SECTION QUESTION
		example.com. IN A
	SECTION ANSWER
		example.com. 10 IN A 5.6.7.8
	SECTION AUTHORITY
		example.com. 10 IN NS ns.example.com.
	SECTION ADDITIONAL
		ns.example.com. 10 IN A 1.2.3.4
ENTRY_END

; Wait for the TTL to expire
STEP 11 TIME_PASSES ELAPSE 11

; Query again
STEP 30 QUERY
ENTRY_BEGIN
	REPLY RD DO
	SECTION QUESTION
		example.com. IN A
ENTRY_END

; Check that we got a stale answer
STEP 40 CHECK_ANSWER
ENTRY_BEGIN
	MATCH all ttl ede=3
	REPLY QR RD RA DO NOERROR
	SECTION QUESTION
		example.com. IN A
	SECTION ANSWER
		example.com.  123 IN A 5.6.7.8
	SECTION AUTHORITY
		example.com. 123 IN NS ns.example.com.
	SECTION ADDITIONAL
		ns.example.com. 123 IN A 1.2.3.4
ENTRY_END

SCENARIO_END