Opened 3 years ago

Last modified 3 years ago

#5089 new defect

CfgMgr::clear() does not reset D2ClientMgr

Reported by: tmark Owned by:
Priority: medium Milestone: Outstanding Tasks
Component: configuration Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 4 Add Hours to Ticket:
Total Hours: 0 Internal?: no

Description

CfgMgr? owns an instance of D2ClientMgr and does not reset its configuration in CfgMgr::clear. This can cause the stale configuration to be carried over, particularly across unit tests. At the very least it should do something like:

  // Need to change CfgMgr to have a D2CfgMgrPtr not an instance?
  D2ClientConfigPtr disabled(new D2ClientConfig());
  setD2ClientConfig(disabled);

Alternatively, it CfgMgr::d2_client_mgr_ could be changed to D2CfgMgrPtr and simply be recreated.

You can see the effect by running dhcp4 unit tests with

GTEST_FILTER=""*.dynamicOutOfPool:*.jsonFile"

Running tests for filter *.dynamicOutOfPool:*.jsonFile
Note: Google Test filter = *.dynamicOutOfPool:*.jsonFile
[==========] Running 2 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 1 test from OutOfRangeTest
[ RUN      ] OutOfRangeTest.dynamicOutOfPool
[       OK ] OutOfRangeTest.dynamicOutOfPool (25 ms)
[----------] 1 test from OutOfRangeTest (25 ms total)

[----------] 1 test from JSONFileBackendTest
[ RUN      ] JSONFileBackendTest.jsonFile
2016-12-16 10:30:05.867 INFO  [kea.dhcpsrv/17084] DHCPSRV_DHCP_DDNS_SENDER_STOPPED NameChangeRequest sender has been stopped.
[       OK ] JSONFileBackendTest.jsonFile (4 ms)
[----------] 1 test from JSONFileBackendTest (4 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 2 test cases ran. (29 ms total)
[  PASSED  ] 2 tests.
PASS: dhcp4_unittests

OutOfRangeTest?.dynamicOutOfPool enables DDNS updates in dhcp4 server. This configuration gets carried over in JSONFileBackendTest.jsonFile, which upon dhcp4 server shutdown stops the listener, hence the log message above.

Subtickets

Change History (1)

comment:1 Changed 3 years ago by hschempf

  • Milestone changed from Kea-proposed to Outstanding Tasks

Per team discussion 22 Dec, move to outstanding

Note: See TracTickets for help on using tickets.