Skip to content

Commit 3d60c02

Browse files
committed
[#3683] Fixed lease_cmds UTs
1 parent b2ccca3 commit 3d60c02

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/hooks/dhcp/lease_cmds/libloadtests/lease_cmds4_unittest.cc

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2017-2024 Internet Systems Consortium, Inc. ("ISC")
1+
// Copyright (C) 2017-2025 Internet Systems Consortium, Inc. ("ISC")
22
//
33
// This Source Code Form is subject to the terms of the Mozilla Public
44
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -544,19 +544,20 @@ void Lease4CmdsTest::testLease4AddBadParams() {
544544
exp_rsp = "Non-IPv4 address specified: 2001:db8:1::1";
545545
testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
546546

547-
// Invalid state: the only supported values are 0,1,2.
547+
// Invalid state: the only supported values are 0,1,2,3,4.
548548
txt =
549549
"{\n"
550550
" \"command\": \"lease4-add\",\n"
551551
" \"arguments\": {"
552552
" \"subnet-id\": 44,\n"
553553
" \"ip-address\": \"192.0.2.1\",\n"
554554
" \"hw-address\": \"1a:1b:1c:1d:1e:1f\",\n"
555-
" \"state\": 4\n"
555+
" \"state\": 5\n"
556556
" }\n"
557557
"}";
558-
exp_rsp = "Invalid state value: 4, supported values are: 0 (default), 1 "
559-
"(declined), 2 (expired-reclaimed) and 3 (released)";
558+
exp_rsp = "Invalid state value: 5, supported values are: 0 (default), 1 "
559+
"(declined), 2 (expired-reclaimed), 3 (released)"
560+
" and 4 (registered)";
560561
testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
561562

562563
// Bad user context: not a map.

src/hooks/dhcp/lease_cmds/libloadtests/lease_cmds6_unittest.cc

+5-4
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ void Lease6CmdsTest::testLease6AddBadParams() {
606606
exp_rsp = "Non-IPv6 address specified: 192.0.2.1";
607607
testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
608608

609-
// Invalid state: the only supported values are 0,1,2.
609+
// Invalid state: the only supported values are 0,1,2,3,4.
610610
txt =
611611
"{\n"
612612
" \"command\": \"lease6-add\",\n"
@@ -615,11 +615,12 @@ void Lease6CmdsTest::testLease6AddBadParams() {
615615
" \"ip-address\": \"2001:db8:1::1\",\n"
616616
" \"duid\": \"1a:1b:1c:1d:1e:1f\",\n"
617617
" \"iaid\": 1234\n,"
618-
" \"state\": 4\n"
618+
" \"state\": 5\n"
619619
" }\n"
620620
"}";
621-
exp_rsp = "Invalid state value: 4, supported values are: 0 (default), 1 "
622-
"(declined), 2 (expired-reclaimed) and 3 (released)";
621+
exp_rsp = "Invalid state value: 5, supported values are: 0 (default), 1 "
622+
"(declined), 2 (expired-reclaimed), 3 (released)"
623+
" and 4 (registered)";
623624
testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
624625

625626
// Bad user context: not a map.

0 commit comments

Comments
 (0)