2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00
Commit Graph

59 Commits

Author SHA1 Message Date
Marcin Siodelski
03d3566dce [5317] Use ASIO unix domain sockets in DHCPv6 server. 2017-06-21 19:16:28 +02:00
Tomek Mrugalski
002e269071 [5187] Kea is less strict with filename argument to config-write 2017-04-18 20:37:11 +02:00
Francis Dupont
79b5468afa [5213] indent and untabily 2017-04-18 09:28:16 +02:00
Tomek Mrugalski
27cf2211cd [5213] config-reload implemented, set-config renamed to config-set 2017-04-14 13:51:51 +02:00
Marcin Siodelski
5f47e18210 [5078] Corrected expected result in two unit tests. 2017-03-29 18:43:15 +02:00
Francis Dupont
5b8d7823cd [5150a] Merged review improvements 2017-03-21 19:50:07 +01:00
Francis Dupont
3ac8487a26 [5150a] Rebased 2017-03-17 06:31:35 +01:00
Francis Dupont
e38e8d974c [102b] rebased 2017-03-17 03:39:22 +01:00
Francis Dupont
5cf8210811 [5151] Restored previous code in checkConfigWrite (no routine to parse full config) 2017-03-15 20:00:47 +01:00
Francis Dupont
3bd3068be8 [5151] Some small fixes 2017-03-15 18:59:07 +01:00
Tomek Mrugalski
d0dc88fe5e [5151] config-get, config-write implemented for DHCPv6 2017-03-15 17:04:15 +01:00
Tomek Mrugalski
2c9ba565e1 [5076] decommentJSONFile moved to isc::test 2017-02-07 13:29:04 +01:00
Tomek Mrugalski
52158a480c [master] Unit-test fixes after #5122 and #5123 merged. 2017-01-28 12:01:23 +01:00
Tomek Mrugalski
44e812a308 [5122] Duplicate position printed in exceptions fixed 2017-01-27 21:39:45 +01:00
Tomek Mrugalski
523deee862 [5122] Contexts removed from SubnetConfigParser 2017-01-27 15:41:30 +01:00
Thomas Markwalder
4afbdcf89c [master] Implement set-config command in kea-dhcp4/6
Merges in branch 'trac5046'
2017-01-04 15:46:12 -05:00
Thomas Markwalder
ebb863e372 [5046] Addressed review comments
Added memfile without persistence to set_config unit tests. This eliminates
the tests attempting to create the csv file.

Updated copyrights.

Fixed misspelling.
2017-01-03 08:23:44 -05:00
Thomas Markwalder
d4d8665494 [master] kea-dhcp4/6 support libreload command
Merge branch 'trac3238'
2016-12-22 14:35:46 -05:00
Thomas Markwalder
e5a6c2b4f8 [5046] CommandMgr dups the connection socket prior to executing command
src/lib/config/command_mgr.cc
    CommandMgr::commandReader(int sockfd) - duplicates the connection
    socket to use for repsonding in case the command closes the channel.

src/lib/testutils/io_utils.cc
    fileExists() - now uses stat() function so one can use it on any
    type of file, like a unix socket

updated unit tests accordingly
2016-12-22 13:38:00 -05:00
Thomas Markwalder
354e68adec [5046] Move apply logging and config commit from processConfig to set-config handler
src/bin/dhcp4/ctrl_dhcp4_srv.cc
    commandConfigReloadHandler() - use commandSetConfigHandler()
    instead of processConfig() to account for logging config

    commandSetConfigHandler() - apply logging config and commit config here instead of
    in processConfig()

src/bin/dhcp4/tests/dhcp4_test_utils.h
     ~NakedDhcpv4Srv() - removed unecesary initLogger call

src/bin/dhcp4/tests/kea_controller_unittest.cc
     ~JSONFileBackendTest() - removed unecessary call to setDefaultLogging

src/bin/dhcp6/ctrl_dhcp6_srv.cc
    commandConfigReloadHandler() - use commandSetConfigHandler()
    instead of processConfig() to account for logging config

    commandSetConfigHandler() - apply logging config and commit config here instead of
    in processConfig()

src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
    createUnixChannelServer() -  added config commit so command channel behavior
    is correct

    TEST_F(CtrlDhcpv6SrvTest, configReload)
        Wrap configuration in Dhcp6 element

    TEST_F(CtrlChannelDhcpv6SrvTest, set_config)
        Turn off timers in config

