2
0
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:
Razvan Becheriu 2025-07-31 16:45:25 +03:00
parent 66a216e62d
commit 67f31db3e8
3 changed files with 13 additions and 11 deletions

View File

@ -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)

View File

@ -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");
} }

View File

@ -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() {