2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-28 20:47:48 +00:00

22978 Commits

Author SHA1 Message Date
Thomas Markwalder
0b4ec962af [4239] Moved schema scripts to src/share/database/scripts
Moved schema scripts into a new common location:

        src/share/database/scripts

    to make them accessible to both kea-admin and dhcpsrv testing
2016-04-12 11:14:52 -04:00
Marcin Siodelski
79bae943c9 [master] Added ChangeLog entry for pull request #19. 2016-04-12 13:03:12 +02:00
Marcin Siodelski
d260a70d6a [master] Merge branch 'github19' 2016-04-12 12:29:16 +02:00
Marcin Siodelski
0598dca6c3 [github19] Updated AUTHORS file.
Added Angelo as contributor.
2016-04-12 12:27:36 +02:00
Thomas Markwalder
5b978dabe1 [4239] Added drop scripts for both MySQL and Postgresql
Rather than use hard-coded lists or query logic for dropping the
database all MySQL and Posgresql tests use new drop scripts
added to src/bind/admin/scripts.

src/bin/admin/scripts/mysql/dhcpdb_drop.mysql
    - New SQL script to drop a MySQL database

src/bin/admin/scripts/pgsql/dhcpdb_drop.pgsql
    - New SQL script to drop a Postgresql database

src/bin/admin/tests/mysql_tests.sh.in
    - mysql_wipe() - modified to use new drop script

src/bin/admin/tests/pgsql_tests.sh.in
    - pgsql_wipe() modified to use new drop script

src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
    - TEST(MySqlOpenTest, OpenDatabase) - added show_err=true
    to destroyMySQLSchema() calls

src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc
    - TEST(PgSqlOpenTest, OpenDatabase) - added show_err=true
    to destroyMySQLSchema() calls

src/lib/dhcpsrv/testutils/mysql_schema.cc
    - destroyMySQLSchema(bool show_err) - modified to use the new
    drop script and accept show_err parameter

src/lib/dhcpsrv/testutils/pgsql_schema.cc
    - destroyPgSQLSchema(bool show_err) - modified to use the new
    drop script and accept show_err parameter
2016-04-11 15:16:58 -04:00
Thomas Markwalder
b45da89536 [4239] MySQL and Postgresql unit tests use production schema create scripts
src/lib/dhcpsrv/testutils/schema.h
src/lib/dhcpsrv/testutils/schema.cc
    New files that contain constants and functions common to RDBMS
    testing

src/lib/dhcpsrv/testutils/pgsql_schema.h
src/lib/dhcpsrv/testutils/pgsql_schema.cc
    New files that contain constants and functions needed for
    Posgresql testing

src/lib/dhcpsrv/testutils/mysql_schema.cc
src/lib/dhcpsrv/testutils/mysql_schema.h
    Removed common constants and functions
    Added MYSQL_VALID_TYPE
    runMySQLScript() - new function to submit a script to MySQL

src/lib/dhcpsrv/pgsql_lease_mgr.cc
    PgSqlLease6Exchange - replaced uint32_t iaid member with Uiaid union
    instance.  This permits the value to be safely stored in the database
    as an INT (signed 4-byte value)
    getColumnValue()- added int32_t variant of this method

src/lib/dhcpsrv/tests/Makefile.am
    Removed schema_pgsql_copy.h

src/lib/dhcpsrv/tests/mysql_host_data_source_unittest.cc
src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
    Altered tests to use MYSQL_VALID_TYPE

src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc
    Moved constants and functions testutils/pgsl_schema.h & cc
2016-04-11 11:51:15 -04:00
Marcin Siodelski
efdaab1b74 [github19] Integrated pull request 19 with unit test fix. 2016-04-11 14:47:28 +02:00
Thomas Markwalder
395104bb79 [4239] Fix constraint-based unit test failure
src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc
   - GenericLeaseMgrTest::testLease6HWTypeAndSource() - now uses valid values
     for hardware address source
2016-04-08 10:03:19 -04:00
Thomas Markwalder
9c26b5fa57 [4239] MySQL unit tests in dhcpsrv now use production db create script
src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
    TEST(MySqlOpenTest, OpenDatabase) - pass in show_err=true for call
    to createMySQLSchema()

src/lib/dhcpsrv/testutils/Makefile.am
    - Added definition of TEST_ADMIN_SCRIPTS_DIR
    - removed schema_mysql_copy.h

src/lib/dhcpsrv/testutils/mysql_schema.cc
    - Removed include of schema_mysql_copy.h
    - destroyMySQLSchema() - now contains destroy_statment[] formerly
    defined in schema_mysql_copy.h
    - createMySQLSchema() - Creates the database through command line
    invocation of MySQL cli, mysql, passing it the production database
    creation script
