File tree Expand file tree Collapse file tree 3 files changed +13
-11
lines changed
src/hooks/dhcp/lease_cmds Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 1- 2382. [build ] razvan
1+ 2382. [func ] razvan
22 Implemented the 'lease6-get-by-hw-address' command used to query
33 IPv6 leases by HW Address.
44 (Gitlab #3826)
Original file line number Diff line number Diff line change @@ -1597,7 +1597,7 @@ LeaseCmdsImpl::leaseGetByHwAddressHandler(CalloutHandle& handle) {
15971597 isc_throw (BadValue, " 'hw-address' parameter must be a string" );
15981598 }
15991599
1600- if (!v4 && hw_address->stringValue ().empty ()) {
1600+ if (hw_address->stringValue ().empty ()) {
16011601 isc_throw (BadValue, " 'hw-address' parameter must not be empty" );
16021602 }
16031603
Original file line number Diff line number Diff line change @@ -1767,6 +1767,17 @@ void Lease4CmdsTest::testLease4GetByHwAddressParams() {
17671767 exp_rsp = " 'hw-address' parameter must be a string" ;
17681768 testCommand (cmd, CONTROL_RESULT_ERROR, exp_rsp);
17691769
1770+ // Empty HWAddr.
1771+ cmd =
1772+ " {\n "
1773+ " \" command\" : \" lease4-get-by-hw-address\" ,\n "
1774+ " \" arguments\" : {"
1775+ " \" hw-address\" : \"\"\n "
1776+ " }\n "
1777+ " }" ;
1778+ exp_rsp = " 'hw-address' parameter must not be empty" ;
1779+ testCommand (cmd, CONTROL_RESULT_ERROR, exp_rsp);
1780+
17701781 // Simply bad value.
17711782 cmd =
17721783 " {\n "
@@ -1795,15 +1806,6 @@ void Lease4CmdsTest::testLease4GetByHwAddressFind0() {
17951806 string exp_rsp = " 0 IPv4 lease(s) found." ;
17961807 testCommand (cmd, CONTROL_RESULT_EMPTY, exp_rsp);
17971808
1798- // Empty HWAddr.
1799- cmd =
1800- " {\n "
1801- " \" command\" : \" lease4-get-by-hw-address\" ,\n "
1802- " \" arguments\" : {"
1803- " \" hw-address\" : \"\"\n "
1804- " }\n "
1805- " }" ;
1806- testCommand (cmd, CONTROL_RESULT_EMPTY, exp_rsp);
18071809}
18081810
18091811void Lease4CmdsTest::testLease4GetByHwAddressFind2 () {
You can’t perform that action at this time.
0 commit comments