]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3578] removed disabled tests
authorRazvan Becheriu <razvan@isc.org>
Thu, 26 Sep 2024 16:33:35 +0000 (19:33 +0300)
committerRazvan Becheriu <razvan@isc.org>
Mon, 30 Sep 2024 09:13:35 +0000 (12:13 +0300)
src/bin/dhcp4/tests/kea_controller_unittest.cc
src/bin/dhcp6/tests/kea_controller_unittest.cc

index f61c90f58ecc4ec182b5e552636021f894415698..93968cd261f7a74eebf6084fb9cc9b1b27d37a5f 100644 (file)
@@ -27,7 +27,6 @@
 #endif
 
 #include <log/logger_support.h>
-#include <testutils/test_to_element.h>
 #include <util/stopwatch.h>
 
 #include <boost/pointer_cast.hpp>
@@ -56,7 +55,6 @@ using namespace isc::db::test;
 using namespace isc::dhcp;
 using namespace isc::dhcp::test;
 using namespace isc::hooks;
-using namespace isc::test;
 
 namespace {
 
@@ -187,14 +185,7 @@ public:
         // We're replacing the @c CBControlDHCPv4 instance with our
         // stub implementation used in tests.
         cb_control_.reset(new TestCBControlDHCPv4());
-
-        CfgMgr::instance().setFamily(AF_INET);
     }
-
-    using ControlledDhcpv4Srv::commandConfigGetHandler;
-    using ControlledDhcpv4Srv::commandConfigSetHandler;
-    using ControlledDhcpv4Srv::commandConfigReloadHandler;
-    using ControlledDhcpv4Srv::commandConfigWriteHandler;
 };
 
 /// @brief test class for Kea configuration backend
@@ -1107,94 +1098,4 @@ TEST_F(JSONFileBackendMySQLTest, reconfigureBackendMemfileToMySQL) {
 
 #endif
 
-/// @brief Test that all-keys.json config file can be loaded, written to disk
-/// and reloaded.
-TEST_F(JSONFileBackendTest, DISABLED_loadWriteReloadTest) {
-
-    // Create server first.
-    boost::scoped_ptr<NakedControlledDhcpv4Srv> srv;
-    ASSERT_NO_THROW(
-        srv.reset(new NakedControlledDhcpv4Srv());
-    );
-
-    try {
-        srv->init(CFG_EXAMPLES"/all-keys.json");
-    } catch (const std::exception& ex) {
-        ADD_FAILURE() << "Exception thrown on load: " << ex.what() << endl;
-    }
-
-    // Save initial configuration.
-    // ConstElementPtr expected_json;
-
-    // Read contents of the file and parse it as JSON.
-    // {
-    //     Parser4Context parser;
-    //     expected_json = parser.parseFile(CFG_EXAMPLES"/all-keys.json", Parser4Context::PARSER_DHCP4);
-    //     if (!expected_json) {
-    //         ADD_FAILURE() << "Invalid configuration in " << CFG_EXAMPLES"/all-keys.json" << endl;
-    //     }
-    // }
-
-    // Set test file used write and reload configuration.
-    srv->setConfigFile(TEST_FILE);
-
-    // Save initial configuration to check it with the reloaded configuration.
-    // ConstElementPtr expected;
-    // try {
-    //     expected = srv->commandConfigGetHandler("", ConstElementPtr());
-    // } catch (const std::exception& ex) {
-    //     ADD_FAILURE() << "Exception thrown on get: " << ex.what() << endl;
-    // }
-
-    ConstElementPtr result;
-    int rcode;
-
-    // Configuration is written to test file.
-    try {
-        result = srv->commandConfigWriteHandler("", ConstElementPtr());
-        result = parseAnswerText(rcode, result);
-    } catch (const std::exception& ex) {
-        ADD_FAILURE() << "Exception thrown on write: " << ex.what() << endl;
-    }
-
-    ASSERT_EQ(CONTROL_RESULT_SUCCESS, rcode);
-    ASSERT_EQ("Configuration written to test-config.json successful", result->stringValue());
-
-    // Save written configuration.
-    // ConstElementPtr actual_json;
-
-    // {
-    //     Parser4Context parser;
-    //     actual_json = parser.parseFile(TEST_FILE, Parser4Context::PARSER_DHCP4);
-    //     if (!actual_json) {
-    //         ADD_FAILURE() << "Invalid configuration in written file " << TEST_FILE << endl;
-    //     }
-    // }
-
-    // Configuration is reloaded from test file.
-    try {
-        result = srv->commandConfigReloadHandler("", ConstElementPtr());
-        result = parseAnswerText(rcode, result);
-    }  catch (const std::exception& ex) {
-        ADD_FAILURE() << "Exception thrown on reload: " << ex.what() << endl;
-    }
-
-    ASSERT_EQ(CONTROL_RESULT_SUCCESS, rcode);
-    ASSERT_EQ("Configuration successful.", result->stringValue());
-
-    // Save reloaded configuration.
-    // ConstElementPtr actual;
-    // try {
-    //     expected = srv->commandConfigGetHandler("", ConstElementPtr());
-    // } catch (const std::exception& ex) {
-    //     ADD_FAILURE() << "Exception thrown on get after reload: " << ex.what() << endl;
-    // }
-
-    // Check initial configuration with reloaded configuration.
-    // expectEqWithDiff(expected_json, actual_json);
-
-    // Check initial configuration with reloaded configuration.
-    // expectEqWithDiff(expected, actual);
-}
-
 } // End of anonymous namespace
