]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
Merge remote-tracking branch 'origin/trac1976-cont' into work/merge
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Tue, 24 Jul 2012 09:00:25 +0000 (11:00 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Tue, 24 Jul 2012 09:00:25 +0000 (11:00 +0200)
Conflicts:
src/bin/auth/tests/datasrc_configurator_unittest.cc

1  2 
src/bin/auth/datasrc_configurator.h
src/bin/auth/main.cc
src/bin/auth/tests/datasrc_configurator_unittest.cc

Simple merge
Simple merge
index d5ed25f29efde57f9b4e544cd82faee57b0e8289,9c009fd4ea2b6e65f932bc30dde353722c47a698..12454f02f73ec764c3bb12164382ec3f4c95f83c
@@@ -115,9 -115,15 +115,15 @@@ protected
      void SetUp() {
          init();
      }
 -    void doInInit() {
+     ElementPtr buildConfig(const string& config) const {
+         const ElementPtr internal(Element::fromJSON(config));
+         const ElementPtr external(Element::fromJSON("{\"version\": 1}"));
+         external->set("classes", internal);
+         return (external);
+     }
 +    void initializeINList() {
          const ElementPtr
-             config(Element::fromJSON("{\"IN\": [{\"type\": \"xxx\"}]}"));
+             config(buildConfig("{\"IN\": [{\"type\": \"xxx\"}]}"));
          session.addMessage(createCommand("config_update", config), "data_sources",
                             "*");
          mccs->checkCommand();
@@@ -161,10 -166,10 +167,10 @@@ TEST_F(DatasrcConfiguratorTest, createL
  
  TEST_F(DatasrcConfiguratorTest, modifyList) {
      // First, initialize the list
 -    doInInit();
 +    initializeINList();
      // And now change the configuration of the list
      const ElementPtr
-         config(Element::fromJSON("{\"IN\": [{\"type\": \"yyy\"}]}"));
+         config(buildConfig("{\"IN\": [{\"type\": \"yyy\"}]}"));
      session.addMessage(createCommand("config_update", config), "data_sources",
                         "*");
      log_ = "";
@@@ -198,10 -202,10 +204,10 @@@ TEST_F(DatasrcConfiguratorTest, multipl
  // It's almost like above, but we initialize first with single-list
  // config.
  TEST_F(DatasrcConfiguratorTest, updateAdd) {
 -    doInInit();
 +    initializeINList();
      const ElementPtr
-         config(Element::fromJSON("{\"IN\": [{\"type\": \"yyy\"}], "
-                                  "\"CH\": [{\"type\": \"xxx\"}]}"));
+         config(buildConfig("{\"IN\": [{\"type\": \"yyy\"}], "
+                            "\"CH\": [{\"type\": \"xxx\"}]}"));
      session.addMessage(createCommand("config_update", config), "data_sources",
                         "*");
      log_ = "";
  
  // We delete a class list in this test.
  TEST_F(DatasrcConfiguratorTest, updateDelete) {
 -    doInInit();
 +    initializeINList();
      const ElementPtr
-         config(Element::fromJSON("{}"));
+         config(buildConfig("{}"));
      session.addMessage(createCommand("config_update", config), "data_sources",
                         "*");
      log_ = "";
  
  // Check that we can rollback an addition if something else fails
  TEST_F(DatasrcConfiguratorTest, rollbackAddition) {
 -    doInInit();
 +    initializeINList();
      // The configuration is wrong. However, the CH one will get done first.
      const ElementPtr
-         config(Element::fromJSON("{\"IN\": [{\"type\": 13}], "
-                                  "\"CH\": [{\"type\": \"xxx\"}]}"));
+         config(buildConfig("{\"IN\": [{\"type\": 13}], "
+                            "\"CH\": [{\"type\": \"xxx\"}]}"));
      session.addMessage(createCommand("config_update", config), "data_sources",
                         "*");
      log_ = "";