Commit fdb231c9 authored by Yoshitaka Aharen's avatar Yoshitaka Aharen
Browse files

[2796] update lettuce tests with a change of a terrain

Update lettuce tests for 'qryrecursion'. Add an argument to the terrain
to control RD bit in the query.
parent 0b690e4c
......@@ -24,7 +24,7 @@ Feature: Authoritative DNS server with a bad zone
And bind10 module Resolver should not be running
A query for www.example.org should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have ancount 1
The last query response should have nscount 2
The last query response should have adcount 2
......
......@@ -120,7 +120,7 @@ Feature: Example feature
The last query response should have adcount 0
# When checking flags, we must pass them exactly as they appear in
# the output of dig.
The last query response should have flags qr aa rd
The last query response should have flags qr aa
A query for www.example.org type TXT should have rcode NOERROR
The last query response should have ancount 0
......
......@@ -25,7 +25,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for a.c.x.w.example. should have rcode NXDOMAIN
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 8
......@@ -57,7 +57,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for ns1.example. type MX should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 4
......@@ -85,7 +85,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for y.w.example. should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 4
......@@ -113,7 +113,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for mc.c.example. type MX should have rcode NOERROR
The last query response should have flags qr rd
The last query response should have flags qr
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 6
......@@ -148,7 +148,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for a.z.w.example. type MX should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 2
The last query response should have nscount 5
......@@ -195,7 +195,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for a.z.w.example. type AAAA should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 8
......@@ -227,7 +227,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for example. type DS should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 4
......@@ -259,7 +259,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for b.x.w.example. should have rcode NXDOMAIN
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 6
......@@ -289,7 +289,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for a.w.example. should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 6
......@@ -319,7 +319,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for *.w.example. type MX should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 2
The last query response should have nscount 3
......@@ -362,7 +362,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for *.w.example. type A should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 4
......@@ -390,7 +390,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. type NSEC3 should have rcode NXDOMAIN
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 8
......@@ -422,7 +422,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for ai.example. type DS should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 4
......@@ -450,7 +450,7 @@ Feature: NSEC3 Authoritative service
And bind10 module StatsHttpd should not be running
A dnssec query for c.example. type DS should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 6
......
......@@ -66,16 +66,12 @@ Feature: Querying feature
When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
# make sure Auth module receives a command
And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
# make sure Auth module replied to the command
And wait for new bind10 stderr message CC_REPLY
# make sure the response is for 'getstats'
And wait for new bind10 stderr message v4
Then I query statistics zones of bind10 module Auth
And last bindctl output should not contain "error"
The statistics counters are 0 in category .Auth.zones._SERVER_
A query for www.example.org should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have ancount 1
The last query response should have nscount 2
The last query response should have adcount 2
......@@ -102,10 +98,6 @@ Feature: Querying feature
When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
# make sure Auth module receives a command
And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
# make sure Auth module replied to the command
And wait for new bind10 stderr message CC_REPLY
# make sure the response is for 'getstats'
And wait for new bind10 stderr message v4
Then I query statistics zones of bind10 module Auth
And last bindctl output should not contain "error"
The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
......@@ -121,7 +113,7 @@ Feature: Querying feature
# Repeat of the above
A query for www.example.org should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have ancount 1
The last query response should have nscount 2
The last query response should have adcount 2
......@@ -148,10 +140,6 @@ Feature: Querying feature
When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
# make sure Auth module receives a command
And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
# make sure Auth module replied to the command
And wait for new bind10 stderr message CC_REPLY
# make sure the response is for 'getstats'
And wait for new bind10 stderr message v4
Then I query statistics zones of bind10 module Auth
And last bindctl output should not contain "error"
The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
......@@ -165,7 +153,7 @@ Feature: Querying feature
| rcode.noerror | 2 |
# And now query something completely different
A query for nosuchname.example.org should have rcode NXDOMAIN
A recursive query for nosuchname.example.org should have rcode NXDOMAIN
The last query response should have flags qr aa rd
The last query response should have ancount 0
The last query response should have nscount 1
......@@ -182,10 +170,6 @@ Feature: Querying feature
When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
# make sure Auth module receives a command
And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
# make sure Auth module replied to the command
And wait for new bind10 stderr message CC_REPLY
# make sure the response is for 'getstats'
And wait for new bind10 stderr message v4
Then I query statistics zones of bind10 module Auth
And last bindctl output should not contain "error"
The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
......@@ -196,6 +180,7 @@ Feature: Querying feature
| responses | 3 |
| qrysuccess | 2 |
| qryauthans | 3 |
| qryrecursion | 1 |
| rcode.noerror | 2 |
| rcode.nxdomain | 1 |
......@@ -216,16 +201,12 @@ Feature: Querying feature
When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
# make sure Auth module receives a command
And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
# make sure Auth module replied to the command
And wait for new bind10 stderr message CC_REPLY
# make sure the response is for 'getstats'
And wait for new bind10 stderr message v4
Then I query statistics zones of bind10 module Auth
And last bindctl output should not contain "error"
The statistics counters are 0 in category .Auth.zones._SERVER_
A query for example.org type ANY should have rcode NOERROR
The last query response should have flags qr aa rd
The last query response should have flags qr aa
The last query response should have ancount 4
The last query response should have nscount 0
The last query response should have adcount 3
......@@ -250,10 +231,6 @@ Feature: Querying feature
When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
# make sure Auth module receives a command
And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
# make sure Auth module replied to the command
And wait for new bind10 stderr message CC_REPLY
# make sure the response is for 'getstats'
And wait for new bind10 stderr message v4
Then I query statistics zones of bind10 module Auth
And last bindctl output should not contain "error"
The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
......@@ -275,16 +252,12 @@ Feature: Querying feature
When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
# make sure Auth module receives a command
And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
# make sure Auth module replied to the command
And wait for new bind10 stderr message CC_REPLY
# make sure the response is for 'getstats'
And wait for new bind10 stderr message v4
Then I query statistics zones of bind10 module Auth
And last bindctl output should not contain "error"
The statistics counters are 0 in category .Auth.zones._SERVER_
A dnssec query for www.sub.example.org type AAAA should have rcode NOERROR
The last query response should have flags qr rd
The last query response should have flags qr
The last query response should have edns_flags do
The last query response should have ancount 0
The last query response should have nscount 1
......@@ -305,10 +278,6 @@ Feature: Querying feature
When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
# make sure Auth module receives a command
And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
# make sure Auth module replied to the command
And wait for new bind10 stderr message CC_REPLY
# make sure the response is for 'getstats'
And wait for new bind10 stderr message v4
Then I query statistics zones of bind10 module Auth
And last bindctl output should not contain "error"
The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
......@@ -342,10 +311,6 @@ Feature: Querying feature
When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
# make sure Auth module receives a command
And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
# make sure Auth module replied to the command
And wait for new bind10 stderr message CC_REPLY
# make sure the response is for 'getstats'
And wait for new bind10 stderr message v4
Then I query statistics zones of bind10 module Auth
And last bindctl output should not contain "error"
The statistics counters are 0 in category .Auth.zones._SERVER_
......@@ -360,10 +325,6 @@ Feature: Querying feature
When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
# make sure Auth module receives a command
And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
# make sure Auth module replied to the command
And wait for new bind10 stderr message CC_REPLY
# make sure the response is for 'getstats'
And wait for new bind10 stderr message v4
Then I query statistics zones of bind10 module Auth
And last bindctl output should not contain "error"
The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
......@@ -389,10 +350,6 @@ Feature: Querying feature
When I wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
# make sure Auth module receives a command
And wait for new bind10 stderr message AUTH_RECEIVED_COMMAND
# make sure Auth module replied to the command
And wait for new bind10 stderr message CC_REPLY
# make sure the response is for 'getstats'
And wait for new bind10 stderr message v4
Then I query statistics zones of bind10 module Auth
And last bindctl output should not contain "error"
The statistics counters are 0 in category .Auth.zones._SERVER_ except for the following items
......
......@@ -24,13 +24,13 @@ Feature: Basic Resolver
And bind10 module StatsHttpd should not be running
# The ACL is set to reject any queries
A query for l.root-servers.net. should have rcode REFUSED
A recursive query for l.root-servers.net. should have rcode REFUSED
# Test whether acl ACCEPT works
When I set bind10 configuration Resolver/query_acl[0] to {"action": "ACCEPT", "from": "127.0.0.1"}
# This address is currently hardcoded, so shouldn't cause outside traffic
A query for l.root-servers.net. should have rcode NOERROR
A recursive query for l.root-servers.net. should have rcode NOERROR
# Check whether setting the ACL to reject again works
When I set bind10 configuration Resolver/query_acl[0] to {"action": "REJECT", "from": "127.0.0.1"}
A query for l.root-servers.net. should have rcode REFUSED
A recursive query for l.root-servers.net. should have rcode REFUSED
......@@ -200,14 +200,19 @@ class QueryResult(object):
"""
pass
@step('A (dnssec )?query for ([\S]+) (?:type ([A-Z0-9]+) )?' +
@step('A (dnssec )?(recursive )?query for ([\S]+) (?:type ([A-Z0-9]+) )?' +
'(?:class ([A-Z]+) )?(?:to ([^:]+|\[[0-9a-fA-F:]+\])(?::([0-9]+))? )?' +
'should have rcode ([\w.]+)')
def query(step, dnssec, query_name, qtype, qclass, addr, port, rcode):
def query(step, dnssec, recursive, query_name, qtype, qclass, addr, port,
rcode):
"""
Run a query, check the rcode of the response, and store the query
result in world.last_query_result.
Parameters:
dnssec ('dnssec'): DO bit is set in the query.
Defaults to unset (no DNSSEC).
recursive ('recursive'): RD bit is set in the query.
Defaults to unset (no recursion).
query_name ('query for <name>'): The domain name to query.
qtype ('type <type>', optional): The RR type to query. Defaults to A.
qclass ('class <class>', optional): The RR class to query. Defaults to IN.
......@@ -234,6 +239,9 @@ def query(step, dnssec, query_name, qtype, qclass, addr, port, rcode):
# additional counts, so unless we need dnssec, explicitly
# disable edns0
additional_arguments.append("+noedns")
# dig sets RD bit by default.
if recursive is None:
additional_arguments.append("+norecurse")
query_result = QueryResult(query_name, qtype, qclass, addr, port,
additional_arguments)
assert query_result.rcode == rcode,\
......
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