index 08693ce6f85264155868dc5be84daf38d1af825c..5b29871686d1ac62e524a8fb19f06a05289cc8de 100644 (file)
@@ -25,7 +25,6 @@
 #endif
 
 #include <log/logger_support.h>
-#include <testutils/test_to_element.h>
 #include <util/stopwatch.h>
 
 #include <boost/pointer_cast.hpp>
@@ -53,7 +52,6 @@ using namespace isc::db::test;
 using namespace isc::dhcp;
 using namespace isc::dhcp::test;
 using namespace isc::hooks;
-using namespace isc::test;
 
 namespace {
 
@@ -184,14 +182,7 @@ public:
         // We're replacing the @c CBControlDHCPv6 instance with our
         // stub implementation used in tests.
         cb_control_.reset(new TestCBControlDHCPv6());
-
-        CfgMgr::instance().setFamily(AF_INET6);
     }
-
-    using ControlledDhcpv6Srv::commandConfigGetHandler;
-    using ControlledDhcpv6Srv::commandConfigSetHandler;
-    using ControlledDhcpv6Srv::commandConfigReloadHandler;
-    using ControlledDhcpv6Srv::commandConfigWriteHandler;
 };
 
 /// @brief test class for Kea configuration backend
@@ -1094,94 +1085,4 @@ TEST_F(JSONFileBackendMySQLTest, reconfigureBackendMemfileToMySQL) {
 
 #endif
 
-/// @brief Test that all-keys.json config file can be loaded, written to disk
-/// and reloaded.
-TEST_F(JSONFileBackendTest, DISABLED_loadWriteReloadTest) {
-
-    // Create server first.
-    boost::scoped_ptr<NakedControlledDhcpv6Srv> srv;
-    ASSERT_NO_THROW(
-        srv.reset(new NakedControlledDhcpv6Srv());
-    );
-
-    try {
-        srv->init(CFG_EXAMPLES"/all-keys.json");
-    } catch (const std::exception& ex) {
-        ADD_FAILURE() << "Exception thrown on load: " << ex.what() << endl;
-    }
-
-    // Save initial configuration.
-    // ConstElementPtr expected_json;
-
-    // Read contents of the file and parse it as JSON.
-    // {
-    //     Parser6Context parser;
-    //     expected_json = parser.parseFile(CFG_EXAMPLES"/all-keys.json", Parser6Context::PARSER_DHCP6);
-    //     if (!expected_json) {
-    //         ADD_FAILURE() << "Invalid configuration in " << CFG_EXAMPLES"/all-keys.json" << endl;
-    //     }
-    // }
-
-    // Set test file used write and reload configuration.
-    srv->setConfigFile(TEST_FILE);
-
-    // Save initial configuration to check it with the reloaded configuration.
-    // ConstElementPtr expected;
-    // try {
-    //     expected = srv->commandConfigGetHandler("", ConstElementPtr());
-    // } catch (const std::exception& ex) {
-    //     ADD_FAILURE() << "Exception thrown on get: " << ex.what() << endl;
-    // }
-
-    ConstElementPtr result;
-    int rcode;
-
-    // Configuration is written to test file.
-    try {
-        result = srv->commandConfigWriteHandler("", ConstElementPtr());
-        result = parseAnswerText(rcode, result);
-    } catch (const std::exception& ex) {
-        ADD_FAILURE() << "Exception thrown on write: " << ex.what() << endl;
-    }
-
-    ASSERT_EQ(CONTROL_RESULT_SUCCESS, rcode);
-    ASSERT_EQ("Configuration written to test-config.json successful", result->stringValue());
-
-    // Save written configuration.
-    // ConstElementPtr actual_json;
-
-    // {
-    //     Parser6Context parser;
-    //     actual_json = parser.parseFile(TEST_FILE, Parser6Context::PARSER_DHCP6);
-    //     if (!actual_json) {
-    //         ADD_FAILURE() << "Invalid configuration in written file " << TEST_FILE << endl;
-    //     }
-    // }
-
-    // Configuration is reloaded from test file.
-    try {
-        result = srv->commandConfigReloadHandler("", ConstElementPtr());
-        result = parseAnswerText(rcode, result);
-    }  catch (const std::exception& ex) {
-        ADD_FAILURE() << "Exception thrown on reload: " << ex.what() << endl;
-    }
-
-    ASSERT_EQ(CONTROL_RESULT_SUCCESS, rcode);
-    ASSERT_EQ("Configuration successful.", result->stringValue());
-
-    // Save reloaded configuration.
-    // ConstElementPtr actual;
-    // try {
-    //     expected = srv->commandConfigGetHandler("", ConstElementPtr());
-    // } catch (const std::exception& ex) {
-    //     ADD_FAILURE() << "Exception thrown on get after reload: " << ex.what() << endl;
-    // }
-
-    // Check initial configuration with reloaded configuration.
-    // expectEqWithDiff(expected_json, actual_json);
-
-    // Check initial configuration with reloaded configuration.
-    // expectEqWithDiff(expected, actual);
-}
-
 } // End of anonymous namespace