[svn] commit: r2780 - in /branches/trac313: ./ src/bin/xfrin/ src/bin/xfrin/tests/ src/lib/bench/ src/lib/cc/ src/lib/cc/tests/ src/lib/config/ src/lib/config/testdata/ src/lib/datasrc/ src/lib/dns/ src/lib/dns/rdata/generic/ src/lib/dns/tests/ src/lib/exceptions/tests/ src/lib/python/isc/config/tests/
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Aug 20 22:12:08 UTC 2010
Author: jinmei
Date: Fri Aug 20 22:12:07 2010
New Revision: 2780
Log:
sync with trunk
Added:
branches/trac313/src/lib/config/testdata/Makefile.am
- copied unchanged from r2779, trunk/src/lib/config/testdata/Makefile.am
branches/trac313/src/lib/config/testdata/b10-config.db.master
- copied unchanged from r2779, trunk/src/lib/config/testdata/b10-config.db.master
Removed:
branches/trac313/src/lib/config/testdata/b10-config.db
Modified:
branches/trac313/ (props changed)
branches/trac313/ChangeLog
branches/trac313/configure.ac
branches/trac313/src/bin/xfrin/ (props changed)
branches/trac313/src/bin/xfrin/tests/xfrin_test.py
branches/trac313/src/lib/bench/ (props changed)
branches/trac313/src/lib/cc/ (props changed)
branches/trac313/src/lib/cc/tests/ (props changed)
branches/trac313/src/lib/config/Makefile.am
branches/trac313/src/lib/datasrc/ (props changed)
branches/trac313/src/lib/dns/ (props changed)
branches/trac313/src/lib/dns/rdata/generic/rrsig_46.cc (props changed)
branches/trac313/src/lib/dns/tests/ (props changed)
branches/trac313/src/lib/exceptions/tests/ (props changed)
branches/trac313/src/lib/python/isc/config/tests/Makefile.am
branches/trac313/src/lib/python/isc/config/tests/cfgmgr_test.py
Modified: branches/trac313/ChangeLog
==============================================================================
--- branches/trac313/ChangeLog (original)
+++ branches/trac313/ChangeLog Fri Aug 20 22:12:07 2010
@@ -1,3 +1,7 @@
+ 89. [build] jinmei
+ Generate b10-config.db for tests at build time so that the source
+ tree does not have to be writable. (Trac #315, r2776)
+
88. [func] jelte
Blocking reads on the msgq command channel now have a timeout
(defaults to 4 seconds, modifiable as needed by modules).
Modified: branches/trac313/configure.ac
==============================================================================
--- branches/trac313/configure.ac (original)
+++ branches/trac313/configure.ac Fri Aug 20 22:12:07 2010
@@ -449,6 +449,7 @@
src/lib/python/isc/notify/tests/Makefile
src/lib/config/Makefile
src/lib/config/tests/Makefile
+ src/lib/config/testdata/Makefile
src/lib/dns/Makefile
src/lib/dns/tests/Makefile
src/lib/dns/python/Makefile
Modified: branches/trac313/src/bin/xfrin/tests/xfrin_test.py
==============================================================================
--- branches/trac313/src/bin/xfrin/tests/xfrin_test.py (original)
+++ branches/trac313/src/bin/xfrin/tests/xfrin_test.py Fri Aug 20 22:12:07 2010
@@ -559,7 +559,7 @@
def raise_ccerror():
raise isc.cc.session.SessionError('test error')
-def raise_excpetion():
+def raise_exception():
raise Exception('test exception')
class TestMain(unittest.TestCase):
@@ -581,7 +581,7 @@
main(MockXfrin, False)
def test_startup_generalerror(self):
- MockXfrin.check_command_hook = raise_excpetion
+ MockXfrin.check_command_hook = raise_exception
main(MockXfrin, False)
if __name__== "__main__":
Modified: branches/trac313/src/lib/config/Makefile.am
==============================================================================
--- branches/trac313/src/lib/config/Makefile.am (original)
+++ branches/trac313/src/lib/config/Makefile.am Fri Aug 20 22:12:07 2010
@@ -1,4 +1,4 @@
-SUBDIRS = . tests
+SUBDIRS = . testdata tests
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
@@ -13,7 +13,7 @@
EXTRA_DIST += testdata/b10-config-bad2.db
EXTRA_DIST += testdata/b10-config-bad3.db
EXTRA_DIST += testdata/b10-config-bad4.db
-EXTRA_DIST += testdata/b10-config.db
+EXTRA_DIST += testdata/b10-config.db.master #.db will be auto-generated
EXTRA_DIST += testdata/data22_1.data
EXTRA_DIST += testdata/data22_2.data
EXTRA_DIST += testdata/data22_3.data
Modified: branches/trac313/src/lib/python/isc/config/tests/Makefile.am
==============================================================================
--- branches/trac313/src/lib/python/isc/config/tests/Makefile.am (original)
+++ branches/trac313/src/lib/python/isc/config/tests/Makefile.am Fri Aug 20 22:12:07 2010
@@ -7,9 +7,12 @@
PYCOVERAGE = $(PYTHON)
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
+ ret=0 ; \
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
CONFIG_TESTDATA_PATH=$(abs_top_srcdir)/src/lib/config/testdata \
- $(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
- done
+ CONFIG_WR_TESTDATA_PATH=$(abs_top_builddir)/src/lib/config/testdata \
+ $(PYCOVERAGE) $(abs_srcdir)/$$pytest || ret=1; \
+ done; \
+ exit $$ret
Modified: branches/trac313/src/lib/python/isc/config/tests/cfgmgr_test.py
==============================================================================
--- branches/trac313/src/lib/python/isc/config/tests/cfgmgr_test.py (original)
+++ branches/trac313/src/lib/python/isc/config/tests/cfgmgr_test.py Fri Aug 20 22:12:07 2010
@@ -28,19 +28,20 @@
class TestConfigManagerData(unittest.TestCase):
def setUp(self):
self.data_path = os.environ['CONFIG_TESTDATA_PATH']
- self.config_manager_data = ConfigManagerData(self.data_path)
+ self.writable_data_path = os.environ['CONFIG_WR_TESTDATA_PATH']
+ self.config_manager_data = ConfigManagerData(self.writable_data_path)
self.assert_(self.config_manager_data)
def test_init(self):
self.assertEqual(self.config_manager_data.data['version'],
config_data.BIND10_CONFIG_DATA_VERSION)
self.assertEqual(self.config_manager_data.data_path,
- self.data_path)
+ self.writable_data_path)
self.assertEqual(self.config_manager_data.db_filename,
- self.data_path + os.sep + "b10-config.db")
+ self.writable_data_path + os.sep + "b10-config.db")
def test_read_from_file(self):
- ConfigManagerData.read_from_file(self.data_path)
+ ConfigManagerData.read_from_file(self.writable_data_path)
self.assertRaises(ConfigManagerDataEmpty,
ConfigManagerData.read_from_file,
"doesnotexist")
@@ -84,14 +85,15 @@
def setUp(self):
self.data_path = os.environ['CONFIG_TESTDATA_PATH']
+ self.writable_data_path = os.environ['CONFIG_WR_TESTDATA_PATH']
self.fake_session = FakeModuleCCSession()
- self.cm = ConfigManager(self.data_path, self.fake_session)
+ self.cm = ConfigManager(self.writable_data_path, self.fake_session)
self.name = "TestModule"
self.spec = isc.config.module_spec_from_file(self.data_path + os.sep + "/spec2.spec")
def test_init(self):
self.assert_(self.cm.module_specs == {})
- self.assert_(self.cm.data_path == self.data_path)
+ self.assert_(self.cm.data_path == self.writable_data_path)
self.assert_(self.cm.config != None)
self.assert_(self.fake_session.has_subscription("ConfigManager"))
self.assert_(self.fake_session.has_subscription("Boss", "ConfigManager"))
@@ -293,8 +295,8 @@
if __name__ == '__main__':
- if not 'CONFIG_TESTDATA_PATH' in os.environ:
- print("You need to set the environment variable CONFIG_TESTDATA_PATH to point to the directory containing the test data files")
+ if not 'CONFIG_TESTDATA_PATH' in os.environ or not 'CONFIG_WR_TESTDATA_PATH' in os.environ:
+ print("You need to set the environment variable CONFIG_TESTDATA_PATH and CONFIG_WR_TESTDATA_PATH to point to the directory containing the test data files")
exit(1)
unittest.main()
More information about the bind10-changes
mailing list