; config options
server:
	module-config: "respip validator iterator"
	target-fetch-policy: "0 0 0 0 0"
	qname-minimisation: no

rpz:
	name: "rpz.example.com."
	zonefile:
TEMPFILE_NAME rpz.example.com
TEMPFILE_CONTENTS rpz.example.com
$ORIGIN example.com.
rpz	3600	IN	SOA	ns1.rpz.example.com. hostmaster.rpz.example.com. (
		1379078166 28800 7200 604800 7200 )
	3600	IN	NS	ns1.rpz.example.com.
	3600	IN	NS	ns2.rpz.example.com.
$ORIGIN rpz.example.com.
a.a CNAME rpz-passthru.
b.a CNAME rpz-tcp-only.
TEMPFILE_END

stub-zone:
	name: "a."
	stub-addr: 10.20.30.40
CONFIG_END

SCENARIO_BEGIN Test RPZ qname trigger and tcp-only action

RANGE_BEGIN 0 100
	ADDRESS 10.20.30.40
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
a. IN NS
SECTION ANSWER
a. IN NS ns.a.
SECTION ADDITIONAL
ns.a IN A 10.20.30.40
ENTRY_END

ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
a.a.  IN  TXT
SECTION ANSWER
a.a.  IN  TXT "upstream txt rr a.a."
ENTRY_END

ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
b.a.  IN  TXT
SECTION ANSWER
b.a.  IN  TXT "upstream txt rr b.a."
ENTRY_END

RANGE_END

STEP 10 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
a.a.  IN TXT
ENTRY_END

STEP 11 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NOERROR
SECTION QUESTION
a.a.  IN TXT
SECTION ANSWER
a.a.  IN TXT "upstream txt rr a.a."
ENTRY_END

STEP 20 QUERY
ENTRY_BEGIN
MATCH UDP
REPLY RD
SECTION QUESTION
b.a.  IN TXT
ENTRY_END

STEP 21 CHECK_ANSWER
ENTRY_BEGIN
MATCH all UDP
REPLY QR AA TC RD RA NOERROR
SECTION QUESTION
b.a.  IN TXT
SECTION ANSWER
ENTRY_END

STEP 30 QUERY
ENTRY_BEGIN
MATCH TCP
REPLY RD
SECTION QUESTION
b.a.  IN TXT
ENTRY_END

STEP 31 CHECK_ANSWER
ENTRY_BEGIN
MATCH all TCP
REPLY QR RD RA NOERROR
SECTION QUESTION
b.a.  IN TXT
SECTION ANSWER
b.a.  IN TXT "upstream txt rr b.a."
ENTRY_END

SCENARIO_END
