summaryrefslogtreecommitdiffstats
path: root/src/hooks/dhcp/pgsql_cb/tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
* [#3019] retry db open on startupRazvan Becheriu2023-12-143-5/+85
|
* [#2702] removed link dependencies to fix odr violationRazvan Becheriu2023-02-111-1/+0
|
* [#2702] applied suggested patchRazvan Becheriu2023-02-101-2/+2
|
* [#2702] fix static linking with libcfgrpt.la multiple timesRazvan Becheriu2023-02-101-3/+4
|
* [#2071] fixed use of valgrindRazvan Becheriu2022-08-101-2/+1
|
* [#2423] release changes: spelling correctionsAndrei Pavel2022-05-232-2/+2
|
* [#2355] PgSQL CB V6 support for client classesThomas Markwalder2022-03-141-0/+28
| | | | | | | | | | | | | | | | | | | | | src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp6.cc Implemented client class related functions src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.h Removed NOT_IMPL_STR macro src/hooks/dhcp/pgsql_cb/pgsql_query_macros_dhcp.h Minor adjustments to PGSQL_UPDATE_CLIENT_CLASS6 query src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp6_unittest.cc TEST_F(PgSqlConfigBackendDHCPv6Test, setAndGetAllClientClasses6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, getClientClass6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, createUpdateClientClass6OptionsTest) TEST_F(PgSqlConfigBackendDHCPv6Test, getModifiedClientClasses6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, deleteClientClass6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, deleteAllClientClasses6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, clientClassDependencies6Test) - new tests
* [#2349] updated commentsRazvan Becheriu2022-03-112-6/+7
|
* [#2349] PgSql CB V6 shared-networks, subnets, poolsThomas Markwalder2022-03-101-2/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure.ac Added src/share/database/scripts/pgsql/upgrade_010_to_011.sh src/bin/admin/tests/pgsql_tests.sh.in Updated for upgrade from 10 to 11. src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp4.cc Make use of PgSqlConfigBackendImpl::addDdnsReplaceClientNameBinding() Add universe paramter to createUpdateOptionDef() calls src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp6.cc PgSqlConfigBackendDHCPv6Impl - implemented methods for shared-networks, subnets, pools, subordinate option defs and options getInterfaceId() addInterfaceIdBinding()- new convenience functions for reading and writing interface id options src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.* PgSqlConfigBackendImpl::createUpdateOptionDef() - added universe parameter to replace incorrect use of space name PgSqlConfigBackendImpl::addDdnsReplaceClientNameBinding() - new convenience function src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp6_unittest.cc Added tests for networks, subnets, pools src/lib/dhcpsrv/testutils/generic_cb_dhcp6_unittest.cc Replaced EXPECT_THROWs with ASSER_THROWs - simplifies debugging tremendously src/lib/pgsql/pgsql_connection.h Updated schema version to 11 src/share/database/scripts/pgsql/Makefile.am src/share/database/scripts/pgsql/.gitignore Added upgrade_010_to_011.sh src/share/database/scripts/pgsql/dhcpdb_create.pgsql Added replacement of createOptionAuditDHCP6() to correct assocation of options to PD pools src/share/database/scripts/pgsql/upgrade_010_to_011.sh.in - new file
* [#2346] updated commentsRazvan Becheriu2022-03-092-9/+4
|
* [#2346] PgSql CB V6 globals,option defs, and optionsThomas Markwalder2022-03-094-2/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp6.cc PgSqlConfigBackendDHCPv6Impl:: getGlobalParameter6() createUpdateGlobalParameter6() deleteTransactional() insertOption6() createUpdateOption6() createUpdateOptionDef6() deleteOptionDef6() deleteOption6() - implemented src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.cc PgSqlConfigBackendImpl::createUpdateOptionDef() - added universe parameter src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp4_mgr_unittest.cc src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp6_mgr_unittest.cc - new files src/hooks/dhcp/pgsql_cb/tests/Makefile.am Added pgsql_cb_dhcp4_mgr_unittest.cc, pgsql_cb_dhcp6_mgr_unittest.cc, src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp6_unittest.cc New tests: TEST_F(PgSqlConfigBackendDHCPv6Test, createUpdateDeleteGlobalParameter6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, globalParameters6WithServerTagsTest) TEST_F(PgSqlConfigBackendDHCPv6Test, getAllGlobalParameters6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, getModifiedGlobalParameters6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, nullKeyErrorTest) TEST_F(PgSqlConfigBackendDHCPv6Test, getOptionDef6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, optionDefs6WithServerTagsTest) TEST_F(PgSqlConfigBackendDHCPv6Test, getAllOptionDefs6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, getModifiedOptionDefs6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, createUpdateDeleteOption6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, globalOptions6WithServerTagsTest) TEST_F(PgSqlConfigBackendDHCPv6Test, getAllOptions6Test) TEST_F(PgSqlConfigBackendDHCPv6Test, getModifiedOptions6Test)
* [#2342] PgSql CB6 core, UT, and CRUD for serversThomas Markwalder2022-03-092-2/+260
| | | | | | | | | | | | | | | | | | | new files: src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp6.cc src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp6.h src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp6_unittest.cc src/hooks/dhcp/pgsql_cb/Makefile.am Added pgsql_cb_dhcp6.cc, pgsql_cb_dhcp6.h src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp4.cc Removed extraneous comment text src/hooks/dhcp/pgsql_cb/pgsql_query_macros_dhcp.h Minor corrections src/hooks/dhcp/pgsql_cb/tests/Makefile.am Added pgsql_cb_dhcp6_unittest.cc
* [#2322] Adds client classes to Postgresql CB v4Thomas Markwalder2022-02-241-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure.ac added src/share/database/scripts/pgsql/upgrade_009_to_010.sh src/bin/admin/tests/pgsql_tests.sh.in pgsql_upgrade_8_0_to_9_0() pgsql_upgrade_9_0_to_10_0() - added/improved upgrade tests src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp4.cc Implemented client class functions src/hooks/dhcp/pgsql_cb/pgsql_query_macros_dhcp.h Modified client class related queries src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp4_unittest.cc TEST_F(PgSqlConfigBackendDHCPv4Test, setAndGetAllClientClasses4Test) TEST_F(PgSqlConfigBackendDHCPv4Test, getClientClass4Test) TEST_F(PgSqlConfigBackendDHCPv4Test, createUpdateClientClass4OptionsTest) TEST_F(PgSqlConfigBackendDHCPv4Test, getModifiedClientClasses4Test) TEST_F(PgSqlConfigBackendDHCPv4Test, deleteClientClass4Test) TEST_F(PgSqlConfigBackendDHCPv4Test, deleteAllClientClasses4Test) TEST_F(PgSqlConfigBackendDHCPv4Test, clientClassDependencies4Test) TEST_F(PgSqlConfigBackendDHCPv4Test, multipleAuditEntriesTest) - new tests src/lib/pgsql/pgsql_connection.h Updated schema version to 10.0 src/share/database/scripts/pgsql/Makefile.am Added upgrade_009_to_010.sh src/share/database/scripts/pgsql/dhcpdb_create.pgsql Schema updated to 10.0: Replace setClientClass<4/6>Order() - wrong local variable type, replace int constants with boolean constants dhcp<4/6>_client_class_dependency tables - - primary key needs to be composite to allow muliptle rows per class id func_dhcp<4/6>_client_class_check_dependency_BINS() - trigger functions need to return NEW not NULL
* [#95] Adds v4 support for networks,subnets,pools,optionsThomas Markwalder2022-02-172-1/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure.ac added pgsql/upgrade_008_to_009.sh src/share/database/scripts/pgsql/dhcpdb_create.pgsql src/share/database/scripts/pgsql/upgrade_008_to_009.sh.in Corrected typo dhcp4_option_def_server_option_def_id_fkey Add missing cascade to constraint on dhcp4/6_subnet_server tables. Dropped extraneous dhcp4/6_shared_network_ADEL triggers Replaced createOptionAuditDHCP4() and createOptionAuditDHCP6() with corrected local variable type src/bin/admin/tests/pgsql_tests.sh.in updated expected schema version added pgsql_upgrade_8_0_to_9_0() src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp4_unittest.cc Disabled TEST_F(MySqlConfigBackendDHCPv4Test, getAllSharedNetworks4Test) src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp4.cc implemented functions for shared-networks, subnets, pools, options, and option-defs src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.* PgSqlConfigBackendImpl:: setRelays() setRequireClasses() - new convenience functions getAllOptions() getOptions() - implemented Changed reference tracking from bool to counter processOptionRow() addOptionValueBinding() - corrected buffer handling src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp4_unittest.cc Added tests subnets, shared networks, pools, options, option defs, src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.* GenericConfigBackendDHCPv4Test::testNewAuditEntry() new variant which accepts a list of expected audit entries GenericConfigBackendDHCPv4Test::getAllSharedNetworks4Test() - now tests for an expected list of audit entries
* [#95] addressed some review comments and formattingRazvan Becheriu2022-02-101-5/+5
|
* [#95] Postgresql v4 backend now supports global parametersThomas Markwalder2022-02-091-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for global paramters and new convenience class, PgSqlResultRowWorker src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp4.cc PgSqlConfigBackendDHCPv4Impl::getGlobalParameter4() PgSqlConfigBackendDHCPv4Impl::createUpdateGlobalParameter4() - implemented src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.cc PgSqlConfigBackendImpl::getRecentAuditEntries() PgSqlConfigBackendImpl::getServers() - now uses PgSqlResultRowWorker PgSqlConfigBackendImpl::getGlobalParameters() - implemented src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp4_unittest.cc TEST_F(PgSqlConfigBackendDHCPv4Test, getAndDeleteAllServersTest) TEST_F(PgSqlConfigBackendDHCPv4Test, createUpdateDeleteGlobalParameter4Test) TEST_F(PgSqlConfigBackendDHCPv4Test, globalParameters4WithServerTagsTest) TEST_F(PgSqlConfigBackendDHCPv4Test, getAllGlobalParameters4Test) TEST_F(PgSqlConfigBackendDHCPv4Test, getModifiedGlobalParameters4Test) TEST_F(PgSqlConfigBackendDHCPv4Test, nullKeyErrorTest) - new tests src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.cc GenericConfigBackendDHCPv4Test::nullKeyErrorTest() - only checks exception type, since messages between backends are different src/lib/pgsql/pgsql_exchange.* PgSqlExchange::convertFromBytea() - new function outputs a vector PgSqlExchange::getTripletValue() PgSqlExchange::getTripletValue() - new functions PgSqlResultRowWorker - new convenience class for accessing columns in a result set row src/lib/pgsql/tests/pgsql_basics.cc Added new columns to basics table src/lib/pgsql/tests/pgsql_exchange_unittest.cc TEST_F(PgSqlBasicsTest, tripleTest) TEST_F(PgSqlBasicsTest, resultRowWorker) - new tests
* [#2275] minor adjustmentsRazvan Becheriu2022-01-272-10/+9
|
* [#2275] Refactored MySQL CB DHCPv4 unit testsThomas Markwalder2022-01-261-16/+10
| | | | | | | | | | | | | | | src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp4_unittest.cc Refactored to use GenericConfigBackendDHCPv4Test, moved individual tests into functions in GenericConfigBackendDHCPv4Test src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp4_unittest.cc src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.* Added functions for individual tests taken from mysql_cb_dhcp4_unittest.cc src/lib/dhcpsrv/testutils/mysql_generic_backend_unittest.* MySqlGenericBackendTest::countRows() - chagned to static
* [#2275] Refactored pgsql_cb unit testsThomas Markwalder2022-01-261-1054/+60
| | | | | | | | | | | | | | | | | | | | | Created common classes for testing config backend. Refactored pgsql_cb using said classes. new files: src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.cc src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.h src/lib/dhcpsrv/testutils/generic_cb_recovery_unittest.cc src/lib/dhcpsrv/testutils/generic_cb_recovery_unittest.h src/lib/dhcpsrv/testutils/Makefile.am - added new files src/lib/dhcpsrv/testutils/pgsql_generic_backend_unittest.cc src/lib/dhcpsrv/testutils/pgsql_generic_backend_unittest.h - made countRows static src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp4_unittest.cc - refactored using new classes
* [#95] Addressed initial review commentsThomas Markwalder2022-01-181-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.cc PgSqlConfigBackendImpl::createUpdateServer() - reworked to use savepoints. src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp4.cc src/hooks/dhcp/pgsql_cb/pgsql_query_macros_dhcp.h src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp4_unittest.cc src/lib/pgsql/tests/pgsql_exchange_unittest.cc minor clean up src/lib/database/db_log.* Added new log enums src/lib/database/db_messages.mes New log messages: DATABASE_PGSQL_CREATE_SAVEPOINT DATABASE_PGSQL_ROLLBACK_SAVEPOINT src/lib/pgsql/pgsql_connection.* PgSqlConnection::createSavepoint() PgSqlConnection::rollbackToSavepoint() PgSqlConnection::executeSQL() - new functions src/lib/pgsql/tests/pgsql_connection_unittest.cc TEST_F(PgSqlConnectionTest, savepoints) - new test
* Remove blank lineMarcin Siodelski2022-01-181-1/+0
|
* [#95] All Queries - CRUD for serversThomas Markwalder2022-01-183-3/+1264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/hooks/dhcp/pgsql_cb/Makefile.am New files: pgsql_query_macros.h pgsql_cb_dhcp4.cc pgsql_cb_dhcp4.h src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp4.* Initial implementation - includes CRUD for servers src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.* PgSqlConfigBackendImpl::getStatement() PgSqlConfigBackendImpl::selectQuery() PgSqlConfigBackendImpl::insertQuery() PgSqlConfigBackendImpl::updateDeleteQuery() PgSqlConfigBackendImpl::createAuditRevision() PgSqlConfigBackendImpl::getRecentAuditEntries() PgSqlConfigBackendImpl::deleteFromTable() PgSqlConfigBackendImpl::getLastInsertId() PgSqlConfigBackendImpl::createInputRelayBinding() PgSqlConfigBackendImpl::createOptionValueBinding() PgSqlConfigBackendImpl::getServer() PgSqlConfigBackendImpl::getServers() PgSqlConfigBackendImpl::createUpdateServer() PgSqlConfigBackendImpl::attachElementToServers() PgSqlConfigBackendImpl::addRelayBinding() PgSqlConfigBackendImpl::addOptionValueBinding() PgSqlConfigBackendImpl::addRequiredClassesBinding() PgSqlConfigBackendImpl::addOptionValueBinding() src/hooks/dhcp/pgsql_cb/pgsql_cb_messages.mes New messages src/hooks/dhcp/pgsql_cb/tests/Makefile.am New file:pgsql_cb_dhcp4_unittest.cc src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp4_unittest.cc New file src/lib/config_backend/base_config_backend.h src/lib/config_backend/tests/config_backend_mgr_unittest.cc src/lib/database/backend_selector.h src/lib/database/backend_selector.cc src/lib/database/tests/backend_selector_unittest.cc "pgsql" -> "postgresql" BackendSelector::Type::PGSQL -> BackendSelector::Type::POSTGRESQL src/lib/pgsql/pgsql_connection.cc Added NULL_KEY PgSqlConnection::checkStatementError() - throws DuplicateEntry and NullKeyError src/lib/pgsql/pgsql_connection.h Added NULL_KEY Upped PGSQL_MAX_PARAMETERS_IN_QUERY to 128; src/lib/pgsql/pgsql_exchange.* PsqlBindArray::popBack() - new function Cleaned up AddOptional functions PsqlBindArray::add(const ConstElementPtr& value) - new
* [#1848] Removed triplet binding functionsThomas Markwalder2021-11-171-151/+19
| | | | | | | | | | | | | | | src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.* Removed Triplet binding functions (supported directly by PsqlBindArray) Commented out myriad of currently unused function arguments Fixed missing return errors src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_impl_unittest.cc Removed problematic dummy schema stuff, now reliably uses full schema like all other Postgresql unit tests Removed triplet binding function tests
* [#1848] Moves Triplet to isc::utilThomas Markwalder2021-11-171-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | renamed: src/lib/dhcpsrv/triplet.h -> src/lib/util/triplet.h modified: src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.h src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_impl_unittest.cc src/lib/cc/simple_parser.cc src/lib/cc/simple_parser.h src/lib/dhcpsrv/Makefile.am src/lib/dhcpsrv/client_class_def.cc src/lib/dhcpsrv/client_class_def.h src/lib/dhcpsrv/network.h src/lib/dhcpsrv/parsers/base_network_parser.cc src/lib/dhcpsrv/parsers/client_class_def_parser.cc src/lib/dhcpsrv/subnet.h src/lib/dhcpsrv/tests/Makefile.am src/lib/dhcpsrv/tests/alloc_engine4_unittest.cc src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc src/lib/dhcpsrv/tests/alloc_engine_utils.cc src/lib/dhcpsrv/tests/cfg_shared_networks4_unittest.cc src/lib/dhcpsrv/tests/cfg_shared_networks6_unittest.cc src/lib/dhcpsrv/tests/cfg_subnets4_unittest.cc src/lib/dhcpsrv/tests/cfg_subnets6_unittest.cc src/lib/dhcpsrv/tests/client_class_def_parser_unittest.cc src/lib/dhcpsrv/tests/shared_network_unittest.cc src/lib/dhcpsrv/tests/srv_config_unittest.cc src/lib/dhcpsrv/tests/subnet_unittest.cc src/lib/dhcpsrv/tests/triplet_unittest.cc src/lib/util/Makefile.am
* [#1848] The tests now manage their own schemaTomek Mrugalski2021-11-171-1/+76
|
* [#1848] Makefiles updated after v6 removalTomek Mrugalski2021-11-171-2/+4
|
* [#1848] v6 CB removedTomek Mrugalski2021-11-172-4553/+0
| | | | - to be added back in #96
* [#1848] Updated Makefiles after v4 removalTomek Mrugalski2021-11-171-3/+5
|
* [#1848] Deleted pgsql_cb_dhcp4 implTomek Mrugalski2021-11-172-4423/+0
| | | | - to be reinstantiated back in #95
* [#1848] Changes to appease clang-formatTomek Mrugalski2021-11-176-1880/+1144
|
* [#1848] tests for default,min,max triplet bindingTomek Mrugalski2021-11-171-16/+113
|
* [#1848] First unit test passed!Tomek Mrugalski2021-11-171-26/+0
| | | | 147 more to go...
* [#1848] pgsql_cb_dhcp4_mgr_unittest.cc addedTomek Mrugalski2021-11-171-0/+88
|
* [#1848] pgsql_cb_dhcp4_unittest.cc addedTomek Mrugalski2021-11-171-0/+4681
|
* [#1848] pgsql_cb_dhcp6_mgr_unittest.cc addedTomek Mrugalski2021-11-171-0/+88
|
* [#1848] pgsql_cb_dhcp6_unittest.cc addedTomek Mrugalski2021-11-171-0/+4856
|
* [#1848] pgsql_cb_impl_unittest.cc addedTomek Mrugalski2021-11-171-0/+61
|
* [#1848] Makefile for pgsql cb tests addedTomek Mrugalski2021-11-172-2/+2
|
* [#1848] Template files for new hook addedTomek Mrugalski2021-11-173-0/+85