|
@@ -25,6 +25,7 @@
|
|
|
#include <dhcpsrv/addr_utilities.h>
|
|
|
#include <dhcpsrv/cfgmgr.h>
|
|
|
#include <dhcpsrv/subnet.h>
|
|
|
+#include <dhcpsrv/testutils/config_result_check.h>
|
|
|
#include <hooks/hooks_manager.h>
|
|
|
|
|
|
#include "test_data_files_config.h"
|
|
@@ -375,9 +376,8 @@ public:
|
|
|
std::string config = createConfigWithOption(param_value, parameter);
|
|
|
ElementPtr json = Element::fromJSON(config);
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(1, rcode_);
|
|
|
+ checkResult(x, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(x, "<string>"));
|
|
|
}
|
|
|
|
|
|
/// @brief Test invalid option paramater value.
|
|
@@ -393,9 +393,8 @@ public:
|
|
|
std::string config = createConfigWithOption(params);
|
|
|
ElementPtr json = Element::fromJSON(config);
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(1, rcode_);
|
|
|
+ checkResult(x, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(x, "<string>"));
|
|
|
}
|
|
|
|
|
|
/// @brief Test option against given code and data.
|
|
@@ -491,9 +490,7 @@ TEST_F(Dhcp6ParserTest, version) {
|
|
|
Element::fromJSON("{\"version\": 0}")));
|
|
|
|
|
|
// returned value must be 0 (configuration accepted)
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
}
|
|
|
|
|
|
/// The goal of this test is to verify that the code accepts only
|
|
@@ -506,9 +503,7 @@ TEST_F(Dhcp6ParserTest, bogusCommand) {
|
|
|
Element::fromJSON("{\"bogus\": 5}")));
|
|
|
|
|
|
// returned value must be 1 (configuration parse error)
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- EXPECT_EQ(1, rcode_);
|
|
|
+ checkResult(x, 1);
|
|
|
}
|
|
|
|
|
|
/// The goal of this test is to verify if configuration without any
|
|
@@ -526,9 +521,7 @@ TEST_F(Dhcp6ParserTest, emptySubnet) {
|
|
|
"\"valid-lifetime\": 4000 }")));
|
|
|
|
|
|
// returned value should be 0 (success)
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(status, 0);
|
|
|
}
|
|
|
|
|
|
/// The goal of this test is to verify if defined subnet uses global
|
|
@@ -551,9 +544,7 @@ TEST_F(Dhcp6ParserTest, subnetGlobalDefaults) {
|
|
|
EXPECT_NO_THROW(status = configureDhcp6Server(srv_, json));
|
|
|
|
|
|
// check if returned status is OK
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(status, 0);
|
|
|
|
|
|
// Now check if the configuration was indeed handled and we have
|
|
|
// expected pool configured.
|
|
@@ -602,9 +593,7 @@ TEST_F(Dhcp6ParserTest, multipleSubnets) {
|
|
|
|
|
|
do {
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
const Subnet6Collection* subnets = CfgMgr::instance().getSubnets6();
|
|
|
ASSERT_TRUE(subnets);
|
|
@@ -659,9 +648,7 @@ TEST_F(Dhcp6ParserTest, multipleSubnetsExplicitIDs) {
|
|
|
|
|
|
do {
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
const Subnet6Collection* subnets = CfgMgr::instance().getSubnets6();
|
|
|
ASSERT_TRUE(subnets);
|
|
@@ -711,9 +698,8 @@ TEST_F(Dhcp6ParserTest, multipleSubnetsOverlapingIDs) {
|
|
|
ElementPtr json = Element::fromJSON(config);
|
|
|
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_NE(rcode_, 0);
|
|
|
+ checkResult(x, 2);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(x, "<string>"));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -798,9 +784,7 @@ TEST_F(Dhcp6ParserTest, reconfigureRemoveSubnet) {
|
|
|
|
|
|
ElementPtr json = Element::fromJSON(config4);
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
const Subnet6Collection* subnets = CfgMgr::instance().getSubnets6();
|
|
|
ASSERT_TRUE(subnets);
|
|
@@ -809,9 +793,7 @@ TEST_F(Dhcp6ParserTest, reconfigureRemoveSubnet) {
|
|
|
// Do the reconfiguration (the last subnet is removed)
|
|
|
json = Element::fromJSON(config_first3);
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
subnets = CfgMgr::instance().getSubnets6();
|
|
|
ASSERT_TRUE(subnets);
|
|
@@ -826,16 +808,12 @@ TEST_F(Dhcp6ParserTest, reconfigureRemoveSubnet) {
|
|
|
|
|
|
json = Element::fromJSON(config4);
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
// Do reconfiguration
|
|
|
json = Element::fromJSON(config_second_removed);
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
subnets = CfgMgr::instance().getSubnets6();
|
|
|
ASSERT_TRUE(subnets);
|
|
@@ -873,9 +851,7 @@ TEST_F(Dhcp6ParserTest, subnetLocal) {
|
|
|
EXPECT_NO_THROW(status = configureDhcp6Server(srv_, json));
|
|
|
|
|
|
// returned value should be 0 (configuration success)
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(status, 0);
|
|
|
|
|
|
Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(IOAddress("2001:db8:1::5"),
|
|
|
classify_);
|
|
@@ -910,9 +886,7 @@ TEST_F(Dhcp6ParserTest, subnetInterface) {
|
|
|
EXPECT_NO_THROW(status = configureDhcp6Server(srv_, json));
|
|
|
|
|
|
// returned value should be 0 (configuration success)
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(status, 0);
|
|
|
|
|
|
Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(IOAddress("2001:db8:1::5"),
|
|
|
classify_);
|
|
@@ -944,9 +918,8 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceBogus) {
|
|
|
EXPECT_NO_THROW(status = configureDhcp6Server(srv_, json));
|
|
|
|
|
|
// returned value should be 1 (configuration error)
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(1, rcode_);
|
|
|
+ checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
|
|
|
Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(IOAddress("2001:db8:1::5"),
|
|
|
classify_);
|
|
@@ -976,9 +949,8 @@ TEST_F(Dhcp6ParserTest, interfaceGlobal) {
|
|
|
EXPECT_NO_THROW(status = configureDhcp6Server(srv_, json));
|
|
|
|
|
|
// returned value should be 1 (parse error)
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(1, rcode_);
|
|
|
+ checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1007,9 +979,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceId) {
|
|
|
EXPECT_NO_THROW(status = configureDhcp6Server(srv_, json));
|
|
|
|
|
|
// Returned value should be 0 (configuration success)
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(status, 0);
|
|
|
|
|
|
// Try to get a subnet based on bogus interface-id option
|
|
|
OptionBuffer tmp(bogus_interface_id.begin(), bogus_interface_id.end());
|
|
@@ -1046,9 +1016,8 @@ TEST_F(Dhcp6ParserTest, interfaceIdGlobal) {
|
|
|
EXPECT_NO_THROW(status = configureDhcp6Server(srv_, json));
|
|
|
|
|
|
// Returned value should be 1 (parse error)
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(1, rcode_);
|
|
|
+ checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
}
|
|
|
|
|
|
// This test checks if it is not possible to define a subnet with an
|
|
@@ -1071,10 +1040,8 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceAndInterfaceId) {
|
|
|
EXPECT_NO_THROW(status = configureDhcp6Server(srv_, json));
|
|
|
|
|
|
// Returned value should be 1 (configuration error)
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(1, rcode_);
|
|
|
-
|
|
|
+ checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1101,9 +1068,8 @@ TEST_F(Dhcp6ParserTest, poolOutOfSubnet) {
|
|
|
|
|
|
// returned value must be 1 (values error)
|
|
|
// as the pool does not belong to that subnet
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(1, rcode_);
|
|
|
+ checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
}
|
|
|
|
|
|
// Goal of this test is to verify if pools can be defined
|
|
@@ -1129,9 +1095,7 @@ TEST_F(Dhcp6ParserTest, poolPrefixLen) {
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
|
|
|
// returned value must be 1 (configuration parse error)
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(IOAddress("2001:db8:1::5"),
|
|
|
classify_);
|
|
@@ -1172,9 +1136,7 @@ TEST_F(Dhcp6ParserTest, pdPoolBasics) {
|
|
|
// Returned value must be non-empty ConstElementPtr to config result.
|
|
|
// rcode should be 0 which indicates successful configuration processing.
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
// Test that we can retrieve the subnet.
|
|
|
Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(IOAddress("2001:db8:1::5"),
|
|
@@ -1246,9 +1208,7 @@ TEST_F(Dhcp6ParserTest, pdPoolList) {
|
|
|
// Returned value must be non-empty ConstElementPtr to config result.
|
|
|
// rcode should be 0 which indicates successful configuration processing.
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
// Test that we can retrieve the subnet.
|
|
|
Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(IOAddress("2001:db8:1::5"),
|
|
@@ -1304,9 +1264,7 @@ TEST_F(Dhcp6ParserTest, subnetAndPrefixDelegated) {
|
|
|
// Returned value must be non-empty ConstElementPtr to config result.
|
|
|
// rcode should be 0 which indicates successful configuration processing.
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
// Test that we can retrieve the subnet.
|
|
|
Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(IOAddress("2001:db8:1::5"),
|
|
@@ -1423,9 +1381,8 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) {
|
|
|
|
|
|
// Returned value must be non-empty ConstElementPtr to config result.
|
|
|
// rcode should be 1 which indicates configuration error.
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- EXPECT_EQ(1, rcode_);
|
|
|
+ checkResult(x, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(x, "<string>"));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1611,6 +1568,7 @@ TEST_F(Dhcp6ParserTest, optionDefDuplicate) {
|
|
|
EXPECT_NO_THROW(status = configureDhcp6Server(srv_, json));
|
|
|
ASSERT_TRUE(status);
|
|
|
checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
}
|
|
|
|
|
|
// The goal of this test is to verify that the option definition
|
|
@@ -1718,6 +1676,7 @@ TEST_F(Dhcp6ParserTest, optionDefInvalidName) {
|
|
|
ASSERT_TRUE(status);
|
|
|
// Expecting parsing error (error code 1).
|
|
|
checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
}
|
|
|
|
|
|
/// The purpose of this test is to verify that the option definition
|
|
@@ -1744,6 +1703,7 @@ TEST_F(Dhcp6ParserTest, optionDefInvalidType) {
|
|
|
ASSERT_TRUE(status);
|
|
|
// Expecting parsing error (error code 1).
|
|
|
checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
}
|
|
|
|
|
|
/// The purpose of this test is to verify that the option definition
|
|
@@ -1770,6 +1730,7 @@ TEST_F(Dhcp6ParserTest, optionDefInvalidRecordType) {
|
|
|
ASSERT_TRUE(status);
|
|
|
// Expecting parsing error (error code 1).
|
|
|
checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
}
|
|
|
|
|
|
/// The goal of this test is to verify that the invalid encapsulated
|
|
@@ -1796,6 +1757,7 @@ TEST_F(Dhcp6ParserTest, optionDefInvalidEncapsulatedSpace) {
|
|
|
ASSERT_TRUE(status);
|
|
|
// Expecting parsing error (error code 1).
|
|
|
checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
}
|
|
|
|
|
|
/// The goal of this test is to verify that the encapsulated
|
|
@@ -1824,6 +1786,7 @@ TEST_F(Dhcp6ParserTest, optionDefEncapsulatedSpaceAndArray) {
|
|
|
ASSERT_TRUE(status);
|
|
|
// Expecting parsing error (error code 1).
|
|
|
checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
}
|
|
|
|
|
|
/// The goal of this test is to verify that the option may not
|
|
@@ -1850,6 +1813,7 @@ TEST_F(Dhcp6ParserTest, optionDefEncapsulateOwnSpace) {
|
|
|
ASSERT_TRUE(status);
|
|
|
// Expecting parsing error (error code 1).
|
|
|
checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
}
|
|
|
|
|
|
/// The purpose of this test is to verify that it is not allowed
|
|
@@ -1915,6 +1879,7 @@ TEST_F(Dhcp6ParserTest, optionStandardDefOverride) {
|
|
|
ASSERT_TRUE(status);
|
|
|
// Expecting parsing error (error code 1).
|
|
|
checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
|
|
|
/// @todo The option 59 is a standard DHCPv6 option. However, at this point
|
|
|
/// there is no definition for this option in libdhcp++, so it should be
|
|
@@ -1982,9 +1947,7 @@ TEST_F(Dhcp6ParserTest, optionDataDefaults) {
|
|
|
ElementPtr json = Element::fromJSON(config);
|
|
|
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(IOAddress("2001:db8:1::5"),
|
|
|
classify_);
|
|
@@ -2292,9 +2255,7 @@ TEST_F(Dhcp6ParserTest, optionDataInMultipleSubnets) {
|
|
|
ElementPtr json = Element::fromJSON(config);
|
|
|
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
Subnet6Ptr subnet1 = CfgMgr::instance().getSubnet6(IOAddress("2001:db8:1::5"),
|
|
|
classify_);
|
|
@@ -2489,9 +2450,7 @@ TEST_F(Dhcp6ParserTest, optionDataLowerCase) {
|
|
|
ElementPtr json = Element::fromJSON(config);
|
|
|
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(IOAddress("2001:db8:1::5"),
|
|
|
classify_);
|
|
@@ -2534,9 +2493,7 @@ TEST_F(Dhcp6ParserTest, stdOptionData) {
|
|
|
ElementPtr json = Element::fromJSON(config);
|
|
|
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(IOAddress("2001:db8:1::5"),
|
|
|
classify_);
|
|
@@ -3025,9 +2982,7 @@ TEST_F(Dhcp6ParserTest, selectedInterfaces) {
|
|
|
|
|
|
// returned value must be 1 (values error)
|
|
|
// as the pool does not belong to that subnet
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(status, 0);
|
|
|
|
|
|
// eth0 and eth1 were explicitly selected. eth2 was not.
|
|
|
EXPECT_TRUE(CfgMgr::instance().isActiveIface("eth0"));
|
|
@@ -3063,9 +3018,7 @@ TEST_F(Dhcp6ParserTest, allInterfaces) {
|
|
|
|
|
|
// returned value must be 1 (values error)
|
|
|
// as the pool does not belong to that subnet
|
|
|
- ASSERT_TRUE(status);
|
|
|
- comment_ = parseAnswer(rcode_, status);
|
|
|
- EXPECT_EQ(0, rcode_);
|
|
|
+ checkResult(status, 0);
|
|
|
|
|
|
// All interfaces should be now active.
|
|
|
EXPECT_TRUE(CfgMgr::instance().isActiveIface("eth0"));
|
|
@@ -3137,9 +3090,7 @@ TEST_F(Dhcp6ParserTest, classifySubnets) {
|
|
|
ElementPtr json = Element::fromJSON(config);
|
|
|
|
|
|
EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
|
|
|
- ASSERT_TRUE(x);
|
|
|
- comment_ = parseAnswer(rcode_, x);
|
|
|
- ASSERT_EQ(0, rcode_);
|
|
|
+ checkResult(x, 0);
|
|
|
|
|
|
const Subnet6Collection* subnets = CfgMgr::instance().getSubnets6();
|
|
|
ASSERT_TRUE(subnets);
|
|
@@ -3294,6 +3245,7 @@ TEST_F(Dhcp6ParserTest, invalidD2ClientConfig) {
|
|
|
|
|
|
// check if returned status is failed.
|
|
|
checkResult(status, 1);
|
|
|
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
|
|
|
// Verify that the D2 configuraiton can be fetched and is set to disabled.
|
|
|
D2ClientConfigPtr d2_client_config = CfgMgr::instance().getD2ClientConfig();
|