2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-04 07:55:18 +00:00

[2203] renamed datasrc_configurator to datasrc_config; it represents it better.

This commit is contained in:
JINMEI Tatuya
2012-10-05 10:12:42 -07:00
parent 4da98b699e
commit b2cb1e1e33
10 changed files with 28 additions and 29 deletions

View File

@@ -55,7 +55,7 @@ b10_auth_SOURCES += auth_config.cc auth_config.h
b10_auth_SOURCES += command.cc command.h b10_auth_SOURCES += command.cc command.h
b10_auth_SOURCES += common.h common.cc b10_auth_SOURCES += common.h common.cc
b10_auth_SOURCES += statistics.cc statistics.h b10_auth_SOURCES += statistics.cc statistics.h
b10_auth_SOURCES += datasrc_configurator.h datasrc_configurator.cc b10_auth_SOURCES += datasrc_config.h datasrc_config.cc
b10_auth_SOURCES += main.cc b10_auth_SOURCES += main.cc
nodist_b10_auth_SOURCES = auth_messages.h auth_messages.cc nodist_b10_auth_SOURCES = auth_messages.h auth_messages.cc

View File

@@ -17,7 +17,7 @@ query_bench_SOURCES += ../auth_srv.h ../auth_srv.cc
query_bench_SOURCES += ../auth_config.h ../auth_config.cc query_bench_SOURCES += ../auth_config.h ../auth_config.cc
query_bench_SOURCES += ../statistics.h ../statistics.cc query_bench_SOURCES += ../statistics.h ../statistics.cc
query_bench_SOURCES += ../auth_log.h ../auth_log.cc query_bench_SOURCES += ../auth_log.h ../auth_log.cc
query_bench_SOURCES += ../datasrc_configurator.h ../datasrc_configurator.cc query_bench_SOURCES += ../datasrc_config.h ../datasrc_config.cc
nodist_query_bench_SOURCES = ../auth_messages.h ../auth_messages.cc nodist_query_bench_SOURCES = ../auth_messages.h ../auth_messages.cc

View File

@@ -30,7 +30,7 @@
#include <auth/auth_srv.h> #include <auth/auth_srv.h>
#include <auth/auth_config.h> #include <auth/auth_config.h>
#include <auth/datasrc_configurator.h> #include <auth/datasrc_config.h>
#include <auth/query.h> #include <auth/query.h>
#include <asiodns/asiodns.h> #include <asiodns/asiodns.h>

View File

@@ -14,7 +14,7 @@
#include <cc/data.h> #include <cc/data.h>
#include "auth_srv.h" #include "auth_srv.h"
#include "datasrc_configurator.h" #include "datasrc_config.h"
// This is a trivial specialization for the commonly used version. // This is a trivial specialization for the commonly used version.
// Defined in .cc to avoid accidental creation of multiple copies. // Defined in .cc to avoid accidental creation of multiple copies.

View File

@@ -12,8 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#ifndef DATASRC_CONFIGURATOR_H #ifndef DATASRC_CONFIG_H
#define DATASRC_CONFIGURATOR_H #define DATASRC_CONFIG_H
#include "auth_srv.h" #include "auth_srv.h"
@@ -108,12 +108,12 @@ configureDataSourceGeneric(Server& server,
} }
} }
/// \brief Concrete version of DataSourceConfiguratorGeneric for the /// \brief Concrete version of configureDataSource() for the
/// use with authoritative server implementation. /// use with authoritative server implementation.
void void
configureDataSource(AuthSrv& server, const isc::data::ConstElementPtr& config); configureDataSource(AuthSrv& server, const isc::data::ConstElementPtr& config);
#endif #endif // DATASRC_CONFIG_H
// Local Variables: // Local Variables:
// mode: c++ // mode: c++

View File

@@ -34,7 +34,7 @@
#include <auth/command.h> #include <auth/command.h>
#include <auth/auth_srv.h> #include <auth/auth_srv.h>
#include <auth/auth_log.h> #include <auth/auth_log.h>
#include <auth/datasrc_configurator.h> #include <auth/datasrc_config.h>
#include <asiodns/asiodns.h> #include <asiodns/asiodns.h>
#include <asiolink/asiolink.h> #include <asiolink/asiolink.h>
#include <log/logger_support.h> #include <log/logger_support.h>

View File