2016-04-08 09:43:22 -04:00
Shawn Routhier
75063d9b41 [trac4269] Update to put 4 byte strings on the value stack for integers 2016-04-07 23:05:50 -07:00
Shawn Routhier
d02a46f2b7 [master] Update change log to add commit number for trac4265 2016-04-07 20:05:53 -07:00
Thomas Markwalder
9e08099507 [master] Added ChangeLog entry 1104 for #4259. 2016-04-07 07:36:52 -04:00
Thomas Markwalder
45e56d7aa0 [master] DDNS parameter, replace-client-name, now supports multiple modes
Merges in trac4259.
2016-04-07 07:09:59 -04:00
Thomas Markwalder
0c3f04e8df [4259] Address review comments, part II
Fixed minor typos.
2016-04-07 07:05:13 -04:00
Marcin Siodelski
61407bbaad [master] Added ChangeLog entry for #4301. 2016-04-06 22:21:11 +02:00
Marcin Siodelski
cf56fc2a2e [master] Merge branch 'trac4301' 2016-04-06 21:50:05 +02:00
Shawn Routhier
bb00d9d205 Merge branch 'trac4265' Access to options and constants from DHCP6 relay encapsulations 2016-04-06 12:27:22 -07:00
Shawn Routhier
0e4e33caa8 [trac4265] Update copyrights and use HOP_COUNT_LIMIT instead of hardcoded value 2016-04-06 11:41:53 -07:00
Marcin Siodelski
253b032fd0 [4301] Addressed review comments. 2016-04-06 18:20:31 +02:00
Thomas Markwalder
773659ff23 [4259] Addressed review comments
Moved string/enum conversion functions inside D2ClientConfig

    Changed underscores to hypens in replace-client-name values and changed
    all literal values to lower case.

    Fixed minor wording issues in admin guide and new log messages.

    Added commentary and extra error logging to unit tests

    Added test case for invalid value of replace-client-name
2016-04-06 11:41:38 -04:00
Stephen Morris
3b34ad14d0 [master] ChangeLog for trac4293 2016-04-06 15:33:18 +01:00
Stephen Morris
06204c5d34 [master] Merge branch 'trac4293' 2016-04-06 15:28:08 +01:00
Marcin Siodelski
7d93d78cda [4301] DUID and HWAddr classes use strutil to convert text to binary. 2016-04-06 15:00:12 +02:00
Marcin Siodelski
0b5aab318e [4301] Implemented utility functions to convert from hex strings.
The supported hex strings may have different formats:
- colon separated values,
- with '0x'prefix
- no prefix, no colons
2016-04-06 14:50:05 +02:00
Shawn Routhier
42b50c9a5f [trac4265] update unittests to go along with token name change 2016-04-05 21:42:55 -07:00
Shawn Routhier
e9fbae1a46 [trac4265] Regenerate parser.cc and parser.h after updates 2016-04-06 04:24:52 +00:00
Shawn Routhier
b2a5d809ac [trac4265] updates per review comments 2016-04-05 20:55:42 -07:00
Thomas Markwalder
604b8e78a2 [4265] Removed whitespaces 2016-04-05 15:31:40 -04:00
Stephen Morris
62b89c1a55 [4293] Correction of a typo in the dhcpsrv message file 2016-04-05 19:03:42 +01:00
Marcin Siodelski
3c6c673464 [4301] HostReservationParser::isIdentifierParameter belongs to parent class. 2016-04-05 16:23:30 +02:00
Marcin Siodelski
fb4c4a30e0 [4301] Host configuration parser now supports circuit-id parameter. 2016-04-05 15:57:11 +02:00
Marcin Siodelski
5adcd2c020 [master] Correcting previous change.
Replace <cstdint> with <stdint.h> because the former is C++11 only.
2016-04-05 15:54:49 +02:00
Marcin Siodelski
8ec157c6fc [master] Added missing inclusion of <cstdint> in strutil.h.
Okayed on jabber.
2016-04-05 15:38:53 +02:00
Thomas Markwalder
8c61caa147 [master] Added ChangeLog entry 1100 for #4243. 2016-04-05 09:28:27 -04:00
Thomas Markwalder
082f846f37 [master] Mitigate GCC 5.x optmizer issue in asiolink
Merged in trac4243.
2016-04-05 08:50:20 -04:00
Marcin Siodelski
abee3e733d [master] Merge branch 'trac4300' 2016-04-05 14:31:05 +02:00
Marcin Siodelski
7741ab8ce8 [4300] Addressed review comments. 2016-04-05 13:30:37 +02:00
Thomas Markwalder
b71852dc1f [4243] Distcheck failure correction
Distcheck sporadically fails to clean up test_leases.csv.2
    can be left behind by dhcp4 and dhcp6 testing.

src/bin/dhcp4/tests/Makefile.am
src/bin/dhcp6/tests/Makefile.am
    - Added test_leases.csv.* to CLEANFILES
2016-04-04 15:34:19 -04:00
Thomas Markwalder
869c33a5f1 [4243] Addressed review comments
src/lib/asiolink/Makefile.am
    added asio_wrapper.h to list of sources

src/lib/asiolink/asio_wrapper.h
    updated commentary to include GNU/Boost bugs and
    added prominent warning comment
