isc_throw(BadValue, "'hw-address' parameter must be a string");
}
- if (!v4 && hw_address->stringValue().empty()) {
+ if (hw_address->stringValue().empty()) {
isc_throw(BadValue, "'hw-address' parameter must not be empty");
}
exp_rsp = "'hw-address' parameter must be a string";
testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
+ // Empty HWAddr.
+ cmd =
+ "{\n"
+ " \"command\": \"lease4-get-by-hw-address\",\n"
+ " \"arguments\": {"
+ " \"hw-address\": \"\"\n"
+ " }\n"
+ "}";
+ exp_rsp = "'hw-address' parameter must not be empty";
+ testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
+
// Simply bad value.
cmd =
"{\n"
string exp_rsp = "0 IPv4 lease(s) found.";
testCommand(cmd, CONTROL_RESULT_EMPTY, exp_rsp);
- // Empty HWAddr.
- cmd =
- "{\n"
- " \"command\": \"lease4-get-by-hw-address\",\n"
- " \"arguments\": {"
- " \"hw-address\": \"\"\n"
- " }\n"
- "}";
- testCommand(cmd, CONTROL_RESULT_EMPTY, exp_rsp);
}
void Lease4CmdsTest::testLease4GetByHwAddressFind2() {