@@ -42,7 +42,7 @@ run_unittests_SOURCES += ../auth_config.h ../auth_config.cc
run_unittests_SOURCES += ../command.h ../command.cc run_unittests_SOURCES += ../command.h ../command.cc
run_unittests_SOURCES += ../common.h ../common.cc run_unittests_SOURCES += ../common.h ../common.cc
run_unittests_SOURCES += ../statistics.h ../statistics.cc run_unittests_SOURCES += ../statistics.h ../statistics.cc
run_unittests_SOURCES += ../datasrc_configurator.h ../datasrc_configurator.cc run_unittests_SOURCES += ../datasrc_config.h ../datasrc_config.cc
run_unittests_SOURCES += datasrc_util.h datasrc_util.cc run_unittests_SOURCES += datasrc_util.h datasrc_util.cc
run_unittests_SOURCES += auth_srv_unittest.cc run_unittests_SOURCES += auth_srv_unittest.cc
run_unittests_SOURCES += config_unittest.cc run_unittests_SOURCES += config_unittest.cc
@@ -51,7 +51,7 @@ run_unittests_SOURCES += command_unittest.cc
run_unittests_SOURCES += common_unittest.cc run_unittests_SOURCES += common_unittest.cc
run_unittests_SOURCES += query_unittest.cc run_unittests_SOURCES += query_unittest.cc
run_unittests_SOURCES += statistics_unittest.cc run_unittests_SOURCES += statistics_unittest.cc
run_unittests_SOURCES += datasrc_configurator_unittest.cc run_unittests_SOURCES += datasrc_config_unittest.cc
run_unittests_SOURCES += run_unittests.cc run_unittests_SOURCES += run_unittests.cc
nodist_run_unittests_SOURCES = ../auth_messages.h ../auth_messages.cc nodist_run_unittests_SOURCES = ../auth_messages.h ../auth_messages.cc

View File

@@ -36,7 +36,7 @@
#include <auth/command.h> #include <auth/command.h>
#include <auth/common.h> #include <auth/common.h>
#include <auth/statistics.h> #include <auth/statistics.h>
#include <auth/datasrc_configurator.h> #include <auth/datasrc_config.h>
#include <util/unittests/mock_socketsession.h> #include <util/unittests/mock_socketsession.h>
#include <util/threads/lock.h> #include <util/threads/lock.h>

View File

@@ -19,7 +19,7 @@
#include <auth/auth_srv.h> #include <auth/auth_srv.h>
#include <auth/auth_config.h> #include <auth/auth_config.h>
#include <auth/command.h> #include <auth/command.h>
#include <auth/datasrc_configurator.h> #include <auth/datasrc_config.h>
#include <dns/name.h> #include <dns/name.h>
#include <dns/rrclass.h> #include <dns/rrclass.h>

View File

