BIND 10 trac1290, updated. bbfee9cc079856d3b437a1bbb69b4157092cbf97 [1290] clear config on each start, and look for specific message

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Oct 19 14:37:26 UTC 2011


The branch, trac1290 has been updated
       via  bbfee9cc079856d3b437a1bbb69b4157092cbf97 (commit)
      from  6bdd521c49d10867b63158837f6fdc6d06d1f256 (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 bbfee9cc079856d3b437a1bbb69b4157092cbf97
Author: Jelte Jansen <jelte at isc.org>
Date:   Wed Oct 19 16:37:06 2011 +0200

    [1290] clear config on each start, and look for specific message

-----------------------------------------------------------------------

Summary of changes:
 tests/lettuce/configurations/example.org.config    |    1 -
 .../lettuce/configurations/example.org.config.orig |    1 +
 tests/lettuce/features/bind10_control.py           |    4 ++++
 tests/lettuce/features/server_from_sqlite3.feature |    2 ++
 tests/lettuce/features/steps.py                    |   11 +++++++++++
 5 files changed, 18 insertions(+), 1 deletions(-)
 delete mode 100644 tests/lettuce/configurations/example.org.config
 create mode 100644 tests/lettuce/configurations/example.org.config.orig

-----------------------------------------------------------------------
diff --git a/tests/lettuce/configurations/example.org.config b/tests/lettuce/configurations/example.org.config
deleted file mode 100644
index f885b75..0000000
--- a/tests/lettuce/configurations/example.org.config
+++ /dev/null
@@ -1 +0,0 @@
-{"version": 2, "Auth": {"database_file": "data/example.org.sqlite3", "listen_on": [{"port": 47806, "address": "127.0.0.1"}]}}
diff --git a/tests/lettuce/configurations/example.org.config.orig b/tests/lettuce/configurations/example.org.config.orig
new file mode 100644
index 0000000..ec60c4b
--- /dev/null
+++ b/tests/lettuce/configurations/example.org.config.orig
@@ -0,0 +1 @@
+{"version": 2, "Logging": {"loggers": [{"debuglevel": 99, "severity": "DEBUG", "name": "auth"}]}, "Auth": {"database_file": "data/example.org.sqlite3", "listen_on": [{"port": 47806, "address": "127.0.0.1"}]}}
diff --git a/tests/lettuce/features/bind10_control.py b/tests/lettuce/features/bind10_control.py
index e86d8f7..c1f1e5a 100644
--- a/tests/lettuce/features/bind10_control.py
+++ b/tests/lettuce/features/bind10_control.py
@@ -49,6 +49,10 @@ def start_bind10(step, config_file):
 def wait_for_auth(step):
     world.wait_for_output_lines(['AUTH_SERVER_STARTED'])
 
+ at step(u'wait for log message (\w+)')
+def wait_for_message(step, message):
+    world.wait_for_output_lines([message], False)
+
 @step(u'stop bind10')
 def stop_the_server(step):
     world.shutdown_server()
diff --git a/tests/lettuce/features/server_from_sqlite3.feature b/tests/lettuce/features/server_from_sqlite3.feature
index aa48df2..d0f4f5a 100644
--- a/tests/lettuce/features/server_from_sqlite3.feature
+++ b/tests/lettuce/features/server_from_sqlite3.feature
@@ -22,6 +22,8 @@ Feature: SQLite3 backend
         Then wait for bind10 auth to start
         A query for www.example.org should have rcode NOERROR
         Then set bind10 configuration Auth/database_file to data/empty_db.sqlite3
+        And wait for log message DATASRC_SQLITE_OPEN
         A query for www.example.org should have rcode REFUSED
         Then set bind10 configuration Auth/database_file to data/example.org.sqlite3
+        And wait for log message DATASRC_SQLITE_OPEN
         A query for www.example.org should have rcode NOERROR
diff --git a/tests/lettuce/features/steps.py b/tests/lettuce/features/steps.py
index 1c07f25..5540fba 100644
--- a/tests/lettuce/features/steps.py
+++ b/tests/lettuce/features/steps.py
@@ -1,6 +1,11 @@
 from lettuce import *
 import subprocess
 import os.path
+import shutil
+
+copylist = [
+["configurations/example.org.config.orig", "configurations/example.org.config"]
+]
 
 @before.each_scenario
 def initialize(feature):
@@ -9,6 +14,12 @@ def initialize(feature):
     world.bind10 = None
     world.bind10_output = []
 
+    # 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])
+
 @after.each_scenario
 def cleanup(feature):
     world.shutdown_server()




More information about the bind10-changes mailing list