Commit d1fd11b0 authored by Grigorii Demidov's avatar Grigorii Demidov

some policy tests were added

parent 21d070f5
; config options
stub-addr: 1.2.3.4
feature-list: policy=policy:add(policy.all(policy.DENY))
CONFIG_END
SCENARIO_BEGIN DENY policy test, uses policy.all
RANGE_BEGIN 0 100
ADDRESS 1.2.3.4
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
dummy.example.cz. IN A
SECTION ANSWER
dummy.example.cz. IN A 5.6.7.8
ENTRY_END
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
dummy.nic.cz. IN A
SECTION ANSWER
dummy.nic.cz. IN A 9.10.11.12
ENTRY_END
RANGE_END
STEP 10 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
example.cz. IN A
ENTRY_END
STEP 20 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
example.cz. IN A
SECTION ANSWER
ENTRY_END
STEP 30 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
dummy.example.cz. IN A
ENTRY_END
STEP 40 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
dummy.example.cz. IN A
SECTION ANSWER
ENTRY_END
STEP 50 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
nic.cz. IN A
ENTRY_END
STEP 60 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
nic.cz. IN A
SECTION ANSWER
ENTRY_END
STEP 70 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
dummy.nic.cz. IN A
ENTRY_END
STEP 80 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
dummy.nic.cz. IN A
SECTION ANSWER
ENTRY_END
SCENARIO_END
; config options
stub-addr: 1.2.3.4
feature-list: policy=policy:add(policy.suffix_common(policy.DENY, policy.todnames({'example.cz', 'nic.cz'}), todname('cz')))
CONFIG_END
SCENARIO_BEGIN DENY policy test, uses policy.common_suffix and policy.todnames
RANGE_BEGIN 0 110
ADDRESS 1.2.3.4
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
example.cz. IN A
SECTION ANSWER
example.cz. IN A 5.6.7.8
ENTRY_END
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
dummy.example.cz. IN A
SECTION ANSWER
dummy.example.cz. IN A 9.10.11.12
ENTRY_END
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
nic.cz. IN A
SECTION ANSWER
nic.cz. IN A 13.14.15.16
ENTRY_END
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
dummy.nic.cz. IN A
SECTION ANSWER
dummy.nic.cz. IN A 17.18.19.20
ENTRY_END
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
example.com. IN A
SECTION ANSWER
example.com. IN A 21.22.23.24
ENTRY_END
RANGE_END
; blocked by policy, must return NXDOMAIN
STEP 10 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
example.cz. IN A
ENTRY_END
STEP 20 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
example.cz. IN A
SECTION ANSWER
ENTRY_END
; blocked by policy, must return NXDOMAIN
STEP 30 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
dummy.example.cz. IN A
ENTRY_END
STEP 40 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
dummy.example.cz. IN A
SECTION ANSWER
ENTRY_END
; blocked by policy, must return NXDOMAIN
STEP 50 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
nic.cz. IN A
ENTRY_END
STEP 60 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
nic.cz. IN A
SECTION ANSWER
ENTRY_END
; blocked by policy, must return NXDOMAIN
STEP 70 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
dummy.nic.cz. IN A
ENTRY_END
STEP 80 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
dummy.nic.cz. IN A
SECTION ANSWER
ENTRY_END
; does not match the policy, so script must retun valid answer
STEP 90 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
example.com. IN A
ENTRY_END
STEP 100 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NOERROR
SECTION QUESTION
example.com. IN A
SECTION ANSWER
example.com. IN A 21.22.23.24
ENTRY_END
SCENARIO_END
; config options
stub-addr: 1.2.3.4
feature-list: policy=policy:add(policy.suffix(policy.DENY, {todname('nic.cz')}))
feature-list: policy=policy:add(policy.pattern(policy.DENY, '\8example[0-8]\2cz'))
CONFIG_END
SCENARIO_BEGIN DENY policy test; uses policy.suffix, policy.pattern, todname
RANGE_BEGIN 0 110
ADDRESS 1.2.3.4
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
nic.cz. IN A
SECTION ANSWER
nic.cz. IN A 5.6.7.8
ENTRY_END
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
dummy.nic.cz. IN A
SECTION ANSWER
dummy.nic.cz. IN A 9.10.11.12
ENTRY_END
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
example0.cz. IN A
SECTION ANSWER
example0.cz. IN A 13.14.15.16
ENTRY_END
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
dummy.example0.cz. IN A
SECTION ANSWER
dummy.example0.cz. IN A 17.18.19.20
ENTRY_END
ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR RD RA NOERROR
SECTION QUESTION
example9.cz. IN A
SECTION ANSWER
example9.cz. IN A 21.22.23.24
ENTRY_END
RANGE_END
; denied by policy.suffix(policy.DENY, {todname('nic.cz')})
STEP 10 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
nic.cz. IN A
ENTRY_END
STEP 20 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
nic.cz. IN A
SECTION ANSWER
ENTRY_END
; denied by policy.suffix(policy.DENY, {todname('nic.cz')})
STEP 30 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
dummy.nic.cz. IN A
ENTRY_END
STEP 40 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
dummy.nic.cz. IN A
SECTION ANSWER
ENTRY_END
; denied by policy.pattern(policy.DENY, todname('example[0-8].cz')
STEP 50 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
example0.cz. IN A
ENTRY_END
STEP 60 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
example0.cz. IN A
SECTION ANSWER
ENTRY_END
; denied by policy.pattern(policy.DENY, todname('example[0-8].cz')
STEP 70 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
dummy.example0.cz. IN A
ENTRY_END
STEP 80 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
dummy.example0.cz. IN A
SECTION ANSWER
ENTRY_END
; does not match any policy; allowed
STEP 90 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
example9.cz. IN A
ENTRY_END
STEP 100 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NOERROR
SECTION QUESTION
example9.cz. IN A
SECTION ANSWER
example9.cz. IN A 21.22.23.24
ENTRY_END
SCENARIO_END
......@@ -4,7 +4,7 @@
feature-list: policy=policy:add(policy.suffix(policy.DENY, {todname('example.cz')}))
CONFIG_END
SCENARIO_BEGIN Simple policy test
SCENARIO_BEGIN PASS, DENY policy test; uses policy.pattern and policy.suffix
RANGE_BEGIN 0 100
ADDRESS 1.2.3.4
ENTRY_BEGIN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment