mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-03 15:35:17 +00:00
[master] Add lettuce test for mixed-case query
This commit is contained in:
@@ -132,6 +132,36 @@ Feature: Example feature
|
|||||||
A query for www.example.org to 127.0.0.1:47806 should have rcode NOERROR
|
A query for www.example.org to 127.0.0.1:47806 should have rcode NOERROR
|
||||||
A query for www.example.org type A class IN to 127.0.0.1:47806 should have rcode NOERROR
|
A query for www.example.org type A class IN to 127.0.0.1:47806 should have rcode NOERROR
|
||||||
|
|
||||||
|
Scenario: example.org mixed-case query
|
||||||
|
# This scenario performs a mixed-case query and checks that the
|
||||||
|
# response has the name copied from the question exactly
|
||||||
|
# (without any change in case). For why this is necessary, see
|
||||||
|
# section 5.2 of:
|
||||||
|
# http://tools.ietf.org/html/draft-vixie-dnsext-dns0x20-00
|
||||||
|
|
||||||
|
Given I have bind10 running with configuration example.org.config
|
||||||
|
And wait for bind10 stderr message BIND10_STARTED_CC
|
||||||
|
And wait for bind10 stderr message CMDCTL_STARTED
|
||||||
|
And wait for bind10 stderr message AUTH_SERVER_STARTED
|
||||||
|
|
||||||
|
bind10 module Auth should be running
|
||||||
|
And bind10 module Resolver should not be running
|
||||||
|
And bind10 module Xfrout should not be running
|
||||||
|
And bind10 module Zonemgr should not be running
|
||||||
|
And bind10 module Xfrin should not be running
|
||||||
|
And bind10 module Stats should not be running
|
||||||
|
And bind10 module StatsHttpd should not be running
|
||||||
|
|
||||||
|
A query for wWw.eXaMpLe.Org should have rcode NOERROR
|
||||||
|
The last query response should have qdcount 1
|
||||||
|
The last query response should have ancount 1
|
||||||
|
The last query response should have nscount 3
|
||||||
|
The last query response should have adcount 0
|
||||||
|
The question section of the last query response should exactly be
|
||||||
|
"""
|
||||||
|
;wWw.eXaMpLe.Org. IN A
|
||||||
|
"""
|
||||||
|
|
||||||
Scenario: changing database
|
Scenario: changing database
|
||||||
# This scenario contains a lot of 'wait for' steps
|
# This scenario contains a lot of 'wait for' steps
|
||||||
# If those are not present, the asynchronous nature of the application
|
# If those are not present, the asynchronous nature of the application
|
||||||
|
@@ -110,6 +110,8 @@ class QueryResult(object):
|
|||||||
self.line_handler = self.parse_answer
|
self.line_handler = self.parse_answer
|
||||||
elif line == ";; OPT PSEUDOSECTION:\n":
|
elif line == ";; OPT PSEUDOSECTION:\n":
|
||||||
self.line_handler = self.parse_opt
|
self.line_handler = self.parse_opt
|
||||||
|
elif line == ";; QUESTION SECTION:\n":
|
||||||
|
self.line_handler = self.parse_question
|
||||||
elif line == ";; AUTHORITY SECTION:\n":
|
elif line == ";; AUTHORITY SECTION:\n":
|
||||||
self.line_handler = self.parse_authority
|
self.line_handler = self.parse_authority
|
||||||
elif line == ";; ADDITIONAL SECTION:\n":
|
elif line == ";; ADDITIONAL SECTION:\n":
|
||||||
@@ -290,8 +292,8 @@ def check_last_query(step, item, value):
|
|||||||
assert str(value) == str(lq_val),\
|
assert str(value) == str(lq_val),\
|
||||||
"Got: " + str(lq_val) + ", expected: " + str(value)
|
"Got: " + str(lq_val) + ", expected: " + str(value)
|
||||||
|
|
||||||
@step('([a-zA-Z]+) section of the last query response should be')
|
@step('([a-zA-Z]+) section of the last query response should (exactly )?be')
|
||||||
def check_last_query_section(step, section):
|
def check_last_query_section(step, section, exact):
|
||||||
"""
|
"""
|
||||||
Check the entire contents of the given section of the response of the last
|
Check the entire contents of the given section of the response of the last
|
||||||
query.
|
query.
|
||||||
@@ -330,7 +332,8 @@ def check_last_query_section(step, section):
|
|||||||
# replace whitespace of any length by one space
|
# replace whitespace of any length by one space
|
||||||
response_string = re.sub("[ \t]+", " ", response_string)
|
response_string = re.sub("[ \t]+", " ", response_string)
|
||||||
expect = re.sub("[ \t]+", " ", step.multiline)
|
expect = re.sub("[ \t]+", " ", step.multiline)
|
||||||
# lowercase them
|
# lowercase them unless we need to do an exact match
|
||||||
|
if exact is None:
|
||||||
response_string = response_string.lower()
|
response_string = response_string.lower()
|
||||||
expect = expect.lower()
|
expect = expect.lower()
|
||||||
# sort them
|
# sort them
|
||||||
|
Reference in New Issue
Block a user