|
@@ -276,9 +276,12 @@ TEST_F(HostReservationParserTest, bcastAddress) {
|
|
|
// This test verifies that the configuration parser for host reservations
|
|
|
// throws an exception when unsupported parameter is specified.
|
|
|
TEST_F(HostReservationParserTest, invalidParameterName) {
|
|
|
+ // The "ip-addresses" parameter name is incorrect for the DHCPv4
|
|
|
+ // case - it is only valid for DHCPv6 case. Trying to set this
|
|
|
+ // parameter should result in error.
|
|
|
std::string config = "{ \"hw-address\": \"01:02:03:04:05:06\","
|
|
|
"\"hostname\": \"foo.bar.isc.org\","
|
|
|
- "\"ip-addresses\": \"192.0.2.3\" }";
|
|
|
+ "\"ip-addresses\": \"2001:db8:1::1\" }";
|
|
|
|
|
|
ElementPtr config_element = Element::fromJSON(config);
|
|
|
|
|
@@ -497,4 +500,20 @@ TEST_F(HostReservationParserTest, dhcp6DuplicatedPrefix) {
|
|
|
}
|
|
|
|
|
|
|
|
|
+// This test verifies that the configuration parser for host reservations
|
|
|
+// throws an exception when unsupported parameter is specified.
|
|
|
+TEST_F(HostReservationParserTest, dhcp6invalidParameterName) {
|
|
|
+ // The "ip-address" parameter name is incorrect for the DHCPv6
|
|
|
+ // case - it is only valid for DHCPv4 case. Trying to set this
|
|
|
+ // parameter should result in error.
|
|
|
+ std::string config = "{ \"hw-address\": \"01:02:03:04:05:06\","
|
|
|
+ "\"hostname\": \"foo.bar.isc.org\","
|
|
|
+ "\"ip-address\": \"192.0.2.3\" }";
|
|
|
+
|
|
|
+ ElementPtr config_element = Element::fromJSON(config);
|
|
|
+
|
|
|
+ HostReservationParser6 parser(SubnetID(10));
|
|
|
+ EXPECT_THROW(parser.build(config_element), DhcpConfigError);
|
|
|
+}
|
|
|
+
|
|
|
} // end of anonymous namespace
|