Browse Source

[2746] Fix the initial issue

initialize message loader in PyInit_datasrc.
Updated one of the general lettuce tests to check the symptom (don't know how else to test this tbh)
Jelte Jansen 12 years ago
parent
commit
5ace1ac933
2 changed files with 8 additions and 2 deletions
  1. 4 0
      src/lib/python/isc/datasrc/datasrc.cc
  2. 4 2
      tests/lettuce/features/example.feature

+ 4 - 0
src/lib/python/isc/datasrc/datasrc.cc

@@ -23,6 +23,8 @@
 #include <datasrc/sqlite3_accessor.h>
 #include <datasrc/sqlite3_accessor.h>
 #include <datasrc/zone_loader.h>
 #include <datasrc/zone_loader.h>
 
 
+#include <log/message_initializer.h>
+
 #include "datasrc.h"
 #include "datasrc.h"
 #include "client_python.h"
 #include "client_python.h"
 #include "finder_python.h"
 #include "finder_python.h"
@@ -276,6 +278,8 @@ PyModuleDef iscDataSrc = {
 
 
 PyMODINIT_FUNC
 PyMODINIT_FUNC
 PyInit_datasrc(void) {
 PyInit_datasrc(void) {
+    isc::log::MessageInitializer::loadDictionary();
+
     PyObject* mod = PyModule_Create(&iscDataSrc);
     PyObject* mod = PyModule_Create(&iscDataSrc);
     if (mod == NULL) {
     if (mod == NULL) {
         return (NULL);
         return (NULL);

+ 4 - 2
tests/lettuce/features/example.feature

@@ -161,11 +161,13 @@ Feature: Example feature
         A query for www.example.org should have rcode NOERROR
         A query for www.example.org should have rcode NOERROR
         Wait for new bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
         Wait for new bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
         Then set bind10 configuration data_sources/classes/IN[0]/params to {"database_file": "data/empty_db.sqlite3"}
         Then set bind10 configuration data_sources/classes/IN[0]/params to {"database_file": "data/empty_db.sqlite3"}
-        And wait for new bind10 stderr message DATASRC_SQLITE_CONNOPEN
+        # The 'not missing placeholder' check is for #2743
+        And wait for new bind10 stderr message DATASRC_SQLITE_CONNOPEN not Missing placeholder
         A query for www.example.org should have rcode REFUSED
         A query for www.example.org should have rcode REFUSED
         Wait for new bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
         Wait for new bind10 stderr message AUTH_SEND_NORMAL_RESPONSE
         Then set bind10 configuration data_sources/classes/IN[0]/params to {"database_file": "data/example.org.sqlite3"}
         Then set bind10 configuration data_sources/classes/IN[0]/params to {"database_file": "data/example.org.sqlite3"}
-        And wait for new bind10 stderr message DATASRC_SQLITE_CONNOPEN
+        # The 'not missing placeholder' check is for #2743
+        And wait for new bind10 stderr message DATASRC_SQLITE_CONNOPEN not Missing placeholder
         A query for www.example.org should have rcode NOERROR
         A query for www.example.org should have rcode NOERROR
 
 
     Scenario: two bind10 instances
     Scenario: two bind10 instances