src/lib/dhcpsrv/srv_config.cc
    SrvConfig::applyLoggingCfg() - remove logic added to not call manager.process
    when there are no specs.
2016-12-15 16:15:26 -05:00
Thomas Markwalder
767bf1503f [5046] Avoid wiping logging when config is empty
src/lib/dhcpsrv/srv_config.cc
    SrvConfig::applyLoggingCfg() - now only calls LoggerManager::process()
    if the logger config isn't empty

src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/tests/dhcp6_test_utils.cc
    Minor clean up and commentary

src/bin/dhcp6/kea_controller.cc
    configure(const std::string& file_name)
    - Removed initial rollback, now done in commandSetConfigHandler()

src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
   - Removed unnecessary call to initLogger
2016-12-09 16:06:38 -05:00
Thomas Markwalder
cb8f8ae36e [5046] Fixed logger setup on set-config
src/bin/dhcp6/ctrl_dhcp6_srv.cc
    ControlledDhcpv6Srv::commandSetConfigHandler()
    - Add logger config
    - Use processConfig() directly instead of config-reload command

src/bin/dhcp6/kea_controller.cc
    configure(const std::string& file_name)
      - Remove logger config
      - Use set-config command instead of config-reload

src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
    createUnixChannelServer()
    - added call to initLogger() to revert logging to unit test logger

