[bind10-dev] failed distcheck

Jeremy C. Reed jreed at isc.org
Thu Aug 19 18:58:36 UTC 2010


On Tue, 17 Aug 2010, Jeremy C. Reed wrote:

> Running test: cfgmgr_test.py
> ..............E
> ======================================================================
> ERROR: test_write_to_file (__main__.TestConfigManagerData)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File 
> "/usr/home/jreed/builder/work/BIND10-distcheck/20100816130000-FreeBSD7-amd64/build/bind10-devel-20100701/_build/../src/lib/python/isc/config/tests/cfgmgr_test.py", 
> line 65, in test_write_to_file
>     os.remove(output_file_name)
> OSError: [Errno 2] No such file or directory: 'b10-config-write-test'


My fix for this part follows. (I don't have workaround for the other 
errors which don't cause it to fail.)

Index: Makefile.am
===================================================================
--- Makefile.am	(revision 2764)
+++ Makefile.am	(working copy)
@@ -11,5 +11,6 @@
 	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 \
+	CONFIG_DATA_PATH=$(abs_top_builddir)/src/lib/config/tests \
 	$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
 	done
Index: cfgmgr_test.py
===================================================================
--- cfgmgr_test.py	(revision 2764)
+++ cfgmgr_test.py	(working copy)
@@ -57,13 +57,6 @@
                           ConfigManagerData.read_from_file,
                           self.data_path, "b10-config-bad4.db")
 
-    def test_write_to_file(self):
-        output_file_name = "b10-config-write-test"
-        self.config_manager_data.write_to_file(output_file_name)
-        new_config = ConfigManagerData(self.data_path, output_file_name)
-        self.assertEqual(self.config_manager_data, new_config)
-        os.remove(output_file_name)
-
     def test_equality(self):
         # tests the __eq__ function. Equality is only defined
         # by equality of the .data element. If data_path or db_filename
@@ -80,6 +73,19 @@
         self.assertNotEqual(cfd1, cfd2)
         
 
+class TestConfigManagerDataWrite(unittest.TestCase):
+    def setUp(self):
+        self.data_path = os.environ['CONFIG_DATA_PATH']
+        self.config_manager_data = ConfigManagerData(self.data_path)
+        self.assert_(self.config_manager_data)
+
+    def test_write_to_file(self):
+        output_file_name = "b10-config-write-test"
+        self.config_manager_data.write_to_file(output_file_name)
+        new_config = ConfigManagerData(self.data_path, output_file_name)
+        self.assertEqual(self.config_manager_data, new_config)
+        os.remove(output_file_name)
+
 class TestConfigManager(unittest.TestCase):
 
     def setUp(self):
@@ -175,7 +181,7 @@
         self.assertEqual(self.cm.config.data, {'version': config_data.BIND10_CONFIG_DATA_VERSION})
 
     def test_write_config(self):
-        # tested in ConfigManagerData tests
+        # tested in ConfigManagerDataWrite tests
         pass
     
     def _handle_msg_helper(self, msg, expected_answer):



More information about the bind10-dev mailing list