From 4f4b53fb5bbbb719aa8e2d4dc134a645264bde38 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Fri, 24 May 2019 14:37:15 +0200 Subject: [PATCH] [#492,!252] Adjusted CfgSubnets4 unit tests after rebase with conflicts. --- src/lib/dhcpsrv/tests/cfg_subnets4_unittest.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/dhcpsrv/tests/cfg_subnets4_unittest.cc b/src/lib/dhcpsrv/tests/cfg_subnets4_unittest.cc index a491036fac..85ec286e6f 100644 --- a/src/lib/dhcpsrv/tests/cfg_subnets4_unittest.cc +++ b/src/lib/dhcpsrv/tests/cfg_subnets4_unittest.cc @@ -280,6 +280,8 @@ TEST(CfgSubnets4Test, mergeSubnets) { option->setData(value.begin(), value.end()); ASSERT_NO_THROW(subnet1b->getCfgOption()->add(option, false, "isc")); + // subnet 3b updates subnet 3 with different ID and removes it + // from network 2 Subnet4Ptr subnet3b(new Subnet4(IOAddress("192.0.3.0"), 26, 3, 4, 500, SubnetID(30))); @@ -327,11 +329,11 @@ TEST(CfgSubnets4Test, mergeSubnets) { ASSERT_EQ(5, cfg_to.getAll()->size()); // The subnet1 should be replaced by subnet1b. - ASSERT_NO_FATAL_FAILURE(checkMergedSubnet(cfg_to, "192.0.1.0/26", + ASSERT_NO_FATAL_FAILURE(checkMergedSubnet(cfg_to, "192.0.10.0/26", SubnetID(1), 400, shared_network1)); // Let's verify that our option is there and populated correctly. - auto subnet = cfg_to.getByPrefix("192.0.1.0/26"); + auto subnet = cfg_to.getByPrefix("192.0.10.0/26"); auto desc = subnet->getCfgOption()->get("isc", 1); ASSERT_TRUE(desc.option_); OptionStringPtr opstr = boost::dynamic_pointer_cast(desc.option_); @@ -344,7 +346,7 @@ TEST(CfgSubnets4Test, mergeSubnets) { // subnet3 should be replaced by subnet3b and no longer assigned to a network. ASSERT_NO_FATAL_FAILURE(checkMergedSubnet(cfg_to, "192.0.3.0/26", - SubnetID(3), 500, no_network)); + SubnetID(30), 500, no_network)); // Let's verify that our option is there and populated correctly. subnet = cfg_to.getByPrefix("192.0.3.0/26"); desc = subnet->getCfgOption()->get("isc", 1); -- 2.47.2