diff options
-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) { |