diff options
author | Thomas Markwalder <tmark@isc.org> | 2024-11-19 21:23:08 +0100 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2024-12-16 16:15:09 +0100 |
commit | f414f9aa2d7d1743c2553445a828fdfdc13a1b3d (patch) | |
tree | 9caaba2c09c2268a859472cbd272133e7f7fa810 /src/lib/dhcpsrv/tests/network_unittest.cc | |
parent | [#3691] bump version in configure.ac (diff) | |
download | kea-f414f9aa2d7d1743c2553445a828fdfdc13a1b3d.tar.xz kea-f414f9aa2d7d1743c2553445a828fdfdc13a1b3d.zip |
[#2819] kea-dhcp4 supports ddns-ttl, min, and max
Added support for ddns-ttl,ddns-ttl-min, and ddsn-ttl-max
to global,shared-network, and subnet for kea-dhcp4
Changes to be committed:
modified: doc/examples/kea4/all-keys.json
modified: src/bin/dhcp4/dhcp4_lexer.cc
modified: src/bin/dhcp4/dhcp4_lexer.ll
modified: src/bin/dhcp4/dhcp4_parser.cc
modified: src/bin/dhcp4/dhcp4_parser.h
modified: src/bin/dhcp4/dhcp4_parser.yy
modified: src/bin/dhcp4/json_config_parser.cc
modified: src/bin/dhcp4/tests/config_parser_unittest.cc
modified: src/bin/dhcp4/tests/fqdn_unittest.cc
modified: src/bin/dhcp4/tests/get_config_unittest.cc
modified: src/bin/dhcp6/json_config_parser.cc
modified: src/lib/dhcpsrv/cb_ctl_dhcp4.cc
modified: src/lib/dhcpsrv/cb_ctl_dhcp6.cc
modified: src/lib/dhcpsrv/cfg_globals.cc
modified: src/lib/dhcpsrv/cfg_globals.h
modified: src/lib/dhcpsrv/dhcpsrv_messages.cc
modified: src/lib/dhcpsrv/dhcpsrv_messages.h
modified: src/lib/dhcpsrv/dhcpsrv_messages.mes
modified: src/lib/dhcpsrv/ncr_generator.cc
modified: src/lib/dhcpsrv/ncr_generator.h
modified: src/lib/dhcpsrv/network.cc
modified: src/lib/dhcpsrv/network.h
modified: src/lib/dhcpsrv/parsers/base_network_parser.cc
modified: src/lib/dhcpsrv/parsers/simple_parser4.cc
modified: src/lib/dhcpsrv/parsers/simple_parser6.cc
modified: src/lib/dhcpsrv/srv_config.cc
modified: src/lib/dhcpsrv/srv_config.h
modified: src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
modified: src/lib/dhcpsrv/tests/ncr_generator_unittest.cc
modified: src/lib/dhcpsrv/tests/network_unittest.cc
modified: src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc
modified: src/lib/dhcpsrv/tests/srv_config_unittest.cc
modified: src/lib/util/str.cc
modified: src/lib/util/str.h
Diffstat (limited to 'src/lib/dhcpsrv/tests/network_unittest.cc')
-rw-r--r-- | src/lib/dhcpsrv/tests/network_unittest.cc | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/lib/dhcpsrv/tests/network_unittest.cc b/src/lib/dhcpsrv/tests/network_unittest.cc index f0d2ac6801..7b4ac5ed4d 100644 --- a/src/lib/dhcpsrv/tests/network_unittest.cc +++ b/src/lib/dhcpsrv/tests/network_unittest.cc @@ -183,6 +183,9 @@ TEST_F(NetworkTest, inheritanceSupport4) { globals_->set("allocator", Element::create("random")); globals_->set("offer-lifetime", Element::create(45)); globals_->set("ddns-ttl-percent", Element::create(0.75)); + globals_->set("ddns-ttl", Element::create(400)); + globals_->set("ddns-ttl-min", Element::create(200)); + globals_->set("ddns-ttl-max", Element::create(600)); // For each parameter for which inheritance is supported run // the test that checks if the values are inherited properly. @@ -372,6 +375,24 @@ TEST_F(NetworkTest, inheritanceSupport4) { &Network::setDdnsTtlPercent, .33, .75); } + { + SCOPED_TRACE("ddns-ttl"); + testNetworkInheritance<TestNetwork4>(&Network::getDdnsTtl, + &Network::setDdnsTtl, + 300, 400); + } + { + SCOPED_TRACE("ddns-ttl-min"); + testNetworkInheritance<TestNetwork4>(&Network::getDdnsTtlMin, + &Network::setDdnsTtlMin, + 100, 200); + } + { + SCOPED_TRACE("ddns-ttl-max"); + testNetworkInheritance<TestNetwork4>(&Network::getDdnsTtlMax, + &Network::setDdnsTtlMax, + 500, 600); + } } // This test verifies that the inheritance is supported for DHCPv6 @@ -394,6 +415,9 @@ TEST_F(NetworkTest, inheritanceSupport6) { globals_->set("pd-allocator", Element::create("random")); globals_->set("ddns-ttl-percent", Element::create(0.55)); globals_->set("ddns-conflict-resolution-mode", Element::create("check-with-dhcid")); + globals_->set("ddns-ttl", Element::create(400)); + globals_->set("ddns-ttl-min", Element::create(200)); + globals_->set("ddns-ttl-max", Element::create(600)); // For each parameter for which inheritance is supported run // the test that checks if the values are inherited properly. @@ -502,6 +526,24 @@ TEST_F(NetworkTest, inheritanceSupport6) { &Network::setDdnsTtlPercent, .22, .55); } + { + SCOPED_TRACE("ddns-ttl"); + testNetworkInheritance<TestNetwork6>(&Network::getDdnsTtl, + &Network::setDdnsTtl, + 300, 400); + } + { + SCOPED_TRACE("ddns-ttl-min"); + testNetworkInheritance<TestNetwork6>(&Network::getDdnsTtlMin, + &Network::setDdnsTtlMin, + 100, 200); + } + { + SCOPED_TRACE("ddns-ttl-max"); + testNetworkInheritance<TestNetwork6>(&Network::getDdnsTtlMax, + &Network::setDdnsTtlMax, + 500, 600); + } // Interface-id requires special type of test. boost::shared_ptr<TestNetwork6> net_child(new TestNetwork6()); |