@@ -12,7 +12,7 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <auth/datasrc_configurator.h> #include <auth/datasrc_config.h>
#include <config/tests/fake_session.h> #include <config/tests/fake_session.h>
#include <config/ccsession.h> #include <config/ccsession.h>
@@ -35,7 +35,7 @@ using namespace boost;
namespace { namespace {
class DatasrcConfiguratorTest; class DatasrcConfigTest;
class FakeList { class FakeList {
public: public:
@@ -61,17 +61,16 @@ private:
typedef shared_ptr<FakeList> ListPtr; typedef shared_ptr<FakeList> ListPtr;
void void
testConfigureDataSource(DatasrcConfiguratorTest& test, testConfigureDataSource(DatasrcConfigTest& test,
const isc::data::ConstElementPtr& config) const isc::data::ConstElementPtr& config)
{ {
// We use the test fixture for the Server type. This makes it possible // We use the test fixture for the Server type. This makes it possible
// to easily fake all needed methods and look that they were called. // to easily fake all needed methods and look that they were called.
configureDataSourceGeneric<DatasrcConfiguratorTest, FakeList>(test, configureDataSourceGeneric<DatasrcConfigTest, FakeList>(test, config);
config);
} }
void void
datasrcConfigHandler(DatasrcConfiguratorTest* fake_server, const std::string&, datasrcConfigHandler(DatasrcConfigTest* fake_server, const std::string&,
isc::data::ConstElementPtr config, isc::data::ConstElementPtr config,
const isc::config::ConfigData&) const isc::config::ConfigData&)
{ {
@@ -80,7 +79,7 @@ datasrcConfigHandler(DatasrcConfiguratorTest* fake_server, const std::string&,
} }
} }
class DatasrcConfiguratorTest : public ::testing::Test { class DatasrcConfigTest : public ::testing::Test {
public: public:
// These pretend to be the server // These pretend to be the server
ListPtr getClientList(const RRClass& rrclass) { ListPtr getClientList(const RRClass& rrclass) {
@@ -104,7 +103,7 @@ public:
return (mutex_); return (mutex_);
} }
protected: protected:
DatasrcConfiguratorTest() : DatasrcConfigTest() :
session(ElementPtr(new ListElement), ElementPtr(new ListElement), session(ElementPtr(new ListElement), ElementPtr(new ListElement),
ElementPtr(new ListElement)), ElementPtr(new ListElement)),
specfile(string(TEST_OWN_DATA_DIR) + "/spec.spec") specfile(string(TEST_OWN_DATA_DIR) + "/spec.spec")
@@ -162,11 +161,11 @@ protected:
}; };
// Push there a configuration with a single list. // Push there a configuration with a single list.
TEST_F(DatasrcConfiguratorTest, createList) { TEST_F(DatasrcConfigTest, createList) {
initializeINList(); initializeINList();
} }
TEST_F(DatasrcConfiguratorTest, modifyList) { TEST_F(DatasrcConfigTest, modifyList) {
// First, initialize the list // First, initialize the list
initializeINList(); initializeINList();
// And now change the configuration of the list // And now change the configuration of the list
@@ -184,7 +183,7 @@ TEST_F(DatasrcConfiguratorTest, modifyList) {
} }
// Check we can have multiple lists at once // Check we can have multiple lists at once
TEST_F(DatasrcConfiguratorTest, multiple) { TEST_F(DatasrcConfigTest, multiple) {
const ElementPtr const ElementPtr
config(buildConfig("{\"IN\": [{\"type\": \"yyy\"}], " config(buildConfig("{\"IN\": [{\"type\": \"yyy\"}], "
"\"CH\": [{\"type\": \"xxx\"}]}")); "\"CH\": [{\"type\": \"xxx\"}]}"));
@@ -204,7 +203,7 @@ TEST_F(DatasrcConfiguratorTest, multiple) {
// //
// It's almost like above, but we initialize first with single-list // It's almost like above, but we initialize first with single-list
// config. // config.
TEST_F(DatasrcConfiguratorTest, updateAdd) { TEST_F(DatasrcConfigTest, updateAdd) {
initializeINList(); initializeINList();
const ElementPtr const ElementPtr
config(buildConfig("{\"IN\": [{\"type\": \"yyy\"}], " config(buildConfig("{\"IN\": [{\"type\": \"yyy\"}], "
@@ -222,7 +221,7 @@ TEST_F(DatasrcConfiguratorTest, updateAdd) {
} }
// We delete a class list in this test. // We delete a class list in this test.
TEST_F(DatasrcConfiguratorTest, updateDelete) { TEST_F(DatasrcConfigTest, updateDelete) {
initializeINList(); initializeINList();
const ElementPtr const ElementPtr
config(buildConfig("{}")); config(buildConfig("{}"));
@@ -239,7 +238,7 @@ TEST_F(DatasrcConfiguratorTest, updateDelete) {
} }
// Check that we can rollback an addition if something else fails // Check that we can rollback an addition if something else fails
TEST_F(DatasrcConfiguratorTest, rollbackAddition) { TEST_F(DatasrcConfigTest, rollbackAddition) {
initializeINList(); initializeINList();
// The configuration is wrong. However, the CH one will get done first. // The configuration is wrong. However, the CH one will get done first.
const ElementPtr const ElementPtr
@@ -258,7 +257,7 @@ TEST_F(DatasrcConfiguratorTest, rollbackAddition) {
} }
// Check that we can rollback a deletion if something else fails // Check that we can rollback a deletion if something else fails
TEST_F(DatasrcConfiguratorTest, rollbackDeletion) { TEST_F(DatasrcConfigTest, rollbackDeletion) {
initializeINList(); initializeINList();
// Put the CH there // Put the CH there
const ElementPtr const ElementPtr
@@ -279,7 +278,7 @@ TEST_F(DatasrcConfiguratorTest, rollbackDeletion) {
// Check that we can roll back configuration change if something // Check that we can roll back configuration change if something
// fails later on. // fails later on.
TEST_F(DatasrcConfiguratorTest, rollbackConfiguration) { TEST_F(DatasrcConfigTest, rollbackConfiguration) {
initializeINList(); initializeINList();
// Put the CH there // Put the CH there
const ElementPtr const ElementPtr