src/bin/dhcp6/tests/dhcp6_test_utils.cc
    BaseServerTest::~BaseServerTest() {
    - added call to initLogger() to revert logging to unit test logger
2016-12-08 14:56:17 -05:00
Thomas Markwalder
a9a3d0d5dd [5046] kea-dhcp6 now implements set-config command
src/bin/dhcp6/ctrl_dhcp6_srv.h
src/bin/dhcp6/ctrl_dhcp6_srv.cc
    ControlledDhcpv6Srv::commandSetConfigHandler() - new method to process
    the set-config command.

    ControlledDhcpv6Srv::processCommand() - call new set-config handler

    ControlledDhcpv6Srv::processConfig() - added logic to apply logging
    and commit configuration after  successful reconfig

    ControlledDhcpv6Srv::ControlledDhcpv6Srv(uint16_t port) - added registration
    of set-config command

    ControlledDhcpv6Srv::~ControlledDhcpv6Srv() - unregisters set-config command

src/bin/dhcp6/json_config_parser.cc
    configureCommandChannel() - extracted logic to reconfigure command channel
    to its own fucntion

src/bin/dhcp6/kea_controller.cc
    configure() - removed logic to apply logging and commit config, now done
    in ControlledDhcpv6Srv::processConfig()

src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
    TEST_F(CtrlChannelDhcpv6SrvTest, set_config) - new test to exercise the
    set-config command
2016-12-07 10:32:22 -05:00
Francis Dupont
4204443ad1 [5014_phase2] Use Dhcp6 (vs JSON) parser as much as possible in unit tests 2016-11-29 19:58:37 +01:00
Francis Dupont
55ad23aa80 [5014_phase2] Use parser in place of fromJSON 2016-11-29 19:58:37 +01:00
Thomas Markwalder
2659a1acbe [3238] Enabled libreload command
doc/guide/ctrl-channel.xml
    Added libreload to common command section

src/bin/dhcp4/ctrl_dhcp4_srv.cc
    Registered and deregistered libreload command

src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
    TEST_F(CtrlChannelDhcpv4SrvTest, libreload) - modified to
    test using CommandMgr instance

src/bin/dhcp6/ctrl_dhcp6_srv.cc
    Registered and deregistered libreload command

src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
    TEST_F(CtrlChannelDhcpv6SrvTest, libreload) - modified to
    test using CommandMgr instance
2016-11-22 14:09:22 -05:00
Tomek Mrugalski
e10309c77e [4297] Unit-tests updated after recent API change. 2016-03-09 18:59:06 +01:00
Marcin Siodelski
3d18318f68 [4236] Updated copyright dates in all files. 2015-12-16 15:28:44 +01:00
Marcin Siodelski
fe9dd86d20 [4236] Replaced license text in all files containing it. 2015-12-16 13:37:29 +01:00
Marcin Siodelski
4373258d9d [4211] Added parameter which enables/disables write of a DUID in file. 2015-11-30 18:07:35 +01:00
Marcin Siodelski
81467147e2 [master] Use LeaseMgrFactory::instance() rather than constructor.
This fixes issues reported by the coverity scans recently.
2015-11-02 12:30:58 +09:00
Francis Dupont
e03cf770b3 [3978] Addressed comments 2015-10-23 04:23:45 +02:00
Francis Dupont
448015b06a [3978] Cleaned up code 2015-10-17 11:19:55 +02:00
Francis Dupont
66e996f842 [3978] Added unit tests 2015-10-16 23:50:39 +02:00
Tomek Mrugalski
a50d64cc41 [master] Merge branch 'trac3902' (extended unit-tests for command channel) 2015-08-25 17:02:41 +02:00
Tomek Mrugalski
afe30f1c38 [3902] Implemented several unit-tests in CtrlChannelDhcpv4SrvTest 2015-07-14 20:03:20 +02:00
Tomek Mrugalski
c6b6ea4048 [3902] UnixControlClient moved to lib/testutils 2015-07-14 15:02:45 +02:00
Francis Dupont
b471b547c8 [3932] Ignored remove return status 2015-07-08 15:56:56 +02:00
Tomek Mrugalski
9cfd502e8d [master] Merge branch 'trac3918' (KEA_SOCKET_TEST_DIR variable)
Conflicts:
	src/lib/util/tests/socketsession_unittest.cc
2015-06-24 18:41:24 +02:00
Tomek Mrugalski
cce3574ab5 [3918] Unix socket tests now use KEA_SOCKET_TEST_DIR env var (if available) 2015-06-24 13:42:47 +02:00
Francis Dupont
b183c1619f [master] Some other/new s/unlink/remove/ 2015-06-24 10:09:50 +02:00
Francis Dupont
ebad861feb [master] Finished merge of trac3841 (use remove() vs unlink()) at the exception of the ChangeLog entry 2015-06-24 10:06:52 +02:00
Tomek Mrugalski
7c64a2b924 [3918] UNIX socket path length is now checked. 2015-06-23 20:03:55 +02:00
Thomas Markwalder
79df1b2a03 [3797] Use TEST_DATA_BUILDDIR for unit tests
Replaced use of TEST_DATA_DIR with TEST_DATA_BUILDDIR for socket_path
and fixed cast of close.
2015-06-19 11:17:03 -04:00
Thomas Markwalder
fa8705e134 [3797] Addressed review comments
Minor cleanup issues
2015-06-19 10:24:46 -04:00
Thomas Markwalder
e103da1162 [3797] Added support for Control Channel to DHCPv6
src/bin/dhcp6/ctrl_dhcp6_srv.cc
    ControlledDhcpv6Srv::ControlledDhcpv6Srv()
        added CommandMgr init and handler registration

    ControlledDhcpv6Srv::~ControlledDhcpv6Srv() {
        added CommandMgr shutdown and handler deregistration

src/bin/dhcp6/json_config_parser.cc
    - createGlobal6DhcpConfigParser()
        added support for "control-socket" element

    - configureDhcp6Server()
        added logic to configure CommandMgr based on
        control-socket configuration element

src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
    - UnixControlClient  - new class that acts as UnixCommandSocket client    - CtrlChannelDhcpv6SrvTest - new test fixture for testing a DHCPv6 server
    with a Control Channel

    - Added the following tests:
    TEST_F(CtrlDhcpv6SrvTest, commandsRegistration)
    TEST_F(CtrlChannelDhcpv6SrvTest, controlChannelNegative)
    TEST_F(CtrlChannelDhcpv6SrvTest, controlChannelShutdown)
    TEST_F(CtrlChannelDhcpv6SrvTest, controlChannelStats)
2015-06-18 15:11:22 -04:00
Tomek Mrugalski
89c0130ed4 [3796] command_interpreter.cc|h|tests moved: src/lib/config => src/lib/cc 2015-06-10 10:48:24 +02:00
Tomek Mrugalski
aa10ecc86f [3796] ccsession.cc|h renamed to command_interpreter.cc|h 2015-05-20 16:14:41 +02:00
Francis Dupont
8c6fbe3a53 [3841] replaced unlink by remove 2015-05-12 22:51:43 +02:00
Marcin Siodelski
e994b57ca4 [3604] Use new interface configuration format where applicable.
Also, renamed interface-config to interfaces-config (plural form).
2015-02-09 13:50:17 +01:00