Kea issueshttps://gitlab.isc.org/isc-projects/kea/-/issues2024-03-26T18:31:40Zhttps://gitlab.isc.org/isc-projects/kea/-/issues/3299Improve MT RADIUS unit tests2024-03-26T18:31:40ZAndrei Pavelandrei@isc.orgImprove MT RADIUS unit testsImprove RADIUS unit tests:
- no goal: write tests for session history: instead implement #414
- MT: see below
- async access added new ways to have a query to be dropped: add these cases
- find a way to detect accounting exchange te...Improve RADIUS unit tests:
- no goal: write tests for session history: instead implement #414
- MT: see below
- async access added new ways to have a query to be dropped: add these cases
- find a way to detect accounting exchange termination (e.g. a class counter of pending exchanges)
RADIUS could have more thorough MT unit tests:
- Start thread pool for accounting by calling the `dhcp*_srv_configured` callout. Currently it is only called for auth. Waiting for work to finish in accounting is not as trivial for auth. Auth uses the unparking for that. (see last general point)
- In both access and accounting, start a second thread pool that simulates the core Kea thread pool / DHCP clients.
- Convert more (all?) ST unit tests to MT. Currently there are only 4 MT unit tests: (v4 + v6) x (access + accounting).kea2.5.8https://gitlab.isc.org/isc-projects/kea/-/issues/3298Make test utility class MemHostDataSource thread-safe2024-03-21T15:02:10ZAndrei Pavelandrei@isc.orgMake test utility class MemHostDataSource thread-safe`MemHostDataSource` is used in certain unit tests.
RADIUS MT unit tests required `MemHostDataSource` to be thread-safe, so the `TestHostCache` that derives it overrode all its methods and added a `lock_guard` to each.
To avoid this boi...`MemHostDataSource` is used in certain unit tests.
RADIUS MT unit tests required `MemHostDataSource` to be thread-safe, so the `TestHostCache` that derives it overrode all its methods and added a `lock_guard` to each.
To avoid this boilerplate code, ideally, `MemHostDataSource` should be made thread-safe itself.
This was not done at the time due to lack of time before the release.
When this is done, remember to remove the overridden methods from `TestHostCache`:
- `premium/src/hooks/dhcp/radius/tests/access_unittests.cc`
- `premium/src/hooks/dhcp/radius/tests/accounting_unittests.cc`
@fdupont says
> Note the mutex must be at most protected.backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/3163unstable unit tests2024-03-20T11:23:33ZAndrei Pavelandrei@isc.orgunstable unit testsThe following tests failed irregularly in the past fortnight:
* `AllocEngine6Test.reservedAddressInPoolReassignedOther` https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/1276/testReport/junit/(root)/AllocEngine6Test/all___debian_1...The following tests failed irregularly in the past fortnight:
* `AllocEngine6Test.reservedAddressInPoolReassignedOther` https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/1276/testReport/junit/(root)/AllocEngine6Test/all___debian_11_amd64___debian_11_amd64_results___reservedAddressInPoolReassignedOther/
```
test_utils.cc:88
Expected equality of these values:
first->cltt_
Which is: 1700075018
second->cltt_
Which is: 1700075019
```
* `HttpClientTest.unreachable` https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/1273/testReport/junit/(root)/HttpClientTest/all___alpine_3_16_amd64___alpine_3_16_amd64_results___unreachable/
```
server_client_unittests.cc:437
Failed
Timeout occurred while running the test!
```
* `MemfileLeaseQueryImpl6ProcessTest.queryByClientIdActiveLeases` https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/1274/testReport/junit/(root)/MemfileLeaseQueryImpl6ProcessTest/all___debian_12_amd64___debian_12_amd64_results___queryByClientIdActiveLeases/
```
lease_query_impl6_unittest.cc:1783
Expected equality of these values:
100
cltt_opt->getValue()
Which is: 101
```
* `MySQLBulkLeaseQuery6ProcessTest.queryByClientIdActiveLeases` https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/1280/testReport/junit/(root)/MySQLBulkLeaseQuery6ProcessTest/all___freebsd_13_0_amd64___freebsd_13_0_amd64_results___queryByClientIdActiveLeases/
```
bulk_lease_query6_unittest.cc:458
Expected equality of these values:
lease->valid_lft_ - elapsed
Which is: 3500
iaaddr_opt->getValid()
Which is: 3499
```
* `MySQLLeaseQueryImpl6ProcessTest.makeClientOptionSingleLink` https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/1265/testReport/junit/(root)/PgSQLLeaseQueryImpl6ProcessTest/all___alpine_3_15_amd64___alpine_3_15_amd64_results___makeClientOptionSingleLink/
```
lease_query_impl6_unittest.cc:880
Expected equality of these values:
100
cltt_opt->getValue()
Which is: 101
```
* `MySQLLeaseQueryImpl6ProcessTest.queryByClientIdActiveLeases` https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/1276/testReport/junit/(root)/MySQLLeaseQueryImpl6ProcessTest/all___debian_10_amd64___debian_10_amd64_results___queryByClientIdActiveLeases/
```
lease_query_impl6_unittest.cc:1783
Expected equality of these values:
100
cltt_opt->getValue()
Which is: 101
```
* `MySQLLeaseQueryImpl6ProcessTest.queryByIpAddressActiveLease` https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/1276/testReport/junit/(root)/MySQLLeaseQueryImpl6ProcessTest/all___ubuntu_20_04_amd64___ubuntu_20_04_amd64_results___queryByIpAddressActiveLease/
```
lease_query_impl6_unittest.cc:1581
Expected equality of these values:
100
cltt_opt->getValue()
Which is: 101
```
* `PgSQLBulkLeaseQuery6ProcessTest.queryByClientIdActiveLeases` https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/1275/testReport/junit/(root)/PgSQLBulkLeaseQuery6ProcessTest/all___fedora_38_amd64___fedora_38_amd64_results___queryByClientIdActiveLeases/
```
bulk_lease_query6_unittest.cc:458
Expected equality of these values:
lease->valid_lft_ - elapsed
Which is: 3500
iaaddr_opt->getValid()
Which is: 3499
```
* `PgSQLLeaseQueryImpl6ProcessTest.makeClientOptionSingleLink` https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/1276/testReport/junit/(root)/PgSQLLeaseQueryImpl6ProcessTest/all___fedora_38_amd64___fedora_38_amd64_results___makeClientOptionSingleLink/
```
lease_query_impl6_unittest.cc:880
Expected equality of these values:
100
cltt_opt->getValue()
Which is: 101
```
* `PgSQLLeaseQueryImpl6ProcessTest.queryByIpAddressActiveLease` https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/1270/testReport/junit/(root)/PgSQLLeaseQueryImpl6ProcessTest/all___rhel_9_amd64___rhel_9_amd64_results___queryByIpAddressActiveLease/
```
lease_query_impl6_unittest.cc:1581
Expected equality of these values:
100
cltt_opt->getValue()
Which is: 101
```kea2.5.8https://gitlab.isc.org/isc-projects/kea/-/issues/2778HA service UT sporadically fail on macOS2024-02-29T06:55:54ZRazvan BecheriuHA service UT sporadically fail on macOS```
[ RUN ] HAServiceTest.sendUpdatesControlResultErrorMultiThreading
ha_service_unittest.cc:1378: Failure
Expected equality of these values:
2
factory3_->getResponseCreator()->getReceivedRequests().size()
Which is: 1
ha_ser...```
[ RUN ] HAServiceTest.sendUpdatesControlResultErrorMultiThreading
ha_service_unittest.cc:1378: Failure
Expected equality of these values:
2
factory3_->getResponseCreator()->getReceivedRequests().size()
Which is: 1
ha_service_unittest.cc:1384: Failure
Value of: update_request3
Actual: false
Expected: true
[ FAILED ] HAServiceTest.sendUpdatesControlResultErrorMultiThreading (2 ms)
```
```
[ RUN ] HAServiceTest.sendSuccessfulUpdates6MultiThreading
ha_service_unittest.cc:1542: Failure
Expected equality of these values:
1
factory3_->getResponseCreator()->getReceivedRequests().size()
Which is: 0
ha_service_unittest.cc:1549: Failure
Value of: update_request3
Actual: false
Expected: true
[ FAILED ] HAServiceTest.sendSuccessfulUpdates6MultiThreading (2 ms)
```
```
[ RUN ] HAServiceTest.sendSuccessfulUpdatesMultiThreading
ha_service_unittest.cc:1120: Failure
Expected equality of these values:
2
factory3_->getResponseCreator()->getReceivedRequests().size()
Which is: 1
ha_service_unittest.cc:1126: Failure
Value of: update_request3
Actual: false
Expected: true
[ FAILED ] HAServiceTest.sendSuccessfulUpdatesMultiThreading (2 ms)
```
It seems that all are caused by checks on the backup server.
It might be realted to the stop condition on the IO service (wait for requests, not for replies)
```
// Actually perform the lease updates.
ASSERT_NO_THROW(runIOService(TEST_TIMEOUT, [this]() {
// Finish running IO service when there are no more pending requests.
return (service_->pendingRequestSize() == 0);
}));
```next-stable-2.6https://gitlab.isc.org/isc-projects/kea/-/issues/3194fix UTs when Kea is configured with botan without TLS2024-02-23T18:26:02ZRazvan Becheriufix UTs when Kea is configured with botan without TLSnext-stable-2.6https://gitlab.isc.org/isc-projects/kea/-/issues/2070make GTEST_FILTER filter shell & python tests too2024-02-02T18:12:53ZAndrei Pavelandrei@isc.orgmake GTEST_FILTER filter shell & python tests too```
$ GTEST_FILTER='CtrlChannelDhcpv4SrvTest.getVersion' make check -C src/bin/dhcp4
```
```
[ RUN ] kea-dhcp4.server_pid_file_test
[ OK ] kea-dhcp4.server_pid_file_test
[ RUN ] dhcpv4_srv.dynamic_reconfiguration
[ ...```
$ GTEST_FILTER='CtrlChannelDhcpv4SrvTest.getVersion' make check -C src/bin/dhcp4
```
```
[ RUN ] kea-dhcp4.server_pid_file_test
[ OK ] kea-dhcp4.server_pid_file_test
[ RUN ] dhcpv4_srv.dynamic_reconfiguration
[ OK ] dhcpv4_srv.dynamic_reconfiguration
[ RUN ] dhcpv4.sigterm_test
[ OK ] dhcpv4.sigint_test
[ RUN ] dhcpv4.version
[ OK ] dhcpv4.version
[ RUN ] dhcpv4.variables
[ OK ] dhcpv4.variables
[ RUN ] dhcpv4_srv.lfc_timer_test
[ OK ] dhcpv4_srv.lfc_timer_test
[ RUN ] dhcpv4.syntax_check_success
[ OK ] dhcpv4.syntax_check_success
[ RUN ] dhcpv4.syntax_check_bad_syntax
[ OK ] dhcpv4.syntax_check_bad_syntax
[ RUN ] dhcpv4.syntax_check_bad_values
[ OK ] dhcpv4.syntax_check_bad_values
[ RUN ] dhcpv4.password_redact_test
[ OK ] dhcpv4.password_redact_test
PASS: dhcp4_process_tests.sh
Note: Google Test filter = CtrlChannelDhcpv4SrvTest.getVersion
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from CtrlChannelDhcpv4SrvTest
[ RUN ] CtrlChannelDhcpv4SrvTest.getVersion
ctrl_dhcp4_srv_unittest.cc:1055: Failure
Value of: response.find("GTEST_VERSION") != string::npos
Actual: false
Expected: true
[ FAILED ] CtrlChannelDhcpv4SrvTest.getVersion (3 ms)
[----------] 1 test from CtrlChannelDhcpv4SrvTest (3 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (3 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] CtrlChannelDhcpv4SrvTest.getVersion
```
It should run a single test.backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/3216Setting YANG list elements with singlequotes in key values is not possible in...2024-01-18T14:58:00ZAndrei Pavelandrei@isc.orgSetting YANG list elements with singlequotes in key values is not possible in our unit testing frameworkOur internal NETCONF test framework in the form of `YangRepr`, particularly the `YangRepr::set` functionality does not support setting list elements that have singlequotes in the value of a key. This is because setting a node is done by ...Our internal NETCONF test framework in the form of `YangRepr`, particularly the `YangRepr::set` functionality does not support setting list elements that have singlequotes in the value of a key. This is because setting a node is done by providing the xpath as a plain string and singlequotes are used to delimit the value of the key, so upon finding a singlequote in the value, the libyang parser thinks the value ends sooner than it actually does and does not know what to do with the rest of the xpath.
This is not a problem in production code, because production code has no need for setting YANG nodes, but instead is only concerned with retrieving them from the sysrepo datastore.
The issue may become more prevalent if issue 3198 gets merged as it was written at the time this issue was created. It makes `data` a key which is more likely to contain a singlequote than other keys, which is also why this issue became obvious there. The issue occurred in unit tests.
```
[ RUN ] ConfigTestKeaV4.examples4
libyang[0]: Invalid character 0x73 ('s'), perhaps "'Error: here'" is supposed to be a function call.
config_unittests.cc:332: Failure
Failed
json = loadFile(path) threw type: N3isc4yang12NetconfErrorE, what: setting item 'nullopt' at '/kea-dhcp4-server:config/option-data[code='56'][space='dhcp4'][data='Error: here's a DHCPNAK!']': Session::setItem: Couldn't set '/kea-dhcp4-server:config/option-data[code='56'][space='dhcp4'][data='Error: here's a DHCPNAK!']': SR_ERR_INVAL_ARG
Google Test trace:
config_unittests.cc:330:
* Tested file: /home/andrei/work/isc/kea-3198-vivso-suboptions-not-properly-supported-in-netconf/doc/examples/kea4/all-options.json
[ FAILED ] ConfigTestKeaV4.examples4 (509 ms)
```
This change was done to avoid it:
```diff
diff --git a/doc/examples/kea4/all-options.json b/doc/examples/kea4/all-options.json
index 5e7d7ccbc7..f52105691b 100644
--- a/doc/examples/kea4/all-options.json
+++ b/doc/examples/kea4/all-options.json
@@ -691,3 +691,3 @@
"code": 56,
- "data": "Error: here's a DHCPNAK!",
+ "data": "Error: here is a DHCPNAK!",
"name": "dhcp-message"
```
One may think of encoding the singlequote as Kea does with the commas in user-context under the lease CSV files. That is not ideal, if even possible, since the singlequote would need to be decoded in get unctionality which means it has an effect on production code, but moreover it might not be compatible with setting outside `YangRepr`, via e.g. sysrepocfg.outstandinghttps://gitlab.isc.org/isc-projects/kea/-/issues/3159ThreadSanitize: SEGSV complain on dhcp4 UT when postgresql isn't running2023-11-23T14:46:57ZThomas MarkwalderThreadSanitize: SEGSV complain on dhcp4 UT when postgresql isn't runningThis ism ore of an inconvenience than anything else but it might be a sign of something else too. When postgresql is compiled in but server is not running, kea-dhcp4 builtin for TSAN, UT throws the following error:
```
[----------] 2 t...This ism ore of an inconvenience than anything else but it might be a sign of something else too. When postgresql is compiled in but server is not running, kea-dhcp4 builtin for TSAN, UT throws the following error:
```
[----------] 2 tests from DORAPgSQLTest
[ RUN ] DORAPgSQLTest.multiStageBoot
wipePgSQLData failed:[export PGPASSWORD=keatest; sh /home/tmark/labs/build/keadev/open/git.3084/kea/src/share/database/scripts/pgsql/wipe_data.sh 19.0 --set ON_ERROR_STOP=1 -A -t -h localhost -q -U keatest -d keatest 2>/dev/null ]
runPgSQLSchema failed: export PGPASSWORD=keatest; cat < /home/tmark/labs/build/keadev/open/git.3084/kea/src/share/database/scripts/pgsql/dhcpdb_drop.pgsql | psql --set ON_ERROR_STOP=1 -A -t -h localhost -q -U keatest -d keatest 2>/dev/null
unknown file: Failure
C++ exception with description "runPgSQLSchema failed: export PGPASSWORD=keatest; cat < /home/tmark/labs/build/keadev/open/git.3084/kea/src/share/database/scripts/pgsql/dhcpdb_drop.pgsql | psql --set ON_ERROR_STOP=1 -A -t -h localhost -q -U keatest -d keatest 2>/dev/null " thrown in the test fixture's constructor.
ThreadSanitizer:DEADLYSIGNAL
==71954==ERROR: ThreadSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55d4686f55bf bp 0x000000000000 sp 0x7ffd8d3170e0 T71954)
==71954==The signal is caused by a READ memory access.
==71954==Hint: address points to the zero page.
#0 testing::Test::DeleteSelf_() /opt/googletest-release-1.8.0/googletest/include/gtest/gtest.h:453 (dhcp4_unittests+0x7735bf)
#1 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /opt/googletest-release-1.8.0/googletest/src/gtest.cc:2402 (dhcp4_unittests+0x781869)
#2 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /opt/googletest-release-1.8.0/googletest/src/gtest.cc:2438 (dhcp4_unittests+0x781869)
#3 testing::TestInfo::Run() /opt/googletest-release-1.8.0/googletest/src/gtest.cc:2661 (dhcp4_unittests+0x76f514)
#4 testing::TestCase::Run() /opt/googletest-release-1.8.0/googletest/src/gtest.cc:2774 (dhcp4_unittests+0x76f871)
#5 testing::internal::UnitTestImpl::RunAllTests() /opt/googletest-release-1.8.0/googletest/src/gtest.cc:4649 (dhcp4_unittests+0x76ff25)
#6 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /opt/googletest-release-1.8.0/googletest/src/gtest.cc:2402 (dhcp4_unittests+0x781fa9)
#7 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /opt/googletest-release-1.8.0/googletest/src/gtest.cc:2438 (dhcp4_unittests+0x781fa9)
#8 testing::UnitTest::Run() /opt/googletest-release-1.8.0/googletest/src/gtest.cc:4257 (dhcp4_unittests+0x7704a5)
#9 RUN_ALL_TESTS() /opt/googletest-release-1.8.0/googletest/include/gtest/gtest.h:2233 (dhcp4_unittests+0x18f59b)
#10 main /home/tmark/labs/build/keadev/open/git.3084/kea/src/bin/dhcp4/tests/dhcp4_unittests.cc:23 (dhcp4_unittests+0x18f59b)
#11 __libc_start_main ../csu/libc-start.c:308 (libc.so.6+0x24082)
#12 _start <null> (dhcp4_unittests+0x1c66dd)
```
Of course if postgresql is running it's not an issue.next-stable-2.6https://gitlab.isc.org/isc-projects/kea/-/issues/2983mysql: Deprecated program name. It will be removed in a future release, use '...2023-08-10T13:48:04ZAndrei Pavelandrei@isc.orgmysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' insteadSome unit tests started showing these warnings:
```
[ RUN ] mysql.db-init
Wiping whole database keatest...
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated pro...Some unit tests started showing these warnings:
```
[ RUN ] mysql.db-init
Wiping whole database keatest...
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
Wiping whole database keatest...
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
[ OK ] mysql.db-init
```
The suggestion is to follow the warning's advice and replace the mysql client invocation with mariadb.
I used this version of the mysql client:
```
$ mysql --version
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
mysql from 11.0.2-MariaDB, client 15.2 for Linux (x86_64) using readline 5.1
$ mariadb --version
mariadb from 11.0.2-MariaDB, client 15.2 for Linux (x86_64) using readline 5.1
```backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/1914HAServiceTest.sendSuccessfulUpdatesAuthorizedMultiThreading sometimes fails2023-02-27T13:41:09ZAndrei Pavelandrei@isc.orgHAServiceTest.sendSuccessfulUpdatesAuthorizedMultiThreading sometimes failsThis time it happened on distcheck on CentOS 8.
https://jenkins.aws.isc.org/job/kea-dev/job/distcheck/415/execution/node/136/log/?consoleFull
```
16:04:40 [ RUN ] HAServiceTest.sendSuccessfulUpdatesAuthorizedMultiThreading
16:04:...This time it happened on distcheck on CentOS 8.
https://jenkins.aws.isc.org/job/kea-dev/job/distcheck/415/execution/node/136/log/?consoleFull
```
16:04:40 [ RUN ] HAServiceTest.sendSuccessfulUpdatesAuthorizedMultiThreading
16:04:40 ../../../../../../../src/hooks/dhcp/high_availability/tests/ha_service_unittest.cc:1096: Failure
16:04:40 Expected equality of these values:
16:04:40 2
16:04:40 factory3_->getResponseCreator()->getReceivedRequests().size()
16:04:40 Which is: 1
16:04:40 ../../../../../../../src/hooks/dhcp/high_availability/tests/ha_service_unittest.cc:1102: Failure
16:04:40 Value of: update_request3
16:04:40 Actual: false
16:04:40 Expected: true
16:04:40 [ FAILED ] HAServiceTest.sendSuccessfulUpdatesAuthorizedMultiThreading (2 ms)
```backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/1799HAServiceTest.sendSuccessfulUpdates6MultiThreading randomly fails2023-02-27T13:40:26ZFrancis DupontHAServiceTest.sendSuccessfulUpdates6MultiThreading randomly failsCopied from the last occurrence but as far as I can remember it was the same the previous time:
```
[ RUN ] HAServiceTest.sendSuccessfulUpdates6MultiThreading
ha_service_unittest.cc:1447: Failure
Expected equality of these values:
...Copied from the last occurrence but as far as I can remember it was the same the previous time:
```
[ RUN ] HAServiceTest.sendSuccessfulUpdates6MultiThreading
ha_service_unittest.cc:1447: Failure
Expected equality of these values:
1
factory3_->getResponseCreator()->getReceivedRequests().size()
Which is: 0
ha_service_unittest.cc:1454: Failure
Value of: update_request3
Actual: false
Expected: true
[ FAILED ] HAServiceTest.sendSuccessfulUpdates6MultiThreading (2 ms)
```
System macOS Big Sur 11.2.3 Xcode 12.4 with master or close to master code - nothing special for the configuration.backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/2703unit tests failure with mysql 5.7.39 and freebsd 12.2023-01-26T16:10:46ZWlodzimierz Wencelunit tests failure with mysql 5.7.39 and freebsd 12.unit test failures:
* https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/lastCompletedBuild/testReport/(root)/MySqlConfigBackendDHCPv6Test/run_tests___freebsd_12_1_amd64___freebsd_12_1_amd64_results___globalOptions6WithServerTagsTes...unit test failures:
* https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/lastCompletedBuild/testReport/(root)/MySqlConfigBackendDHCPv6Test/run_tests___freebsd_12_1_amd64___freebsd_12_1_amd64_results___globalOptions6WithServerTagsTest/
* https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/lastCompletedBuild/testReport/(root)/MySqlConfigBackendDHCPv6Test/run_tests___freebsd_12_1_amd64___freebsd_12_1_amd64_results___globalOptions6WithServerTagsTest/
* https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/lastCompletedBuild/testReport/(root)/MySqlConfigBackendDHCPv6Test/run_tests___freebsd_12_1_amd64___freebsd_12_1_amd64_results___unassignedSubnet6Test/
```
19:27:28 MySQL:
19:27:28 MYSQL_VERSION: 5.7.39
19:27:28 MYSQL_CPPFLAGS: -I/usr/local/include/mysql
19:27:28 MYSQL_LIBS: -L/usr/local/lib/mysql -lmysqlclient -lpthread -lm -lrt -lexecinfo -lssl -lcrypto -lssl -lcrypto
```
test report: https://jenkins.aws.isc.org/job/kea-dev/job/ut-extended/957/testReport/
Most of systems we are using at the build farm are using mysql version 8 or higher. Except centos 7 (5.5.68) and ubuntu 18.04 (5.7.39) but tests are not failing there.backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/2002LQ tests too strict (off by 1 failure)2022-11-02T15:10:40ZTomek MrugalskiLQ tests too strict (off by 1 failure)On one case lease query premium tests failed with the following error:
```
08:16:19 [ RUN ] LeaseQueryImpl6ProcessTest.queryByClientIdActiveLeases
08:16:19 ../../../../../../../../premium/src/hooks/dhcp/lease_query/tests/lease_qu...On one case lease query premium tests failed with the following error:
```
08:16:19 [ RUN ] LeaseQueryImpl6ProcessTest.queryByClientIdActiveLeases
08:16:19 ../../../../../../../../premium/src/hooks/dhcp/lease_query/tests/lease_query_impl6_unittest.cc:1585: Failure
08:16:19 Expected equality of these values:
08:16:19 100
08:16:19 cltt_opt->getValue()
08:16:19 Which is: 101
08:16:19 ../../../../../../../../premium/src/hooks/dhcp/lease_query/tests/lease_query_impl6_unittest.cc:401: Failure
08:16:19 Expected equality of these values:
08:16:19 lease->valid_lft_ - elapsed
08:16:19 Which is: 3500
08:16:19 iaaddr_opt->getValid()
08:16:19 Which is: 3499
08:16:19 ../../../../../../../../premium/src/hooks/dhcp/lease_query/tests/lease_query_impl6_unittest.cc:402: Failure
08:16:19 Expected equality of these values:
08:16:19 lease->preferred_lft_ - elapsed
08:16:19 Which is: 3500
08:16:19 iaaddr_opt->getPreferred()
08:16:19 Which is: 3499
08:16:19 ../../../../../../../../premium/src/hooks/dhcp/lease_query/tests/lease_query_impl6_unittest.cc:417: Failure
08:16:19 Expected equality of these values:
08:16:19 lease->valid_lft_ - elapsed
08:16:19 Which is: 3400
08:16:19 iaprefix_opt->getValid()
08:16:19 Which is: 3399
08:16:19 ../../../../../../../../premium/src/hooks/dhcp/lease_query/tests/lease_query_impl6_unittest.cc:418: Failure
08:16:19 Expected equality of these values:
08:16:19 lease->preferred_lft_ - elapsed
08:16:19 Which is: 3400
08:16:19 iaprefix_opt->getPreferred()
08:16:19 Which is: 3399
08:16:19 [ FAILED ] LeaseQueryImpl6ProcessTest.queryByClientIdActiveLeases (1 ms)
```
Details: [jenkins](https://jenkins.aws.isc.org/job/kea-dev/job/distcheck/477/execution/node/187/log/?consoleFull)
This looks like a timing error that, depending on when exactly the code get run, the values may be off by 1.backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/1557add loose comparison in some unit tests2022-11-02T15:10:19ZFrancis Dupontadd loose comparison in some unit testsFor instance Multi-node testing loop / freebsd-64-latest / results / RebindTest.requestPrefixInRebind failed with:
```
rebind_unittest.cc:948
Expected: 1000
To be equal to: leases_client_na_rebound[0].cltt_ - leases_client_na[0].cl...For instance Multi-node testing loop / freebsd-64-latest / results / RebindTest.requestPrefixInRebind failed with:
```
rebind_unittest.cc:948
Expected: 1000
To be equal to: leases_client_na_rebound[0].cltt_ - leases_client_na[0].cltt_
Which is: 1001
```
it is obviously a timing issue. I propose:
- create a generic tool for handling this case if it does not yet exist
- use it beginning by this testbackloghttps://gitlab.isc.org/isc-projects/kea/-/issues/1765move header only files about test utils2022-11-02T15:10:19ZFrancis Dupontmove header only files about test utilsIn src/lib/testutils the two files sandbox.h and gtest_utils.h are header only (i.e. it is enough to include them: no need to link with libkea-testutils.la). I propose to move them to src/lib/util/unittests keeping of course the header o...In src/lib/testutils the two files sandbox.h and gtest_utils.h are header only (i.e. it is enough to include them: no need to link with libkea-testutils.la). I propose to move them to src/lib/util/unittests keeping of course the header only property. The idea is to avoid spurious consideration about not existent dependency when these two standalone files are used in a library before testutils...backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/1645Changed title: migrate TIMESTAMP to DATETIMEs to support dates past 2038?2022-11-02T15:10:18ZAndrei Pavelandrei@isc.orgChanged title: migrate TIMESTAMP to DATETIMEs to support dates past 2038?For native MariaDB 10.5.8, `MySqlLeaseMgrTest.maxDate*` tests pass.
When starting MariaDB 10.5.8 in docker with [this script](https://github.com/andrei-pavel/scripts/blob/master/scripts/docker/start-mysql), they fail:
<details>
<summary...For native MariaDB 10.5.8, `MySqlLeaseMgrTest.maxDate*` tests pass.
When starting MariaDB 10.5.8 in docker with [this script](https://github.com/andrei-pavel/scripts/blob/master/scripts/docker/start-mysql), they fail:
<details>
<summary>$ ./src/lib/dhcpsrv/tests/libdhcpsrv_unittests --gtest_filter='MySqlLeaseMgrTest.maxDate*'</summary>
<pre>
Note: Google Test filter = MySqlLeaseMgrTest.maxDate*
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from MySqlLeaseMgrTest
[ RUN ] MySqlLeaseMgrTest.maxDate4
wipeMySQLData failed:[sh /home/andrei/work/isc/kea/src/share/database/scripts/mysql/wipe_data.sh 9.5 -N -B --user=keatest --password=keatest keatest 2>/dev/null ]
test_utils.cc:54: Failure
Expected equality of these values:
first->cltt_
Which is: 2147483647
second->cltt_
Which is: 1610629470
[ FAILED ] MySqlLeaseMgrTest.maxDate4 (1679 ms)
[ RUN ] MySqlLeaseMgrTest.maxDate4MultiThreading
test_utils.cc:54: Failure
Expected equality of these values:
first->cltt_
Which is: 2147483647
second->cltt_
Which is: 1610629470
[ FAILED ] MySqlLeaseMgrTest.maxDate4MultiThreading (56 ms)
[ RUN ] MySqlLeaseMgrTest.maxDate6
test_utils.cc:87: Failure
Expected equality of these values:
first->cltt_
Which is: 2147483647
second->cltt_
Which is: 1610629470
[ FAILED ] MySqlLeaseMgrTest.maxDate6 (56 ms)
[ RUN ] MySqlLeaseMgrTest.maxDate6MultiThreading
test_utils.cc:87: Failure
Expected equality of these values:
first->cltt_
Which is: 2147483647
second->cltt_
Which is: 1610629470
[ FAILED ] MySqlLeaseMgrTest.maxDate6MultiThreading (56 ms)
[----------] 4 tests from MySqlLeaseMgrTest (1847 ms total)
[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (1847 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 4 tests, listed below:
[ FAILED ] MySqlLeaseMgrTest.maxDate4
[ FAILED ] MySqlLeaseMgrTest.maxDate4MultiThreading
[ FAILED ] MySqlLeaseMgrTest.maxDate6
[ FAILED ] MySqlLeaseMgrTest.maxDate6MultiThreading
4 FAILED TESTS
</pre>
</details>
The date that is returned is the current time. When looking into the database, the date that is inserted inside the test is MAX_DATE. When doing a manual select via `mysql` client, it is MAX_DATE. So the problem must be on the SELECT statement when using the MySQL libs which were the same version when I tested `mariadb-libs 10.5.8`.backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/774A lot of DISABLED unit tests - either enable or remove2022-11-02T15:10:17ZRazvan BecheriuA lot of DISABLED unit tests - either enable or removebacklogRazvan BecheriuRazvan Becheriuhttps://gitlab.isc.org/isc-projects/kea/-/issues/1764Remove massive duplication in http/tls tests code2022-11-02T15:10:17ZTomek MrugalskiRemove massive duplication in http/tls tests codeThe !1116 branch introduced TLS socket and tests. The tests reused existing HTTP tests, which caused massive code duplication. The goal of this ticket is to remove duplication between the following files:
- tls_client_unittests.cc
- tls...The !1116 branch introduced TLS socket and tests. The tests reused existing HTTP tests, which caused massive code duplication. The goal of this ticket is to remove duplication between the following files:
- tls_client_unittests.cc
- tls_server_unittests.cc
- server_client_unittests.cc
See comments https://gitlab.isc.org/isc-projects/kea/-/merge_requests/1116#note_200522 and https://gitlab.isc.org/isc-projects/kea/-/merge_requests/1116#note_200526.backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/152Add a rebuild-test target for CA, D2 and NETCONF2022-11-02T15:08:43ZFrancis DupontAdd a rebuild-test target for CA, D2 and NETCONFand of course Netconf. Currently a rebuild-test target is available only for DHCPv4 and DHCPv6: it should be adapted to anything using a flex/bison JSON syntax.and of course Netconf. Currently a rebuild-test target is available only for DHCPv4 and DHCPv6: it should be adapted to anything using a flex/bison JSON syntax.backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/355Postgres unit-tests fail in weird way if postgres timezone is set incorrectly2022-11-02T15:08:42ZTomek MrugalskiPostgres unit-tests fail in weird way if postgres timezone is set incorrectlyI live in Poland (CET, GMT+1), but I was visiting London (GMT) and installed Postgres. It had this in postgresql.conf:
```
datestyle = 'iso, mdy'
timezone = 'GB'
```
However, my system timezone (as set in mac os control panel) was CET....I live in Poland (CET, GMT+1), but I was visiting London (GMT) and installed Postgres. It had this in postgresql.conf:
```
datestyle = 'iso, mdy'
timezone = 'GB'
```
However, my system timezone (as set in mac os control panel) was CET.
This caused weird error in unit-tests:
```
[ RUN ] PgSqlBasicsTest.timeStampTest
NOTICE: table "basics" does not exist, skipping
pgsql_exchange_unittest.cc:896: Failure
Expected: fetched_time
Which is: 1544791527
To be equal to: times[row]
Which is: 1544787927
row: 0
pgsql_exchange_unittest.cc:896: Failure
Expected: fetched_time
Which is: 2147487247
To be equal to: times[row]
Which is: 2147483647
row: 1
pgsql_exchange_unittest.cc:896: Failure
Expected: fetched_time
Which is: 4294970895
To be equal to: times[row]
Which is: 4294967295
row: 2
pgsql_exchange_unittest.cc:896: Failure
Expected: fetched_time
Which is: 1544877927
To be equal to: times[row]
Which is: 1544874327
row: 3
[ FAILED ] PgSqlBasicsTest.timeStampTest (40 ms)
```.
Yes, this was a weird configuration, but Kea should have done both conversions using the same timezone.
At the very least we should print a warning about checking timezone configuration if the values are off by multiplicity of 3600 seconds.backlog