From: Marcin Siodelski Date: Mon, 27 Jan 2014 09:45:58 +0000 (+0100) Subject: [3295] Adjusted unit test to expect only one NCR to be generated for 3 IAs. X-Git-Tag: bind10-1.2.0beta1-release~83^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d71c2e5e68d17d99349936232277155b7db9f7eb;p=thirdparty%2Fkea.git [3295] Adjusted unit test to expect only one NCR to be generated for 3 IAs. --- diff --git a/src/bin/dhcp6/tests/fqdn_unittest.cc b/src/bin/dhcp6/tests/fqdn_unittest.cc index 192be9d332..1e974e00c0 100644 --- a/src/bin/dhcp6/tests/fqdn_unittest.cc +++ b/src/bin/dhcp6/tests/fqdn_unittest.cc @@ -492,9 +492,8 @@ TEST_F(FqdnDhcpv6SrvTest, createNameChangeRequestsNoAddr) { ASSERT_TRUE(srv.name_change_reqs_.empty()); } -// Test that a number of NameChangeRequests is created as a result of -// processing the answer message which holds 3 IAs and when FQDN is -// specified. +// Test that exactly one NameChangeRequest is created as a result of processing +// the answer message which holds 3 IAs and when FQDN is specified. TEST_F(FqdnDhcpv6SrvTest, createNameChangeRequests) { NakedDhcpv6Srv srv(0); @@ -514,32 +513,17 @@ TEST_F(FqdnDhcpv6SrvTest, createNameChangeRequests) { Option6ClientFqdn::FULL); answer->addOption(fqdn); - // Create NameChangeRequests. Since we have added 3 IAs, it should - // result in generation of 3 distinct NameChangeRequests. + // Create NameChangeRequest for the first allocated address. ASSERT_NO_THROW(srv.createNameChangeRequests(answer)); - ASSERT_EQ(3, srv.name_change_reqs_.size()); - - // Verify that NameChangeRequests are correct. Each call to the - // verifyNameChangeRequest will pop verified request from the queue. + ASSERT_EQ(1, srv.name_change_reqs_.size()); + // Verify that NameChangeRequest is correct. verifyNameChangeRequest(srv, isc::dhcp_ddns::CHG_ADD, true, true, "2001:db8:1::1", "000201415AA33D1187D148275136FA30300478" "FAAAA3EBD29826B5C907B2C9268A6F52", 0, 500); - verifyNameChangeRequest(srv, isc::dhcp_ddns::CHG_ADD, true, true, - "2001:db8:1::2", - "000201415AA33D1187D148275136FA30300478" - "FAAAA3EBD29826B5C907B2C9268A6F52", - 0, 500); - - verifyNameChangeRequest(srv, isc::dhcp_ddns::CHG_ADD, true, true, - "2001:db8:1::3", - "000201415AA33D1187D148275136FA30300478" - "FAAAA3EBD29826B5C907B2C9268A6F52", - 0, 500); - } // Test creation of the NameChangeRequest to remove both forward and reverse