summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRazvan Becheriu <razvan@isc.org>2020-11-23 11:51:37 +0100
committerRazvan Becheriu <razvan@isc.org>2020-11-23 15:03:23 +0100
commitb96740f1224dca630a4fd00d94f3db13defac880 (patch)
tree891fb3317adcb1e87aa3a71aae11c6a67797afa3
parent[#1542] added MT unittests (diff)
downloadkea-b96740f1224dca630a4fd00d94f3db13defac880.tar.xz
kea-b96740f1224dca630a4fd00d94f3db13defac880.zip
[#1542] added more checksKea-1.9.2
-rw-r--r--src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc b/src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc
index 20f188469b..1f66b12570 100644
--- a/src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc
+++ b/src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc
@@ -5550,7 +5550,7 @@ void LeaseCmdsTest::testLease6UpdateMissingParams() {
"{\n"
" \"command\": \"lease6-update\",\n"
" \"arguments\": {"
- " \"subnet-id\": 44,\n"
+ " \"subnet-id\": 66,\n"
" \"ip-address\": \"2001:db8:1::1\"\n"
" }\n"
"}";
@@ -5562,12 +5562,38 @@ void LeaseCmdsTest::testLease6UpdateMissingParams() {
"{\n"
" \"command\": \"lease6-update\",\n"
" \"arguments\": {"
- " \"subnet-id\": 44,\n"
+ " \"subnet-id\": 66,\n"
" \"duid\": \"1a:1b:1c:1d:1e:1f\"\n"
" }\n"
"}";
exp_rsp = "missing parameter 'ip-address' (<string>:3:19)";
testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
+
+ // Just subnet-id, duid and iaid is not enough (ip missing).
+ txt =
+ "{\n"
+ " \"command\": \"lease6-update\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": 66,\n"
+ " \"duid\": \"1a:1b:1c:1d:1e:1f\",\n"
+ " \"iaid\": 1234\n"
+ " }\n"
+ "}";
+ exp_rsp = "missing parameter 'ip-address' (<string>:3:19)";
+ testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
+
+ // Close, but no cigars. Still missing iaid.
+ txt =
+ "{\n"
+ " \"command\": \"lease6-update\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": 66,\n"
+ " \"duid\": \"1a:1b:1c:1d:1e:1f\",\n"
+ " \"ip-address\": \"2001:db8:1::1\"\n"
+ " }\n"
+ "}";
+ exp_rsp = "missing parameter 'iaid' (<string>:3:19)";
+ testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
}
TEST_F(LeaseCmdsTest, lease6UpdateMissingParams) {