diff options
author | Yoshitaka Aharen <aharen@jprs.co.jp> | 2013-05-17 04:50:05 +0200 |
---|---|---|
committer | Yoshitaka Aharen <aharen@jprs.co.jp> | 2013-05-20 12:18:23 +0200 |
commit | fdb231c9e31422dea878922607a0268675f50ec6 (patch) | |
tree | 88b33eede88ce0772f3062b9a06fde04879d5500 /tests/lettuce/features | |
parent | [master] removed accidentally committed code with the previous fix. (diff) | |
download | kea-fdb231c9e31422dea878922607a0268675f50ec6.tar.xz kea-fdb231c9e31422dea878922607a0268675f50ec6.zip |
[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.
Diffstat (limited to 'tests/lettuce/features')
-rw-r--r-- | tests/lettuce/features/auth_badzone.feature | 2 | ||||
-rw-r--r-- | tests/lettuce/features/example.feature | 2 | ||||
-rw-r--r-- | tests/lettuce/features/nsec3_auth.feature | 28 | ||||
-rw-r--r-- | tests/lettuce/features/queries.feature | 55 | ||||
-rw-r--r-- | tests/lettuce/features/resolver_basic.feature | 6 | ||||
-rw-r--r-- | tests/lettuce/features/terrain/querying.py | 12 |
6 files changed, 35 insertions, 70 deletions
diff --git a/tests/lettuce/features/auth_badzone.feature b/tests/lettuce/features/auth_badzone.feature index 5448b6e9de..122cf96071 100644 --- a/tests/lettuce/features/auth_badzone.feature +++ b/tests/lettuce/features/auth_badzone.feature @@ -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 diff --git a/tests/lettuce/features/example.feature b/tests/lettuce/features/example.feature index 86d20d3bbf..ee84b46574 100644 --- a/tests/lettuce/features/example.feature +++ b/tests/lettuce/features/example.feature @@ -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 diff --git a/tests/lettuce/features/nsec3_auth.feature b/tests/lettuce/features/nsec3_auth.feature index 6d3a556d14..8ead43f50a 100644 --- a/tests/lettuce/features/nsec3_auth.feature +++ b/tests/lettuce/features/nsec3_auth.feature @@ -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 diff --git a/tests/lettuce/features/queries.feature b/tests/lettuce/features/queries.feature index b0a6facc38..eb640cf3ac 100644 --- a/tests/lettuce/features/queries.feature +++ b/tests/lettuce/features/queries.feature @@ -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 diff --git a/tests/lettuce/features/resolver_basic.feature b/tests/lettuce/features/resolver_basic.feature index 47fc12304c..341c14c5b5 100644 --- a/tests/lettuce/features/resolver_basic.feature +++ b/tests/lettuce/features/resolver_basic.feature @@ -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 diff --git a/tests/lettuce/features/terrain/querying.py b/tests/lettuce/features/terrain/querying.py index ae348fd7d5..ec75490510 100644 --- a/tests/lettuce/features/terrain/querying.py +++ b/tests/lettuce/features/terrain/querying.py @@ -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,\ |