Parcourir la source

[2136] Changes regarding the test config file

- moved b10-config_test.db from src/bin/stats/tests to
  src/bin/stats/tests/testdata

- renamed its name to b10-config.db

- changed its format to multiline

These changes are due to the reviewer's comment.
Naoki Kambe il y a 12 ans
Parent
commit
e0a964e89c

+ 1 - 0
configure.ac

@@ -1039,6 +1039,7 @@ AC_CONFIG_FILES([Makefile
                  src/bin/zonemgr/tests/Makefile
                  src/bin/zonemgr/tests/Makefile
                  src/bin/stats/Makefile
                  src/bin/stats/Makefile
                  src/bin/stats/tests/Makefile
                  src/bin/stats/tests/Makefile
+                 src/bin/stats/tests/testdata/Makefile
                  src/bin/usermgr/Makefile
                  src/bin/usermgr/Makefile
                  src/bin/tests/Makefile
                  src/bin/tests/Makefile
                  src/lib/Makefile
                  src/lib/Makefile

+ 4 - 2
src/bin/stats/tests/Makefile.am

@@ -1,6 +1,8 @@
+SUBDIRS = testdata .
+
 PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
 PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
 PYTESTS = b10-stats_test.py b10-stats-httpd_test.py
 PYTESTS = b10-stats_test.py b10-stats-httpd_test.py
-EXTRA_DIST = $(PYTESTS) test_utils.py b10-config_test.db
+EXTRA_DIST = $(PYTESTS) test_utils.py
 CLEANFILES = test_utils.pyc
 CLEANFILES = test_utils.pyc
 
 
 # If necessary (rare cases), explicitly specify paths to dynamic libraries
 # If necessary (rare cases), explicitly specify paths to dynamic libraries
@@ -23,7 +25,7 @@ endif
 	PYTHONPATH=$(COMMON_PYTHON_PATH):$(abs_top_builddir)/src/bin/stats:$(abs_top_builddir)/src/bin/stats/tests:$(abs_top_builddir)/src/bin/msgq:$(abs_top_builddir)/src/lib/python/isc/config \
 	PYTHONPATH=$(COMMON_PYTHON_PATH):$(abs_top_builddir)/src/bin/stats:$(abs_top_builddir)/src/bin/stats/tests:$(abs_top_builddir)/src/bin/msgq:$(abs_top_builddir)/src/lib/python/isc/config \
 	B10_FROM_SOURCE=$(abs_top_srcdir) \
 	B10_FROM_SOURCE=$(abs_top_srcdir) \
 	BIND10_MSGQ_SOCKET_FILE=$(abs_top_builddir)/msgq_socket \
 	BIND10_MSGQ_SOCKET_FILE=$(abs_top_builddir)/msgq_socket \
-	CONFIG_TESTDATA_PATH=$(abs_top_srcdir)/src/bin/stats/tests \
+	CONFIG_TESTDATA_PATH=$(abs_top_srcdir)/src/bin/stats/tests/testdata \
 	B10_LOCKFILE_DIR_FROM_BUILD=$(abs_top_builddir) \
 	B10_LOCKFILE_DIR_FROM_BUILD=$(abs_top_builddir) \
 	$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
 	$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
 	done
 	done

+ 0 - 1
src/bin/stats/tests/b10-config_test.db

@@ -1 +0,0 @@
-{"version": 2, "Boss": {"components": {"b10-auth": {"kind": "needed", "special": "auth"}, "b10-auth-2": {"kind": "needed", "special": "auth"}}}}

+ 1 - 1
src/bin/stats/tests/test_utils.py

@@ -125,7 +125,7 @@ class MockCfgmgr:
     def __init__(self):
     def __init__(self):
         self._started = threading.Event()
         self._started = threading.Event()
         self.cfgmgr = isc.config.cfgmgr.ConfigManager(
         self.cfgmgr = isc.config.cfgmgr.ConfigManager(
-            os.environ['CONFIG_TESTDATA_PATH'], "b10-config_test.db")
+            os.environ['CONFIG_TESTDATA_PATH'], "b10-config.db")
         self.cfgmgr.read_config()
         self.cfgmgr.read_config()
 
 
     def run(self):
     def run(self):

+ 1 - 0
src/bin/stats/tests/testdata/Makefile.am

@@ -0,0 +1 @@
+EXTRA_DIST = b10-config.db

+ 14 - 0
src/bin/stats/tests/testdata/b10-config.db

@@ -0,0 +1,14 @@
+{ "version": 2,
+  "Boss": {
+    "components": {
+      "b10-auth": {
+        "kind": "needed",
+        "special": "auth"
+      },
+      "b10-auth-2": {
+        "kind": "needed",
+        "special": "auth"
+      }
+    }
+  }
+}