BIND 10 trac1290, updated. 6d8da5a713e33008a9e8bac1ba24367a3ba86a10 [1290] put in a (for now hardcoded) nondefault cmdctl port
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Oct 20 13:05:24 UTC 2011
The branch, trac1290 has been updated
via 6d8da5a713e33008a9e8bac1ba24367a3ba86a10 (commit)
via d63457baaa31c80bb1ffeefd4f111c7d92685c8c (commit)
from dcd6d7ff4c0671a0995fe4051cea0e525d3f82bc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6d8da5a713e33008a9e8bac1ba24367a3ba86a10
Author: Jelte Jansen <jelte at isc.org>
Date: Thu Oct 20 15:05:06 2011 +0200
[1290] put in a (for now hardcoded) nondefault cmdctl port
commit d63457baaa31c80bb1ffeefd4f111c7d92685c8c
Author: Jelte Jansen <jelte at isc.org>
Date: Thu Oct 20 15:00:46 2011 +0200
[1290] additional comments and info, and a compound step example
-----------------------------------------------------------------------
Summary of changes:
tests/lettuce/features/bind10_control.py | 19 +++++++++++++------
tests/lettuce/features/querying.py | 8 ++++----
tests/lettuce/features/server_from_sqlite3.feature | 17 +++++++++++++++--
tests/lettuce/features/steps.py | 4 ++--
4 files changed, 34 insertions(+), 14 deletions(-)
-----------------------------------------------------------------------
diff --git a/tests/lettuce/features/bind10_control.py b/tests/lettuce/features/bind10_control.py
index 8a93c14..1896c44 100644
--- a/tests/lettuce/features/bind10_control.py
+++ b/tests/lettuce/features/bind10_control.py
@@ -30,7 +30,7 @@ def wait_for_output_lines(lines, examine_past = True):
if output.find(line) != -1:
return line
- at step(u'start bind10(?: with configuration ([\w.]+))?')
+ at step('start bind10(?: with configuration ([\w.]+))?')
def start_bind10(step, config_file):
args = [ 'bind10', '-v' ]
if config_file is not None:
@@ -38,6 +38,7 @@ def start_bind10(step, config_file):
args.append("configurations/")
args.append('-c')
args.append(config_file)
+ args.append('--cmdctl-port=47805')
world.bind10 = subprocess.Popen(args, 1, None, subprocess.PIPE,
subprocess.PIPE, subprocess.PIPE)
@@ -47,21 +48,27 @@ def start_bind10(step, config_file):
"BIND10_STARTUP_ERROR"])
assert message == "BIND10_STARTUP_COMPLETE"
- at step(u'wait for bind10 auth to start')
+ at step('wait for bind10 auth to start')
def wait_for_auth(step):
world.wait_for_output_lines(['AUTH_SERVER_STARTED'])
- at step(u'wait for log message (\w+)')
+ at 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')
+
+ at step('wait for log message (\w+)')
def wait_for_message(step, message):
world.wait_for_output_lines([message], False)
- at step(u'stop bind10')
+ at step('stop bind10')
def stop_the_server(step):
world.shutdown_server()
- at step(u'set bind10 configuration (\S+) to (.*)')
+ at step('set bind10 configuration (\S+) to (.*)')
def set_config_command(step, name, value):
- bindctl = subprocess.Popen(['bindctl'], 1, None, subprocess.PIPE,
+ args = ['bindctl', '-p', '47805']
+ bindctl = subprocess.Popen(args, 1, None, subprocess.PIPE,
subprocess.PIPE, None)
bindctl.stdin.write("config set " + name + " " + value + "\n")
bindctl.stdin.write("config commit\n")
diff --git a/tests/lettuce/features/querying.py b/tests/lettuce/features/querying.py
index b0b4f97..96a7e3e 100644
--- a/tests/lettuce/features/querying.py
+++ b/tests/lettuce/features/querying.py
@@ -106,8 +106,8 @@ class QueryResult(object):
def parse_footer(self, line):
pass
- at step(u'A query for ([\w.]+) (?:type ([A-Z]+) )?(?:class ([A-Z]+) )?' +
- '(?:to ([^:]+)(?::([0-9]+))? )?should have rcode ([\w.]+)')
+ at step('A query for ([\w.]+) (?:type ([A-Z]+) )?(?:class ([A-Z]+) )?' +
+ '(?:to ([^:]+)(?::([0-9]+))? )?should have rcode ([\w.]+)')
def query(step, query_name, qtype, qclass, addr, port, rcode):
if qtype is None:
qtype = "A"
@@ -121,7 +121,7 @@ def query(step, query_name, qtype, qclass, addr, port, rcode):
assert query_result.rcode == rcode, "Got " + query_result.rcode
world.last_query_result = query_result
- at step(u'The SOA serial for ([\w.]+) should be ([0-9]+)')
+ at step('The SOA serial for ([\w.]+) should be ([0-9]+)')
def query_soa(step, query_name, serial):
query_result = QueryResult(query_name, "SOA", "IN", "127.0.0.1", "47806")
assert "NOERROR" == query_result.rcode,\
@@ -132,7 +132,7 @@ def query_soa(step, query_name, serial):
assert serial == soa_parts[6],\
"Got SOA serial " + soa_parts[6] + ", expected " + serial
- at step(u'last query should have (\S+) (.+)')
+ at step('last query should have (\S+) (.+)')
def check_last_query(step, item, value):
assert world.last_query_result is not None
assert item in world.last_query_result.__dict__
diff --git a/tests/lettuce/features/server_from_sqlite3.feature b/tests/lettuce/features/server_from_sqlite3.feature
index 472528c..3eb2c4a 100644
--- a/tests/lettuce/features/server_from_sqlite3.feature
+++ b/tests/lettuce/features/server_from_sqlite3.feature
@@ -14,11 +14,15 @@ Feature: SQLite3 backend
# This scenario performs a number of queries and inspects the results
# This is not only to test, but also to show the different options
# we have to inspect the data
- When I start bind10 with configuration example.org.config
- Then wait for bind10 auth to start
+ # This is a compound statement that starts and waits for the
+ # started message
+ Given I have bind10 running with configuration example.org.config
+
+ # A simple query that is not examined further
A query for www.example.com should have rcode REFUSED
+ # A query where we look at some of the result properties
A query for www.example.org should have rcode NOERROR
The last query should have qdcount 1
The last query should have ancount 1
@@ -26,6 +30,7 @@ Feature: SQLite3 backend
The last query should have adcount 0
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 should have qdcount 1
The last query should have ancount 0
@@ -36,6 +41,8 @@ Feature: SQLite3 backend
A query for www.example.org type TXT should have rcode NOERROR
The last query 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:47806 should have rcode NOERROR
@@ -48,6 +55,12 @@ Feature: SQLite3 backend
# 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
Then wait for bind10 auth to start
Wait for log message CMDCTL_STARTED
diff --git a/tests/lettuce/features/steps.py b/tests/lettuce/features/steps.py
index 70fef48..ab06c4e 100644
--- a/tests/lettuce/features/steps.py
+++ b/tests/lettuce/features/steps.py
@@ -26,12 +26,12 @@ def cleanup(feature):
world.shutdown_server()
world.bind10_output = []
- at step(u'Given I have no database')
+ at step('Given I have no database')
def given_i_have_no_database(step):
if os.path.exists("test.db"):
os.remove("test.db")
- at step(u'I should see a database file')
+ at step('I should see a database file')
def i_should_see_a_database_file(step):
assert os.path.exists("test.db")
os.remove("test.db")
More information about the bind10-changes
mailing list