diff options
| author | Razvan Becheriu <razvan@isc.org> | 2020-11-23 12:51:37 +0200 |
|---|---|---|
| committer | Razvan Becheriu <razvan@isc.org> | 2020-11-23 14:03:23 +0000 |
| commit | b96740f1224dca630a4fd00d94f3db13defac880 (patch) | |
| tree | 891fb3317adcb1e87aa3a71aae11c6a67797afa3 | |
| parent | b0d08aebb247838e1c44cd03e1713fe34574995c (diff) | |
[#1542] added more checksKea-1.9.2
| -rw-r--r-- | src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc | 30 |
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) { |
