mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-22 09:57:41 +00:00
[#3826] addressed review comments
This commit is contained in:
parent
66a216e62d
commit
67f31db3e8
@ -1,4 +1,4 @@
|
|||||||
2382. [build] razvan
|
2382. [func] razvan
|
||||||
Implemented the 'lease6-get-by-hw-address' command used to query
|
Implemented the 'lease6-get-by-hw-address' command used to query
|
||||||
IPv6 leases by HW Address.
|
IPv6 leases by HW Address.
|
||||||
(Gitlab #3826)
|
(Gitlab #3826)
|
||||||
|
@ -1597,7 +1597,7 @@ LeaseCmdsImpl::leaseGetByHwAddressHandler(CalloutHandle& handle) {
|
|||||||
isc_throw(BadValue, "'hw-address' parameter must be a string");
|
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");
|
isc_throw(BadValue, "'hw-address' parameter must not be empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1767,6 +1767,17 @@ void Lease4CmdsTest::testLease4GetByHwAddressParams() {
|
|||||||
exp_rsp = "'hw-address' parameter must be a string";
|
exp_rsp = "'hw-address' parameter must be a string";
|
||||||
testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
|
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.
|
// Simply bad value.
|
||||||
cmd =
|
cmd =
|
||||||
"{\n"
|
"{\n"
|
||||||
@ -1795,15 +1806,6 @@ void Lease4CmdsTest::testLease4GetByHwAddressFind0() {
|
|||||||
string exp_rsp = "0 IPv4 lease(s) found.";
|
string exp_rsp = "0 IPv4 lease(s) found.";
|
||||||
testCommand(cmd, CONTROL_RESULT_EMPTY, exp_rsp);
|
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() {
|
void Lease4CmdsTest::testLease4GetByHwAddressFind2() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user