]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2276] Addressed review comments
authorThomas Markwalder <tmark@isc.org>
Fri, 9 Jun 2023 14:39:49 +0000 (10:39 -0400)
committerThomas Markwalder <tmark@isc.org>
Thu, 6 Jul 2023 14:27:25 +0000 (14:27 +0000)
src/bin/admin/tests/pgsql_tests.sh.in
src/bin/d2/check_exists_add.cc
src/bin/d2/check_exists_remove.cc
src/bin/d2/simple_add_without_dhcid.cc
src/bin/dhcp4/parser_context.cc
src/bin/dhcp6/parser_context.cc
src/lib/dhcp_ddns/tests/test_utils.h
src/lib/dhcpsrv/tests/srv_config_unittest.cc

index 15801a46d6fb64283cf054258b7b99ccff90882e..57216967ed964af1fba79883110926a982476187 100644 (file)
@@ -2055,7 +2055,7 @@ insert into ipv6_reservations (address, prefix_len, type, dhcp6_iaid, host_id) \
     # tables.
     #
     # Initialize database to schema 1.0.
-    pgsql_execute_script "/home/tmark/labs/build/keadev/sandbox/git.2276/kea/src/bin/admin/tests/dhcpdb_create_1.0.pgsql"
+    pgsql_execute_script "@abs_top_srcdir@/src/bin/admin/tests/dhcpdb_create_1.0.pgsql"
     assert_eq 0 "${EXIT_CODE}" "cannot initialize 1.0 database, expected exit code: %d, actual: %d"
 
     # Now upgrade to schema 17.0
index dade71eeed8f57e31a7b177ff279c8419546cd44..5cd46016649dbae677dc12bfaae88832a625a702 100644 (file)
@@ -162,8 +162,7 @@ CheckExistsAddTransaction::selectingFwdServerHandler() {
     if (selectNextServer()) {
         // We have a server to try.
         transition(ADDING_FWD_ADDRS_ST, SERVER_SELECTED_EVT);
-    }
-    else {
+    } else {
         // Server list is exhausted, so fail the transaction.
         transition(PROCESS_TRANS_FAILED_ST, NO_MORE_SERVERS_EVT);
     }
index 10d4566c71564b4b1a65b9b493bbfd47de9a8805..f55680a573c7282425229d9fa31efcae1f9ac47d 100644 (file)
@@ -166,8 +166,7 @@ CheckExistsRemoveTransaction::selectingFwdServerHandler() {
     if (selectNextServer()) {
         // We have a server to try.
         transition(REMOVING_FWD_ADDRS_ST, SERVER_SELECTED_EVT);
-    }
-    else {
+    } else {
         // Server list is exhausted, so fail the transaction.
         transition(PROCESS_TRANS_FAILED_ST, NO_MORE_SERVERS_EVT);
     }
index bec84a155893ead89a4123dce1b5ec828124d314..8979f8b4f301624de87a6611f6a34cbeb49d1f25 100644 (file)
@@ -508,7 +508,7 @@ SimpleAddWithoutDHCIDTransaction::buildReplaceRevPtrsRequest() {
 
     // There are no prerequisites.
 
-    // Create the FQDN/IP PTR 'delete' RR for this IP and add it to 
+    // Create the FQDN/IP PTR 'delete' RR for this IP and add it to
     // the update section.
     dns::RRsetPtr update(new dns::RRset(rev_ip, dns::RRClass::ANY(),
                          dns::RRType::PTR(), dns::RRTTL(0)));
index 55902e7c8b0b52a0048876cee93209d38daf828d..578edf903c8e128a0896b057725d44ab8e0da1b7 100644 (file)
@@ -221,6 +221,8 @@ Parser4Context::contextName() {
         return ("config-database");
     case COMPATIBILITY:
         return ("compatibility");
+    case DDNS_CONFLICT_RESOLUTION_MODE:
+        return ("ddns-conflict-resolution-mode");
     default:
         return ("__unknown__");
     }
index 96a16964762feae50f6e90eb2bf6b8710316b261..acbdaf8a31759ccbf4b695959af9f5af2ae1f41d 100644 (file)
@@ -222,6 +222,8 @@ Parser6Context::contextName() {
         return ("config-database");
     case COMPATIBILITY:
         return ("compatibility");
+    case DDNS_CONFLICT_RESOLUTION_MODE:
+        return ("ddns-conflict-resolution-mode");
     default:
         return ("__unknown__");
     }
index 256350e384cd75200798b68bc3b39396d8a02be7..9de33f81aef43a74c75af8a4aed47e0de5839b3a 100644 (file)
@@ -20,10 +20,10 @@ namespace dhcp_ddns {
 /// @param fd_to_check The file descriptor to test
 ///
 /// @return Returns less than one on an error, 0 if the fd is not ready to
-/// read, > 0 if it is ready to read. 
+/// read, > 0 if it is ready to read.
 int selectCheck(int fd_to_check);
 
 }; // namespace isc::dhcp_ddns;
 }; // namespace isc;
 
-#endif 
+#endif
index 8b519f6cb3e072bfd91ae0204b07ea861e8fd995..b5545a626434ea91c24ca2ad322b3b2dc1a0d80b 100644 (file)
@@ -2335,41 +2335,4 @@ TEST_F(SrvConfigTest, sanityChecksLifetime) {
     }
 }
 
-#if 0
-// Verifies the conflict resolution mode if the older configuration item
-// is specified
-TEST_F(SrvConfigTest, getDdnsConflictResolutionMode) {
-    DdnsParamsPtr params;
-
-    CfgMgr::instance().setFamily(AF_INET);
-    SrvConfig conf(32);
-
-    // Enable conflict resolution globally.
-    conf.addConfiguredGlobal("ddns-use-conflict-resolution", Element::create(true));
-
-    // Add a plain subnet
-    Triplet<uint32_t> def_triplet;
-    Subnet4Ptr subnet1(new Subnet4(IOAddress("192.0.1.0"), 24,
-                                    def_triplet, def_triplet, 4000, SubnetID(1)));
-    /// TKM - does this make sense?
-    subnet1->setDdnsUseConflictResolution(false);
-
-    // In order to take advantage of the dynamic inheritance of global
-    // parameters to a subnet we need to set a callback function for each
-    // subnet to allow for fetching global parameters.
-    subnet1->setFetchGlobalsFn([conf]() -> ConstCfgGlobalsPtr {
-        return (conf.getConfiguredGlobals());
-    });
-
-    conf.getCfgSubnets4()->add(subnet1);
-
-    // Get DDNS params for subnet1.
-    ASSERT_NO_THROW(params = conf_.getDdnsParams(subnet1));
-
-    // Verify subnet1 values are right.
-    EXPECT_FALSE(params->getUseConflictResolution());
-    EXPECT_EQ("no-check-with-dhcid", params->getConflictResolutionMode());
-}
-#endif
-
 } // end of anonymous namespace