Browse Source

[2854] added some minimal behavior for memgr.

JINMEI Tatuya 12 years ago
parent
commit
11de0085d2

+ 18 - 2
src/bin/memmgr/memmgr.py.in

@@ -15,8 +15,24 @@
 # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
+import os
+import sys
+import signal
 
-import sys; sys.path.append('@@PYTHONPATH@@')
+sys.path.append('@@PYTHONPATH@@')
+import isc.log
+from isc.log_messages.memmgr_messages import *
+from isc.server_common.bind10_server import BIND10Server
+
+MODULE_NAME = 'memmgr'
+
+isc.log.init('b10-memmgr', buffer=True)
+logger = isc.log.Logger(MODULE_NAME)
+
+class Memmgr(BIND10Server):
+    def _config_handler(self, new_config):
+        pass
 
 if '__main__' == __name__:
-    pass
+    mgr = Memmgr()
+    sys.exit(mgr.run(MODULE_NAME))

+ 0 - 3
src/bin/memmgr/memmgr.spec

@@ -2,8 +2,6 @@
   "module_spec": {
     "module_name": "Memmgr",
     "config_data": [
-      {
-      }
     ],
     "commands": [
       {
@@ -20,4 +18,3 @@
     ]
   }
 }
-

+ 2 - 0
src/bin/memmgr/memmgr_messages.mes

@@ -15,3 +15,5 @@
 # When you add a message to this file, it is a good idea to run
 # <topsrcdir>/tools/reorder_message_file.py to make sure the
 # messages are in the correct order.
+
+% MEMMGR_CONFIG_UPDATE received new configuration: %1

+ 11 - 1
src/bin/memmgr/tests/memmgr_test.py

@@ -13,9 +13,19 @@
 # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-import isc.log
 import unittest
 
+import isc.log
+import isc.config
+import memmgr
+
+class MockMemmgr(memmgr.Memmgr):
+    pass
+
+class TestMemmgr(unittest.TestCase):
+    def setUp(self):
+        self.__mgr = MockMemmgr()
+
 if __name__== "__main__":
     isc.log.resetUnitTestRootLogger()
     unittest.main()