Commit 1e14f099 authored by Grigorii Demidov's avatar Grigorii Demidov

some nsec3 test improvements; view module test was added

parent 23577c79
...@@ -181,13 +181,14 @@ Format ...@@ -181,13 +181,14 @@ Format
- **qname** - check if domain name (**QNAME**) fields of question sections are equal - **qname** - check if domain name (**QNAME**) fields of question sections are equal
- **subdomain** - check if domain from question section of incoming query (answer) - **subdomain** - check if domain from question section of incoming query (answer)
is a subdomain of domain from question section of this **ENTRY** block. is a subdomain of domain from question section of this **ENTRY** block.
- **flags** - check if set of dns flags (**QR** **AA** **TC** **RD** **RA**) is equal - **flags** - check if sets of dns flags (**QR** **AA** **TC** **RD** **RA**) are equal
- **rcode** - check if response codes are equal
- **question**, - **question**,
- **answer**, - **answer**,
- **authority**, - **authority**,
- **additional** - check if lists of RR sets for question,answer,authority and - **additional** - check if lists of RR sets for question,answer,authority and
additional section respectively is equal additional section respectively is equal
- **all** - check if set of dns flags is equal and all sections presented - **all** - check if sets of dns flags are equal, rcodes and all sections presented
in entry are equal to ones in incoming query (answer); incoming query in entry are equal to ones in incoming query (answer); incoming query
(answer) can contain some extra sections which will not be compared (answer) can contain some extra sections which will not be compared
......
; config options
stub-addr: 1.2.3.4
feature-list: view=view:addr('127.0.0.0/24', policy.suffix(policy.DENY,{"\3com\0"}))
feature-list: view=view:addr('127.0.0.0/24', policy.suffix(policy.FORWARD('1.2.3.4'),{"\2cz\0"}))
CONFIG_END
SCENARIO_BEGIN view:addr test
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
example.com. IN A
SECTION ANSWER
example.com. IN A 21.22.23.24
ENTRY_END
RANGE_END
; allowed by view
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 NOERROR
SECTION QUESTION
example.cz. IN A
SECTION ANSWER
example.cz. IN A 5.6.7.8
ENTRY_END
; blocked by view
; NXDOMAIN expected
STEP 30 QUERY
ENTRY_BEGIN
REPLY RD
SECTION QUESTION
example.com. IN A
ENTRY_END
STEP 40 CHECK_ANSWER
ENTRY_BEGIN
MATCH all
REPLY QR RD RA NXDOMAIN
SECTION QUESTION
example.com. IN A
SECTION ANSWER
ENTRY_END
SCENARIO_END
...@@ -129,7 +129,9 @@ ENTRY_END ...@@ -129,7 +129,9 @@ ENTRY_END
; recursion happens here. ; recursion happens here.
STEP 10 CHECK_ANSWER STEP 10 CHECK_ANSWER
ENTRY_BEGIN ENTRY_BEGIN
MATCH all ;MATCH all
;do not compare authority
MATCH opcode qname flags rcode question answer additional
REPLY QR RD RA SERVFAIL REPLY QR RD RA SERVFAIL
SECTION QUESTION SECTION QUESTION
a.c.x.w.example. IN A a.c.x.w.example. IN A
......
...@@ -131,7 +131,9 @@ ENTRY_END ...@@ -131,7 +131,9 @@ ENTRY_END
; recursion happens here. ; recursion happens here.
STEP 10 CHECK_ANSWER STEP 10 CHECK_ANSWER
ENTRY_BEGIN ENTRY_BEGIN
MATCH all ;MATCH all
;do not compare authority
MATCH opcode qname flags rcode question answer additional
REPLY QR RD RA SERVFAIL REPLY QR RD RA SERVFAIL
SECTION QUESTION SECTION QUESTION
a.c.x.w.example. IN A a.c.x.w.example. IN A
......
...@@ -130,7 +130,9 @@ ENTRY_END ...@@ -130,7 +130,9 @@ ENTRY_END
; recursion happens here. ; recursion happens here.
STEP 10 CHECK_ANSWER STEP 10 CHECK_ANSWER
ENTRY_BEGIN ENTRY_BEGIN
MATCH all ;do not compare authority
;MATCH all
MATCH opcode qname flags rcode question answer additional
REPLY QR RD RA DO SERVFAIL REPLY QR RD RA DO SERVFAIL
SECTION QUESTION SECTION QUESTION
a.c.x.w.example. IN A a.c.x.w.example. IN A
......
...@@ -30,6 +30,13 @@ renumber.config({{ '{{' }}'{{FEATURES.renumber_src}}','{{FEATURES.renumber_dst}} ...@@ -30,6 +30,13 @@ renumber.config({{ '{{' }}'{{FEATURES.renumber_src}}','{{FEATURES.renumber_dst}}
{{policy}} {{policy}}
{% endfor %} {% endfor %}
{% if FEATURES.view is defined %}
modules.load( 'view')
{% for view in FEATURES.view %}
{{view}}
{% endfor %}
{% endif %}
verbose(true) verbose(true)
-- Self-checks on globals -- Self-checks on globals
......
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