+++ /dev/null
-/output/
-/setup_intree_bind10.sh
+++ /dev/null
-noinst_SCRIPTS = setup_intree_bind10.sh
+++ /dev/null
-BIND10 system testing with Lettuce
-or: to BDD or not to BDD
-
-In this directory, we define a set of behavioral tests for BIND 10. Currently,
-these tests are specific for BIND10, but we are keeping in mind that RFC-related
-tests could be separated, so that we can test other systems as well.
-
-Prerequisites:
-- BIND 10 must be compiled or installed (even when testing in-tree build;
- see below) with both DNS and DHCP components enabled
-- dig
-- lettuce (http://lettuce.it)
-
-To install lettuce, if you have the python pip installation tool, simply do
-pip install lettuce
-See http://lettuce.it/intro/install.html
-
-Most systems have the pip tool in a separate package; on Debian-based systems
-it is called python-pip. On FreeBSD the port is devel/py-pip.
-
-Running the tests
------------------
-
-At this moment, we have a fixed port for local tests in our setups, port 56176.
-This port must be free. (TODO: can we make this run-time discovered?).
-Port 56175 is used for cmdctl, and must also be available.
-(note, we will need to extend this to a range, or if possible, we will need to
-do some on-the-fly available port finding)
-
-You can run the lettuce tests with the provided run_lettuce.sh script.
-
-By default it will use the build tree, but you can use an installed version
-of bind10 by passing -I as the first argument of run_lettuce.sh
-
-The tool 'dig' must be in the default search path of your environment. If
-you specified -I, so must the main BIND 10 programs. And, with or without
--I, some BIND 10 programs still have to be installed as they are invoked
-from test tools. Those include bindctl and b10-loadzone.
-
-Due to the default way lettuce prints its output, it is advisable to run it
-in a terminal that is wide than the default. If you see a lot of lines twice
-in different colors, the terminal is not wide enough.
-
-If you just want to run one specific feature test, use
-run_lettuce.sh [-I] features/<feature file>
-
-To run a specific scenario from a feature, use
-run_lettuce.sh [-I] features/<feature file> -s <scenario number>
-
-We have set up the tests to assume that lettuce is run from this directory,
-so even if you specify a specific feature file, you should do it from this
-directory.
-
-What to do when a test fails
-----------------------------
-
-First of all, look at the error it printed and see what step it occurred in.
-If written well, the output should explain most of what went wrong.
-
-The stacktrace that is printed is *not* of bind10, but of the testing
-framework; this helps in finding more information about what exactly the test
-tried to achieve when it failed (as well as help debug the tests themselves).
-
-Furthermore, if any scenario fails, the output from long-running processes
-will be stored in the directory output/. The name of the files will be
-<Feature name>-<Scenario name>-<Process name>.stdout and
-<Feature name>-<Scenario name>-<Process name>.stderr
-Where spaces and other non-standard characters are replaced by an underscore.
-The process name is either the standard name for said process (e.g. 'bind10'),
-or the name given to it by the test ('when i run bind10 as <name>').
-
-These files *will* be overwritten or deleted if the same scenarios are run
-again, so if you want to inspect them after a failed test, either do so
-immediately or move the files.
-
-If you want to keep these output files even for successful runs, you can
-specify the environment variable LETTUCE_KEEP_OUTPUT=1. The files will
-still be overwritten by subsequent runs, but they will not automatically be
-deleted.
-
-Adding and extending tests
---------------------------
-
-If you want to add tests, it is advisable to first go through the examples to
-see what is possible, and read the documentation on http://www.lettuce.it
-
-There is also a README.tutorial file here.
-
-We have a couple of conventions to keep things manageable.
-
-Configuration files go into the configurations/ directory.
-Data files go into the data/ directory.
-Step definition go into the features/terrain/ directory (the name terrain is
-chosen for the same reason Lettuce chose terrain.py, this is the place the
-tests 'live' in).
-Feature definitions go directly into the features/ directory.
-
-These directories are currently not divided further; we may want to consider
-this as the set grows. Due to a (current?) limitation of Lettuce, for
-feature files this is currently not possible; the python files containing
-steps and terrain must be below or at the same level of the feature files.
-
-Long-running processes should be started through the world.RunningProcesses
-instance. If you want to add a process (e.g. bind9), create start, stop and
-control steps in terrain/<base_name>_control.py, and let it use the
-RunningProcesses API (defined in terrain.py). See bind10_control.py for an
-example.
-
-For sending queries and checking the results, steps have been defined in
-terrain/querying.py. These use dig and store the results split up into text
-strings. This is intentionally not parsed through our own library (as that way
-we might run into a 'symmetric bug'). If you need something more advanced from
-query results, define it here.
-
-Some very general steps are defined in terrain/steps.py.
-Initialization code, cleanup code, and helper classes are defined in
-terrain/terrain.py.
-
-To find the right steps, case insensitive matching is used. Parameters taken
-from the steps are case-sensitive though. So a step defined as
-'do foo with value (bar)' will be matched when using
-'Do Foo with value xyz', but xyz will be taken as given.
-
-If you need to add steps that are very particular to one test, create a new
-file with a name relevant for that test in terrain. We may want to consider
-creating a specific subdirectory for these, but at this moment it is unclear
-whether we need to.
-
-We should try to keep steps as general as possible, while not making them to
-complex and error-prone.
-
+++ /dev/null
-Quick tutorial and overview
----------------------------
-
-Lettuce is a framework for doing Behaviour Driven Development (BDD).
-
-The idea behind BDD is that you first write down your requirements in
-the form of scenarios, then implement their behaviour.
-
-We do not plan on doing full BDD, but such a system should also help
-us make system tests. And, hopefully, being able to better identify
-what exactly is going wrong when a test fails.
-
-Lettuce is a python implementation of the Cucumber framework, which is
-a ruby system. So far we chose lettuce because we already need python
-anyway, so chances are higher that any system we want to run it on
-supports it. It only supports a subset of cucumber, but more cucumber
-features are planned. As I do not know much details of cucumber, I
-can't really say what is there and what is not.
-
-A slight letdown is that the current version does not support python 3.
-However, as long as the tool-calling glue is python2, this should not
-cause any problems, since these aren't unit tests; We do not plan to use
-our libraries directly, but only through the runnable scripts and
-executables.
-
------
-
-Features, Scenarios, Steps.
-
-Lettuce makes a distinction between features, scenarios, and steps.
-
-Features are general, well, features. Each 'feature' has its own file
-ending in .feature. A feature file contains a description and a number
-of scenarios. Each scenario tests one or more particular parts of the
-feature. Each scenario consists of a number of steps.
-
-So let's open up a simple one.
-
--- example.feature
-Feature: showing off BIND 10
- This is to show BIND 10 running and that it answer queries
-
- Scenario: Starting bind10
- # steps go here
---
-
-I have predefined a number of steps we can use, as we build test we
-will need to expand these, but we will look at them shortly.
-
-This file defines a feature, just under the feature name we can
-provide a description of the feature.
-
-The one scenario we have has no steps, so if we run it we should
-see something like:
-
--- output
-> ./run_lettuce.sh
-Feature: showing off BIND 10
- This is to show BIND 10 running and that it answer queries
-
- Scenario: Starting bind10
-
-1 feature (1 passed)
-1 scenario (1 passed)
-0 step (0 passed)
---
-
-Let's first add some steps that send queries.
-
---
- A query for www.example.com should have rcode REFUSED
- A query for www.example.org should have rcode NOERROR
---
-
-Since we didn't start any bind10, dig will time out and the result
-should be an error saying it got no answer. Errors are in the
-form of stack traces (trigger by failed assertions), so we can find
-out easily where in the tests they occurred. Especially when the total
-set of steps gets bigger we might need that.
-
-So let's add a step that starts bind10.
-
---
- When I start bind10 with configuration example.org.config
---
-
-This is not good enough; it will start the process, but setting up
-b10-auth may take a few moments, so we need to add a step to wait for
-it to be started before we continue.
-
---
- Then wait for bind10 auth to start
---
-
-And let's run the tests again.
-
---
-> ./run_lettuce.sh
-
-Feature: showing off BIND 10
- This is to show BIND 10 running and that it answer queries
-
- Scenario: Starting bind10
- When I start bind10 with configuration example.org.config
- Then wait for bind10 auth to start
- A query for www.example.com should have rcode REFUSED
- A query for www.example.org should have rcode NOERROR
-
-1 feature (1 passed)
-1 scenario (1 passed)
-4 steps (4 passed)
-(finished within 2 seconds)
---
-
-So take a look at one of those steps, let's pick the first one.
-
-A step is defined through a python decorator, which in essence is a regular
-expression; lettuce searches through all defined steps to find one that
-matches. These are 'partial' matches (unless specified otherwise in the
-regular expression itself), so if the step is defined with "do foo bar", the
-scenario can add words for readability "When I do foo bar".
-
-Each captured group will be passed as an argument to the function we define.
-For bind10, I defined a configuration file, a cmdctl port, and a process
-name. The first two should be self-evident, and the process name is an
-optional name we give it, should we want to address it in the rest of the
-tests. This is most useful if we want to start multiple instances. In the
-next step (the wait for auth to start), I added a 'of <instance>'. So if we
-define the bind10 'as b10_second_instance', we can specify that one here as
-'of b10_second_instance'.
-
---
- When I start bind10 with configuration second.config
- with cmdctl port 12345 as b10_second_instance
---
-(line wrapped for readability)
-
-But notice how we needed two steps, which we probably always need (but
-not entirely always)? We can also combine steps; for instance:
-
---
-@step('have bind10 running(?: with configuration ([\w.]+))?')
-def have_bind10_running(step, config_file):
- step.given('start bind10 with configuration ' + config_file)
- step.given('wait for bind10 auth to start')
---
-
-Now we can replace the two steps with one:
-
---
- Given I have bind10 running
---
-
-That's it for the quick overview. For some more examples, with comments,
-take a look at features/example.feature. You can read more about lettuce and
-its features on http://www.lettuce.it, and if you plan on adding tests and
-scenarios, please consult the last section of the main README first.
+++ /dev/null
-/bindctl_commands.config
-/example.org.config
-/generate.config
-/root.config
-/static.config
+++ /dev/null
-/auth_badzone.config
-/auth_basic.config
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [{
- "severity": "DEBUG",
- "name": "*",
- "debuglevel": 99
- }]
- },
- "Auth": {
- "listen_on": [{
- "port": 56176,
- "address": "127.0.0.1"
- }]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "MasterFiles",
- "cache-enable": true,
- "params": {
- "example.org": "data/example.org",
- "example.com": "data/example.com-broken",
- "example.net": "data/example.net-empty",
- "example.info": "data/example.info-doesnt-exist"
- }
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "listen_on": [ {
- "port": 56176,
- "address": "127.0.0.1"
- } ]
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-/bindctl.config
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "database_file": "data/example.org.sqlite3",
- "listen_on": [ {
- "port": 56176,
- "address": "127.0.0.1"
- } ]
- },
- "data_sources": {
- "classes": {}
- },
- "Init": {
- "components": {
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "database_file": "data/example.org.sqlite3",
- "listen_on": [ {
- "port": 56176,
- "address": "127.0.0.1"
- } ]
- },
- "data_sources": {
- "classes": {}
- },
- "StatsHttpd": {
- "listen_on": [ {
- "port": 47811,
- "address": "127.0.0.1"
- } ]
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "dispensable", "special": "auth" },
- "b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
- "b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-stats": { "address": "Stats", "kind": "dispensable" },
- "b10-stats-httpd": { "address": "StatsHttpd", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-/ddns.config
-/noddns.config
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [
- {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- }
- ]
- },
- "Zonemgr": {
- "secondary_zones": [
- {
- "class": "IN",
- "name": "secondary.org"
- }
- ]
- },
- "Auth": {
- "database_file": "data/ddns/example.org.sqlite3",
- "listen_on": [
- {
- "port": 56176,
- "address":
- "127.0.0.1"
- }
- ]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "sqlite3",
- "params": {
- "database_file": "data/ddns/example.org.sqlite3"
- }
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-xfrout": {
- "kind": "dispensable",
- "address": "Xfrout"
- },
- "b10-zonemgr": {
- "kind": "dispensable",
- "address": "ZoneMgr"
- },
- "b10-ddns": {
- "kind": "dispensable",
- "address": "DDNS"
- },
- "b10-auth": {
- "kind": "needed",
- "special": "auth"
- },
- "b10-cmdctl": {
- "kind": "needed",
- "special": "cmdctl"
- }
- }
- },
- "DDNS": {
- "zones": [
- {
- "origin": "example.org.",
- "update_acl": [
- {
- "action": "ACCEPT",
- "from": "127.0.0.1"
- }
- ],
- "class": "IN"
- },
- {
- "origin": "secondary.org.",
- "update_acl": [
- {
- "action": "ACCEPT",
- "from": "127.0.0.1"
- }
- ],
- "class": "IN"
- }
- ]
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [
- {
- "severity": "DEBUG",
- "name": "*",
- "debuglevel": 99
- }
- ]
- },
- "DDNS": {"zones": []},
- "Auth": {
- "database_file": "data/ddns/example.org.sqlite3",
- "listen_on": [
- {
- "port": 56176,
- "address": "127.0.0.1"
- }
- ]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "sqlite3",
- "params": {
- "database_file": "data/ddns/example.org.sqlite3"
- },
- "cache-enable": true,
- "cache-zones": [
- "example.org"
- ]
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-xfrout": {"kind": "dispensable"},
- "b10-auth": {"kind": "needed", "special": "auth"},
- "b10-zonemgr": {"kind": "dispensable", "address": "ZoneMgr" },
- "b10-cmdctl": {"kind": "needed", "special": "cmdctl"}
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "StatsHttpd": {
- "listen_on": [ {
- "port": 47811,
- "address": "127.0.0.1"
- } ]
- }
-}
+++ /dev/null
-root,bind10\r
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "database_file": "data/example.org.sqlite3",
- "listen_on": [ {
- "port": 56176,
- "address": "127.0.0.1"
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "sqlite3",
- "params": {
- "database_file": "data/example.org.sqlite3"
- }
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [{
- "severity": "DEBUG",
- "name": "*",
- "debuglevel": 99
- }]
- },
- "Auth": {
- "listen_on": [{
- "port": 56176,
- "address": "127.0.0.1"
- }]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "MasterFiles",
- "cache-enable": true,
- "params": {
- "example.org": "data/example.org"
- }
- },
- {
- "type": "broken_libraries_should_be_skipped",
- "cache-enable": false,
- "params": {
- }
- }
- ]
- }
- },
- "Stats": {
- "poll-interval": 1
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-stats": { "address": "Stats", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "severity": "DEBUG",
- "name": "*",
- "debuglevel": 99
- }
- ]
- },
- "Auth": {
- "database_file": "data/example.org.sqlite3",
- "listen_on": [ {
- "port": 56177,
- "address": "::1"
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "sqlite3",
- "params": {
- "database_file": "data/example.org.sqlite3"
- }
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [{
- "severity": "DEBUG",
- "name": "*",
- "debuglevel": 99
- }]
- },
- "Auth": {
- "listen_on": [{
- "port": 56176,
- "address": "127.0.0.1"
- }]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "MasterFiles",
- "cache-enable": true,
- "params": {
- "example.org": "data/generate.zone"
- }
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [{
- "severity": "DEBUG",
- "name": "*",
- "debuglevel": 99
- }]
- },
- "Auth": {
- "listen_on": [{
- "port": 56176,
- "address": "127.0.0.1"
- }]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "sqlite3",
- "params": {
- "database_file": "data/glue.sqlite3"
- }
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "listen_on": [ {
- "port": 56176,
- "address": "127.0.0.1"
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "sqlite3",
- "params": {
- "database_file": "data/example.org.sqlite3"
- },
- "cache-enable": true,
- "cache-zones": [
- "example.org"
- ]
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "Xfrin": {
- "zones": [
- {
- "class": "IN",
- "name": "example.com.",
- "master_addr": "178.18.82.80"
- }
- ]
- },
- "version": 3,
- "Logging": {
- "loggers":
- [
- {
- "debuglevel": 99,
- "severity": "DEBUG",
- "output_options": [
- {
- "output": "stderr",
- "flush": true
- }
- ],
- "name": "*"
- }
- ]
- },
- "Auth": {
- "database_file": "data/ixfr-out/zones.sqlite3",
- "listen_on": [
- {
- "port": 56176,
- "address": "::"
- },
- {
- "port": 56176,
- "address": "0.0.0.0"
- }
- ]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "sqlite3",
- "params": {
- "database_file": "data/ixfr-out/zones.sqlite3"
- }
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
- "b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-/multi_auth.config
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "database_file": "data/test_nonexistent_db.sqlite3",
- "listen_on": [ {
- "port": 56176,
- "address": "127.0.0.1"
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [{
- "type": "sqlite3",
- "params": {
- "database_file": "data/test_nonexistent_db.sqlite3"
- }
- }]
- }
- },
- "Init": {
- "components": {
- "b10-auth-2": {"kind": "dispensable", "special": "auth"},
- "b10-auth": {"kind": "dispensable", "special": "auth"},
- "b10-cmdctl": {"kind": "needed", "special": "cmdctl"}
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "severity": "DEBUG",
- "name": "*",
- "debuglevel": 99
- }
- ]
- },
- "Auth": {
- "database_file": "data/test_nonexistent_db.sqlite3",
- "listen_on": [ {
- "port": 56176,
- "address": "127.0.0.1"
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "sqlite3",
- "params": {
- "database_file": "data/test_nonexistent_db.sqlite3"
- }
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [
- {
- "severity": "DEBUG",
- "name": "*", "debuglevel": 99
- }
- ]
- },
- "Auth": {
- "datasources": [
- {"zones": [{"origin": "example.", "file": "configurations/nsec3/rfc5155-example.zone.signed"}], "type": "memory"}],
- "listen_on": [{"port": 56176, "address": "0.0.0.0"}
- ]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "MasterFiles",
- "cache-enable": true,
- "params": {
- "example.": "configurations/nsec3/rfc5155-example.zone.signed"
- }
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-auth": {"kind": "needed", "special": "auth"},
- "b10-cmdctl": {"kind": "needed", "special": "cmdctl"}
- }
- }
-}
+++ /dev/null
-;; The example NSEC3-signed zone used in RFC5155.
-
-example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
-example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
-example. 3600 IN NS ns1.example.
-example. 3600 IN NS ns2.example.
-example. 3600 IN RRSIG NS 7 1 3600 20150420235959 20051021000000 40430 example. PVOgtMK1HHeSTau+HwDWC8Ts+6C8qtqd4pQJqOtdEVgg+MA+ai4fWDEh u3qHJyLcQ9tbD2vvCnMXjtz6SyObxA==
-example. 3600 IN MX 1 xx.example.
-example. 3600 IN RRSIG MX 7 1 3600 20150420235959 20051021000000 40430 example. GgQ1A9xs47k42VPvpL/a1BWUz/6XsnHkjotw9So8MQtZtl2wJBsnOQsa oHrRCrRbyriEl/GZn9Mto/Kx+wBo+w==
-example. 3600 IN DNSKEY 256 3 7 AwEAAaetidLzsKWUt4swWR8yu0wPHPiUi8LUsAD0QPWU+wzt89epO6tH zkMBVDkC7qphQO2hTY4hHn9npWFRw5BYubE=
-example. 3600 IN DNSKEY 257 3 7 AwEAAcUlFV1vhmqx6NSOUOq2R/dsR7Xm3upJj7IommWSpJABVfW8Q0rO vXdM6kzt+TAu92L9AbsUdblMFin8CVF3n4s=
-example. 3600 IN RRSIG DNSKEY 7 1 3600 20150420235959 20051021000000 12708 example. AuU4juU9RaxescSmStrQks3Gh9FblGBlVU31uzMZ/U/FpsUb8aC6QZS+ sTsJXnLnz7flGOsmMGQZf3bH+QsCtg==
-example. 3600 IN NSEC3PARAM 1 0 12 AABBCCDD
-example. 3600 IN RRSIG NSEC3PARAM 7 1 3600 20150420235959 20051021000000 40430 example. C1Gl8tPZNtnjlrYWDeeUV/sGLCyy/IHie2rerN05XSA3Pq0U3+4VvGWY WdUMfflOdxqnXHwJTLQsjlkynhG6Cg==
-2t7b4g4vsa5smi47k61mv5bv1a22bojr.example. 3600 IN A 192.0.2.127
-2t7b4g4vsa5smi47k61mv5bv1a22bojr.example. 3600 IN RRSIG A 7 2 3600 20150420235959 20051021000000 40430 example. h6c++bzhRuWWt2bykN6mjaTNBcXNq5UuL5EdK+iDP4eY8I0kSiKaCjg3 tC1SQkeloMeub2GWk8p6xHMPZumXlw==
-a.example. 3600 IN NS ns1.a.example.
-a.example. 3600 IN NS ns2.a.example.
-a.example. 3600 IN DS 58470 5 1 3079F1593EBAD6DC121E202A8B766A6A4837206C
-a.example. 3600 IN RRSIG DS 7 2 3600 20150420235959 20051021000000 40430 example. XacFcQVHLVzdoc45EJhN616zQ4mEXtE8FzUhM2KWjfy1VfRKD9r1MeVG wwoukOKgJxBPFsWoo722vZ4UZ2dIdA==
-ns1.a.example. 3600 IN A 192.0.2.5
-ns2.a.example. 3600 IN A 192.0.2.6
-ai.example. 3600 IN A 192.0.2.9
-ai.example. 3600 IN RRSIG A 7 2 3600 20150420235959 20051021000000 40430 example. hVe+wKYMlObTRPhX0NL67GxeZfdxqr/QeR6FtfdAj5+FgYxyzPEjIzvK Wy00hWIl6wD3Vws+rznEn8sQ64UdqA==
-ai.example. 3600 IN HINFO "KLH-10" "ITS"
-ai.example. 3600 IN RRSIG HINFO 7 2 3600 20150420235959 20051021000000 40430 example. Yi42uOq43eyO6qXHNvwwfFnIustWgV5urFcxenkLvs6pKRh00VBjODmf 3Z4nMO7IOl6nHSQ1v0wLHpEZG7Xj2w==
-ai.example. 3600 IN AAAA 2001:db8::f00:baa9
-ai.example. 3600 IN RRSIG AAAA 7 2 3600 20150420235959 20051021000000 40430 example. LcdxKaCB5bGZwPDg+3JJ4O02zoMBrjxqlf6WuaHQZZfTUpb9Nf2nxFGe 2XRPfR5tpJT6GdRGcHueLuXkMjBArQ==
-c.example. 3600 IN NS ns1.c.example.
-c.example. 3600 IN NS ns2.c.example.
-ns1.c.example. 3600 IN A 192.0.2.7
-ns2.c.example. 3600 IN A 192.0.2.8
-ns1.example. 3600 IN A 192.0.2.1
-ns1.example. 3600 IN RRSIG A 7 2 3600 20150420235959 20051021000000 40430 example. bu6kx73n6XEunoVGuRfAgY7EF/AJqHy7hj0jkiqJjB0dOrx3wuz9SaBe GfqWIdn/uta3SavN4FRvZR9SCFHF5Q==
-ns2.example. 3600 IN A 192.0.2.2
-ns2.example. 3600 IN RRSIG A 7 2 3600 20150420235959 20051021000000 40430 example. ktQ3TqE0CfRfki0Rb/Ip5BM0VnxelbuejCC4zpLbFKA/7eD7UNAwxMgx JPtbdST+syjYSJaj4IHfeX6n8vfoGA==
-*.w.example. 3600 IN MX 1 ai.example.
-*.w.example. 3600 IN RRSIG MX 7 2 3600 20150420235959 20051021000000 40430 example. CikebjQwGQPwijVcxgcZcSJKtfynugtlBiKb9FcBTrmOoyQ4InoWVudh CWsh/URX3lc4WRUMivEBP6+4KS3ldA==
-x.w.example. 3600 IN MX 1 xx.example.
-x.w.example. 3600 IN RRSIG MX 7 3 3600 20150420235959 20051021000000 40430 example. IrK3tq/tHFIBF0scHiE/1IwMAvckS/55hAVvQyxTFbkAdDloP3NbZzu+ yoSsr3b3OX6qbBpY7WCtwwekLKRAwQ==
-x.y.w.example. 3600 IN MX 1 xx.example.
-x.y.w.example. 3600 IN RRSIG MX 7 4 3600 20150420235959 20051021000000 40430 example. MqSt5HqJIN8+SLlzTOImrh5h9Xa6gDvAW/GnnbdPc6Z7nXvCpLPJj/5l Cwx3VuzVOjkbvXze8/8Ccl2Zn2hbug==
-xx.example. 3600 IN A 192.0.2.10
-xx.example. 3600 IN RRSIG A 7 2 3600 20150420235959 20051021000000 40430 example. T35hBWEZ017VC5u2c4OriKyVn/pu+fVK4AlXYOxJ6iQylfV2HQIKjv6b 7DzINB3aF/wjJqgXpQvhq+Ac6+ZiFg==
-xx.example. 3600 IN HINFO "KLH-10" "TOPS-20"
-xx.example. 3600 IN RRSIG HINFO 7 2 3600 20150420235959 20051021000000 40430 example. KimG+rDd+7VA1zRsu0ITNAQUTRlpnsmqWrihFRnU+bRa93v2e5oFNFYC s3Rqgv62K93N7AhW6Jfqj/8NzWjvKg==
-xx.example. 3600 IN AAAA 2001:db8::f00:baaa
-xx.example. 3600 IN RRSIG AAAA 7 2 3600 20150420235959 20051021000000 40430 example. IXBcXORITNwd8h3gNwyxtYFvAupS/CYWufVeuBUX0O25ivBCULjZjpDx FSxfohb/KA7YRdxENzYfMItpILl/Xw==
-0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN NSEC3 1 1 12 AABBCCDD 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR NS SOA MX RRSIG DNSKEY NSEC3PARAM
-0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. OSgWSm26B+cS+dDL8b5QrWr/dEWhtCsKlwKLIBHYH6blRxK9rC0bMJPw Q4mLIuw85H2EY762BOCXJZMnpuwhpA==
-2t7b4g4vsa5smi47k61mv5bv1a22bojr.example. 3600 IN NSEC3 1 1 12 AABBCCDD 2VPTU5TIMAMQTTGL4LUU9KG21E0AOR3S A RRSIG
-2t7b4g4vsa5smi47k61mv5bv1a22bojr.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. OmBvJ1Vgg1hCKMXHFiNeIYHK9XVW0iLDLwJN4TFoNxZuP03gAXEI634Y wOc4YBNITrj413iqNI6mRk/r1dOSUw==
-2vptu5timamqttgl4luu9kg21e0aor3s.example. 3600 IN NSEC3 1 1 12 AABBCCDD 35MTHGPGCU1QG68FAB165KLNSNK3DPVL MX RRSIG
-2vptu5timamqttgl4luu9kg21e0aor3s.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. KL1V2oFYghNV0Hm7Tf2vpJjM6l+0g1JCcVYGVfI0lKrhPmTsOA96cLEA Cgo1x8I7kApJX+obTuktZ+sdsZPY1w==
-35mthgpgcu1qg68fab165klnsnk3dpvl.example. 3600 IN NSEC3 1 1 12 AABBCCDD B4UM86EGHHDS6NEA196SMVMLO4ORS995 NS DS RRSIG
-35mthgpgcu1qg68fab165klnsnk3dpvl.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. g6jPUUpduAJKRljUsN8gB4UagAX0NxY9shwQAynzo8EUWH+z6hEIBlUT PGj15eZll6VhQqgZXtAIR3chwgW+SA==
-b4um86eghhds6nea196smvmlo4ors995.example. 3600 IN NSEC3 1 1 12 AABBCCDD GJEQE526PLBF1G8MKLP59ENFD789NJGI MX RRSIG
-b4um86eghhds6nea196smvmlo4ors995.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. ZkPG3M32lmoHM6pa3D6gZFGB/rhL//Bs3Omh5u4m/CUiwtblEVOaAKKZ d7S959OeiX43aLX3pOv0TSTyiTxIZg==
-gjeqe526plbf1g8mklp59enfd789njgi.example. 3600 IN NSEC3 1 1 12 AABBCCDD JI6NEOAEPV8B5O6K4EV33ABHA8HT9FGC A HINFO AAAA RRSIG
-gjeqe526plbf1g8mklp59enfd789njgi.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. IVnezTJ9iqblFF97vPSmfXZ5Zozngx3KX3byLTZC4QBH2dFWhf6scrGF ZB980AfCxoD9qbbKDy+rdGIeRSVNyw==
-ji6neoaepv8b5o6k4ev33abha8ht9fgc.example. 3600 IN NSEC3 1 1 12 AABBCCDD K8UDEMVP1J2F7EG6JEBPS17VP3N8I58H
-ji6neoaepv8b5o6k4ev33abha8ht9fgc.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. gPkFp1s2QDQ6wQzcg1uSebZ61W33rUBDcTj72F3kQ490fEdp7k1BUIfb cZtPbX3YCpE+sIt0MpzVSKfTwx4uYA==
-k8udemvp1j2f7eg6jebps17vp3n8i58h.example. 3600 IN NSEC3 1 1 12 AABBCCDD KOHAR7MBB8DC2CE8A9QVL8HON4K53UHI
-k8udemvp1j2f7eg6jebps17vp3n8i58h.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. FtXGbvF0+wf8iWkyo73enAuVx03klN+pILBKS6qCcftVtfH4yVzsEZqu J27NHR7ruxJWDNMtOtx7w9WfcIg62A==
-kohar7mbb8dc2ce8a9qvl8hon4k53uhi.example. 3600 IN NSEC3 1 1 12 AABBCCDD Q04JKCEVQVMU85R014C7DKBA38O0JI5R A RRSIG
-kohar7mbb8dc2ce8a9qvl8hon4k53uhi.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. VrDXs2uVW21N08SyQIz88zml+y4ZCInTwgDr6zz43yAg+LFERjOrj3Oj ct51ac7Dp4eZbf9FQJazmASFKGxGXg==
-q04jkcevqvmu85r014c7dkba38o0ji5r.example. 3600 IN NSEC3 1 1 12 AABBCCDD R53BQ7CC2UVMUBFU5OCMM6PERS9TK9EN A RRSIG
-q04jkcevqvmu85r014c7dkba38o0ji5r.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. hV5I89b+4FHJDATp09g4bbN0R1F845CaXpL3ZxlMKimoPAyqletMlEWw LfFia7sdpSzn+ZlNNlkxWcLsIlMmUg==
-r53bq7cc2uvmubfu5ocmm6pers9tk9en.example. 3600 IN NSEC3 1 1 12 AABBCCDD T644EBQK9BIBCNA874GIVR6JOJ62MLHV MX RRSIG
-r53bq7cc2uvmubfu5ocmm6pers9tk9en.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. aupviViruXs4bDg9rCbezzBMf9h1ZlDvbW/CZFKulIGXXLj8B/fsDJar XVDA9bnUoRhEbKp+HF1FWKW7RIJdtQ==
-t644ebqk9bibcna874givr6joj62mlhv.example. 3600 IN NSEC3 1 1 12 AABBCCDD 0P9MHAVEQVM6T7VBL5LOP2U3T2RP3TOM A HINFO AAAA RRSIG
-t644ebqk9bibcna874givr6joj62mlhv.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. RAjGECB8P7O+F4Pa4Dx3tC0M+Z3KmlLKImcafb9XWwx+NWUNz7NBEDBQ HivIyKPVDkChcePIX1xPl1ATNa+8Dw==
+++ /dev/null
-/resolver_basic.config
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "severity": "DEBUG",
- "name": "*",
- "debuglevel": 99
- } ]
- },
- "Resolver": {
- "query_acl": [ {
- "action": "REJECT",
- "from": "127.0.0.1"
- } ],
- "listen_on": [ {
- "port": 56176,
- "address": "127.0.0.1"
- } ]
- },
- "Init": {
- "components": {
- "b10-resolver": {
- "kind": "needed"
- },
- "b10-cmdctl": {
- "kind": "needed",
- "special": "cmdctl"
- }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "database_file": "data/root.sqlite3",
- "listen_on": [ {
- "port": 56176,
- "address": "127.0.0.1"
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "sqlite3",
- "cache-enable": false,
- "params": {
- "database_file": "data/root.sqlite3"
- }
- }
- ]
- }
- },
- "Stats": {
- "poll-interval": 60
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-stats": { "address": "Stats", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [{
- "severity": "DEBUG",
- "name": "*",
- "debuglevel": 99
- }]
- },
- "Auth": {
- "listen_on": [{
- "port": 56176,
- "address": "127.0.0.1"
- }]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "MasterFiles",
- "cache-enable": true,
- "params": {
- "example.org": "data/example.org"
- }
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-stats": { "address": "Stats", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-/retransfer_master.conf
-/retransfer_master_nons.conf
-/retransfer_slave.conf
-/retransfer_slave_notify.conf
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "database_file": "data/inmem-xfrin.sqlite3",
- "listen_on": [ {
- "address": "::1",
- "port": 56176
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [
- {
- "type": "sqlite3",
- "params": {
- "database_file": "data/inmem-xfrin.sqlite3"
- },
- "cache-enable": true,
- "cache-zones": [
- "example.org"
- ]
- }
- ]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "database_file": "data/example.org.sqlite3",
- "listen_on": [ {
- "address": "::1",
- "port": 56177
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [{
- "type": "sqlite3",
- "params": {
- "database_file": "data/example.org.sqlite3"
- }
- }]
- }
- },
- "Xfrout": {
- "zone_config": [ {
- "origin": "example.org"
- } ],
- "also_notify": [ {
- "address": "::1",
- "port": 56176
- } ]
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-stats": { "address": "Stats", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "database_file": "data/xfrin-diffs.sqlite3",
- "listen_on": [ {
- "address": "::1",
- "port": 56177
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [{
- "type": "sqlite3",
- "params": {
- "database_file": "data/xfrin-diffs.sqlite3"
- }
- }]
- }
- },
- "Xfrout": {
- "zone_config": [ {
- "origin": "example."
- } ],
- "also_notify": [ {
- "address": "::1",
- "port": 56176
- } ]
- },
- "Stats": {
- "poll-interval": 1
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "database_file": "data/example.org-nons.sqlite3",
- "listen_on": [ {
- "address": "::1",
- "port": 56177
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [{
- "type": "sqlite3",
- "params": {
- "database_file": "data/example.org-nons.sqlite3"
- }
- }]
- }
- },
- "Xfrout": {
- "zone_config": [ {
- "origin": "example.org"
- } ],
- "also_notify": [ {
- "address": "::1",
- "port": 56176
- } ]
- },
- "Stats": {
- "poll-interval": 1
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-stats": { "address": "Stats", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "database_file": "data/example.org.sqlite3",
- "listen_on": [ {
- "address": "127.0.0.1",
- "port": 56179
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [{
- "type": "sqlite3",
- "params": {
- "database_file": "data/example.org.sqlite3"
- }
- }]
- }
- },
- "Xfrout": {
- "zone_config": [ {
- "origin": "example.org"
- } ],
- "also_notify": [ {
- "address": "127.0.0.1",
- "port": 56176
- } ]
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-stats": { "address": "Stats", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "listen_on": [ {
- "address": "::1",
- "port": 56176
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [{
- "type": "sqlite3",
- "params": {
- "database_file": "data/test_nonexistent_db.sqlite3"
- }
- }]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "listen_on": [ {
- "address": "::1",
- "port": 56176
- } ]
- },
- "Xfrin": {
- "zones": [ {
- "name": "example",
- "master_addr": "::1",
- "master_port": 56177
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [{
- "type": "sqlite3",
- "params": {
- "database_file": "data/xfrin-before-diffs.sqlite3"
- }
- }]
- }
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "listen_on": [ {
- "address": "::1",
- "port": 56176
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [{
- "type": "sqlite3",
- "params": {
- "database_file": "data/xfrin-notify.sqlite3"
- }
- }]
- }
- },
- "Xfrin": {
- "zones": [ {
- "name": "example.org",
- "master_addr": "::1",
- "master_port": 56177,
- "request_ixfr": "no"
- } ]
- },
- "Zonemgr": {
- "secondary_zones": [ {
- "name": "example.org",
- "class": "IN"
- } ]
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-stats": { "address": "Stats", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "listen_on": [ {
- "address": "127.0.0.1",
- "port": 56176
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [{
- "type": "sqlite3",
- "params": {
- "database_file": "data/xfrin-notify.sqlite3"
- }
- }]
- }
- },
- "Xfrin": {
- "zones": [ {
- "name": "example.org",
- "master_addr": "127.0.0.1",
- "master_port": 56179,
- "request_ixfr": "no"
- } ]
- },
- "Zonemgr": {
- "secondary_zones": [ {
- "name": "example.org",
- "class": "IN"
- } ]
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-stats": { "address": "Stats", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-{
- "version": 3,
- "Logging": {
- "loggers": [ {
- "debuglevel": 99,
- "severity": "DEBUG",
- "name": "*"
- } ]
- },
- "Auth": {
- "database_file": "data/xfrout.sqlite3",
- "listen_on": [ {
- "address": "::1",
- "port": 56176
- } ]
- },
- "data_sources": {
- "classes": {
- "IN": [{
- "type": "sqlite3",
- "params": {
- "database_file": "data/xfrout.sqlite3"
- }
- }]
- }
- },
- "Xfrout": {
- "zone_config": [ {
- "origin": "example.org"
- } ]
- },
- "Init": {
- "components": {
- "b10-auth": { "kind": "needed", "special": "auth" },
- "b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
- "b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
- "b10-stats": { "address": "Stats", "kind": "dispensable" },
- "b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
- }
- }
-}
+++ /dev/null
-/inmem-xfrin.sqlite3
-/root.sqlite3
-/test_nonexistent_db.sqlite3
-/xfrin-before-diffs.sqlite3
-/xfrin-notify.sqlite3
+++ /dev/null
-!echo shouldshow
-# just add something so the test can verify it's reverted
-config add /Init/components b10-auth
-config set /Init/components/b10-auth/kind needed
-config set /Init/components/b10-auth/special auth
-bad command
-# this should not be reached
-!echo shouldnotshow
-config commit
+++ /dev/null
-# this is a comment: commentexample1
-!echo this is an echo: echoexample2
-!verbose on
-# this is a comment with verbose on: verbosecommentexample3
-!verbose off
-# this is a comment with verbose off again: commentexample4
-# empty lines and lines with only whitespace should be ignored
-
-
-
-
-
-# directives are case insensitive, and should handle whitespace
-!ECHO echoexample5
-!eChO echoexample6
-!Verbose ON
-# verbosecommentexample7
-!verBOSE off
-# commentexample8
+++ /dev/null
-# include a different file
-execute file data/commands/nested1
+++ /dev/null
-# this is included by nested
-!echo shouldshow
+++ /dev/null
-/example.org.sqlite3
+++ /dev/null
-example.com. 3600 IN SOA ns1.example.com. admin.example.com. 1234 3600 1800 2419200 7200
-example.com. 3600 IN NS ns1.example.com.
-example.com. 3600 IN NS ns2.example.com.
-example.com. 3600 IN MX 10 mail.example.com.
-www.example.com. 3600 IN A 192.0.2.1
-ns1.example.com. 3600 IN A 192.0.2.3
-ns2.example.com. 3600 IN A 192.0.2.4
-
-;; DNAME + NS (non-apex) throws ZoneDataUpdater::AddError
-ns1.example.com. 3600 IN DNAME foo.example.com.
-ns1.example.com. 3600 IN NS bar.example.com.
+++ /dev/null
-example.org. 3600 IN SOA ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
-example.org. 3600 IN NS ns1.example.org.
-example.org. 3600 IN NS ns2.example.org.
-example.org. 3600 IN MX 10 mail.example.org.
-www.example.org. 3600 IN A 192.0.2.1
-mail.example.org. 3600 IN A 192.0.2.10
-sub.example.org. 3600 IN NS ns.sub.example.org.
-ns.sub.example.org. 3600 IN A 192.0.2.101
-dname.example.org. 3600 IN DNAME dname.example.info.
-dname2.foo.example.org. 3600 IN DNAME dname2.example.info.
-ns1.example.org. 3600 IN A 192.0.2.3
-ns2.example.org. 3600 IN A 192.0.2.4
-shell.example.org. 3600 IN SSHFP 2 1 123456789abcdef67890123456789abcdef67890
+++ /dev/null
-$ORIGIN example.org.
-example.org. 3600 IN SOA ns1.example.org. admin.example.org. 12341 3600 1800 2419200 7200
-$GENERATE 1-2 @ NS ns$.example.org.
-$GENERATE 1-4 host$ A 192.0.2.$
+++ /dev/null
-example.org. 3600 IN SOA ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
-example.org. 3600 IN NS ns1.example.org.
-example.org. 3600 IN NS ns2.example.org.
-example.org. 3600 IN MX 10 mail.example.org.
-www.example.org. 3600 IN A 192.0.2.63
-ns1.example.org. 3600 IN A 192.0.2.3
-ns2.example.org. 3600 IN A 192.0.2.4
+++ /dev/null
-/zones.sqlite3
+++ /dev/null
-BIND. 3600 CH SOA BIND. BIND. 3 3600 300 36000 3600
-BIND. 3600 CH NS BIND.
-VERSION.BIND. 3600 CH TXT "10"
+++ /dev/null
-/resolver_basic.feature
+++ /dev/null
-Feature: Authoritative DNS server with a bad zone
- This feature set is for testing the execution of the b10-auth
- component when one zone is broken, whereas others are fine. In this
- case, b10-auth should not reject the data source, but reject the bad
- zone only (with SERVFAIL) and serve the good zones anyway.
-
- Scenario: Bad zone
- Given I have bind10 running with configuration auth/auth_badzone.config
-
- # loading example.com, example.net and example.info zones fail.
- # Note: wait for these messages right away as otherwise they
- # will be logged and we cannot use the 'new' keyword to wait for
- # 3 different log messages. *There could still be a race here if
- # auth starts very quickly.*
- And wait for new bind10 stderr message DATASRC_LOAD_ZONE_ERROR
- And wait for new bind10 stderr message DATASRC_LOAD_ZONE_ERROR
- And wait for new bind10 stderr message DATASRC_LOAD_ZONE_ERROR
-
- 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
-
- A query for www.example.org should have rcode NOERROR
- 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
-
- The answer section of the last query response should be
- """
- www.example.org. 3600 IN A 192.0.2.1
- """
- The authority section of the last query response should be
- """
- example.org. 3600 IN NS ns1.example.org.
- example.org. 3600 IN NS ns2.example.org.
- """
- The additional section of the last query response should be
- """
- ns1.example.org. 3600 IN A 192.0.2.3
- ns2.example.org. 3600 IN A 192.0.2.4
- """
-
- A query for www.example.com should have rcode SERVFAIL
- A query for www.example.net should have rcode SERVFAIL
- A query for www.example.info should have rcode SERVFAIL
+++ /dev/null
-Feature: Basic Authoritative DNS server
- This feature set is for testing the execution of the b10-auth
- component using its default datasource configurations. This
- will start it and perform queries against it.
-
- Scenario: Query builtin bind zone
- Given I have bind10 running with configuration auth/auth_basic.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
-
- A query for example.com should have rcode REFUSED
- A query for version.bind type TXT class CH should have rcode NOERROR
- A query for authors.bind type TXT class CH should have rcode NOERROR
-
- # TODO: to be compatible with BIND 9
- # A query for nonexistent.bind type TXT class CH should have rcode REFUSED
+++ /dev/null
-Feature: control with bindctl
- Assorted tests using bindctl for the administration of BIND 10.
-
-
- Scenario: Removing modules
- # This test runs the original example configuration, which has
- # a number of modules. It then removes all non-essential modules,
- # and checks whether they do disappear from the list of running
- # modules (note that it 'misuses' the help command for this,
- # there is a Init command 'show_processes' but it's output is
- # currently less standardized than 'help')
- Given I have bind10 running with configuration bindctl_commands.config
- And wait for bind10 stderr message BIND10_STARTED_CC
- And wait for bind10 stderr message CMDCTL_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
- And wait for bind10 stderr message AUTH_SERVER_STARTED
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message XFROUT_STARTED
- And wait for bind10 stderr message STATS_STARTING
- And wait for bind10 stderr message STATSHTTPD_STARTED
-
- Then remove bind10 configuration Init/components/NOSUCHMODULE
- last bindctl output should contain Error
-
- bind10 module Xfrout should be running
- bind10 module Stats should be running
- bind10 module Zonemgr should be running
- bind10 module Xfrin should be running
- bind10 module Auth should be running
- bind10 module StatsHttpd should be running
- bind10 module Resolver should not be running
-
- Then remove bind10 configuration Init/components value b10-xfrout
- And wait for new bind10 stderr message BIND10_PROCESS_ENDED
- last bindctl output should not contain Error
-
- # assuming it won't error for further modules (if it does, the final
- # 'should not be running' tests would fail anyway)
- Then remove bind10 configuration Init/components value b10-stats-httpd
- And wait for new bind10 stderr message BIND10_PROCESS_ENDED
- last bindctl output should not contain Error
-
- Then remove bind10 configuration Init/components value b10-stats
- And wait for new bind10 stderr message BIND10_PROCESS_ENDED
- last bindctl output should not contain Error
-
- Then remove bind10 configuration Init/components value b10-zonemgr
- And wait for new bind10 stderr message BIND10_PROCESS_ENDED
- last bindctl output should not contain Error
-
- Then remove bind10 configuration Init/components value b10-xfrin
- And wait for new bind10 stderr message BIND10_PROCESS_ENDED
- last bindctl output should not contain Error
-
- Then remove bind10 configuration Init/components value b10-auth
- And wait for new bind10 stderr message BIND10_PROCESS_ENDED
- last bindctl output should not contain Error
-
- # After these ^^^ have been stopped...
- bind10 module Xfrout should not be running
- bind10 module Zonemgr should not be running
- bind10 module Xfrin should not be running
- bind10 module Auth should not be running
- bind10 module StatsHttpd should not be running
- bind10 module Stats should not be running
- bind10 module Resolver should not be running
-
- Scenario: Executing scripts from files
- # This test tests the 'execute' command, which reads and executes
- # bindctl commands from a file
- Given I have bind10 running with configuration bindctl/bindctl.config
- And wait for bind10 stderr message BIND10_STARTED_CC
- And wait for bind10 stderr message CMDCTL_STARTED
-
- # first a few bad commands
- When I send bind10 the command execute
- last bindctl output should contain Error
- When I send bind10 the command execute file
- last bindctl output should contain Error
- When I send bind10 the command execute file data/commands/nosuchfile
- last bindctl output should contain Error
-
- # empty list should be no-op
- When I send bind10 the command execute file data/commands/empty
- last bindctl output should not contain Error
-
- # some tests of directives like !echo and !verbose
- When I send bind10 the command execute file data/commands/directives
- last bindctl output should not contain Error
- last bindctl output should not contain commentexample1
- last bindctl output should contain echoexample2
- last bindctl output should contain verbosecommentexample3
- last bindctl output should not contain commentexample4
- last bindctl output should contain echoexample5
- last bindctl output should contain echoexample6
- last bindctl output should contain verbosecommentexample7
- last bindctl output should not contain commentexample8
-
- # bad_command contains a bad command, at which point execution should stop
- When I send bind10 the command execute file data/commands/bad_command
- last bindctl output should contain shouldshow
- last bindctl output should contain Error
- last bindctl output should not contain shouldnotshow
- # This would fail if the entire list was passed, or the configuration
- # was committed
- send bind10 the command config show Init/components
- last bindctl output should not contain b10-auth
-
- # nested_command contains another execute script
- When I send bind10 the command execute file data/commands/nested
- last bindctl output should contain shouldshow
- last bindctl output should not contain Error
-
- # show commands from a file
- When I send bind10 the command execute file data/commands/bad_command show
- last bindctl output should not contain Error
- last bindctl output should contain shouldshow
- last bindctl output should contain shouldnotshow
-
- Scenario: Executing builting script init_authoritative_server
- Given I have bind10 running with configuration bindctl/bindctl.config
- And wait for bind10 stderr message BIND10_STARTED_CC
- And wait for bind10 stderr message CMDCTL_STARTED
-
- When I send bind10 the command execute init_authoritative_server show
- # just test some parts of the output
- last bindctl output should contain /Init/components/b10-auth/special
- last bindctl output should contain /Init/components/b10-zonemgr/kind
- last bindctl output should contain Please
-
- # nothing should have been changed
- When I send bind10 the command config diff
- last bindctl output should contain {}
-
- # ok now make sure modules aren't running, execute it, and make
- # sure modules are running
- bind10 module Auth should not be running
- bind10 module Xfrout should not be running
- bind10 module Xfrin should not be running
- bind10 module Zonemgr should not be running
-
- When I send bind10 the following commands:
- """
- execute init_authoritative_server
- config commit
- """
- And wait for bind10 stderr message AUTH_SERVER_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message XFROUT_STARTED
-
- last bindctl output should not contain Error
- bind10 module Auth should be running
- bind10 module Xfrout should be running
- bind10 module Xfrin should be running
- bind10 module Zonemgr should be running
-
- Scenario: Shutting down a certain module
- # We could test with several modules, but for now we are particularly
- # interested in shutting down cmdctl. It previously caused hangup,
- # so this scenario confirms it's certainly fixed. Note: since cmdctl
- # is a "needed" component, shutting it down will result in system
- # shutdown. So "send bind10 command" will fail (it cannot complete
- # "quit").
- Given I have bind10 running with configuration bindctl/bindctl.config
- And wait for bind10 stderr message BIND10_STARTED_CC
- And wait for bind10 stderr message CMDCTL_STARTED
-
- When I send bind10 ignoring failure the command Cmdctl shutdown
- And wait for bind10 stderr message CMDCTL_EXITING
- And wait for bind10 stderr message BIND10_SHUTDOWN_COMPLETE
+++ /dev/null
-Feature: DDNS System
- A number of BIND10-specific DDNS tests, that do not fall under the
- 'compliance' category; specific ACL checks, module checks, etc.
-
- Scenario: Module tests
- # The given config has b10-ddns disabled
- Given I have bind10 running with configuration ddns/noddns.config
- And wait for bind10 stderr message BIND10_STARTED_CC
- And wait for bind10 stderr message AUTH_SERVER_STARTED
-
- # Sanity check
- bind10 module DDNS should not be running
-
- # Test 1
- When I use DDNS to set the SOA serial to 1235
- # Note: test spec says refused here, system returns NOTIMP
- The DDNS response should be NOTIMP
- And the SOA serial for example.org should be 1234
-
- # Test 2
- When I configure bind10 to run DDNS
- And wait for new bind10 stderr message DDNS_STARTED
- bind10 module DDNS should be running
-
- # Test 3
- When I use DDNS to set the SOA serial to 1236
- The DDNS response should be REFUSED
- And the SOA serial for example.org should be 1234
-
- # Test 4
- When I send bind10 the following commands
- """
- config add DDNS/zones
- config set DDNS/zones[0]/origin example.org
- config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "from": "127.0.0.1"}
- config commit
- """
-
- # Test 5
- When I use DDNS to set the SOA serial to 1237
- # also check if Auth server reloaded
- And wait for new bind10 stderr message AUTH_DATASRC_CLIENTS_BUILDER_LOAD_ZONE
- The DDNS response should be SUCCESS
- And the SOA serial for example.org should be 1237
-
- # Test 6
- When I send bind10 the command DDNS shutdown
- And wait for new bind10 stderr message DDNS_STOPPED
-
- # Test 7
- # Init should restart it
- And wait for new bind10 stderr message DDNS_STARTED
-
- # Test 8
- When I use DDNS to set the SOA serial to 1238
- And wait for new bind10 stderr message AUTH_DATASRC_CLIENTS_BUILDER_LOAD_ZONE
- The DDNS response should be SUCCESS
- And the SOA serial for example.org should be 1238
-
- When I use DDNS to set the SOA serial to 1239
- And wait for new bind10 stderr message AUTH_DATASRC_CLIENTS_BUILDER_LOAD_ZONE
- The DDNS response should be SUCCESS
- And the SOA serial for example.org should be 1239
-
- # Test 9
- When I send bind10 the command Auth shutdown
- And wait for new bind10 stderr message AUTH_SHUTDOWN
- # Init should restart it automatically
- And wait for new bind10 stderr message AUTH_SERVER_STARTED
-
- # Test 10
- When I use DDNS to set the SOA serial to 1240
- And wait for new bind10 stderr message AUTH_DATASRC_CLIENTS_BUILDER_LOAD_ZONE
- The DDNS response should be SUCCESS
- And the SOA serial for example.org should be 1240
-
- # Test 11
- When I configure BIND10 to stop running DDNS
- And wait for new bind10 stderr message DDNS_STOPPED
-
- bind10 module DDNS should not be running
-
- # Test 12
- When I use DDNS to set the SOA serial to 1241
- # should this be REFUSED again?
- The DDNS response should be NOTIMP
- And the SOA serial for example.org should be 1240
-
- Scenario: ACL
- Given I have bind10 running with configuration ddns/ddns.config
- And wait for bind10 stderr message BIND10_STARTED_CC
- And wait for bind10 stderr message AUTH_SERVER_STARTED
- And wait for bind10 stderr message DDNS_STARTED
-
- # Sanity check
- A query for new1.example.org should have rcode NXDOMAIN
- A query for new2.example.org should have rcode NXDOMAIN
- A query for new3.example.org should have rcode NXDOMAIN
- The SOA serial for example.org should be 1234
-
- # Test 1
- When I use DDNS to add a record new1.example.org. 3600 IN A 192.0.2.1
- The DDNS response should be SUCCESS
- A query for new1.example.org should have rcode NOERROR
- The SOA serial for example.org should be 1235
-
- # Test 2
- When I set DDNS ACL 0 for 127.0.0.1 to REJECT
- Then use DDNS to add a record new2.example.org. 3600 IN A 192.0.2.2
- The DDNS response should be REFUSED
- A query for new2.example.org should have rcode NXDOMAIN
- The SOA serial for example.org should be 1235
-
- # Test 3
- When I set DDNS ACL 0 for 127.0.0.1 to ACCEPT
- Then use DDNS to add a record new3.example.org. 3600 IN A 192.0.2.3
- The DDNS response should be SUCCESS
- A query for new3.example.org should have rcode NOERROR
- The SOA serial for example.org should be 1236
-
- Scenario: Zone validation check
- Given I have bind10 running with configuration ddns/ddns.config
- And wait for bind10 stderr message BIND10_STARTED_CC
- And wait for bind10 stderr message AUTH_SERVER_STARTED
- And wait for bind10 stderr message DDNS_STARTED
-
- # Sanity check
- A query for example.org type NS should have rcode NOERROR
- The answer section of the last query response should be
- """
- example.org. 3600 IN NS ns1.example.org.
- example.org. 3600 IN NS ns2.example.org.
- example.org. 3600 IN NS ns3.example.org.
- """
- The SOA serial for example.org should be 1234
-
- # Test failed validation. Here, example.org has ns1.example.org
- # configured as a name server. CNAME records cannot be added for
- # ns1.example.org.
- When I use DDNS to add a record ns1.example.org. 3600 IN CNAME ns3.example.org.
- The DDNS response should be REFUSED
- A query for ns1.example.org type CNAME should have rcode NXDOMAIN
- The SOA serial for example.org should be 1234
-
- # Test passed validation. Here, example.org does not have
- # ns4.example.org configured as a name server. CNAME records can
- # be added for ns4.example.org.
- When I use DDNS to add a record ns4.example.org. 3600 IN CNAME ns3.example.org.
- The DDNS response should be SUCCESS
- A query for ns4.example.org type CNAME should have rcode NOERROR
- The answer section of the last query response should be
- """
- ns4.example.org. 3600 IN CNAME ns3.example.org.
- """
- The SOA serial for example.org should be 1235
-
- #Scenario: DDNS and Xfrout
- ## Unfortunately, Xfrout can only notify to inzone slaves, and hence only
- ## to port 53, which we do not want to use for Lettuce tests (for various
- ## reasons). So for now this test is only an outline, the configs
- ## themselves have not been set up yet
- # When I start bind10 with configuration ddns/primary.config as primary
- # And wait for primary stderr message AUTH_SERVER_STARTED
- # And wait for primary stderr message XFROUT_STARTED
- # And wait for primary stderr message DDNS_STARTED
-
- # And I start bind10 with configuration example2.org.config with cmdctl port 56174 as secondary
- # And wait for secondary stderr message AUTH_SERVER_STARTED
- # And wait for secondary stderr message XFRIN_STARTED
-
- # # Sanity check
- # The SOA serial for example.org should be 1234
- # The SOA serial for example.org at 127.0.0.1:56177 should be 1234
-
- # When I use DDNS to set the SOA serial to 1235
- # The DDNS response should be SUCCESS
-
- # The SOA serial for example.org should be 1235
- # The SOA serial for example.org at 127.0.0.1:56177 should be 1235
+++ /dev/null
-Feature: default bind10 config
- Tests for the default configuration of bind10.
-
- Scenario: Check that only the default components are running
- Given I have bind10 running with configuration default.config
- And wait for bind10 stderr message BIND10_STARTED_CC
- And wait for bind10 stderr message CMDCTL_STARTED
- And wait for bind10 stderr message STATS_STARTING
-
- # These should be running
- bind10 module Init should be running
- And bind10 module Logging should be running
- And bind10 module Stats should be running
-
- # These should not be running
- 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 Auth should not be running
- And bind10 module StatsHttpd should not be running
+++ /dev/null
-Feature: Example feature
- This is an example Feature set. Is is mainly intended to show
- our use of the lettuce tool and our own framework for it
- The first scenario is to show what a simple test would look like, and
- is intentionally uncommented.
- The later scenarios have comments to show what the test steps do and
- support
-
- Scenario: A simple example
- 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
- A query for www.doesnotexist.org should have rcode REFUSED
- The SOA serial for example.org should be 1234
-
- Scenario: New database
- # This test checks whether a database file is automatically created
- # Underwater, we take advantage of our initialization routines so
- # that we are sure this file does not exist, see
- # features/terrain/terrain.py
-
- # Standard check to test (non-)existence of a file.
- # This file is actually automatically created.
- The file data/test_nonexistent_db.sqlite3 should not exist
-
- # In the first scenario, we used 'given I have bind10 running', which
- # is actually a compound step consisting of the following two
- # one to start the server
- When I start bind10 with configuration no_db_file.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
-
- # Now we use the first step again to see if the file has been created
- The file data/test_nonexistent_db.sqlite3 should exist
-
- 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
-
- # This is a general step to stop a named process. By convention,
- # the default name for any process is the same as the one we
- # use in the start step (for bind 10, that is 'I start bind10 with')
- # See scenario 'Multiple instances' for more.
- Then stop process bind10
-
- Scenario: example.org queries
- # This scenario performs a number of queries and inspects the results
- # Simple queries have already been show, but after we have sent a query,
- # we can also do more extensive checks on the result.
- # See querying.py for more information on these steps.
-
- # note: lettuce can group similar checks by using tables, but we
- # intentionally do not make use of that here
-
- # This is a compound statement that starts and waits for the
- # started message
- 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
-
- # Some simple queries that is not examined further
- A query for www.example.com should have rcode REFUSED
- A query for www.example.org should have rcode NOERROR
-
- # A query where we look at some of the result properties
- 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 answer section can be inspected in its entirety; in the future
- # we may add more granular inspection steps
- The answer section of the last query response should be
- """
- www.example.org. 3600 IN A 192.0.2.1
- """
-
- A query for example.org type NS should have rcode NOERROR
- The answer section of the last query response should be
- """
- example.org. 3600 IN NS ns1.example.org.
- example.org. 3600 IN NS ns2.example.org.
- example.org. 3600 IN NS ns3.example.org.
- """
-
- # We have a specific step for checking SOA serial numbers
- The SOA serial for example.org should be 1234
-
- # Another query where we look at some of the result properties
- A query for doesnotexist.example.org should have rcode NXDOMAIN
- The last query response should have qdcount 1
- The last query response should have ancount 0
- The last query response should have nscount 1
- 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
-
- A query for www.example.org type TXT should have rcode NOERROR
- The last query response should have ancount 0
-
- # Some queries where we specify more details about what to send and
- # where
- A query for www.example.org class CH should have rcode REFUSED
- A query for www.example.org to 127.0.0.1 should have rcode NOERROR
- A query for www.example.org to 127.0.0.1:56176 should have rcode NOERROR
- A query for www.example.org type A class IN to 127.0.0.1:56176 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
- # This scenario contains a lot of 'wait for' steps
- # If those are not present, the asynchronous nature of the application
- # can cause some of the things we send to be handled out of order;
- # for instance auth could still be serving the old zone when we send
- # the new query, or already respond from the new database.
- # Therefore we wait for specific log messages after each operation
- #
- # This scenario outlines every single step, and does not use
- # 'steps of steps' (e.g. Given I have bind10 running)
- # We can do that but as an example this is probably better to learn
- # the system
-
- When I start bind10 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
- Wait for new bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
- Then set bind10 configuration data_sources/classes/IN[0]/params to {"database_file": "data/empty_db.sqlite3"}
- # The 'not missing placeholder' check is for #2743
- And wait for new bind10 stderr message DATASRC_SQLITE_CONNOPEN not Missing placeholder
- A query for www.example.org should have rcode REFUSED
- Wait for new bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
- Then set bind10 configuration data_sources/classes/IN[0]/params to {"database_file": "data/example.org.sqlite3"}
- # The 'not missing placeholder' check is for #2743
- And wait for new bind10 stderr message DATASRC_SQLITE_CONNOPEN not Missing placeholder
- A query for www.example.org should have rcode NOERROR
-
- Scenario: two bind10 instances
- # This is more a test of the test system, start 2 bind10's
- When I start bind10 with configuration example.org.config as bind10_one
- And wait for bind10_one stderr message BIND10_STARTED_CC
- And wait for bind10_one stderr message CMDCTL_STARTED
- And wait for bind10_one stderr message AUTH_SERVER_STARTED
-
- And I start bind10 with configuration example2.org.config with cmdctl port 56174 as bind10_two
- And wait for bind10_two stderr message BIND10_STARTED_CC
- And wait for bind10_two stderr message CMDCTL_STARTED
- And wait for bind10_two stderr message AUTH_SERVER_STARTED
-
- A query for www.example.org to 127.0.0.1:56176 should have rcode NOERROR
- A query for www.example.org to [::1]:56177 should have rcode NOERROR
- The SOA serial for example.org should be 1234
- The SOA serial for example.org at 127.0.0.1:56176 should be 1234
- The SOA serial for example.org at ::1:56177 should be 1234
-
- Then set bind10 configuration data_sources/classes/IN[0]/params to {"database_file": "data/empty_db.sqlite3"}
- And wait for bind10_one stderr message DATASRC_SQLITE_CONNOPEN
-
- A query for www.example.org to 127.0.0.1:56176 should have rcode REFUSED
- A query for www.example.org to [::1]:56177 should have rcode NOERROR
+++ /dev/null
-Feature: In-memory zone using SQLite3 backend
- This feature tests the authoritative server configured with an in-memory
- data source that uses the SQLite3 data source as the backend, and tests
- scenarios that update the zone via incoming zone transfers.
-
- Scenario: 1. Load and response
- Given I have bind10 running with configuration inmemory_over_sqlite3/secondary.conf
- 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
- A query for www.example.org should have rcode NOERROR
- The SOA serial for example.org should be 1234
-
- Scenario: 2. In-memory datasource backed by sqlite3
- Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
-
- And I have bind10 running with configuration xfrin/inmem_slave.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- A query for www.example.org to [::1]:56176 should have rcode NOERROR
- """
- www.example.org. 3600 IN A 192.0.2.63
- """
- A query for mail.example.org to [::1]:56176 should have rcode NXDOMAIN
- When I send bind10 the command Xfrin retransfer example.org IN ::1 56177
- Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
- Then wait for new bind10 stderr message AUTH_DATASRC_CLIENTS_BUILDER_LOAD_ZONE
-
- A query for www.example.org to [::1]:56177 should have rcode NOERROR
- The answer section of the last query response should be
- """
- www.example.org. 3600 IN A 192.0.2.1
- """
- A query for mail.example.org to [::1]:56176 should have rcode NOERROR
+++ /dev/null
-Feature: IXFR out
- Tests for IXFR-out, specific for BIND 10 behaviour.
- These are (part of) the tests as described on
- http://bind10.isc.org/wiki/IxfrSystemTests
-
- # A lot of these tests test specific UDP behaviour.
- #
- # Where possible, we use the TCP equivalent. Some of the behaviour
- # tested is UDP-specific though. In either case, a comment above
- # the test shows how and why it differs from the test specification,
- # or why it is commented out for now.
- # When we do implement UDP IXFR, we should probably keep the TCP
- # tests, and add them to the test specification, so we still have a
- # 1-to-1 mapping between these tests and the specification document.
- #
- # These tests use a zone with just a few records, the first serial
- # is 2, and it is incremented in steps of 2, up to serial 22.
- # Each updates either deletes or adds the www.example.com A record.
- # Version 2 has the record, then the update to version 4 deletes it,
- # the update to 6 adds it again, and so on, until version 22 (where
- # the last update has added it again)
- #
- # Some of the tests (scenario 1 tests 3 and 4, and scenario 2 tests 1 and
- # 2 may still not work if we replicate BIND 9's behaviour; it always
- # responds to UDP IXFR requests with just the SOA, and it does not do
- # AXFR-style IXFR if the number of changes exceeds the size of the zone)
- #
- # So in effect, there is only one test that is currently active (scenario
- # 1 test 7)
-
-
- Scenario: Test Set 1
- Given I have bind10 running with configuration ixfr-out/testset1-config.db
-
- 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
- And wait for bind10 stderr message XFROUT_STARTED
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- The SOA serial for example.com should be 22
-
- #
- # Test 1
- #
- # We don't support UDP yet, and for TCP we currently return full zone,
- # so this test is currently skipped
- #
- #When I do an IXFR transfer of example.com 123 over udp
- #The transfer result should have 1 RRs
- #The full result of the last transfer should be
- #"""
- #example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- #"""
-
- #
- # Test 2
- #
- # Original test specification was for UDP, using TCP for now
- #
- #When I do an IXFR transfer of example.com 22 over udp
- When I do an IXFR transfer of example.com 22 over tcp
- The transfer result should have 1 RRs
- The full result of the last transfer should be
- """
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- """
-
- #
- # Test 3
- #
- # Original test specification was for UDP, using TCP for now
- #
- #When I do an IXFR transfer of example.com 20 over udp
- When I do an IXFR transfer of example.com 20 over tcp
- The transfer result should have 5 RRs
- The full result of the last transfer should be
- """
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 20 28800 7200 604800 18000
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- www.example.com. 3600 IN A 192.0.2.1
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- """
-
- #
- # Test 4
- #
- # Original test specification was for UDP, using TCP for now
- #
- #When I do an IXFR transfer of example.com 18 over udp
- When I do an IXFR transfer of example.com 18 over tcp
- The transfer result should have 8 RRs
- The full result of the last transfer should be
- """
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 18 28800 7200 604800 18000
- www.example.com. 3600 IN A 192.0.2.1
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 20 28800 7200 604800 18000
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 20 28800 7200 604800 18000
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- www.example.com. 3600 IN A 192.0.2.1
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- """
-
- #
- # Test 5
- #
- # This test does not have a TCP equivalent, so it is skipped.
- #
- #When I do an IXFR transfer of example.com 2 over udp
- #The transfer result should have 1 RRs
- #The full result of the last transfer should be
- #"""
- #example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- #"""
-
- #
- # Test 6
- #
- # This test does not have a TCP equivalent, so it is skipped.
- #
- #When I do an IXFR transfer of example.com 5 over udp
- #The transfer result should have 1 RRs
- #The full result of the last transfer should be
- #"""
- #example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- #"""
-
- #
- # Test 7
- #
- When I do an IXFR transfer of example.com 14 over tcp
- The transfer result should have 14 RRs
- The full result of the last transfer should be
- """
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 14 28800 7200 604800 18000
- www.example.com. 3600 IN A 192.0.2.1
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 16 28800 7200 604800 18000
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 16 28800 7200 604800 18000
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 18 28800 7200 604800 18000
- www.example.com. 3600 IN A 192.0.2.1
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 18 28800 7200 604800 18000
- www.example.com. 3600 IN A 192.0.2.1
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 20 28800 7200 604800 18000
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 20 28800 7200 604800 18000
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- www.example.com. 3600 IN A 192.0.2.1
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- """
-
- Scenario: Test Set 2
- Given I have bind10 running with configuration ixfr-out/testset1-config.db
-
- 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
- And wait for bind10 stderr message XFROUT_STARTED
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- The SOA serial for example.com should be 22
-
- #
- # Test 1
- #
- # Original test specification was for UDP, using TCP for now
- #
- #When I do an IXFR transfer of example.com 19 over udp
- When I do an IXFR transfer of example.com 19 over tcp
- The transfer result should have 5 RRs
- The full result of the last transfer should be
- """
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- example.com. 3600 IN NS ns.example.com.
- ns.example.com. 3600 IN A 192.0.2.1
- www.example.com. 3600 IN A 192.0.2.1
- example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- """
-
- #
- # Test 2
- #
- # This test has no TCP equivalent
- #
- #When I do an IXFR transfer of example.com 6 over udp
- #The transfer result should have 5 RRs
- #The full result of the last transfer should be
- #"""
- #example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- #example.com. 3600 IN NS ns.example.com.
- #ns.example.com. 3600 IN A 192.0.2.1
- #www.example.com. 3600 IN A 192.0.2.1
- #example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- #"""
-
- #
- # Test 3
- #
- # This test has no TCP equivalent
- #
- #When I do an IXFR transfer of example.com 2 over udp
- #The transfer result should have 1 RRs
- #The full result of the last transfer should be
- #"""
- #example.com. 3600 IN SOA ns.example.com. admin.example.com. 22 28800 7200 604800 18000
- #"""
+++ /dev/null
-Feature: Master loader feature
- This feature is a collection of tests for the zone file loader in
- BIND 10.
-
- Scenario: $GENERATE support
- Given I have bind10 running with configuration generate.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 NXDOMAIN
- The SOA serial for example.org should be 12341
-
- A query for host0.example.org should have rcode NXDOMAIN
- A query for host1.example.org should have rcode NOERROR
- The answer section of the last query response should be
- """
- host1.example.org. 3600 IN A 192.0.2.1
- """
- A query for host2.example.org should have rcode NOERROR
- The answer section of the last query response should be
- """
- host2.example.org. 3600 IN A 192.0.2.2
- """
- A query for host3.example.org should have rcode NOERROR
- The answer section of the last query response should be
- """
- host3.example.org. 3600 IN A 192.0.2.3
- """
- A query for host4.example.org should have rcode NOERROR
- The answer section of the last query response should be
- """
- host4.example.org. 3600 IN A 192.0.2.4
- """
- A query for host5.example.org should have rcode NXDOMAIN
-
- A query for example.org type NS should have rcode NOERROR
- The answer section of the last query response should be
- """
- example.org. 3600 IN NS ns1.example.org.
- example.org. 3600 IN NS ns2.example.org.
- """
+++ /dev/null
-Feature: Message queue tests
- Tests for the message queue daemon.
-
- Scenario: logging
- # We check the message queue logs.
- Given I have bind10 running with configuration default.config
- And wait for bind10 stderr message BIND10_STARTED_CC
- And wait for bind10 stderr message MSGQ_START
- And wait for bind10 stderr message MSGQ_LISTENER_STARTED
- And wait for bind10 stderr message MSGQ_CFGMGR_SUBSCRIBED
- And wait for bind10 stderr message CMDCTL_STARTED
-
- # Check it handles configuration. The configuration is invalid,
- # but it should get there anyway and we abuse it.
- # TODO: Once it has any kind of real command or configuration
- # value, use that instead.
- Then set bind10 configuration Msgq to {"nonsense": 1}
- And wait for bind10 stderr message MSGQ_CONFIG_DATA
+++ /dev/null
-Feature: Multiple instances
- This feature tests whether multiple instances can be run, and whether
- removing them does not affect the running of other instances
-
- Scenario: Multiple instances of Auth
- # Standard check to test (non-)existence of a file
- # This file is actually automatically
- The file data/test_nonexistent_db.sqlite3 should not exist
-
- # This config should have two running instances
- Given I have bind10 running with configuration multi_instance/multi_auth.config
- And wait for bind10 stderr message BIND10_STARTED_CC
- And wait for bind10 stderr message CMDCTL_STARTED
-
- # This is a hack. We should actually check if b10-auth and
- # b10-auth-2 are started by name. But there's currently no way
- # for a component to find out its name and log it.
- And wait 2 times 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
-
- # Now we use the first step again to see if the file has been created
- The file data/test_nonexistent_db.sqlite3 should exist
-
- A query for example.com should have rcode REFUSED
-
- # this also checks whether the process is running
- If I remember the pid of process b10-auth
- And remember the pid of process b10-auth-2
-
- When I remove bind10 configuration Init/components value b10-auth-2
- And wait for new bind10 stderr message BIND10_PROCESS_ENDED
-
- Then the pid of process b10-auth should not have changed
- And a query for example.com should have rcode REFUSED
-
- When I send bind10 the following commands
- """
- config add Init/components b10-auth-2
- config set Init/components/b10-auth-2/special auth
- config set Init/components/b10-auth-2/kind needed
- config commit
- """
- And wait for new bind10 stderr message AUTH_SERVER_STARTED
- And remember the pid of process b10-auth-2
-
- Then the pid of process b10-auth should not have changed
- A query for example.com should have rcode REFUSED
-
- When I remove bind10 configuration Init/components value b10-auth
- And wait for new bind10 stderr message BIND10_PROCESS_ENDED
- Then the pid of process b10-auth-2 should not have changed
- A query for example.com should have rcode REFUSED
+++ /dev/null
-Feature: NSEC3 Authoritative service
- This feature tests NSEC3 as defined in RFC5155, using the example
- zone from appendix A and testing the example responses from appendix B.
- Additional tests can be added as well.
-
- # Response section data is taken directly from RFC5155
- # It has been modified slightly; it has been 'flattened' (i.e. converted
- # to 1-line RRs with TTL and class data), and whitespace has been added
- # in the places where dig adds them too.
- # Any other changes from the specific example data are added as inline
- # comments.
-
- Scenario: B.1. Name Error
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for a.c.x.w.example. should have rcode NXDOMAIN
- 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
- The last query response should have adcount 1
- The authority section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
- example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
- 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN NSEC3 1 1 12 aabbccdd 2t7b4g4vsa5smi47k61mv5bv1a22bojr NS SOA MX RRSIG DNSKEY NSEC3PARAM
- 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. OSgWSm26B+cS+dDL8b5QrWr/dEWhtCsKlwKLIBHYH6blRxK9rC0bMJPw Q4mLIuw85H2EY762BOCXJZMnpuwhpA==
- b4um86eghhds6nea196smvmlo4ors995.example. 3600 IN NSEC3 1 1 12 aabbccdd gjeqe526plbf1g8mklp59enfd789njgi MX RRSIG
- b4um86eghhds6nea196smvmlo4ors995.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. ZkPG3M32lmoHM6pa3D6gZFGB/rhL//Bs3Omh5u4m/CUiwtblEVOaAKKZ d7S959OeiX43aLX3pOv0TSTyiTxIZg==
- 35mthgpgcu1qg68fab165klnsnk3dpvl.example. 3600 IN NSEC3 1 1 12 aabbccdd b4um86eghhds6nea196smvmlo4ors995 NS DS RRSIG
- 35mthgpgcu1qg68fab165klnsnk3dpvl.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. g6jPUUpduAJKRljUsN8gB4UagAX0NxY9shwQAynzo8EUWH+z6hEIBlUT PGj15eZll6VhQqgZXtAIR3chwgW+SA==
- """
-
- Scenario: B.2. No Data Error
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for ns1.example. type MX should have rcode NOERROR
- 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
- The last query response should have adcount 1
- The authority section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
- example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
- 2t7b4g4vsa5smi47k61mv5bv1a22bojr.example. 3600 IN NSEC3 1 1 12 aabbccdd 2vptu5timamqttgl4luu9kg21e0aor3s A RRSIG
- 2t7b4g4vsa5smi47k61mv5bv1a22bojr.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. OmBvJ1Vgg1hCKMXHFiNeIYHK9XVW0iLDLwJN4TFoNxZuP03gAXEI634Y wOc4YBNITrj413iqNI6mRk/r1dOSUw==
- """
-
- Scenario: B2.1. No Data Error, Empty Non-Terminal
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for y.w.example. should have rcode NOERROR
- 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
- The last query response should have adcount 1
- The authority section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
- example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
- ji6neoaepv8b5o6k4ev33abha8ht9fgc.example. 3600 IN NSEC3 1 1 12 aabbccdd k8udemvp1j2f7eg6jebps17vp3n8i58h
- ji6neoaepv8b5o6k4ev33abha8ht9fgc.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. gPkFp1s2QDQ6wQzcg1uSebZ61W33rUBDcTj72F3kQ490fEdp7k1BUIfb cZtPbX3YCpE+sIt0MpzVSKfTwx4uYA==
- """
-
- Scenario: B.3. Referral to an Opt-Out Unsigned Zone
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for mc.c.example. type MX should have rcode NOERROR
- 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
- The last query response should have adcount 3
- The authority section of the last query response should be
- """
- c.example. 3600 IN NS ns1.c.example.
- c.example. 3600 IN NS ns2.c.example.
- 35mthgpgcu1qg68fab165klnsnk3dpvl.example. 3600 IN NSEC3 1 1 12 aabbccdd b4um86eghhds6nea196smvmlo4ors995 NS DS RRSIG
- 35mthgpgcu1qg68fab165klnsnk3dpvl.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. g6jPUUpduAJKRljUsN8gB4UagAX0NxY9shwQAynzo8EUWH+z6hEIBlUT PGj15eZll6VhQqgZXtAIR3chwgW+SA==
- 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN NSEC3 1 1 12 aabbccdd 2t7b4g4vsa5smi47k61mv5bv1a22bojr NS SOA MX RRSIG DNSKEY NSEC3PARAM
- 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. OSgWSm26B+cS+dDL8b5QrWr/dEWhtCsKlwKLIBHYH6blRxK9rC0bMJPw Q4mLIuw85H2EY762BOCXJZMnpuwhpA==
- """
- The additional section of the last query response should be
- """
- ns1.c.example. 3600 IN A 192.0.2.7
- ns2.c.example. 3600 IN A 192.0.2.8
- """
-
- Scenario: B.4. Wildcard Expansion
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for a.z.w.example. type MX should have rcode NOERROR
- 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
- The last query response should have adcount 9
- The answer section of the last query response should be
- """
- a.z.w.example. 3600 IN MX 1 ai.example.
- a.z.w.example. 3600 IN RRSIG MX 7 2 3600 20150420235959 20051021000000 40430 example. CikebjQwGQPwijVcxgcZcSJKtfynugtlBiKb9FcBTrmOoyQ4InoWVudh CWsh/URX3lc4WRUMivEBP6+4KS3ldA==
- """
- The authority section of the last query response should be
- """
- example. 3600 IN NS ns1.example.
- example. 3600 IN NS ns2.example.
- example. 3600 IN RRSIG NS 7 1 3600 20150420235959 20051021000000 40430 example. PVOgtMK1HHeSTau+HwDWC8Ts+6C8qtqd4pQJqOtdEVgg+MA+ai4fWDEh u3qHJyLcQ9tbD2vvCnMXjtz6SyObxA==
- q04jkcevqvmu85r014c7dkba38o0ji5r.example. 3600 IN NSEC3 1 1 12 aabbccdd r53bq7cc2uvmubfu5ocmm6pers9tk9en A RRSIG
- q04jkcevqvmu85r014c7dkba38o0ji5r.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. hV5I89b+4FHJDATp09g4bbN0R1F845CaXpL3ZxlMKimoPAyqletMlEWw LfFia7sdpSzn+ZlNNlkxWcLsIlMmUg==
- """
- # This is slightly different from the example in RFC5155; there are
- # more RRs in the additional section.
- The additional section of the last query response should be
- """
- ai.example. 3600 IN A 192.0.2.9
- ai.example. 3600 IN AAAA 2001:db8::f00:baa9
- ns1.example. 3600 IN A 192.0.2.1
- ns2.example. 3600 IN A 192.0.2.2
- ai.example. 3600 IN RRSIG A 7 2 3600 20150420235959 20051021000000 40430 example. hVe+wKYMlObTRPhX0NL67GxeZfdxqr/QeR6FtfdAj5+FgYxyzPEjIzvK Wy00hWIl6wD3Vws+rznEn8sQ64UdqA==
- ai.example. 3600 IN RRSIG AAAA 7 2 3600 20150420235959 20051021000000 40430 example. LcdxKaCB5bGZwPDg+3JJ4O02zoMBrjxqlf6WuaHQZZfTUpb9Nf2nxFGe 2XRPfR5tpJT6GdRGcHueLuXkMjBArQ==
- ns1.example. 3600 IN RRSIG A 7 2 3600 20150420235959 20051021000000 40430 example. bu6kx73n6XEunoVGuRfAgY7EF/AJqHy7hj0jkiqJjB0dOrx3wuz9SaBe GfqWIdn/uta3SavN4FRvZR9SCFHF5Q==
- ns2.example. 3600 IN RRSIG A 7 2 3600 20150420235959 20051021000000 40430 example. ktQ3TqE0CfRfki0Rb/Ip5BM0VnxelbuejCC4zpLbFKA/7eD7UNAwxMgx JPtbdST+syjYSJaj4IHfeX6n8vfoGA==
- """
-
- Scenario: B.5. Wildcard No Data Error
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for a.z.w.example. type AAAA should have rcode NOERROR
- 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
- The last query response should have adcount 1
- The authority section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
- example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
- k8udemvp1j2f7eg6jebps17vp3n8i58h.example. 3600 IN NSEC3 1 1 12 aabbccdd kohar7mbb8dc2ce8a9qvl8hon4k53uhi
- k8udemvp1j2f7eg6jebps17vp3n8i58h.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. FtXGbvF0+wf8iWkyo73enAuVx03klN+pILBKS6qCcftVtfH4yVzsEZqu J27NHR7ruxJWDNMtOtx7w9WfcIg62A==
- q04jkcevqvmu85r014c7dkba38o0ji5r.example. 3600 IN NSEC3 1 1 12 aabbccdd r53bq7cc2uvmubfu5ocmm6pers9tk9en A RRSIG
- q04jkcevqvmu85r014c7dkba38o0ji5r.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. hV5I89b+4FHJDATp09g4bbN0R1F845CaXpL3ZxlMKimoPAyqletMlEWw LfFia7sdpSzn+ZlNNlkxWcLsIlMmUg==
- r53bq7cc2uvmubfu5ocmm6pers9tk9en.example. 3600 IN NSEC3 1 1 12 aabbccdd t644ebqk9bibcna874givr6joj62mlhv MX RRSIG
- r53bq7cc2uvmubfu5ocmm6pers9tk9en.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. aupviViruXs4bDg9rCbezzBMf9h1ZlDvbW/CZFKulIGXXLj8B/fsDJar XVDA9bnUoRhEbKp+HF1FWKW7RIJdtQ==
- """
-
- Scenario: B.6. DS Child Zone No Data Error
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for example. type DS should have rcode NOERROR
- 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
- The last query response should have adcount 1
- The authority section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
- example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
- 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN NSEC3 1 1 12 aabbccdd 2t7b4g4vsa5smi47k61mv5bv1a22bojr NS SOA MX RRSIG DNSKEY NSEC3PARAM
- 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. OSgWSm26B+cS+dDL8b5QrWr/dEWhtCsKlwKLIBHYH6blRxK9rC0bMJPw Q4mLIuw85H2EY762BOCXJZMnpuwhpA==
- """
-
- #
- # Below are additional tests, not explicitly stated in RFC5155
- #
-
- Scenario: 7.2.2 other; Name Error where one NSEC3 covers multiple parts of proof (closest encloser)
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for b.x.w.example. should have rcode NXDOMAIN
- 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
- The last query response should have adcount 1
- The authority section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
- example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
- b4um86eghhds6nea196smvmlo4ors995.example. 3600 IN NSEC3 1 1 12 aabbccdd gjeqe526plbf1g8mklp59enfd789njgi MX RRSIG
- b4um86eghhds6nea196smvmlo4ors995.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. ZkPG3M32lmoHM6pa3D6gZFGB/rhL//Bs3Omh5u4m/CUiwtblEVOaAKKZ d7S959OeiX43aLX3pOv0TSTyiTxIZg==
- 35mthgpgcu1qg68fab165klnsnk3dpvl.example. 3600 IN NSEC3 1 1 12 aabbccdd b4um86eghhds6nea196smvmlo4ors995 NS DS RRSIG
- 35mthgpgcu1qg68fab165klnsnk3dpvl.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. g6jPUUpduAJKRljUsN8gB4UagAX0NxY9shwQAynzo8EUWH+z6hEIBlUT PGj15eZll6VhQqgZXtAIR3chwgW+SA==
- """
-
- Scenario: 7.2.2 other; Name Error where one NSEC3 covers multiple parts of proof (wildcard)
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for a.w.example. should have rcode NOERROR
- 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
- The last query response should have adcount 1
- The authority section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
- example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
- k8udemvp1j2f7eg6jebps17vp3n8i58h.example. 3600 IN NSEC3 1 1 12 AABBCCDD KOHAR7MBB8DC2CE8A9QVL8HON4K53UHI
- k8udemvp1j2f7eg6jebps17vp3n8i58h.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. FtXGbvF0+wf8iWkyo73enAuVx03klN+pILBKS6qCcftVtfH4yVzsEZqu J27NHR7ruxJWDNMtOtx7w9WfcIg62A==
- r53bq7cc2uvmubfu5ocmm6pers9tk9en.example. 3600 IN NSEC3 1 1 12 AABBCCDD T644EBQK9BIBCNA874GIVR6JOJ62MLHV MX RRSIG
- r53bq7cc2uvmubfu5ocmm6pers9tk9en.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. aupviViruXs4bDg9rCbezzBMf9h1ZlDvbW/CZFKulIGXXLj8B/fsDJar XVDA9bnUoRhEbKp+HF1FWKW7RIJdtQ==
- """
-
- Scenario: Wildcard other: Wildcard name itself
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for *.w.example. type MX should have rcode NOERROR
- 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
- The last query response should have adcount 9
- The answer section of the last query response should be
- """
- *.w.example. 3600 IN MX 1 ai.example.
- *.w.example. 3600 IN RRSIG MX 7 2 3600 20150420235959 20051021000000 40430 example. CikebjQwGQPwijVcxgcZcSJKtfynugtlBiKb9FcBTrmOoyQ4InoWVudh CWsh/URX3lc4WRUMivEBP6+4KS3ldA==
- """
- The authority section of the last query response should be
- """
- example. 3600 IN NS ns1.example.
- example. 3600 IN NS ns2.example.
- example. 3600 IN RRSIG NS 7 1 3600 20150420235959 20051021000000 40430 example. PVOgtMK1HHeSTau+HwDWC8Ts+6C8qtqd4pQJqOtdEVgg+MA+ai4fWDEh u3qHJyLcQ9tbD2vvCnMXjtz6SyObxA==
- """
- The additional section of the last query response should be
- """
- ai.example. 3600 IN A 192.0.2.9
- ai.example. 3600 IN AAAA 2001:db8::f00:baa9
- ns1.example. 3600 IN A 192.0.2.1
- ns2.example. 3600 IN A 192.0.2.2
- ai.example. 3600 IN RRSIG A 7 2 3600 20150420235959 20051021000000 40430 example. hVe+wKYMlObTRPhX0NL67GxeZfdxqr/QeR6FtfdAj5+FgYxyzPEjIzvK Wy00hWIl6wD3Vws+rznEn8sQ64UdqA==
- ai.example. 3600 IN RRSIG AAAA 7 2 3600 20150420235959 20051021000000 40430 example. LcdxKaCB5bGZwPDg+3JJ4O02zoMBrjxqlf6WuaHQZZfTUpb9Nf2nxFGe 2XRPfR5tpJT6GdRGcHueLuXkMjBArQ==
- ns1.example. 3600 IN RRSIG A 7 2 3600 20150420235959 20051021000000 40430 example. bu6kx73n6XEunoVGuRfAgY7EF/AJqHy7hj0jkiqJjB0dOrx3wuz9SaBe GfqWIdn/uta3SavN4FRvZR9SCFHF5Q==
- ns2.example. 3600 IN RRSIG A 7 2 3600 20150420235959 20051021000000 40430 example. ktQ3TqE0CfRfki0Rb/Ip5BM0VnxelbuejCC4zpLbFKA/7eD7UNAwxMgx JPtbdST+syjYSJaj4IHfeX6n8vfoGA==
- """
-
- Scenario: Wildcard other: Wildcard name itself nodata
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for *.w.example. type A should have rcode NOERROR
- 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
- The last query response should have adcount 1
- The authority section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
- example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
- r53bq7cc2uvmubfu5ocmm6pers9tk9en.example. 3600 IN NSEC3 1 1 12 AABBCCDD T644EBQK9BIBCNA874GIVR6JOJ62MLHV MX RRSIG
- r53bq7cc2uvmubfu5ocmm6pers9tk9en.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. aupviViruXs4bDg9rCbezzBMf9h1ZlDvbW/CZFKulIGXXLj8B/fsDJar XVDA9bnUoRhEbKp+HF1FWKW7RIJdtQ==
- """
-
- Scenario: Direct query for NSEC3 record
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. type NSEC3 should have rcode NXDOMAIN
- 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
- The last query response should have adcount 1
- The authority section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
- example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
- 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN NSEC3 1 1 12 AABBCCDD 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR NS SOA MX RRSIG DNSKEY NSEC3PARAM
- 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. OSgWSm26B+cS+dDL8b5QrWr/dEWhtCsKlwKLIBHYH6blRxK9rC0bMJPw Q4mLIuw85H2EY762BOCXJZMnpuwhpA==
- q04jkcevqvmu85r014c7dkba38o0ji5r.example. 3600 IN NSEC3 1 1 12 AABBCCDD R53BQ7CC2UVMUBFU5OCMM6PERS9TK9EN A RRSIG
- q04jkcevqvmu85r014c7dkba38o0ji5r.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. hV5I89b+4FHJDATp09g4bbN0R1F845CaXpL3ZxlMKimoPAyqletMlEWw LfFia7sdpSzn+ZlNNlkxWcLsIlMmUg==
- gjeqe526plbf1g8mklp59enfd789njgi.example. 3600 IN NSEC3 1 1 12 AABBCCDD JI6NEOAEPV8B5O6K4EV33ABHA8HT9FGC A HINFO AAAA RRSIG
- gjeqe526plbf1g8mklp59enfd789njgi.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. IVnezTJ9iqblFF97vPSmfXZ5Zozngx3KX3byLTZC4QBH2dFWhf6scrGF ZB980AfCxoD9qbbKDy+rdGIeRSVNyw==
- """
-
- Scenario: No data, type DS, in-zone
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for ai.example. type DS should have rcode NOERROR
- 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
- The last query response should have adcount 1
- The authority section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
- example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
- gjeqe526plbf1g8mklp59enfd789njgi.example. 3600 IN NSEC3 1 1 12 AABBCCDD JI6NEOAEPV8B5O6K4EV33ABHA8HT9FGC A HINFO AAAA RRSIG
- gjeqe526plbf1g8mklp59enfd789njgi.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. IVnezTJ9iqblFF97vPSmfXZ5Zozngx3KX3byLTZC4QBH2dFWhf6scrGF ZB980AfCxoD9qbbKDy+rdGIeRSVNyw==
- """
-
- Scenario: No data, type DS, optout delegation
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for c.example. type DS should have rcode NOERROR
- 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
- The last query response should have adcount 1
- The authority section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. bugs.x.w.example. 1 3600 300 3600000 3600
- example. 3600 IN RRSIG SOA 7 1 3600 20150420235959 20051021000000 40430 example. Hu25UIyNPmvPIVBrldN+9Mlp9Zql39qaUd8iq4ZLlYWfUUbbAS41pG+6 8z81q1xhkYAcEyHdVI2LmKusbZsT0Q==
- 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN NSEC3 1 1 12 AABBCCDD 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR NS SOA MX RRSIG DNSKEY NSEC3PARAM
- 0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. OSgWSm26B+cS+dDL8b5QrWr/dEWhtCsKlwKLIBHYH6blRxK9rC0bMJPw Q4mLIuw85H2EY762BOCXJZMnpuwhpA==
- 35mthgpgcu1qg68fab165klnsnk3dpvl.example. 3600 IN NSEC3 1 1 12 AABBCCDD B4UM86EGHHDS6NEA196SMVMLO4ORS995 NS DS RRSIG
- 35mthgpgcu1qg68fab165klnsnk3dpvl.example. 3600 IN RRSIG NSEC3 7 2 3600 20150420235959 20051021000000 40430 example. g6jPUUpduAJKRljUsN8gB4UagAX0NxY9shwQAynzo8EUWH+z6hEIBlUT PGj15eZll6VhQqgZXtAIR3chwgW+SA==
- """
+++ /dev/null
-Feature: Querying feature
- This feature is a collection of non-specific querying tests;
- for instance whether multiple queries in a row return consistent
- answers.
-
- Scenario: Glue
- # Check the auth server returns the correct glue when asked for it.
- Given I have bind10 running with configuration glue.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
-
- # This query should result in a delegation with two NS; one in the
- # delegated zone and one in a so called out-of-bailiwick zone for which
- # the auth server has authority, too. For the former, the server
- # should return glue in the parent zone. For the latter, BIND 9 and
- # BIND 10 behave differently; BIND 9 uses "glue" in the parent zone
- # (since this is the root zone everything can be considered a valid
- # glue). BIND 10 (using sqlite3 data source) searches the other zone
- # and uses the authoritative data in that zone (which is intentionally
- # different from the glue in the root zone).
- A query for foo.bar.example type A should have rcode NOERROR
- The answer section of the last query response should be
- """
- """
- The authority section of the last query response should be
- """
- example. 172800 IN NS NS1.example.COM.
- example. 172800 IN NS NS.example.
- """
- The additional section of the last query response should be
- """
- NS.example. 172800 IN A 192.0.2.1
- NS.example. 172800 IN A 192.0.2.2
- NS1.example.COM. 172800 IN A 192.0.2.3
- """
- # Test we don't get out-of-zone glue
- A query for example.net type A should have rcode NOERROR
- The answer section of the last query response should be
- """
- """
- The authority section of the last query response should be
- """
- example.net. 300 IN NS ns2.example.info.
- example.net. 300 IN NS ns1.example.info.
- """
- The additional section of the last query response should be
- """
- """
-
- Scenario: Repeated queries
- Given I have bind10 running with configuration example.org.inmem.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
-
- # DATASRC_LIBRARY_ERROR must be generated due to
- # "broken_libraries_should_be_skipped" in
- # example.org.inmem.config
- And wait for bind10 stderr message DATASRC_LIBRARY_ERROR
-
- And wait for bind10 stderr message STATS_STARTING
-
- bind10 module Auth should be running
- And bind10 module Stats 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 StatsHttpd should not be running
-
- 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
- The last query response should have ancount 1
- The last query response should have nscount 2
- The last query response should have adcount 2
-
- The answer section of the last query response should be
- """
- www.example.org. 3600 IN A 192.0.2.1
- """
- The authority section of the last query response should be
- """
- example.org. 3600 IN NS ns1.example.org.
- example.org. 3600 IN NS ns2.example.org.
- """
- The additional section of the last query response should be
- """
- ns1.example.org. 3600 IN A 192.0.2.3
- ns2.example.org. 3600 IN A 192.0.2.4
- """
-
- # Make sure handling statistics command handling checked below is
- # after this query
- And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
-
- 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
- | item_name | item_value |
- | request.v4 | 1 |
- | request.udp | 1 |
- | opcode.query | 1 |
- | responses | 1 |
- | qrysuccess | 1 |
- | qryauthans | 1 |
- | rcode.noerror | 1 |
-
-
- # Repeat of the above
- A query for www.example.org should have rcode NOERROR
- 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
-
- The answer section of the last query response should be
- """
- www.example.org. 3600 IN A 192.0.2.1
- """
- The authority section of the last query response should be
- """
- example.org. 3600 IN NS ns1.example.org.
- example.org. 3600 IN NS ns2.example.org.
- """
- The additional section of the last query response should be
- """
- ns1.example.org. 3600 IN A 192.0.2.3
- ns2.example.org. 3600 IN A 192.0.2.4
- """
-
- # Make sure handling statistics command handling checked below is
- # after this query
- And wait for new bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
-
- 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
- | item_name | item_value |
- | request.v4 | 2 |
- | request.udp | 2 |
- | opcode.query | 2 |
- | responses | 2 |
- | qrysuccess | 2 |
- | qryauthans | 2 |
- | rcode.noerror | 2 |
-
- # And now query something completely different
- 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
- The last query response should have adcount 0
- The authority section of the last query response should be
- """
- example.org. 3600 IN SOA ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
- """
-
- # Make sure handling statistics command handling checked below is
- # after this query
- And wait for new bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
-
- 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
- | item_name | item_value |
- | request.v4 | 3 |
- | request.udp | 3 |
- | opcode.query | 3 |
- | responses | 3 |
- | qrysuccess | 2 |
- | qryauthans | 3 |
- | qryrecursion | 1 |
- | rcode.noerror | 2 |
- | rcode.nxdomain | 1 |
-
- Scenario: ANY query
- Given I have bind10 running with configuration example.org.inmem.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 Stats 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 StatsHttpd should not be running
-
- 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
- The last query response should have ancount 4
- The last query response should have nscount 0
- The last query response should have adcount 3
- The answer section of the last query response should be
- """
- example.org. 3600 IN NS ns1.example.org.
- example.org. 3600 IN NS ns2.example.org.
- example.org. 3600 IN SOA ns1.example.org. admin.example.org. 1234 3600 1800 2419200 7200
- example.org. 3600 IN MX 10 mail.example.org.
- """
- The additional section of the last query response should be
- """
- ns1.example.org. 3600 IN A 192.0.2.3
- ns2.example.org. 3600 IN A 192.0.2.4
- mail.example.org. 3600 IN A 192.0.2.10
- """
-
- # Make sure handling statistics command handling checked below is
- # after this query
- And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
-
- 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
- | item_name | item_value |
- | request.v4 | 1 |
- | request.udp | 1 |
- | opcode.query | 1 |
- | responses | 1 |
- | qrysuccess | 1 |
- | qryauthans | 1 |
- | rcode.noerror | 1 |
-
- Scenario: Delegation query for unsigned child zone
- Given I have bind10 running with configuration example.org.inmem.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
-
- 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
- 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
- The last query response should have adcount 2
- The authority section of the last query response should be
- """
- sub.example.org. 3600 IN NS ns.sub.example.org.
- """
- The additional section of the last query response should be
- """
- ns.sub.example.org. 3600 IN A 192.0.2.101
- """
-
- # Make sure handling statistics command handling checked below is
- # after this query
- And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
-
- 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
- | item_name | item_value |
- | request.v4 | 1 |
- | request.udp | 1 |
- | request.edns0 | 1 |
- | request.dnssec_ok | 1 |
- | opcode.query | 1 |
- | responses | 1 |
- | response.edns0 | 1 |
- | qrynoauthans | 1 |
- | qryreferral | 1 |
- | rcode.noerror | 1 |
-
- Scenario: RRSIG query
- # Directly querying for RRSIGs should result in rcode=REFUSED.
- Given I have bind10 running with configuration nsec3/nsec3_auth.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 dnssec query for example. type RRSIG should have rcode REFUSED
- 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 0
- The last query response should have adcount 1
-
- Scenario: SSHFP query
- # We are testing one more RR type for a normal successful case
- Given I have bind10 running with configuration example.org.inmem.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 Stats 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 StatsHttpd should not be running
-
- 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 SSHFP should have rcode NOERROR
- The last query response should have ancount 0
-
- # Make sure handling statistics command handling checked below is
- # after this query
- And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
-
- 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
- | item_name | item_value |
- | request.v4 | 1 |
- | request.udp | 1 |
- | opcode.query | 1 |
- | responses | 1 |
- | qryauthans | 1 |
- | qrynxrrset | 1 |
- | rcode.noerror | 1 |
-
- A query for shell.example.org type SSHFP should have rcode NOERROR
- The last query response should have ancount 1
- The answer section of the last query response should be
- """
- shell.example.org. 3600 IN SSHFP 2 1 123456789abcdef67890123456789abcdef67890
- """
- # Make sure handling statistics command handling checked below is
- # after this query
- And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
-
- 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
- | item_name | item_value |
- | request.v4 | 2 |
- | request.udp | 2 |
- | opcode.query | 2 |
- | responses | 2 |
- | qrysuccess | 1 |
- | qryauthans | 2 |
- | qrynxrrset | 1 |
- | rcode.noerror | 2 |
-
- Scenario: Querying non-existing name in root zone from sqlite3 should work
- Given I have bind10 running with configuration root.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 Stats 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 StatsHttpd should not be running
-
- A query for . type SOA should have rcode NOERROR
- A query for nonexistent. type A should have rcode NXDOMAIN
- Then wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE not AUTH_PROCESS_FAIL
-
- Scenario: CH class static zone query
- # We are testing one more RR type for a normal successful case
- Given I have bind10 running with configuration static.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 Stats 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 StatsHttpd should not be running
-
- A query for version.bind. type TXT class CH should have rcode REFUSED
-
- When I send bind10 the following commands
- """
- config add data_sources/classes/CH
- config set data_sources/classes/CH[0]/type MasterFiles
- config set data_sources/classes/CH[0]/cache-enable true
- config set data_sources/classes/CH[0]/params {"BIND": "data/static.zone"}
- config commit
- """
-
- And wait for new bind10 stderr message AUTH_DATASRC_CLIENTS_BUILDER_RECONFIGURE_SUCCESS
-
- A query for version.bind. type TXT class CH should have rcode NOERROR
- The last query response should have ancount 1
-
- # NOTE: The double double-quote characters trailing 10 in the
- # response below are required due to a lettuce bug in reading
- # multi-line strings with embedded double-quotes.
-
- The answer section of the last query response should be
- """
- version.bind. 3600 CH TXT "10""
- """
+++ /dev/null
-Feature: Basic Resolver
- This feature set is just testing the execution of the b10-resolver
- module. It sees whether it starts up, takes configuration, and
- answers queries.
-
- Scenario: Listen for and answer query
- # This scenario starts a server that runs a real resolver.
- # In order not to send out queries into the wild, we only
- # query for something known to be hardcoded at this moment.
- # NOTE: once real priming has been implemented, this test needs
- # to be revised (as it would then leak, which is probably true
- # for any resolver system test)
- When I start bind10 with configuration resolver/resolver_basic.config
- And wait for bind10 stderr message BIND10_STARTED_CC
- And wait for bind10 stderr message CMDCTL_STARTED
- And wait for bind10 stderr message RESOLVER_STARTED
-
- bind10 module Resolver should be running
- And bind10 module Auth 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
-
- # The ACL is set to reject any queries
- 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 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 recursive query for l.root-servers.net. should have rcode REFUSED
+++ /dev/null
-Feature: b10-stats-httpd module
- Tests the stats httpd module
-
- Scenario: Check that the module logs and responds to requests
- Given I have bind10 running with configuration bindctl_commands.config
- And wait for bind10 stderr message STATSHTTPD_STARTED
-
- When I request the URL http://127.0.0.1:47811/
- # Should result in redirect, so two query logs
- And wait for new bind10 stderr message "GET / HTTP/1.0" 302 -
- And wait for new bind10 stderr message "GET /bind10/statistics/xml/ HTTP/1.0" 200 -
- The last http response status code should be 200
-
- When I request the URL http://127.0.0.1:47811/no_such_url
- And wait for new bind10 stderr message "GET /no_such_url HTTP/1.0" 404 -
- The last http response status code should be 404
+++ /dev/null
-# Copyright (C) 2011-2012 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-from lettuce import *
-import time
-import subprocess
-import re
-import json
-
-@step('sleep for (\d+) seconds')
-def wait_seconds(step, seconds):
- """Sleep for some seconds.
- Parameters:
- seconds number of seconds to sleep for.
- """
- time.sleep(float(seconds))
-
-@step('start bind10(?: with configuration (\S+))?' +\
- '(?: with cmdctl port (\d+))?' +\
- '(?: with msgq socket file (\S+))?' +\
- '(?: as (\S+))?')
-def start_bind10(step, config_file, cmdctl_port, msgq_sockfile, process_name):
- """
- Start BIND 10 with the given optional config file, cmdctl port, and
- store the running process in world with the given process name.
- Parameters:
- config_file ('with configuration <file>', optional): this configuration
- will be used. The path is relative to the base lettuce
- directory.
- cmdctl_port ('with cmdctl port <portnr>', optional): The port on which
- b10-cmdctl listens for bindctl commands. Defaults to 56175.
- msgq_sockfile ('with msgq socket file', optional): The msgq socket file
- that will be used for internal communication
- process_name ('as <name>', optional). This is the name that can be used
- in the following steps of the scenario to refer to this
- BIND 10 instance. Defaults to 'bind10'.
- This call will block until BIND10_STARTUP_COMPLETE or BIND10_STARTUP_ERROR
- is logged. In the case of the latter, or if it times out, the step (and
- scenario) will fail.
- It will also fail if there is a running process with the given process_name
- already.
- """
- args = [ 'bind10', '-v' ]
- if config_file is not None:
- args.append('-p')
- args.append("configurations/")
- args.append('-c')
- args.append(config_file)
- if cmdctl_port is None:
- args.append('--cmdctl-port=56175')
- else:
- args.append('--cmdctl-port=' + cmdctl_port)
- if process_name is None:
- process_name = "bind10"
- else:
- args.append('-m')
- args.append(process_name + '_msgq.socket')
-
- world.processes.add_process(step, process_name, args)
-
- # check output to know when startup has been completed
- (message, line) = world.processes.wait_for_stderr_str(process_name,
- ["BIND10_STARTUP_COMPLETE",
- "BIND10_STARTUP_ERROR"])
- assert message == "BIND10_STARTUP_COMPLETE", "Got: " + str(line)
-
-@step('wait for bind10 auth (?:of (\w+) )?to start')
-def wait_for_auth(step, process_name):
- """Wait for b10-auth to run. This is done by blocking until the message
- AUTH_SERVER_STARTED is logged.
- Parameters:
- process_name ('of <name', optional): The name of the BIND 10 instance
- to wait for. Defaults to 'bind10'.
- """
- if process_name is None:
- process_name = "bind10"
- world.processes.wait_for_stderr_str(process_name, ['AUTH_SERVER_STARTED'],
- False)
-
-@step('wait for bind10 xfrout (?:of (\w+) )?to start')
-def wait_for_xfrout(step, process_name):
- """Wait for b10-xfrout to run. This is done by blocking until the message
- XFROUT_NEW_CONFIG_DONE is logged.
- Parameters:
- process_name ('of <name', optional): The name of the BIND 10 instance
- to wait for. Defaults to 'bind10'.
- """
- if process_name is None:
- process_name = "bind10"
- world.processes.wait_for_stderr_str(process_name,
- ['XFROUT_NEW_CONFIG_DONE'],
- False)
-
-@step('have bind10 running(?: with configuration ([\S]+))?' +\
- '(?: with cmdctl port (\d+))?' +\
- '(?: as ([\S]+))?')
-def have_bind10_running(step, config_file, cmdctl_port, process_name):
- """
- Compound convenience step for running bind10, which consists of
- start_bind10.
- Currently only supports the 'with configuration' option.
- """
- start_step = 'start bind10 with configuration ' + config_file
- if cmdctl_port is not None:
- start_step += ' with cmdctl port ' + str(cmdctl_port)
- if process_name is not None:
- start_step += ' as ' + process_name
- step.given(start_step)
-
-# function to send lines to bindctl, and store the result
-def run_bindctl(commands, cmdctl_port=None, ignore_failure=False):
- """Run bindctl.
- Parameters:
- commands: a sequence of strings which will be sent.
- cmdctl_port: a port number on which cmdctl is listening, is converted
- to string if necessary. If not provided, or None, defaults
- to 56175
- ignore_failure(bool): if set to True, don't examin the result code
- of bindctl and assert it succeeds.
-
- bindctl's stdout and stderr streams are stored (as one multiline string
- in world.last_bindctl_stdout/stderr.
- Fails if the return code is not 0
- """
- if cmdctl_port is None:
- cmdctl_port = 56175
-
- args = ['bindctl', '-p', str(cmdctl_port), '--csv-file-dir=configurations/' ]
- bindctl = subprocess.Popen(args, 1, None, subprocess.PIPE,
- subprocess.PIPE, None)
- for line in commands:
- bindctl.stdin.write(line + "\n")
- (stdout, stderr) = bindctl.communicate()
- if ignore_failure:
- return
- result = bindctl.returncode
- world.last_bindctl_stdout = stdout
- world.last_bindctl_stderr = stderr
- assert result == 0, "bindctl exit code: " + str(result) +\
- "\nstdout:\n" + str(stdout) +\
- "stderr:\n" + str(stderr)
-
-
-@step('last bindctl( stderr)? output should( not)? contain (\S+)( exactly)?')
-def check_bindctl_output(step, stderr, notv, string, exactly):
- """Checks the stdout (or stderr) stream of the last run of bindctl,
- fails if the given string is not found in it (or fails if 'not' was
- set and it is found
- Parameters:
- stderr ('stderr'): Check stderr instead of stdout output
- notv ('not'): reverse the check (fail if string is found)
- string ('contain <string>') string to look for
- exactly ('exactly'): Make an exact match delimited by whitespace
- """
- if stderr is None:
- output = world.last_bindctl_stdout
- else:
- output = world.last_bindctl_stderr
- found = False
- if exactly is None:
- if string in output:
- found = True
- else:
- if re.search(r'^\s+' + string + r'\s+', output, re.IGNORECASE | re.MULTILINE) is not None:
- found = True
- if notv is None:
- assert found == True, "'" + string +\
- "' was not found in bindctl output:\n" +\
- output
- else:
- assert not found, "'" + string +\
- "' was found in bindctl output:\n" +\
- output
-
-def parse_bindctl_output_as_data_structure():
- """Helper function for data-related command tests: evaluates the
- last output of bindctl as a data structure that can then be
- inspected.
- If the bindctl output is not valid (json) data, this call will
- fail with an assertion failure.
- If it is valid, it is parsed and returned as whatever data
- structure it represented.
- """
- # strip any extra output after a character that commonly terminates a valid
- # JSON expression, i.e., ']', '}' and '"'. (The extra output would
- # contain 'Exit from bindctl' message, and depending on environment some
- # other control-like characters...but why is this message even there?)
- # Note that this filter is not perfect. For example, it cannot recognize
- # a simple expression of true/false/null.
- output = re.sub("(.*)([^]}\"]*$)", r"\1", world.last_bindctl_stdout)
- try:
- return json.loads(output)
- except ValueError as ve:
- assert False, "Last bindctl output does not appear to be a " +\
- "parseable data structure: '" + output + "': " + str(ve)
-
-def find_process_pid(step, process_name):
- """Helper function to request the running processes from Init, and
- return the pid of the process with the given process_name.
- Fails with an assert if the response from b10-init is not valid JSON,
- or if the process with the given name is not found.
- """
- # show_processes output is a list of lists, where the inner lists
- # are of the form [ pid, "name" ]
- # Not checking data form; errors will show anyway (if these turn
- # out to be too vague, we can change this)
- step.given('send bind10 the command Init show_processes')
- running_processes = parse_bindctl_output_as_data_structure()
-
- for process in running_processes:
- if process[1] == process_name:
- return process[0]
- assert False, "Process named " + process_name +\
- " not found in output of Init show_processes";
-
-@step("remember the pid of process ([\S]+)")
-def remember_pid(step, process_name):
- """Stores the PID of the process with the given name as returned by
- Init show_processes command.
- Fails if the process with the given name does not appear to exist.
- Stores the component_name->pid value in the dict world.process_pids.
- This should only be used by the related step
- 'the pid of process <name> should (not) have changed'
- Arguments:
- process name ('process <name>') the name of the component to store
- the pid of.
- """
- if world.process_pids is None:
- world.process_pids = {}
- world.process_pids[process_name] = find_process_pid(step, process_name)
-
-@step('pid of process ([\S]+) should not have changed')
-def check_pid(step, process_name):
- """Checks the PID of the process with the given name as returned by
- Init show_processes command.
- Fails if the process with the given name does not appear to exist.
- Fails if the process with the given name exists, but has a different
- pid than it had when the step 'remember the pid of process' was
- called.
- Fails if that step has not been called (since world.process_pids
- does not exist).
- """
- assert world.process_pids is not None, "No process pids stored"
- assert process_name in world.process_pids, "Process named " +\
- process_name +\
- " was not stored"
- pid = find_process_pid(step, process_name)
- assert world.process_pids[process_name] == pid,\
- "Expected pid: " + str(world.process_pids[process_name]) +\
- " Got pid: " + str(pid)
-
-@step('set bind10 configuration (\S+) to (.*)(?: with cmdctl port (\d+))?')
-def config_set_command(step, name, value, cmdctl_port):
- """
- Run bindctl, set the given configuration to the given value, and commit it.
- Parameters:
- name ('configuration <name>'): Identifier of the configuration to set
- value ('to <value>'): value to set it to.
- cmdctl_port ('with cmdctl port <portnr>', optional): cmdctl port to send
- the command to. Defaults to 56175.
- Fails if cmdctl does not exit with status code 0.
- """
- commands = ["config set " + name + " " + value,
- "config commit",
- "quit"]
- run_bindctl(commands, cmdctl_port)
-
-@step('send bind10 the following commands(?: with cmdctl port (\d+))?')
-def send_multiple_commands(step, cmdctl_port):
- """
- Run bindctl, and send it the given multiline set of commands.
- A quit command is always appended.
- cmdctl_port ('with cmdctl port <portnr>', optional): cmdctl port to send
- the command to. Defaults to 56175.
- Fails if cmdctl does not exit with status code 0.
- """
- commands = step.multiline.split("\n")
- # Always add quit
- commands.append("quit")
- run_bindctl(commands, cmdctl_port)
-
-@step('remove bind10 configuration (\S+)(?: value (\S+))?(?: with cmdctl port (\d+))?')
-def config_remove_command(step, name, value, cmdctl_port):
- """
- Run bindctl, remove the given configuration item, and commit it.
- Parameters:
- name ('configuration <name>'): Identifier of the configuration to remove
- value ('value <value>'): if name is a named set, use value to identify
- item to remove
- cmdctl_port ('with cmdctl port <portnr>', optional): cmdctl port to send
- the command to. Defaults to 56175.
- Fails if cmdctl does not exit with status code 0.
- """
- cmd = "config remove " + name
- if value is not None:
- cmd = cmd + " " + value
- commands = [cmd,
- "config commit",
- "quit"]
- run_bindctl(commands, cmdctl_port)
-
-@step('send bind10(?: with cmdctl port (\d+))?( ignoring failure)? the command (.+)')
-def send_command(step, cmdctl_port, ignore_failure, command):
- """
- Run bindctl, send the given command, and exit bindctl.
- Parameters:
- command ('the command <command>'): The command to send.
- cmdctl_port ('with cmdctl port <portnr>', optional): cmdctl port to send
- the command to. Defaults to 56175.
- ignore_failure ('ignoring failure', optional): set to None if bindctl
- is expected to succeed (normal case, which is the default); if it is
- not None, it means bindctl is expected to fail (and it's acceptable).
-
- Fails if bindctl does not exit with status code 0 and ignore_failure
- is not None.
-
- """
- commands = [command,
- "quit"]
- run_bindctl(commands, cmdctl_port, ignore_failure is not None)
-
-@step('bind10 module (\S+) should( not)? be running')
-def module_is_running(step, name, not_str):
- """
- Convenience step to check if a module is running; can only work with
- default cmdctl port; sends a 'help' command with bindctl, then
- checks if the output contains the given name.
- Parameters:
- name ('module <name>'): The name of the module (case sensitive!)
- not ('not'): Reverse the check (fail if it is running)
- """
- if not_str is None:
- not_str = ""
- step.given('send bind10 the command help')
- step.given('last bindctl output should' + not_str + ' contain ' + name + ' exactly')
-
-@step('Configure BIND10 to run DDNS')
-def configure_ddns_on(step):
- """
- Convenience compound step to enable the b10-ddns module.
- """
- step.behave_as("""
- When I send bind10 the following commands
- \"\"\"
- config add Init/components b10-ddns
- config set Init/components/b10-ddns/kind dispensable
- config set Init/components/b10-ddns/address DDNS
- config commit
- \"\"\"
- """)
-
-@step('Configure BIND10 to stop running DDNS')
-def configure_ddns_off(step):
- """
- Convenience compound step to disable the b10-ddns module.
- """
- step.behave_as("""
- When I send bind10 the following commands
- \"\"\"
- config remove Init/components b10-ddns
- config commit
- \"\"\"
- """)
-
-@step('query statistics(?: (\S+))? of bind10 module (\S+)(?: with cmdctl port (\d+))?')
-def query_statistics(step, statistics, name, cmdctl_port):
- """
- query statistics data via bindctl.
- Parameters:
- statistics ('statistics <statistics>', optional) : The queried statistics name.
- name ('module <name>'): The name of the module (case sensitive!)
- cmdctl_port ('with cmdctl port <portnr>', optional): cmdctl port to send
- the command to.
- """
- port_str = ' with cmdctl port %s' % cmdctl_port \
- if cmdctl_port else ''
- step.given('send bind10%s the command Stats show owner=%s%s'\
- % (port_str, name,\
- ' name=%s' % statistics if statistics else ''))
-
-@step('statistics counters are 0 in category (\S+)( except for the' + \
- ' following items)?')
-def check_statistics_items(step, category, has_except_for):
- """
- check the output of bindctl for statistics of specified counter.
- Parameters:
- category ('category <category>'): The category of counter.
- has_except_for ('except for the following items'): checks values of items
- with the multiline part.
-
- Expected values of items are taken from the multiline part of the step in
- the scenario. The multiline part has at most four columns: item_name,
- item_value, min_value, and max_value. item_name is a relative name
- to category. item_value is an expected value for
- item_name. min_value and max_value are expected to be used when
- item_value cannot be specified to be item_value. min_value is the
- minimum value in the expected range, and max_value is the maximum
- value in the expected range. Values would be examined if they are
- in columns corresponding to these.
- """
-
- def flatten(dictionary, prefix=''):
- h = {}
- for k, v in dictionary.items():
- if type(v) is dict:
- h.update(flatten(v, prefix+'.'+k))
- else:
- h[prefix+'.'+k] = v
- return h
-
- stats = flatten(parse_bindctl_output_as_data_structure())
- if has_except_for:
- # fetch step tables in the scnario as hashes
- for item in step.hashes:
- name = category+'.'+item['item_name']
- assert stats.has_key(name), \
- 'Statistics item %s was not found' % (name)
- found = stats[name]
- if 'item_value' in item and item['item_value']:
- value = item['item_value']
- assert int(found) == int(value), \
- 'Statistics item %s has unexpected value %s (expect %s)' % \
- (name, found, value)
- if 'min_value' in item and item['min_value']:
- value = item['min_value']
- assert float(value) <= float(found), \
- 'Statistics item %s has unexpected value %s (expect %s or greater than)' % \
- (name, found, value)
- if 'max_value' in item and item['max_value']:
- value = item['max_value']
- assert float(found) <= float(value), \
- 'Statistics item %s has unexpected value %s (expect %s or less than)' % \
- (name, found, value)
- del(stats[name])
- for name, found in stats.items():
- assert int(found) == 0, \
- 'Statistics item %s has unexpected value %s (expect %s)' % \
- (name, found, 0)
-
-@step('check initial statistics(?:( not)? containing (\S+))? for (\S+)'
- '( with cmdctl port \d+)?( except for the following items)?')
-def check_init_statistics(step, notv, string, name, cmdctl_port, has_except_for):
- """Checks the initial statistics for the module. Also checks a
- string is contained or not contained in them. Statistics counters
- other than zero can follow below.
- Parameters:
- notv ('not'): reverse the check (fail if string is found)
- string ('containing <string>') string to look for
- name ('module <name>'): The name of the module (case sensitive!)
- cmdctl_port ('with cmdctl port <portnr>', optional): cmdctl port to send
- the command to.
- has_except_for ('except for the following items'): checks values of items
- with the multiline part.
- """
- query_str = 'query statistics of bind10 module ' + name
- if cmdctl_port:
- query_str = query_str + cmdctl_port
- notcontain_str = 'last bindctl output should%s contain "%s"'
- check_str = 'statistics counters are 0 in category .' + name
- if has_except_for:
- check_str = check_str + has_except_for + "\n" \
- + step.represent_hashes()
- step.given(query_str)
- step.given(notcontain_str % (' not', 'error'))
- if string is not None:
- step.given(notcontain_str % (notv, string))
- step.given(check_str)
+++ /dev/null
-# Copyright (C) 2013 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-from lettuce import *
-import urllib
-
-# Basic request
-@step('request the URL (.*)')
-def request_url(step, url):
- """
- Performs one basic HTTP GET request. The resulting HTTPResponse object
- will we placed in world.last_http_response
- Parameters:
- url: the full URL to query
- """
- world.last_http_response = urllib.urlopen(url)
-
-@step('last http response status code should be ([0-9]+)')
-def check_last_response_code(step, code):
- """
- Checks whether the last call to request_url resulted in a response
- with the given (numeric) status code
- Fails if it does not, or if there never was a complete request_url
- operation
- """
- assert world.last_http_response != None, "No HTTP request made yet"
- assert int(code) == world.last_http_response.getcode(),\
- code + " != " +\
- str(world.last_http_response.getcode())
+++ /dev/null
-# Copyright (C) 2013 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-from lettuce import *
-import subprocess
-import tempfile
-
-def run_loadzone(zone, zone_file, db_file):
- """Run b10-loadzone.
-
- It currently only works for an SQLite3-based data source, and takes
- its DB file as a parameter.
-
- Parameters:
- zone (str): the zone name
- zone_file (str): master zone file for the zone; can be None to make an
- empty zone.
- db_file (str): SQLite3 DB file to load the zone into
-
- """
- sqlite_datasrc_cfg = '{"database_file": "' + db_file + '"}'
- if zone_file is not None:
- args = ['b10-loadzone', '-c', sqlite_datasrc_cfg, zone, zone_file]
- else:
- args = ['b10-loadzone', '-c', sqlite_datasrc_cfg, '-e', zone]
- loadzone = subprocess.Popen(args, 1, None, None,
- subprocess.PIPE, subprocess.PIPE)
- (stdout, stderr) = loadzone.communicate()
- result = loadzone.returncode
- world.last_loadzone_stdout = stdout
- world.last_loadzone_stderr = stderr
- assert result == 0, "loadzone exit code: " + str(result) +\
- "\nstdout:\n" + str(stdout) +\
- "stderr:\n" + str(stderr)
-
-@step('load zone (\S+) to DB file (\S+) from (\S+)')
-def load_zone_to_dbfile(step, zone, db_file, zone_file):
- """Load a zone into a data source from a zone file.
-
- It currently only works for an SQLite3-based data source. Its
- DB file name should be specified.
-
- Step definition:
- load zone <zone_name> to DB file <db_file> from <zone_file>
-
- """
- run_loadzone(zone, zone_file, db_file)
-
-@step('make empty zone (\S+) in DB file (\S+)')
-def make_empty_zone_to_dbfile(step, zone, db_file):
- """Make an empty zone into a data source.
-
- If a non-empty zone already exists in the data source, it will be emptied;
- otherwise, a new empty zone will be created.
-
- It currently only works for an SQLite3-based data source. Its
- DB file name should be specified.
-
- Step definition:
- make empty zone <zone_name> to DB file <db_file>
-
- """
- run_loadzone(zone, None, db_file)
-
-@step('load (\d+) records for zone (\S+) to DB file (\S+)')
-def load_zone_rr_to_dbfile(step, num_records, zone, db_file):
- """Load a zone with a specified number of RRs into a data source.
-
- It currently only works for an SQLite3-based data source. Its
- DB file name should be specified.
-
- It creates the content of the zone dynamically so the total number of
- RRs of the zone is the specified number, including mandatory SOA and NS.
-
- Step definition:
- load zone <zone_name> to DB file <db_file> from <zone_file>
-
- """
- num_records = int(num_records)
- assert num_records >= 2, 'zone must have at least 2 RRs: SOA and NS'
- num_records -= 2
- with tempfile.NamedTemporaryFile(mode='w', prefix='zone-file',
- dir='data/', delete=True) as f:
- filename = f.name
- f.write('$TTL 3600\n')
- f.write('$ORIGIN .\n') # so it'll work whether or not zone ends with .
- f.write(zone + ' IN SOA . . 0 0 0 0 0\n')
- f.write(zone + ' IN NS 0.' + zone + '\n')
- count = 0
- while count < num_records:
- f.write(str(count) + '.' + zone + ' IN A 192.0.2.1\n')
- count += 1
- f.flush()
- run_loadzone(zone, f.name, db_file)
+++ /dev/null
-# Copyright (C) 2012 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-from lettuce import *
-import subprocess
-import re
-
-def run_nsupdate(commands):
- """Run nsupdate.
- Parameters:
- commands: a sequence of strings which will be sent.
- update_address: address to send the update to
- update_port: port to send the update to
- zone: zone to update
-
- Appends 'send' and 'quit' as final commands.
-
- nsupdate's stdout and stderr streams are stored (as one multiline string
- in world.last_nsupdate_stdout/stderr.
-
- The return code is stored in world.last_nsupdate_returncode
- (it is not checked here, since a number of tests intentionally
- result in a non-zero return code).
- """
- commands.append('send')
- commands.append('quit')
- args = ['nsupdate' ]
- nsupdate = subprocess.Popen(args, 1, None, subprocess.PIPE,
- subprocess.PIPE, subprocess.PIPE)
- for line in commands:
- nsupdate.stdin.write(line + "\n")
- (stdout, stderr) = nsupdate.communicate()
- world.last_nsupdate_returncode = nsupdate.returncode
- world.last_nsupdate_stdout = stdout
- world.last_nsupdate_stderr = stderr
-
-@step('send a DDNS update for (\S+) with the following commands:')
-def send_multiple_commands(step, zone):
- """
- Run nsupdate, and send it the given multiline set of commands.
- A send and quit command is always appended.
-
- This is the most 'raw' wrapper around the nsupdate call; every
- command except the final send needs to be specified. Intended
- for those tests that have unique properties.
- """
- commands = step.multiline.split("\n")
- run_nsupdate(commands, zone)
-
-@step('DDNS response should be ([A-Z]+)')
-def check_ddns_response(step, response):
- """
- Checks the result of the last call to nsupdate.
-
- If the given response argument is SUCCESS, it simply checks whether
- the return code from nsupdate is 0 (there is no output in that case).
- If not, it checks whether it is not 0, and if the given response string
- matches a line 'update failed: <response>' in the stderr output of
- nsupdate.
-
- Prints exit code, stdout and stderr streams of nsupdate if it fails.
- """
- # For success, nsupdate is silent, only check result code 0
- if response == "SUCCESS":
- assert 0 == world.last_nsupdate_returncode,\
- "nsupdate exit code: " + str(world.last_nsupdate_returncode) +\
- "\nstdout:\n" + str(world.last_nsupdate_stdout) +\
- "stderr:\n" + str(world.last_nsupdate_stderr)
- else:
- found = False
- for line in world.last_nsupdate_stderr.split('\n'):
- if line == "update failed: " + response:
- found = True
- assert found and (0 != world.last_nsupdate_returncode),\
- "Response " + response + " not found in nsupdate output\n" +\
- "nsupdate exit code: " + str(world.last_nsupdate_returncode) +\
- "\nstdout:\n" + str(world.last_nsupdate_stdout) +\
- "stderr:\n" + str(world.last_nsupdate_stderr)
-
-
-# Individual steps to create a DDNS update packet through nsupdate
-@step('Prepare a DDNS update(?: for (\S+))?(?: to (\S+)(?: port ([0-9]+)))?')
-def prepare_update(step, zone, server, port):
- """
- Prepares an nsupdate command that sets up an update to a server
- for a zone. The update is not sent yet, but the commands
- are stored in world.nsupdate_commands.
- """
- commands = []
- if server is not None:
- commands.append("server " + server)
- else:
- commands.append("server 127.0.0.1")
- if port is not None:
- commands[0] = commands[0] + " " + port
- else:
- commands[0] = commands[0] + " 56176"
- if zone is not None:
- commands.append("zone " + zone)
- world.nsupdate_commands = commands
-
-@step('Add to the DDNS update: (.*)')
-def add_line_to_ddns_update(step, line):
- """
- Adds a single line to the prepared nsupdate. It is not sent yet.
- The line must conform to nsupdate syntax.
- """
- world.nsupdate_commands.append(line)
-
-@step('Add the following lines to the DDNS update:')
-def add_lines_to_ddns_update(step, line):
- """
- Adds multiple lines to the prepared nsupdate. It is not sent yet.
- The lines must conform to nsupdate syntax.
- """
- world.nsupdate_commands.extend(step.multiline.split('\n'))
-
-@step('Send the DDNS update')
-def run_ddns_update(step):
- """
- Runs the prepared nsupdate, see run_nsupdate() for more information.
- """
- run_nsupdate(world.nsupdate_commands)
-
-@step('use DDNS to set the SOA SERIAL to ([0-9]+)')
-def set_serial_to(step, new_serial):
- """
- Convenience compound step; prepare an update for example.org,
- which sets the SERIAL to the given value, and send it.
- It makes no other changes, and has hardcoded values for the other
- SOA rdata fields.
- """
- step.given('Prepare a DDNS update')
- step.given('add to the DDNS update: update add example.org 3600 IN SOA ns1.example.org. admin.example.org. ' + new_serial + ' 3600 1800 2419200 7200')
- step.given('Send the DDNS update')
-
-@step('use DDNS to add a record (.*)')
-def add_record(step, new_record):
- """
- Convenience compound step; prepare an update for example.org,
- which adds one record, then send it.
- Apart from the update addition, the update will not contain anything else.
- """
- step.given('Prepare a DDNS update')
- step.given('add to the DDNS update: update add ' + new_record)
- step.given('Send the DDNS update')
-
-@step('set DDNS ACL ([0-9]+) for ([0-9.]+) to ([A-Z]+)')
-def set_ddns_acl_to(step, nr, address, action):
- """
- Convenience step to update a single ACL for DDNS.
- Replaces the ACL at the given index for the given
- address, to the given action
- """
- step.given('set bind10 configuration DDNS/zones[' + nr + ']/update_acl to [{"action": "' + action + '", "from": "' + address + '"}]')
- step.given('last bindctl output should not contain Error')
+++ /dev/null
-# Copyright (C) 2011 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-# This script provides querying functionality
-# The most important step is
-#
-# query for <name> [type X] [class X] [to <addr>[:port]] should have rcode <rc>
-#
-# By default, it will send queries to 127.0.0.1:56176 unless specified
-# otherwise. The rcode is always checked. If the result is not NO_ANSWER,
-# the result will be stored in last_query_result, which can then be inspected
-# more closely, for instance with the step
-#
-# "the last query response should have <property> <value>"
-#
-# Also see example.feature for some examples
-
-from lettuce import *
-import subprocess
-import re
-
-#
-# define a class to easily access different parts
-# We may consider using our full library for this, but for now
-# simply store several parts of the response as text values in
-# this structure.
-# (this actually has the advantage of not relying on our own libraries
-# to test our own, well, libraries)
-#
-# The following attributes are 'parsed' from the response, all as strings,
-# and end up as direct attributes of the QueryResult object:
-# opcode, rcode, id, flags, qdcount, ancount, nscount, adcount,
-# edns_version, edns_flags, and edns_udp_size
-# (flags and edns_flags are both one string with all flags, in the order
-# in which they appear in the response message.)
-#
-# this will set 'rcode' as the result code, we 'define' one additional
-# rcode, "NO_ANSWER", if the dig process returned an error code itself
-# In this case none of the other attributes will be set.
-#
-# The different sections will be lists of strings, one for each RR in the
-# section. The question section will start with ';', as per dig output
-#
-# See server_from_sqlite3.feature for various examples to perform queries
-class QueryResult(object):
- status_re = re.compile("opcode: ([A-Z])+, status: ([A-Z]+), id: ([0-9]+)")
- edns_re = re.compile("; EDNS: version: ([0-9]+), flags: ([a-z ]*); udp: ([0-9]+)")
- flags_re = re.compile("flags: ([a-z ]+); QUERY: ([0-9]+), ANSWER: " +
- "([0-9]+), AUTHORITY: ([0-9]+), ADDITIONAL: ([0-9]+)")
-
- def __init__(self, name, qtype, qclass, address, port,
- additional_args=None):
- """
- Constructor. This fires of a query using dig.
- Parameters:
- name: The domain name to query
- qtype: The RR type to query. Defaults to A if it is None.
- qclass: The RR class to query. Defaults to IN if it is None.
- address: The IP address to send the query to.
- port: The port number to send the query to.
- additional_args: List of additional arguments (e.g. '+dnssec').
- All parameters must be either strings or have the correct string
- representation.
- Only one query attempt will be made.
- """
- args = [ 'dig', '+tries=1', '@' + str(address), '-p', str(port) ]
- if qtype is not None:
- args.append('-t')
- args.append(str(qtype))
- if qclass is not None:
- args.append('-c')
- args.append(str(qclass))
- if additional_args is not None:
- args.extend(additional_args)
- args.append(name)
- dig_process = subprocess.Popen(args, 1, None, None, subprocess.PIPE,
- None)
- result = dig_process.wait()
- if result != 0:
- self.rcode = "NO_ANSWER"
- else:
- self.rcode = None
- parsing = "HEADER"
- self.question_section = []
- self.answer_section = []
- self.authority_section = []
- self.additional_section = []
- self.line_handler = self.parse_header
- for out in dig_process.stdout:
- self.line_handler(out)
-
- def _check_next_header(self, line):
- """
- Returns true if we found a next header, and sets the internal
- line handler to the appropriate value.
- """
- if line == ";; ANSWER SECTION:\n":
- self.line_handler = self.parse_answer
- elif line == ";; OPT PSEUDOSECTION:\n":
- self.line_handler = self.parse_opt
- elif line == ";; QUESTION SECTION:\n":
- self.line_handler = self.parse_question
- elif line == ";; AUTHORITY SECTION:\n":
- self.line_handler = self.parse_authority
- elif line == ";; ADDITIONAL SECTION:\n":
- self.line_handler = self.parse_additional
- elif line.startswith(";; Query time"):
- self.line_handler = self.parse_footer
- else:
- return False
- return True
-
- def parse_header(self, line):
- """
- Parse the header lines of the query response.
- Parameters:
- line: The current line of the response.
- """
- if not self._check_next_header(line):
- status_match = self.status_re.search(line)
- flags_match = self.flags_re.search(line)
- if status_match is not None:
- self.opcode = status_match.group(1)
- self.rcode = status_match.group(2)
- elif flags_match is not None:
- self.flags = flags_match.group(1)
- self.qdcount = flags_match.group(2)
- self.ancount = flags_match.group(3)
- self.nscount = flags_match.group(4)
- self.adcount = flags_match.group(5)
-
- def parse_opt(self, line):
- """
- Parse the header lines of the query response.
- Parameters:
- line: The current line of the response.
- """
- if not self._check_next_header(line):
- edns_match = self.edns_re.search(line)
- if edns_match is not None:
- self.edns_version = edns_match.group(1)
- self.edns_flags = edns_match.group(2)
- self.edns_udp_size = edns_match.group(3)
-
- def parse_question(self, line):
- """
- Parse the question section lines of the query response.
- Parameters:
- line: The current line of the response.
- """
- if not self._check_next_header(line):
- if line != "\n":
- self.question_section.append(line.strip())
-
- def parse_answer(self, line):
- """
- Parse the answer section lines of the query response.
- Parameters:
- line: The current line of the response.
- """
- if not self._check_next_header(line):
- if line != "\n":
- self.answer_section.append(line.strip())
-
- def parse_authority(self, line):
- """
- Parse the authority section lines of the query response.
- Parameters:
- line: The current line of the response.
- """
- if not self._check_next_header(line):
- if line != "\n":
- self.authority_section.append(line.strip())
-
- def parse_additional(self, line):
- """
- Parse the additional section lines of the query response.
- Parameters:
- line: The current line of the response.
- """
- if not self._check_next_header(line):
- if line != "\n":
- self.additional_section.append(line.strip())
-
- def parse_footer(self, line):
- """
- Parse the footer lines of the query response.
- Parameters:
- line: The current line of the response.
- """
- pass
-
-@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, 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.
- addr ('to <address>', optional): The IP address of the nameserver to query.
- Defaults to 127.0.0.1.
- port (':<port>', optional): The port number of the nameserver to query.
- Defaults to 56176.
- rcode ('should have rcode <rcode>'): The expected rcode of the answer.
- """
- if qtype is None:
- qtype = "A"
- if qclass is None:
- qclass = "IN"
- if addr is None:
- addr = "127.0.0.1"
- addr = re.sub(r"\[(.+)\]", r"\1", addr) # convert [IPv6_addr] to IPv6_addr
- if port is None:
- port = 56176
- additional_arguments = []
- if dnssec is not None:
- additional_arguments.append("+dnssec")
- else:
- # some builds of dig add edns0 by default. This could muck up
- # 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,\
- "Expected: " + rcode + ", got " + query_result.rcode
- world.last_query_result = query_result
-
-@step('The SOA serial for ([\S.]+) (?:at (\S+)(?::([0-9]+)) )?should be ([0-9]+)')
-def query_soa(step, query_name, address, port, serial=None):
- """
- Convenience function to check the SOA SERIAL value of the given zone at
- the nameserver at the default address (127.0.0.1:56176).
- Parameters:
- query_name ('for <name>'): The zone to find the SOA record for.
- serial ('should be <number>'): The expected value of the SOA SERIAL.
- If the rcode is not NOERROR, or the answer section does not contain the
- SOA record, this step fails.
- """
- if address is None:
- address = "127.0.0.1"
- if port is None:
- port = "56176"
- query_result = QueryResult(query_name, "SOA", "IN", address, port)
- assert "NOERROR" == query_result.rcode,\
- "Got " + query_result.rcode + ", expected NOERROR"
- assert len(query_result.answer_section) == 1,\
- "Too few or too many answers in SOA response"
- soa_parts = query_result.answer_section[0].split()
- assert serial == soa_parts[6],\
- "Got SOA serial " + soa_parts[6] + ", expected " + serial
-
-@step('last query response should have (\S+) (.+)')
-def check_last_query(step, item, value):
- """
- Check a specific value in the reponse from the last successful query sent.
- Parameters:
- item: The item to check the value of
- value: The expected value.
- This performs a very simple direct string comparison of the QueryResult
- member with the given item name and the given value.
- Fails if the item is unknown, or if its value does not match the expected
- value.
- """
- assert world.last_query_result is not None
- assert item in world.last_query_result.__dict__
- lq_val = world.last_query_result.__dict__[item]
- assert str(value) == str(lq_val),\
- "Got: " + str(lq_val) + ", expected: " + str(value)
-
-@step('([a-zA-Z]+) section of the last query response should (exactly )?be')
-def check_last_query_section(step, section, exact):
- """
- Check the entire contents of the given section of the response of the last
- query.
- Parameters:
- section ('<section> section'): The name of the section (QUESTION, ANSWER,
- AUTHORITY or ADDITIONAL).
- The expected response is taken from the multiline part of the step in the
- scenario. Differing whitespace is ignored, the order of the lines is
- ignored, and the comparison is case insensitive.
- Fails if they do not match.
- WARNING: Case insensitivity is not strictly correct; for instance the
- data of TXT RRs would be case sensitive. But most other output is, so
- currently the checks are always case insensitive. Should we decide
- these checks do need to be case sensitive, we can either remove it
- or make it optional (for the former, we'll need to update a number of
- tests).
- """
- response_string = None
- if section.lower() == 'question':
- response_string = "\n".join(world.last_query_result.question_section)
- elif section.lower() == 'answer':
- response_string = "\n".join(world.last_query_result.answer_section)
- elif section.lower() == 'authority':
- response_string = "\n".join(world.last_query_result.authority_section)
- elif section.lower() == 'additional':
- response_string = "\n".join(world.last_query_result.additional_section)
- else:
- assert False, "Unknown section " + section
-
- # Now mangle the data for 'conformance'
- # This could be done more efficiently, but is done one
- # by one on a copy of the original data, so it is clear
- # what is done. Final error output is currently still the
- # original unchanged multiline strings
-
- # replace whitespace of any length by one space
- response_string = re.sub("[ \t]+", " ", response_string)
- expect = re.sub("[ \t]+", " ", step.multiline)
- # lowercase them unless we need to do an exact match
- if exact is None:
- response_string = response_string.lower()
- expect = expect.lower()
- # sort them
- response_string_parts = response_string.split("\n")
- response_string_parts.sort()
- response_string = "\n".join(response_string_parts)
- expect_parts = expect.split("\n")
- expect_parts.sort()
- expect = "\n".join(expect_parts)
-
- assert response_string.strip() == expect.strip(),\
- "Got:\n'" + response_string + "'\nExpected:\n'" + step.multiline +"'"
-
+++ /dev/null
-# Copyright (C) 2011 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-#
-# This file contains a number of common steps that are general and may be used
-# By a lot of feature files.
-#
-
-from lettuce import *
-import os
-
-@step('stop process (\w+)')
-def stop_a_named_process(step, process_name):
- """
- Stop the process with the given name.
- Parameters:
- process_name ('process <name>'): Name of the process to stop.
- """
- world.processes.stop_process(process_name)
-
-@step('wait (?:(\d+) times )?for (new )?(\w+) stderr message (\S+)(?: not (\S+))?')
-def wait_for_stderr_message(step, times, new, process_name, message, not_message):
- """
- Block until the given message is printed to the given process's stderr
- output.
- Parameter:
- times: Check for the string this many times.
- new: (' new', optional): Only check the output from the process that has
- not been covered in previous calls to this
- function. See RunningProcess._wait_for_output_str
- for details.
- process_name ('<name> stderr'): Name of the process to check the output of.
- message ('message <message>'): Output (part) to wait for.
- not_message ('not <message>'): Output (part) to wait for, and fail
- Fails if the message is not found after 10 seconds.
- """
- strings = [message]
- if not_message is not None:
- strings.append(not_message)
- if times is None:
- times = 1
- (found, line) = world.processes.wait_for_stderr_str(process_name, strings, new, int(times))
- if not_message is not None:
- assert found != not_message, line
-
-@step('wait (?:(\d+) times )?for (new )?(\w+) stdout message (\w+)(?: not (\w+))?')
-def wait_for_stdout_message(step, times, new, process_name, message, not_message):
- """
- Block until the given message is printed to the given process's stdout
- output.
- Parameter:
- times: Check for the string this many times.
- new: (' new', optional): Only check the output from the process that has
- not been covered in previous calls to this
- function. See RunningProcess._wait_for_output_str
- for details.
- process_name ('<name> stderr'): Name of the process to check the output of.
- message ('message <message>'): Output (part) to wait for, and succeed.
- not_message ('not <message>'): Output (part) to wait for, and fail
- Fails if the message is not found after 10 seconds.
- """
- strings = [message]
- if not_message is not None:
- strings.append(not_message)
- if times is None:
- times = 1
- (found, line) = world.processes.wait_for_stdout_str(process_name, strings, new, int(times))
- if not_message is not None:
- assert found != not_message, line
-
-@step('the file (\S+) should (not )?exist')
-def check_existence(step, file_name, should_not_exist):
- """
- Check the existence of the given file.
- Parameters:
- file_name ('file <name>'): File to check existence of.
- should_not_exist ('not', optional): Whether it should or should not exist.
- Fails if the file should exist and does not, or vice versa.
- """
- if should_not_exist is None:
- assert os.path.exists(file_name), file_name + " does not exist"
- else:
- assert not os.path.exists(file_name), file_name + " exists"
+++ /dev/null
-# Copyright (C) 2011-2014 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-#
-# This is the 'terrain' in which the lettuce lives. By convention, this is
-# where global setup and teardown is defined.
-#
-# We declare some attributes of the global 'world' variables here, so the
-# tests can safely assume they are present.
-#
-# We also use it to provide scenario invariants, such as resetting data.
-#
-
-from lettuce import *
-import subprocess
-import os
-import shutil
-import re
-import sys
-import time
-
-# lettuce cannot directly pass commands to the terrain, so we need to
-# use environment variables to influence behaviour
-KEEP_OUTPUT = 'LETTUCE_KEEP_OUTPUT'
-
-# In order to make sure we start all tests with a 'clean' environment,
-# We perform a number of initialization steps, like restoring configuration
-# files, and removing generated data files.
-
-# This approach may not scale; if so we should probably provide specific
-# initialization steps for scenarios. But until that is shown to be a problem,
-# It will keep the scenarios cleaner.
-
-# This is a list of files that are freshly copied before each scenario
-# The first element is the original, the second is the target that will be
-# used by the tests that need them
-copylist = [
- ["configurations/bindctl_commands.config.orig",
- "configurations/bindctl_commands.config"],
- ["configurations/example.org.config.orig",
- "configurations/example.org.config"],
- ["configurations/generate.config.orig",
- "configurations/generate.config"],
- ["configurations/bindctl/bindctl.config.orig",
- "configurations/bindctl/bindctl.config"],
- ["configurations/auth/auth_basic.config.orig",
- "configurations/auth/auth_basic.config"],
- ["configurations/auth/auth_badzone.config.orig",
- "configurations/auth/auth_badzone.config"],
- ["configurations/resolver/resolver_basic.config.orig",
- "configurations/resolver/resolver_basic.config"],
- ["configurations/multi_instance/multi_auth.config.orig",
- "configurations/multi_instance/multi_auth.config"],
- ["configurations/ddns/ddns.config.orig",
- "configurations/ddns/ddns.config"],
- ["configurations/ddns/noddns.config.orig",
- "configurations/ddns/noddns.config"],
- ["configurations/xfrin/retransfer_master.conf.orig",
- "configurations/xfrin/retransfer_master.conf"],
- ["configurations/xfrin/retransfer_master_v4.conf.orig",
- "configurations/xfrin/retransfer_master_v4.conf"],
- ["configurations/xfrin/retransfer_master_nons.conf.orig",
- "configurations/xfrin/retransfer_master_nons.conf"],
- ["configurations/xfrin/retransfer_slave.conf.orig",
- "configurations/xfrin/retransfer_slave.conf"],
- ["configurations/xfrin/retransfer_slave_notify.conf.orig",
- "configurations/xfrin/retransfer_slave_notify.conf"],
- ["configurations/root.config.orig",
- "configurations/root.config"],
- ["configurations/static.config.orig",
- "configurations/static.config"],
- ["data/inmem-xfrin.sqlite3.orig",
- "data/inmem-xfrin.sqlite3"],
- ["data/root.sqlite3.orig",
- "data/root.sqlite3"],
- ["data/xfrin-before-diffs.sqlite3.orig",
- "data/xfrin-before-diffs.sqlite3"],
- ["data/xfrin-notify.sqlite3.orig",
- "data/xfrin-notify.sqlite3"],
- ["data/ddns/example.org.sqlite3.orig",
- "data/ddns/example.org.sqlite3"],
- ["data/empty_db.sqlite3",
- "data/xfrout.sqlite3"]
-]
-
-# This is a list of files that, if present, will be removed before a scenario
-removelist = [
-"data/test_nonexistent_db.sqlite3"
-]
-
-# When waiting for output data of a running process, use OUTPUT_WAIT_INTERVAL
-# as the interval in which to check again if it has not been found yet.
-# If we have waited OUTPUT_WAIT_MAX_INTERVALS times, we will abort with an
-# error (so as not to hang indefinitely)
-OUTPUT_WAIT_INTERVAL = 0.5
-OUTPUT_WAIT_MAX_INTERVALS = 120
-
-# class that keeps track of one running process and the files
-# we created for it.
-class RunningProcess:
- def __init__(self, step, process_name, args):
- # set it to none first so destructor won't error if initializer did
- """
- Initialize the long-running process structure, and start the process.
- Parameters:
- step: The scenario step it was called from. This is used for
- determining the output files for redirection of stdout
- and stderr.
- process_name: The name to refer to this running process later.
- args: Array of arguments to pass to Popen().
- """
- self.process = None
- self.step = step
- self.process_name = process_name
- self.remove_files_on_exit = (os.environ.get(KEEP_OUTPUT) != '1')
- self._check_output_dir()
- self._create_filenames()
- self._start_process(args)
-
- # used in _wait_for_output_str, map from (filename, (strings))
- # to a file offset.
- self.__file_offsets = {}
-
- def _start_process(self, args):
- """
- Start the process.
- Parameters:
- args:
- Array of arguments to pass to Popen().
- """
- stderr_write = open(self.stderr_filename, "w")
- stdout_write = open(self.stdout_filename, "w")
- self.process = subprocess.Popen(args, 0, None, subprocess.PIPE,
- stdout_write, stderr_write)
- # open them again, this time for reading
- self.stderr = open(self.stderr_filename, "r")
- self.stdout = open(self.stdout_filename, "r")
-
- def mangle_filename(self, filebase, extension):
- """
- Remove whitespace and non-default characters from a base string,
- and return the substituted value. Whitespace is replaced by an
- underscore. Any other character that is not an ASCII letter, a
- number, a dot, or a hyphen or underscore is removed.
- Parameter:
- filebase: The string to perform the substitution and removal on
- extension: An extension to append to the result value
- Returns the modified filebase with the given extension
- """
- filebase = re.sub("\s+", "_", filebase)
- filebase = re.sub("[^a-zA-Z0-9.\-_]", "", filebase)
- return filebase + "." + extension
-
- def _check_output_dir(self):
- # We may want to make this overridable by the user, perhaps
- # through an environment variable. Since we currently expect
- # lettuce to be run from our lettuce dir, we shall just use
- # the relative path 'output/'
- """
- Make sure the output directory for stdout/stderr redirection
- exists.
- Fails if it exists but is not a directory, or if it does not
- and we are unable to create it.
- """
- self._output_dir = os.getcwd() + os.sep + "output"
- if not os.path.exists(self._output_dir):
- os.mkdir(self._output_dir)
- assert os.path.isdir(self._output_dir),\
- self._output_dir + " is not a directory."
-
- def _create_filenames(self):
- """
- Derive the filenames for stdout/stderr redirection from the
- feature, scenario, and process name. The base will be
- "<Feature>-<Scenario>-<process name>.[stdout|stderr]"
- """
- filebase = self.step.scenario.feature.name + "-" +\
- self.step.scenario.name + "-" + self.process_name
- self.stderr_filename = self._output_dir + os.sep +\
- self.mangle_filename(filebase, "stderr")
- self.stdout_filename = self._output_dir + os.sep +\
- self.mangle_filename(filebase, "stdout")
-
- def stop_process(self):
- """
- Stop this process by calling terminate(). Blocks until process has
- exited. If remove_files_on_exit is True, redirected output files
- are removed.
- """
- if self.process is not None:
- self.process.terminate()
- self.process.wait()
- self.process = None
- if self.remove_files_on_exit:
- self._remove_files()
-
- def _remove_files(self):
- """
- Remove the files created for redirection of stdout/stderr output.
- """
- os.remove(self.stderr_filename)
- os.remove(self.stdout_filename)
-
- def _wait_for_output_str(self, filename, running_file, strings, only_new,
- matches=1):
- """
- Wait for a line of output in this process. This will (if
- only_new is False) check all output from the process including
- that may have been checked before. If only_new is True, it
- only checks output that has not been covered in previous calls
- to this method for the file (if there was no such previous call to
- this method, it works same as the case of only_new=False).
-
- Care should be taken if only_new is to be set to True, as it may cause
- counter-intuitive results. For example, assume the file is expected
- to contain a line that has XXX and another line has YYY, but the
- ordering is not predictable. If this method is called with XXX as
- the search string, but the line containing YYY appears before the
- target line, this method remembers the point in the file beyond
- the line that has XXX. If a next call to this method specifies
- YYY as the search string with only_new being True, the search will
- fail. If the same string is expected to appear multiple times
- and you want to catch the latest one, a more reliable way is to
- specify the match number and set only_new to False, if the number
- of matches is predictable.
-
- For each line in the output, the given strings array is checked. If
- any output lines checked contains one of the strings in the strings
- array, that string (not the line!) is returned.
- Parameters:
- filename: The filename to read previous output from, if applicable.
- running_file: The open file to read new output from.
- strings: Array of strings to look for.
- only_new: See above.
- matches: Check for the string this many times.
- Returns a tuple containing the matched string, and the complete line
- it was found in.
- Fails if none of the strings was read after 10 seconds
- (OUTPUT_WAIT_INTERVAL * OUTPUT_WAIT_MAX_INTERVALS).
- """
- # Identify the start offset of search. if only_new=True, start from
- # the farthest point we've reached in the file; otherwise start from
- # the beginning.
- if not filename in self.__file_offsets:
- self.__file_offsets[filename] = 0
- offset = self.__file_offsets[filename] if only_new else 0
- running_file.seek(offset)
-
- match_count = 0
- wait_count = 0
- while wait_count < OUTPUT_WAIT_MAX_INTERVALS:
- line = running_file.readline()
- where = running_file.tell()
- if line:
- for string in strings:
- if line.find(string) != -1:
- match_count += 1
- if match_count >= matches:
- # If we've gone further, update the recorded offset
- if where > self.__file_offsets[filename]:
- self.__file_offsets[filename] = where
- return (string, line)
- else:
- wait_count += 1
- time.sleep(OUTPUT_WAIT_INTERVAL)
- running_file.seek(where)
- assert False, "Timeout waiting for process output: " + str(strings)
-
- def wait_for_stderr_str(self, strings, only_new = True, matches = 1):
- """
- Wait for one of the given strings in this process's stderr output.
- Parameters:
- strings: Array of strings to look for.
- only_new: See _wait_for_output_str.
- matches: Check for the string this many times.
- Returns a tuple containing the matched string, and the complete line
- it was found in.
- Fails if none of the strings was read after 10 seconds
- (OUTPUT_WAIT_INTERVAL * OUTPUT_WAIT_MAX_INTERVALS).
- """
- return self._wait_for_output_str(self.stderr_filename, self.stderr,
- strings, only_new, matches)
-
- def wait_for_stdout_str(self, strings, only_new = True, matches = 1):
- """
- Wait for one of the given strings in this process's stdout output.
- Parameters:
- strings: Array of strings to look for.
- only_new: See _wait_for_output_str.
- matches: Check for the string this many times.
- Returns a tuple containing the matched string, and the complete line
- it was found in.
- Fails if none of the strings was read after 10 seconds
- (OUTPUT_WAIT_INTERVAL * OUTPUT_WAIT_MAX_INTERVALS).
- """
- return self._wait_for_output_str(self.stdout_filename, self.stdout,
- strings, only_new, matches)
-
-# Container class for a number of running processes
-# i.e. servers like bind10, etc
-# one-shot programs like dig or bindctl are started and closed separately
-class RunningProcesses:
- def __init__(self):
- """
- Initialize with no running processes.
- """
- self.processes = {}
-
- def add_process(self, step, process_name, args):
- """
- Start a process with the given arguments, and store it under the given
- name.
- Parameters:
- step: The scenario step it was called from. This is used for
- determining the output files for redirection of stdout
- and stderr.
- process_name: The name to refer to this running process later.
- args: Array of arguments to pass to Popen().
- Fails if a process with the given name is already running.
- """
- assert process_name not in self.processes,\
- "Process " + process_name + " already running"
- self.processes[process_name] = RunningProcess(step, process_name, args)
-
- def get_process(self, process_name):
- """
- Return the Process with the given process name.
- Parameters:
- process_name: The name of the process to return.
- Fails if the process is not running.
- """
- assert process_name in self.processes,\
- "Process " + name + " unknown"
- return self.processes[process_name]
-
- def stop_process(self, process_name):
- """
- Stop the Process with the given process name.
- Parameters:
- process_name: The name of the process to return.
- Fails if the process is not running.
- """
- assert process_name in self.processes,\
- "Process " + name + " unknown"
- self.processes[process_name].stop_process()
- del self.processes[process_name]
-
- def stop_all_processes(self):
- """
- Stop all running processes.
- """
- for process in self.processes.values():
- process.stop_process()
-
- def keep_files(self):
- """
- Keep the redirection files for stdout/stderr output of all processes
- instead of removing them when they are stopped later.
- """
- for process in self.processes.values():
- process.remove_files_on_exit = False
-
- def wait_for_stderr_str(self, process_name, strings, only_new = True, matches = 1):
- """
- Wait for one of the given strings in the given process's stderr output.
- Parameters:
- process_name: The name of the process to check the stderr output of.
- strings: Array of strings to look for.
- only_new: See _wait_for_output_str.
- matches: Check for the string this many times.
- Returns the matched string.
- Fails if none of the strings was read after 10 seconds
- (OUTPUT_WAIT_INTERVAL * OUTPUT_WAIT_MAX_INTERVALS).
- Fails if the process is unknown.
- """
- assert process_name in self.processes,\
- "Process " + process_name + " unknown"
- return self.processes[process_name].wait_for_stderr_str(strings,
- only_new,
- matches)
-
- def wait_for_stdout_str(self, process_name, strings, only_new = True, matches = 1):
- """
- Wait for one of the given strings in the given process's stdout output.
- Parameters:
- process_name: The name of the process to check the stdout output of.
- strings: Array of strings to look for.
- only_new: See _wait_for_output_str.
- matches: Check for the string this many times.
- Returns the matched string.
- Fails if none of the strings was read after 10 seconds
- (OUTPUT_WAIT_INTERVAL * OUTPUT_WAIT_MAX_INTERVALS).
- Fails if the process is unknown.
- """
- assert process_name in self.processes,\
- "Process " + process_name + " unknown"
- return self.processes[process_name].wait_for_stdout_str(strings,
- only_new,
- matches)
-
-@before.each_scenario
-def initialize(scenario):
- """
- Global initialization for each scenario.
- """
- # Keep track of running processes
- world.processes = RunningProcesses()
-
- # Convenience variable to access the last query result from querying.py
- world.last_query_result = None
-
- # Convenience variable to access the last HTTP response from http.py
- world.last_http_response = None
-
- # For slightly better errors, initialize a process_pids for the relevant
- # steps
- world.process_pids = None
-
- # Some tests can modify the settings. If the tests fail half-way, or
- # don't clean up, this can leave configurations or data in a bad state,
- # so we copy them from originals before each scenario
- for item in copylist:
- shutil.copy(item[0], item[1])
-
- for item in removelist:
- if os.path.exists(item):
- os.remove(item)
-
-@after.each_scenario
-def cleanup(scenario):
- """
- Global cleanup for each scenario.
- """
- # Keep output files if the scenario failed
- if not scenario.passed:
- world.processes.keep_files()
- # Stop any running processes we may have had around
- world.processes.stop_all_processes()
-
-# Environment check
-# Checks if LETTUCE_SETUP_COMPLETED is set in the environment
-# If not, abort with an error to use the run-script
-if 'LETTUCE_SETUP_COMPLETED' not in os.environ:
- print("Environment check failure; LETTUCE_SETUP_COMPLETED not set")
- print("Please use the run_lettuce.sh script. If you want to test an")
- print("installed version of bind10 with these tests, use")
- print("run_lettuce.sh -I [lettuce arguments]")
- sys.exit(1)
+++ /dev/null
-# Copyright (C) 2011 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-# This script provides transfer (ixfr/axfr) test functionality
-# It provides steps to perform the client side of a transfer,
-# and inspect the results.
-#
-# Like querying.py, it uses dig to do the transfers, and
-# places its output in a result structure. It also uses a custom client
-# implementation for less normal operations.
-#
-# This is done in a different file with different steps than
-# querying, because the format of dig's output is
-# very different than that of normal queries
-
-from lettuce import *
-import subprocess
-import re
-
-class TransferResult(object):
- """This object stores transfer results, which is essentially simply
- a list of RR strings. These are stored, as read from dig's output,
- in the list 'records'. So for an IXFR transfer it contains
- the exact result as returned by the server.
- If this list is empty, the transfer failed for some reason (dig
- does not really show error results well, unfortunately).
- We may add some smarter inspection functionality to this class
- later.
- """
- def __init__(self, args):
- """Perform the transfer by calling dig, and store the results.
- args is the array of arguments to pass to Popen(), this
- is passed as is since for IXFR and AXFR there can be very
- different options"""
- self.records = []
-
- # Technically, using a pipe here can fail; since we don't expect
- # large output right now, this works, but should we get a test
- # where we do have a lot of output, this could block, and we will
- # need to read the output in a different way.
- dig_process = subprocess.Popen(args, 1, None, None, subprocess.PIPE,
- None)
- result = dig_process.wait()
- assert result == 0
- for l in dig_process.stdout:
- line = l.strip()
- if len(line) > 0 and line[0] != ';':
- self.records.append(line)
-
-def parse_addr_port(address, port):
- if address is None:
- address = "::1" # default address
- # convert [IPv6_addr] to IPv6_addr:
- address = re.sub(r"\[(.+)\]", r"\1", address)
- if port is None:
- port = 56176 # default port
- return (address, port)
-
-@step('An AXFR transfer of ([\w.]+)(?: from ([\d.]+|\[[0-9a-fA-F:]+\])(?::([0-9]+))?)?')
-def perform_axfr(step, zone_name, address, port):
- """
- Perform an AXFR transfer, and store the result as an instance of
- TransferResult in world.transfer_result.
-
- Step definition:
- An AXFR transfer of <zone_name> [from <address>:<port>]
-
- Address defaults to ::1
- Port defaults to 56176
- """
- (address, port) = parse_addr_port(address, port)
- args = [ 'dig', 'AXFR', '@' + str(address), '-p', str(port), zone_name ]
- world.transfer_result = TransferResult(args)
-
-@step('A customized AXFR transfer of ([\w.]+)(?: from ([\d.]+|\[[0-9a-fA-F:]+\])(?::([0-9]+))?)?(?: with pause of (\d+) seconds?)?')
-def perform_custom_axfr(step, zone_name, address, port, delay):
- """Checks AXFR transfer, and store the result in the form of internal
- CustomTransferResult class, which is compatible with TransferResult.
-
- Step definition:
- A customized AXFR transfer of <zone_name> [from <address>:<port>] [with pause of <delay> second]
-
- If optional delay is specified (not None), it waits for the specified
- seconds after sending the AXFR query before starting receiving
- responses. This emulates a slower AXFR client.
-
- """
-
- class CustomTransferResult:
- """Store transfer result only on the number of received answer RRs.
-
- To be compatible with TransferResult it stores the result in the
- 'records' attribute, which is a list. But its content is
- meaningless; its only use is to be used with
- check_transfer_result_count where its length is of concern.
-
- """
- def __init__(self):
- self.records = []
-
- # Build arguments and run xfr-client.py. On success, it simply dumps
- # the number of received answer RRs to stdout.
- (address, port) = parse_addr_port(address, port)
- args = ['/bin/sh', 'run_python-tool.sh', 'tools/xfr-client.py',
- '-s', address, '-p', str(port)]
- if delay is not None:
- args.extend(['-d', delay])
- args.append(zone_name)
- client = subprocess.Popen(args, 1, None, None, subprocess.PIPE,
- subprocess.PIPE)
- (stdout, stderr) = client.communicate()
- result = client.returncode
- world.last_client_stdout = stdout
- world.last_client_stderr = stderr
- assert result == 0, "xfr-client exit code: " + str(result) +\
- "\nstdout:\n" + str(stdout) +\
- "stderr:\n" + str(stderr)
- num_rrs = int(stdout.strip())
-
- # Make the result object, storing dummy value (None) for the number of
- # answer RRs in the records list.
- world.transfer_result = CustomTransferResult()
- world.transfer_result.records = [None for _ in range(0, num_rrs)]
-
-@step('An IXFR transfer of ([\w.]+) (\d+)(?: from ([^:]+)(?::([0-9]+))?)?(?: over (tcp|udp))?')
-def perform_ixfr(step, zone_name, serial, address, port, protocol):
- """
- Perform an IXFR transfer, and store the result as an instance of
- TransferResult in world.transfer_result.
-
- Step definition:
- An IXFR transfer of <zone_name> <serial> [from <address>:port] [over <tcp|udp>]
-
- Address defaults to 127.0.0.1
- Port defaults to 56176
- If either tcp or udp is specified, only this protocol will be used.
- """
- if address is None:
- address = "127.0.0.1"
- if port is None:
- port = 56176
- args = [ 'dig', 'IXFR=' + str(serial), '@' + str(address), '-p', str(port), zone_name ]
- if protocol is not None:
- assert protocol == 'tcp' or protocol == 'udp', "Unknown protocol: " + protocol
- if protocol == 'tcp':
- args.append('+tcp')
- elif protocol == 'udp':
- args.append('+notcp')
- world.transfer_result = TransferResult(args)
-
-@step('transfer result should have (\d+) rrs?')
-def check_transfer_result_count(step, number_of_rrs):
- """
- Check the number of rrs in the transfer result object created by
- the AXFR transfer or IXFR transfer step.
-
- Step definition:
- transfer result should have <number> rr[s]
-
- Fails if the number of RRs is not equal to number
- """
- assert int(number_of_rrs) == len(world.transfer_result.records),\
- "Got " + str(len(world.transfer_result.records)) +\
- " records, expected " + str(number_of_rrs)
-
-@step('full result of the last transfer should be')
-def check_full_transfer_result(step):
- """
- Check the complete output from the last transfer call.
-
- Step definition:
- full result of the last transfer should be <multiline value>
-
- Whitespace is normalized in both the multiline value and the
- output, but the order of the output is not.
- Fails if there is any difference between the two. Prints
- full output and expected value upon failure.
- """
- records_string = "\n".join(world.transfer_result.records)
- records_string = re.sub("[ \t]+", " ", records_string)
- expect = re.sub("[ \t]+", " ", step.multiline)
- assert records_string.strip() == expect.strip(),\
- "Got:\n'" + records_string + "'\nExpected:\n'" + expect + "'"
+++ /dev/null
-Feature: Xfrin
- Tests for Xfrin, specific for BIND 10 behaviour.
-
- Scenario: Retransfer command
- # Standard check to test (non-)existence of a file.
- # This file is actually automatically created.
- The file data/test_nonexistent_db.sqlite3 should not exist
-
- Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
-
- And I have bind10 running with configuration xfrin/retransfer_slave.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- # Now we use the first step again to see if the file has been created.
- # The DB currently doesn't know anything about the zone, so we install
- # an empty zone for xfrin.
- The file data/test_nonexistent_db.sqlite3 should exist
- A query for www.example.org to [::1]:56176 should have rcode REFUSED
- Then make empty zone example.org in DB file data/test_nonexistent_db.sqlite3
-
- When I send bind10 the command Xfrin retransfer example.org IN ::1 56177
- # The data we receive contain a NS RRset that refers to three names in the
- # example.org. zone. All these three are nonexistent in the data, producing
- # 3 separate warning messages in the log.
- And wait for new bind10 stderr message XFRIN_ZONE_WARN
- And wait for new bind10 stderr message XFRIN_ZONE_WARN
- And wait for new bind10 stderr message XFRIN_ZONE_WARN
- # But after complaining, the zone data should be accepted.
- Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
- # there's no guarantee this is logged before XFRIN_TRANSFER_SUCCESS, so
- # we can't reliably use 'wait for new'. In this case this should be the
- # only occurrence of this message, so this should be okay.
- Then wait for bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
- A query for www.example.org to [::1]:56176 should have rcode NOERROR
-
- # The transferred zone should have 11 non-NSEC3 RRs and 1 NSEC3 RR.
- # The following check will get these by AXFR, so the total # of RRs
- # should be 13, counting the duplicated SOA.
- # At this point we can confirm both in and out of AXFR for a zone
- # containing an NSEC3 RR.
- # We don't have to specify the address/port here; the defaults will work.
- When I do an AXFR transfer of example.org
- Then transfer result should have 13 rrs
-
- # Now try to offer another update. However, the validation of
- # data should fail. The old version shoud still be available.
- When I send bind10 the following commands with cmdctl port 56174:
- """
- config set data_sources/classes/IN[0]/params/database_file data/example.org-nons.sqlite3
- config set Auth/database_file data/example.org-nons.sqlite3
- config commit
- """
- Then I send bind10 the command Xfrin retransfer example.org IN ::1 56177
- And wait for new bind10 stderr message XFRIN_ZONE_INVALID
- And wait for new bind10 stderr message XFRIN_INVALID_ZONE_DATA
- # We can't use 'wait for new' here; see above.
- Then wait for bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED
- A query for example.org type NS to [::1]:56176 should have rcode NOERROR
- And transfer result should have 13 rrs
-
- Scenario: Transfer with TSIG
- # Similar setup to the test above, but this time, we add TSIG configuration
-
- # In order to check that the tests don't give false positives because config
- # happens to be right (like no TSIG on either side), we take an existing
- # non-TSIG config, add TSIG on the master side, see it fail, add TSIG
- # on the slave side, then check again.
-
- Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 56174 as master
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
-
- And I have bind10 running with configuration xfrin/retransfer_slave.conf
- And wait for bind10 stderr message CMDCTL_STARTED
- And wait for bind10 stderr message XFRIN_STARTED
-
- # For xfrin make the data source aware of the zone (with empty data)
- Then make empty zone example.org in DB file data/test_nonexistent_db.sqlite3
-
- # Set slave config for 'automatic' xfrin
- When I set bind10 configuration Xfrin/zones to [{"master_port": 56176, "name": "example.org", "master_addr": "::1"}]
-
- # Make sure it is fully open
- When I send bind10 the command Xfrin retransfer example.org
- Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
- # this can't be 'wait for new'; see above.
- And wait for bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
-
- # First to master, a transfer should then fail
- When I send bind10 the following commands with cmdctl port 56174:
- """
- config add tsig_keys/keys "example.key.:c2VjcmV0"
- config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "::1", "key": "example.key."}]
- config commit
- """
-
- # Transfer should fail
- When I send bind10 the command Xfrin retransfer example.org
- Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_PROTOCOL_VIOLATION not XFRIN_TRANSFER_SUCCESS
- # Set client to use TSIG as well
- When I send bind10 the following commands:
- """
- config add tsig_keys/keys "example.key.:c2VjcmV0"
- config set Xfrin/zones[0]/tsig_key "example.key."
- config commit
- """
-
- # Transwer should succeed now
- When I send bind10 the command Xfrin retransfer example.org
- Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
-
- Scenario: Validation fails
- # In this test, the source data of the XFR is invalid (missing NS record
- # at the origin). We check it is rejected after the transfer.
- #
- # We use abuse the fact that we do not check data when we read it from
- # the sqlite3 database (unless we load into in-memory, which we don't
- # do here).
- The file data/test_nonexistent_db.sqlite3 should not exist
-
- Given I have bind10 running with configuration xfrin/retransfer_master_nons.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
-
- And I have bind10 running with configuration xfrin/retransfer_slave.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- # Now we use the first step again to see if the file has been created,
- # then install empty zone data
- The file data/test_nonexistent_db.sqlite3 should exist
- A query for www.example.org to [::1]:56176 should have rcode REFUSED
- Then make empty zone example.org in DB file data/test_nonexistent_db.sqlite3
-
- When I send bind10 the command Xfrin retransfer example.org IN ::1 56177
- # It should complain once about invalid data, then again that the whole
- # zone is invalid and then reject it.
- And wait for new bind10 stderr message XFRIN_ZONE_INVALID
- And wait for new bind10 stderr message XFRIN_INVALID_ZONE_DATA
- # This can't be 'wait for new'
- Then wait for bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED
- # The zone still doesn't exist as it is rejected.
- # FIXME: This step fails. Probably an empty zone is created in the data
- # source :-|. This should be REFUSED, not SERVFAIL.
- A query for www.example.org to [::1]:56176 should have rcode SERVFAIL
-
- # TODO:
- # * IXFR - generate an sqlite db that contains the journal. Check it was
- # IXFR by logs.
- # * IXFR->AXFR fallback if IXFR is not available (even rejected or
- # something, not just the differences missing).
- # * Retransfer with short refresh time (without notify).
- Scenario: With differences
- # We transfer from one bind10 to other, just like in the Retransfer command
- # scenario. Just this time, the master contains the differences table
- # and the slave has a previous version of the zone, so we use the IXFR.
-
- Given I have bind10 running with configuration xfrin/retransfer_master_diffs.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
-
- And I have bind10 running with configuration xfrin/retransfer_slave_diffs.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- A query for example. type SOA to [::1]:56176 should have rcode NOERROR
- The answer section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. hostmaster.example. 94 3600 900 7200 300
- """
-
- # To invoke IXFR we need to use refresh command
- When I send bind10 the command Xfrin refresh example. IN ::1 56177
- Then wait for new bind10 stderr message XFRIN_GOT_INCREMENTAL_RESP
- Then wait for new bind10 stderr message XFRIN_IXFR_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
- # This can't be 'wait for new'
- Then wait for bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
-
- A query for example. type SOA to [::1]:56176 should have rcode NOERROR
- The answer section of the last query response should be
- """
- example. 3600 IN SOA ns1.example. hostmaster.example. 100 3600 900 7200 300
- """
+++ /dev/null
-Feature: Xfrin incoming notify handling
- Tests for Xfrin incoming notify handling. They also test
- statistics counters incremented, which are related to notifying
- and transferring by Xfrout and receiveing by Xfrin. Some cases are
- considered: Transferring is done via IPv4 or IPv6 transport. A
- transfer request from Xfrin is rejected by Xfrout. The master
- server or slave server is unreachable.
-
- Scenario: Handle incoming notify
- Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
- And wait for master stderr message STATS_STARTING
-
- And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- A query for www.example.org to [::1]:56176 should have rcode NXDOMAIN
-
- #
- # Test1 for Xfrout statistics
- #
- check initial statistics not containing example.org for Xfrout with cmdctl port 56174 except for the following items
- | item_name | min_value | max_value |
- | socket.unixdomain.open | 0 | 1 |
- # Note: .Xfrout.socket.unixdomain.open can be either expected to
- # be 0 or 1 here. The reason is: if b10-xfrout has started up and is
- # ready for a request from b10-stats, then b10-stats does request
- # to b10-xfrout and the value results in 1. Otherwise if
- # b10-xfrout is starting and isn't yet ready, then b10-stats
- # doesn't request to b10-xfrout and the value still remains to be the
- # default value(0).
-
- #
- # Test2 for Xfrin statistics
- #
- check initial statistics not containing example.org for Xfrin except for the following items
- | item_name | min_value | max_value |
- | soa_in_progress | 0 | 1 |
- | axfr_running | 0 | 1 |
- # Note: soa_in_progress and axfr_running cannot be always a fixed value. The
- # reason is same as the case of .Xfrout.socket.unixdomain.open. as described
- # above.
-
- When I send bind10 with cmdctl port 56174 the command Xfrout notify example.org IN
- Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
- Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
- Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
- # Note: The following waits should be for *new* log messages, or
- # they will match older log messages that were generated by AXFR
- # during startup.
- Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
- Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
- Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
- Then wait for new master stderr message NOTIFY_OUT_REPLY_RECEIVED
-
- A query for www.example.org to [::1]:56176 should have rcode NOERROR
- # Make sure handling statistics command handling checked below is
- # after this query
- And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
-
- #
- # Test3 for Xfrout statistics
- #
- # check statistics change
- #
-
- # wait until the last stats requesting is finished
- When I query statistics zones of bind10 module Xfrout with cmdctl port 56174
- # note that this does not 100% guarantee the stats updated Xfrout
- # statistics. But there doesn't seem to be a better log message that
- # suggests this event.
- wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
- last bindctl output should not contain "error"
-
- When I query statistics zones of bind10 module Xfrout with cmdctl port 56174
- The statistics counters are 0 in category .Xfrout.zones.IN except for the following items
- | item_name | item_value |
- | _SERVER_.notifyoutv6 | 1 |
- | _SERVER_.xfrreqdone | 1 |
- | example.org..notifyoutv6 | 1 |
- | example.org..xfrreqdone | 1 |
-
- When I query statistics socket of bind10 module Xfrout with cmdctl port 56174
- The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
- | item_name | item_value |
- | open | 1 |
- | accept | 1 |
-
- #
- # Test4 for Xfrin statistics
- #
- # check statistics change
- #
-
- # wait until the last stats requesting is finished
- When I query statistics zones of bind10 module Xfrin with cmdctl
- wait for new bind10 stderr message XFRIN_RECEIVED_COMMAND
- last bindctl output should not contain "error"
-
- When I query statistics of bind10 module Xfrin with cmdctl
- The statistics counters are 0 in category .Xfrin except for the following items
- | item_name | item_value | min_value |
- | zones.IN._SERVER_.soaoutv6 | 1 | |
- | zones.IN._SERVER_.axfrreqv6 | 1 | |
- | zones.IN._SERVER_.xfrsuccess | 1 | |
- | zones.IN._SERVER_.last_axfr_duration | | 0.0 |
- | zones.IN.example.org..soaoutv6 | 1 | |
- | zones.IN.example.org..axfrreqv6 | 1 | |
- | zones.IN.example.org..xfrsuccess | 1 | |
- | zones.IN.example.org..last_axfr_duration | | 0.0 |
- | soa_in_progress | 0 | |
- | axfr_running | 0 | |
- | socket.ipv6.tcp.open | | 1 |
- | socket.ipv6.tcp.close | | 1 |
- | socket.ipv6.tcp.conn | | 1 |
- | socket.ipv6.tcp.connfail | 0 | |
-
- #
- # Test for handling incoming notify only in IPv4
- #
- Scenario: Handle incoming notify (IPv4)
- Given I have bind10 running with configuration xfrin/retransfer_master_v4.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
- And wait for master stderr message STATS_STARTING
-
- And I have bind10 running with configuration xfrin/retransfer_slave_notify_v4.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- A query for www.example.org to 127.0.0.1:56176 should have rcode NXDOMAIN
-
- #
- # Test1 for Xfrout statistics
- #
- check initial statistics not containing example.org for Xfrout with cmdctl port 56174 except for the following items
- | item_name | min_value | max_value |
- | socket.unixdomain.open | 0 | 1 |
- # Note: See above about .Xfrout.socket.unixdomain.open.
-
- #
- # Test2 for Xfrin statistics
- #
- check initial statistics not containing example.org for Xfrin except for the following items
- | item_name | min_value | max_value |
- | soa_in_progress | 0 | 1 |
- | axfr_running | 0 | 1 |
- # Note: See above about soa_in_progress and axfr_running of Xfrin
-
- When I send bind10 with cmdctl port 56174 the command Xfrout notify example.org IN
- Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
- Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
- Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
- # Note: The following waits should be for *new* log messages, or
- # they will match older log messages that were generated by AXFR
- # during startup.
- Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
- Then wait for new bind10 stderr message XFRIN_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
- Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
- Then wait for new master stderr message NOTIFY_OUT_REPLY_RECEIVED
-
- A query for www.example.org to 127.0.0.1:56176 should have rcode NOERROR
- # Make sure handling statistics command handling checked below is
- # after this query
- And wait for bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
-
- #
- # Test3 for Xfrout statistics
- #
- # check statistics change
- #
-
- # wait until the last stats requesting is finished
- When I query statistics zones of bind10 module Xfrout with cmdctl port 56174
- # note that this does not 100% guarantee the stats updated Xfrout
- # statistics. But there doesn't seem to be a better log message that
- # suggests this event.
- wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
- last bindctl output should not contain "error"
-
- When I query statistics zones of bind10 module Xfrout with cmdctl port 56174
- The statistics counters are 0 in category .Xfrout.zones.IN except for the following items
- | item_name | item_value |
- | _SERVER_.notifyoutv4 | 1 |
- | _SERVER_.xfrreqdone | 1 |
- | example.org..notifyoutv4 | 1 |
- | example.org..xfrreqdone | 1 |
-
- When I query statistics socket of bind10 module Xfrout with cmdctl port 56174
- The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
- | item_name | item_value |
- | open | 1 |
- | accept | 1 |
-
- #
- # Test4 for Xfrin statistics
- #
- # check statistics change
- #
-
- # wait until the last stats requesting is finished
- When I query statistics zones of bind10 module Xfrin with cmdctl
- wait for new bind10 stderr message XFRIN_RECEIVED_COMMAND
- last bindctl output should not contain "error"
-
- When I query statistics of bind10 module Xfrin with cmdctl
- The statistics counters are 0 in category .Xfrin except for the following items
- | item_name | item_value | min_value |
- | zones.IN._SERVER_.soaoutv4 | 1 | |
- | zones.IN._SERVER_.axfrreqv4 | 1 | |
- | zones.IN._SERVER_.xfrsuccess | 1 | |
- | zones.IN._SERVER_.last_axfr_duration | | 0.0 |
- | zones.IN.example.org..soaoutv4 | 1 | |
- | zones.IN.example.org..axfrreqv4 | 1 | |
- | zones.IN.example.org..xfrsuccess | 1 | |
- | zones.IN.example.org..last_axfr_duration | | 0.0 |
- | soa_in_progress | 0 | |
- | axfr_running | 0 | |
- | socket.ipv4.tcp.open | | 1 |
- | socket.ipv4.tcp.close | | 1 |
- | socket.ipv4.tcp.conn | | 1 |
- | socket.ipv4.tcp.connfail | 0 | |
-
- #
- # Test for Xfr request rejected
- #
- Scenario: Handle incoming notify (XFR request rejected)
- Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
- And wait for master stderr message STATS_STARTING
-
- And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- A query for www.example.org to [::1]:56176 should have rcode NXDOMAIN
-
- #
- # Test1 for Xfrout statistics
- #
- check initial statistics not containing example.org for Xfrout with cmdctl port 56174 except for the following items
- | item_name | min_value | max_value |
- | socket.unixdomain.open | 0 | 1 |
- # Note: See above about .Xfrout.socket.unixdomain.open.
-
- #
- # Test2 for Xfrin statistics
- #
- check initial statistics not containing example.org for Xfrin except for the following items
- | item_name | min_value | max_value |
- | soa_in_progress | 0 | 1 |
- | axfr_running | 0 | 1 |
- # Note: See above about soa_in_progress and axfr_running of Xfrin
-
- #
- # set transfer_acl rejection
- # Local xfr requests from Xfrin module would be rejected here.
- #
- When I send bind10 the following commands with cmdctl port 56174
- """
- config set Xfrout/zone_config[0]/transfer_acl [{"action": "REJECT", "from": "::1"}]
- config commit
- """
- last bindctl output should not contain Error
- Then wait for new master stderr message XFROUT_NEW_CONFIG_DONE
-
- When I send bind10 with cmdctl port 56174 the command Xfrout notify example.org IN
- Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
- Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
- Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
- # Note: The following waits should be for *new* log messages, or
- # they will match older log messages that were generated by AXFR
- # during startup.
- Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
- Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_PROTOCOL_VIOLATION not XFRIN_TRANSFER_SUCCESS
- Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED not ZONEMGR_RECEIVE_XFRIN_SUCCESS
- Then wait for new master stderr message NOTIFY_OUT_REPLY_RECEIVED
-
- A query for www.example.org to [::1]:56176 should have rcode NXDOMAIN
-
- #
- # Test3 for Xfrout statistics
- #
- # check statistics change
- #
-
- # wait until the last stats requesting is finished
- When I query statistics zones of bind10 module Xfrout with cmdctl port 56174
- wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
- last bindctl output should not contain "error"
-
- When I query statistics zones of bind10 module Xfrout with cmdctl port 56174
- The statistics counters are 0 in category .Xfrout.zones.IN except for the following items
- | item_name | item_value | min_value | max_value |
- | _SERVER_.notifyoutv6 | 1 | | |
- | _SERVER_.xfrrej | | 1 | 3 |
- | example.org..notifyoutv6 | 1 | | |
- | example.org..xfrrej | | 1 | 3 |
- # Note: The above rejection counters might sometimes be increased
- # up to 3. See this for details
- # http://git.bind10.isc.org/~tester/builder/BIND10-lettuce/20120918210000-MacOS/logs/lettuce.out
-
- When I query statistics socket of bind10 module Xfrout with cmdctl port 56174
- The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
- | item_name | item_value |
- | open | 1 |
- | accept | 1 |
-
- #
- # Test4 for Xfrin statistics
- #
- # check statistics change
- #
-
- # wait until the last stats requesting is finished
- When I query statistics zones of bind10 module Xfrin with cmdctl
- wait for new bind10 stderr message XFRIN_RECEIVED_COMMAND
- last bindctl output should not contain "error"
-
- When I query statistics of bind10 module Xfrin with cmdctl
- The statistics counters are 0 in category .Xfrin except for the following items
- | item_name | item_value | min_value |
- | zones.IN._SERVER_.soaoutv6 | | 1 |
- | zones.IN._SERVER_.axfrreqv6 | | 1 |
- | zones.IN._SERVER_.xfrfail | | 1 |
- | zones.IN.example.org..soaoutv6 | | 1 |
- | zones.IN.example.org..axfrreqv6 | | 1 |
- | zones.IN.example.org..xfrfail | | 1 |
- | soa_in_progress | | 0 |
- | axfr_running | | 0 |
- | socket.ipv6.tcp.open | | 1 |
- | socket.ipv6.tcp.close | | 1 |
- | socket.ipv6.tcp.conn | | 1 |
- | socket.ipv6.tcp.connfail | 0 | |
-
- #
- # Test for Xfr request rejected in IPv4
- #
- Scenario: Handle incoming notify (XFR request rejected in IPv4)
- Given I have bind10 running with configuration xfrin/retransfer_master_v4.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
- And wait for master stderr message STATS_STARTING
-
- And I have bind10 running with configuration xfrin/retransfer_slave_notify_v4.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- A query for www.example.org to 127.0.0.1:56176 should have rcode NXDOMAIN
-
- #
- # Test1 for Xfrout statistics
- #
- check initial statistics not containing example.org for Xfrout with cmdctl port 56174 except for the following items
- | item_name | min_value | max_value |
- | socket.unixdomain.open | 0 | 1 |
- # Note: See above about .Xfrout.socket.unixdomain.open.
-
- #
- # Test2 for Xfrin statistics
- #
- check initial statistics not containing example.org for Xfrin except for the following items
- | item_name | min_value | max_value |
- | soa_in_progress | 0 | 1 |
- | axfr_running | 0 | 1 |
- # Note: See above about soa_in_progress and axfr_running of Xfrin
-
- #
- # set transfer_acl rejection
- # Local xfr requests from Xfrin module would be rejected here.
- #
- When I send bind10 the following commands with cmdctl port 56174
- """
- config set Xfrout/zone_config[0]/transfer_acl [{"action": "REJECT", "from": "127.0.0.1"}]
- config commit
- """
- last bindctl output should not contain Error
- Then wait for new master stderr message XFROUT_NEW_CONFIG_DONE
-
- When I send bind10 with cmdctl port 56174 the command Xfrout notify example.org IN
- Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
- Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
- Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
- # Note: The following waits should be for *new* log messages, or
- # they will match older log messages that were generated by AXFR
- # during startup.
- Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_STARTED
- Then wait for new bind10 stderr message XFRIN_XFR_TRANSFER_PROTOCOL_VIOLATION not XFRIN_TRANSFER_SUCCESS
- Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED not ZONEMGR_RECEIVE_XFRIN_SUCCESS
- Then wait for new master stderr message NOTIFY_OUT_REPLY_RECEIVED
-
- A query for www.example.org to 127.0.0.1:56176 should have rcode NXDOMAIN
-
- #
- # Test3 for Xfrout statistics
- #
- # check statistics change
- #
-
- When I query statistics zones of bind10 module Xfrout with cmdctl port 56174
- # wait until stats request at least after NOTIFY_OUT_REPLY_RECEIVED
- wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
- last bindctl output should not contain "error"
-
- When I query statistics zones of bind10 module Xfrout with cmdctl port 56174
- The statistics counters are 0 in category .Xfrout.zones.IN except for the following items
- | item_name | item_value | min_value | max_value |
- | _SERVER_.notifyoutv4 | 1 | | |
- | _SERVER_.xfrrej | | 1 | 3 |
- | example.org..notifyoutv4 | 1 | | |
- | example.org..xfrrej | | 1 | 3 |
- # Note: The above rejection counters might sometimes be increased
- # up to 3. See this for details
- # http://git.bind10.isc.org/~tester/builder/BIND10-lettuce/20120918210000-MacOS/logs/lettuce.out
-
- When I query statistics socket of bind10 module Xfrout with cmdctl port 56174
- The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
- | item_name | item_value |
- | open | 1 |
- | accept | 1 |
-
- #
- # Test4 for Xfrin statistics
- #
- # check statistics change
- #
-
- # wait until the last stats requesting is finished
- When I query statistics zones of bind10 module Xfrin with cmdctl
- wait for new bind10 stderr message XFRIN_RECEIVED_COMMAND
- last bindctl output should not contain "error"
-
- When I query statistics of bind10 module Xfrin with cmdctl
- The statistics counters are 0 in category .Xfrin except for the following items
- | item_name | item_value | min_value |
- | zones.IN._SERVER_.soaoutv4 | | 1 |
- | zones.IN._SERVER_.axfrreqv4 | | 1 |
- | zones.IN._SERVER_.xfrfail | | 1 |
- | zones.IN.example.org..soaoutv4 | | 1 |
- | zones.IN.example.org..axfrreqv4 | | 1 |
- | zones.IN.example.org..xfrfail | | 1 |
- | soa_in_progress | | 0 |
- | axfr_running | | 0 |
- | socket.ipv4.tcp.open | | 1 |
- | socket.ipv4.tcp.close | | 1 |
- | socket.ipv4.tcp.conn | | 1 |
- | socket.ipv4.tcp.connfail | 0 | |
-
- #
- # Test for unreachable slave
- #
- Scenario: Handle incoming notify (unreachable slave)
- Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
- And wait for master stderr message STATS_STARTING
-
- When I send bind10 with cmdctl port 56174 the command Xfrout notify example.org IN
- Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
- Then wait for new master stderr message NOTIFY_OUT_SENDING_NOTIFY
- Then wait for new master stderr message NOTIFY_OUT_TIMEOUT
-
- #
- # Test1 for Xfrout statistics
- #
- # check statistics change
- #
-
- When I query statistics zones of bind10 module Xfrout with cmdctl port 56174
- # wait until stats request at least after NOTIFY_OUT_TIMEOUT
- wait for new master stderr message XFROUT_RECEIVED_GETSTATS_COMMAND
- last bindctl output should not contain "error"
-
- When I query statistics zones of bind10 module Xfrout with cmdctl port 56174
- The statistics counters are 0 in category .Xfrout.zones.IN except for the following items
- | item_name | min_value | max_value |
- | _SERVER_.notifyoutv6 | 1 | 5 |
- | example.org..notifyoutv6 | 1 | 5 |
-
- When I query statistics socket of bind10 module Xfrout with cmdctl port 56174
- The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
- | item_name | item_value |
- | open | 1 |
-
- #
- # Test for NOTIFY that would result in NOTAUTH
- #
- Scenario: Handle incoming notify that does match authoritative zones
- Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
- And wait for master stderr message STATS_STARTING
-
- And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- #
- # replace master's data source with unmatched zone for slave's zone.
- # we restart Xfrout to make it sure.
- #
- When I send bind10 the following commands with cmdctl port 56174
- """
- config set data_sources/classes/IN[0]/params/database_file data/ixfr-out/zones.sqlite3
- config set Auth/database_file data/ixfr-out/zones.sqlite3
- config set Xfrout/zone_config[0]/origin example.com
- config commit
- Xfrout shutdown
- """
- last bindctl output should not contain "error"
- And wait for new master stderr message XFROUT_STARTED
-
- A query for www.example.com to [::1]:56176 should have rcode REFUSED
-
- When I send bind10 with cmdctl port 56174 the command Xfrout notify example.com IN
- Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
- Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY_NOTAUTH
- Then wait for new master stderr message NOTIFY_OUT_REPLY_RECEIVED
-
- A query for www.example.com to [::1]:56176 should have rcode REFUSED
-
- #
- # Test for NOTIFY that's not in the secondaries list
- #
- Scenario: Handle incoming notify that is not in the secondaries list
- Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
- And wait for master stderr message STATS_STARTING
-
- And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- #
- # Empty slave's secondaries list, and restart zonemgr to make it sure
- #
- When I send bind10 the following commands with cmdctl
- """
- config remove Zonemgr/secondary_zones[0]
- config commit
- Zonemgr shutdown
- """
- last bindctl output should not contain "error"
- And wait for new bind10 stderr message ZONEMGR_STARTED
-
- A query for www.example.org to [::1]:56176 should have rcode NXDOMAIN
-
- When I send bind10 with cmdctl port 56174 the command Xfrout notify example.org IN
- Then wait for new master stderr message XFROUT_NOTIFY_COMMAND
- Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
- Then wait for new bind10 stderr message ZONEMGR_RECEIVE_NOTIFY
- Then wait for new bind10 stderr message ZONEMGR_ZONE_NOTIFY_NOT_SECONDARY
- Then wait for new master stderr message NOTIFY_OUT_REPLY_RECEIVED
-
- A query for www.example.org to [::1]:56176 should have rcode NXDOMAIN
-
- #
- # Test for NOTIFY when zonemgr is not running
- #
- Scenario: Handle incoming notify while zonemgr is not running
- Given I have bind10 running with configuration xfrin/retransfer_master.conf with cmdctl port 56174 as master
- And wait for master stderr message BIND10_STARTED_CC
- And wait for master stderr message CMDCTL_STARTED
- And wait for master stderr message AUTH_SERVER_STARTED
- And wait for master stderr message XFROUT_STARTED
- And wait for master stderr message ZONEMGR_STARTED
- And wait for master stderr message STATS_STARTING
-
- And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- # remove zonemgr from the system. a subsequent notify is ignored, but
- # an error message shouldn't be logged at auth.
- When I send bind10 the following commands with cmdctl
- """
- config remove Init/components b10-zonemgr
- config commit
- """
- last bindctl output should not contain "error"
- And wait for new bind10 stderr message BIND10_PROCESS_ENDED
-
- A query for www.example.org to [::1]:56176 should have rcode NXDOMAIN
-
- When I send bind10 with cmdctl port 56174 the command Xfrout notify example.org IN
- Then wait for master stderr message XFROUT_NOTIFY_COMMAND
- Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY
- Then wait for new bind10 stderr message AUTH_ZONEMGR_NOTEXIST not AUTH_ZONEMGR_ERROR
- Then wait for master stderr message NOTIFY_OUT_TIMEOUT not NOTIFY_OUT_REPLY_RECEIVED
-
- A query for www.example.org to [::1]:56176 should have rcode NXDOMAIN
-
- #
- # Test for unreachable master
- #
- Scenario: Handle incoming notify (unreachable master)
-
- And I have bind10 running with configuration xfrin/retransfer_slave_notify.conf
- 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
- And wait for bind10 stderr message XFRIN_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- A query for www.example.org to [::1]:56176 should have rcode NXDOMAIN
-
- #
- # Test1 for Xfrin statistics
- #
- check initial statistics not containing example.org for Xfrin
-
- #
- # execute reftransfer for Xfrin
- #
- When I send bind10 the command Xfrin retransfer example.org IN
- Then wait for new bind10 stderr message XFRIN_CONNECT_MASTER
- Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_FAILED
-
- #
- # Test2 for Xfrin statistics
- #
- # check initial statistics
- #
-
- # wait until the last stats requesting is finished
- wait for new bind10 stderr message STATS_SEND_STATISTICS_REQUEST
- wait for new bind10 stderr message XFRIN_RECEIVED_COMMAND
-
- When I query statistics socket of bind10 module Xfrin with cmdctl
- The statistics counters are 0 in category .Xfrin.socket.ipv6.tcp except for the following items
- | item_name | min_value |
- | open | 1 |
- | close | 1 |
- | connfail | 1 |
+++ /dev/null
-Feature: Xfrout
- Tests for Xfrout, specific for BIND 10 behaviour.
-
- Scenario: normal transfer with a moderate number of RRs
-
- Load 100 records for zone example.org to DB file data/xfrout.sqlite3
-
- Given I have bind10 running with configuration xfrout_master.conf
- 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
- And wait for bind10 stderr message XFROUT_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- # The transferred zone should have the generated 100 RRs plush one
- # trailing SOA.
- When I do a customized AXFR transfer of example.org
- Then transfer result should have 101 rrs
-
- # Similar to the previous one, but using a much larger zone, and with
- # a small delay at the client side. It should still succeed.
- # The specific delay (5 seconds) was chosen for an environment that
- # revealed a bug which is now fixed to reproduce the issue; shorter delays
- # didn't trigger the problem. Depending on the OS implementation, machine
- # speed, etc, the same delay may be too long or too short, but in any case
- # the test should succeed now.
- Scenario: transfer a large zone
-
- Load 50000 records for zone example.org to DB file data/xfrout.sqlite3
-
- Given I have bind10 running with configuration xfrout_master.conf
- 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
- And wait for bind10 stderr message XFROUT_STARTED
- And wait for bind10 stderr message ZONEMGR_STARTED
-
- When I do a customized AXFR transfer of example.org from [::1]:56176 with pause of 5 seconds
- Then transfer result should have 50001 rrs
+++ /dev/null
-#! /bin/sh
-
-# Copyright (C) 2012 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-if [ "$1" = "-I" ]; then
- shift
- echo "$@"
- LETTUCE_SETUP_COMPLETED=1 exec lettuce $@
-else
- . ./setup_intree_bind10.sh
- exec lettuce $@
-fi
+++ /dev/null
-#!/bin/sh
-
-# Copyright (C) 2013 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-# This script runs the specified python program, referring to the in-tree
-# BIND 10 Python libraries (in case the program needs them)
-# usage example: run_python-tool.sh tools/xfr-client.py -p 5300 example.org
-
-. ./setup_intree_bind10.sh
-$PYTHON_EXEC $*
+++ /dev/null
-#! /bin/sh
-
-# Copyright (C) 2010 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-PYTHON_EXEC=${PYTHON_EXEC:-@PYTHON@}
-export PYTHON_EXEC
-
-BIND10_PATH=@abs_top_builddir@/src/bin/bind10
-
-PATH=@abs_top_builddir@/src/bin/bind10:@abs_top_builddir@/src/bin/bindctl:@abs_top_builddir@/src/bin/msgq:@abs_top_builddir@/src/bin/auth:@abs_top_builddir@/src/bin/resolver:@abs_top_builddir@/src/bin/cfgmgr:@abs_top_builddir@/src/bin/cmdctl:@abs_top_builddir@/src/bin/stats:@abs_top_builddir@/src/bin/xfrin:@abs_top_builddir@/src/bin/xfrout:@abs_top_builddir@/src/bin/zonemgr:@abs_top_builddir@/src/bin/ddns:@abs_top_builddir@/src/bin/dhcp6:@abs_top_builddir@/src/bin/sockcreator:@abs_top_builddir@/src/bin/loadzone:$PATH
-export PATH
-
-PYTHONPATH=@abs_top_builddir@/src/bin:@abs_top_builddir@/src/lib/python/isc/log_messages:@abs_top_builddir@/src/lib/python/isc/cc:@abs_top_builddir@/src/lib/python:@abs_top_builddir@/src/lib/dns/python/.libs:@abs_top_builddir@/src/lib/xfr/.libs:@abs_top_builddir@/src/lib/log/.libs:@abs_top_builddir@/src/lib/util/io/.libs:@abs_top_builddir@/src/lib/python/isc/config:@abs_top_builddir@/src/lib/python/isc/acl/.libs:@abs_top_builddir@/src/lib/python/isc/datasrc/.libs:$PYTHONPATH
-export PYTHONPATH
-
-# If necessary (rare cases), explicitly specify paths to dynamic libraries
-# required by loadable python modules.
-SET_ENV_LIBRARY_PATH=@SET_ENV_LIBRARY_PATH@
-if test $SET_ENV_LIBRARY_PATH = yes; then
- @ENV_LIBRARY_PATH@=@abs_top_builddir@/src/lib/dns/.libs:@abs_top_builddir@/src/lib/dns/python/.libs:@abs_top_builddir@/src/lib/cryptolink/.libs:@abs_top_builddir@/src/lib/cc/.libs:@abs_top_builddir@/src/lib/config/.libs:@abs_top_builddir@/src/lib/log/.libs:@abs_top_builddir@/src/lib/acl/.libs:@abs_top_builddir@/src/lib/util/.libs:@abs_top_builddir@/src/lib/util/threads/.libs:@abs_top_builddir@/src/lib/util/io/.libs:@abs_top_builddir@/src/lib/exceptions/.libs:@abs_top_builddir@/src/lib/datasrc/.libs:$@ENV_LIBRARY_PATH@
- export @ENV_LIBRARY_PATH@
-fi
-
-WANT_EXPERIMENTAL_RESOLVER=@WANT_EXPERIMENTAL_RESOLVER@
-if test $WANT_EXPERIMENTAL_RESOLVER = yes; then
- cp -f @srcdir@/features/resolver_basic.feature.disabled @srcdir@/features/resolver_basic.feature
-fi
-
-KEA_FROM_SOURCE=@abs_top_srcdir@
-export KEA_FROM_SOURCE
-# TODO: We need to do this feature based (ie. no general from_source)
-# But right now we need a second one because some spec files are
-# generated and hence end up under builddir
-KEA_FROM_BUILD=@abs_top_builddir@
-export KEA_FROM_BUILD
-
-BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
-export BIND10_MSGQ_SOCKET_FILE
-
-export LETTUCE_SETUP_COMPLETED=1
+++ /dev/null
-#!/usr/bin/env python3
-
-# Copyright (C) 2013 Internet Systems Consortium.
-#
-# Permission to use, copy, modify, and distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
-# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-# A simple XFR client program with some customized behavior.
-# This is intended to provide some less common or even invalid client behavior
-# for some specific tests on outbound zone transfer.
-# It currently only supports AXFR, but can be extended to support IXFR
-# as we see the need for it.
-#
-# For command line usage, run this program with -h option.
-
-from isc.dns import *
-import sys
-import socket
-import struct
-import time
-from optparse import OptionParser
-
-parser = OptionParser(usage='usage: %prog [options] zone_name')
-parser.add_option('-d', '--delay', dest='delay', action='store', default=None,
- help='delay (sec) before receiving responses, ' +
- 'emulating slow clients')
-parser.add_option('-s', '--server', dest='server_addr', action='store',
- default='::1',
- help="master server's address [default: %default]")
-parser.add_option('-p', '--port', dest='server_port', action='store',
- default=53,
- help="master server's TCP port [default: %default]")
-(options, args) = parser.parse_args()
-
-if len(args) == 0:
- parser.error('missing argument')
-
-# Parse arguments and options, and creates client socket.
-zone_name = Name(args[0])
-gai = socket.getaddrinfo(options.server_addr, int(options.server_port), 0,
- socket.SOCK_STREAM, socket.IPPROTO_TCP,
- socket.AI_NUMERICHOST|socket.AI_NUMERICSERV)
-server_family, server_socktype, server_proto, server_sockaddr = \
- (gai[0][0], gai[0][1], gai[0][2], gai[0][4])
-s = socket.socket(server_family, server_socktype, server_proto)
-s.connect(server_sockaddr)
-s.settimeout(60) # safety net in case of hangup situation
-
-# Build XFR query.
-axfr_qry = Message(Message.RENDER)
-axfr_qry.set_rcode(Rcode.NOERROR)
-axfr_qry.set_opcode(Opcode.QUERY)
-axfr_qry.add_question(Question(zone_name, RRClass.IN, RRType.AXFR))
-
-renderer = MessageRenderer()
-axfr_qry.to_wire(renderer)
-qry_data = renderer.get_data()
-
-# Send the query
-hlen_data = struct.pack('H', socket.htons(len(qry_data)))
-s.send(hlen_data)
-s.send(qry_data)
-
-# If specified wait for the given period
-if options.delay is not None:
- time.sleep(int(options.delay))
-
-def get_request_response(s, size):
- """A helper function to receive data of specified length from a socket."""
- recv_size = 0
- data = b''
- while recv_size < size:
- need_recv_size = size - recv_size
- tmp_data = s.recv(need_recv_size)
- if len(tmp_data) == 0:
- return None
- recv_size += len(tmp_data)
- data += tmp_data
- return data
-
-# Receive responses until the connection is terminated, and dump the
-# number of received answer RRs to stdout.
-num_rrs = 0
-while True:
- hlen_data = get_request_response(s, 2)
- if hlen_data is None:
- break
- resp_data = get_request_response(
- s, socket.ntohs(struct.unpack('H', hlen_data)[0]))
- msg = Message(Message.PARSE)
- msg.from_wire(resp_data, Message.PRESERVE_ORDER)
- num_rrs += msg.get_rr_count(Message.SECTION_ANSWER)
-print(str(num_rrs))