2016-04-04 15:32:57 -04:00
Shawn Routhier
7e468146f1 [trac4265] Add test code, tidy up main code 2016-04-04 10:30:10 -07:00
Thomas Markwalder
fe77538dc4 [4259] Updated admin guide and spec files
Revamped discussion of FQDN name generation and use of the
    replace-client-name parameter in the v4 and v6 guides.
2016-04-04 07:24:16 -04:00
Thomas Markwalder
b3f483e537 [4259] kea-dhcp6 now supports replace-client-name modes
src/bin/dhcp6/dhcp6_messages.mes
        - Added new log message, DHCP6_DDNS_SUPPLY_FQDN

    src/bin/dhcp6/dhcp6_srv.cc
        - Dhcpv6Srv::processClientFqdn() - modified to support the name
        replacement modes

    src/bin/dhcp6/tests/fqdn_unittest.cc
        - FqdnDhcpv6SrvTest::testReplaceClientNameMode() new method which tests
        a server's handling of a single client packet for a given
        replace-client-name mode.

        - TEST_F(FqdnDhcpv6SrvTest, replaceClientNameModeTest) - new test which
        exercises the permutations of client packets and replace-client-name
        modes.
2016-04-04 07:21:43 -04:00
Thomas Markwalder
bc8768e936 [4259] kea-dhcp4 now supports replace-client-name modes
src/bin/dhcp4/dhcp4_messages.mes
        - Added new log message DHCP4_SUPPLY_HOSTNAME

    src/bin/dhcp4/dhcp4_srv.cc
        - Dhcpv4Srv::processClientName() - pushed lack of host option in the
        client request down into processHostoption()

        - Dhcpv4Srv::processHostnameOption() - modified to support the new name
        replacement modes

    src/bin/dhcp4/tests/fqdn_unittest.cc
        - NameDhcpv4SrvTest:: testReplaceClientNameMode() - new method which
        tests a server's handling of a single client packet for a given
        replace-client-name mode.

        - TEST_F(NameDhcpv4SrvTest, replaceClientNameModeTest) - new test which
        exercises the permutations of client packets and replace-client-name
        modes.
2016-04-04 07:19:55 -04:00
Thomas Markwalder
d80e28d309 [4259] Converted replace-client-name from boolean to enumeration
The D2 client configuration parameter, replace-client-name, was
    changed from a boolean, to an enumerated list of modes:

        "NEVER" - do not alter or supply the client name
        "ALWAYS" - always replace the client name, or supply it if
         not sent by the client
        "WHEN_PRESENT" - replace the client name sent by the client,
         do not supply one otherwise
        "WHEN_NOT_PRESENT" - supply the client name only if one was
        not sent by the client

    src/lib/dhcpsrv/d2_client_cfg.cc
    src/lib/dhcpsrv/d2_client_cfg.h
        Added the D2ClientConfig::ReplaceClientNameMode enumeration.

    src/lib/dhcpsrv/parsers/dhcp_parsers.cc
        - Alter replace-client-name parsing to parse the mode labels.
        - Maps boolean literals true and false to RCM_WHEN_PRESENT and
        RCM_NEVER respectively

    src/bin/dhcp4/dhcp6_srv.cc
    src/bin/dhcp4/dhcp4_srv.cc
    src/lib/dhcpsrv/d2_client_mgr.h
        - Adapted to use the enumeration

    src/bin/dhcp4/tests/config_parser_unittest.cc
    src/bin/dhcp4/tests/fqdn_unittest.cc
    src/bin/dhcp6/tests/config_parser_unittest.cc
    src/bin/dhcp6/tests/fqdn_unittest.cc
    src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
    src/lib/dhcpsrv/tests/d2_client_unittest.cc
    src/lib/dhcpsrv/tests/d2_udp_unittest.cc
    src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
        - Alter existing tests to use the enumeration. Note false was replaced
        with RCM_NEVER and true with RCM_WHEN_PRESENT
2016-04-04 07:18:24 -04:00
Thomas Markwalder
849439da6c [4259] Add unit tests to ensure StringParser can parse booleans
Added checks to ensure that StringParser can handle being given
    a boolean literal (i.e. unquoted true or false)
2016-04-04 07:16:09 -04:00
Marcin Siodelski
2b12535e20 [4300] Added "circuit-id" as supported identifier into Host class. 2016-04-04 10:57:33 +02:00
Marcin Siodelski
f1289b6cc0 [4300] Added utility function to convert string in quotes to vector. 2016-04-04 10:57:33 +02:00
Marcin Siodelski
e4a879e3e2 [4300] Host class holds identifier rather than HW address or DUID. 2016-04-04 10:57:33 +02:00
Marcin Siodelski
12320a7284 [master] Added ChangeLog entry for #4302. 2016-04-04 10:49:45 +02:00
Marcin Siodelski
3979656c91 [master] Merge branch 'trac4302_rebase' 2016-04-04 09:50:56 +02:00