Commit 82b89ddd authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[5468] Leases returned for lease4-get-all command are storedin "subnets".

parent 75e555d5
......@@ -514,8 +514,10 @@ LeaseCmdsImpl::lease4GetAllHandler(CalloutHandle& handle) {
std::ostringstream s;
s << leases_json->size() << " IPv4 lease(s) found.";
ElementPtr args = Element::createMap();
args->set("leases", leases_json);
ConstElementPtr response = createAnswer(CONTROL_RESULT_SUCCESS,
s.str(), leases_json);
s.str(), args);
setResponse(handle, response);
......
......@@ -1140,7 +1140,12 @@ TEST_F(LeaseCmdsTest, Lease4GetAll) {
// Now check that the lease parameters were indeed returned.
ASSERT_TRUE(rsp);
ConstElementPtr leases = rsp->get("arguments");
ConstElementPtr args = rsp->get("arguments");
ASSERT_TRUE(args);
ASSERT_EQ(Element::map, args->getType());
ConstElementPtr leases = args->get("leases");
ASSERT_TRUE(leases);
ASSERT_EQ(Element::list, leases->getType());
......@@ -1171,7 +1176,12 @@ TEST_F(LeaseCmdsTest, Lease4GetAllBySubnetId) {
// Now check that the lease parameters were indeed returned.
ASSERT_TRUE(rsp);
ConstElementPtr leases = rsp->get("arguments");
ConstElementPtr args = rsp->get("arguments");
ASSERT_TRUE(args);
ASSERT_EQ(Element::map, args->getType());
ConstElementPtr leases = args->get("leases");
ASSERT_TRUE(leases);
ASSERT_EQ(Element::list, leases->getType());
......@@ -1199,7 +1209,12 @@ TEST_F(LeaseCmdsTest, Lease4GetAllByMultipleSubnetIds) {
// Now check that the lease parameters were indeed returned.
ASSERT_TRUE(rsp);
ConstElementPtr leases = rsp->get("arguments");
ConstElementPtr args = rsp->get("arguments");
ASSERT_TRUE(args);
ASSERT_EQ(Element::map, args->getType());
ConstElementPtr leases = args->get("leases");
ASSERT_TRUE(leases);
ASSERT_EQ(Element::list, leases->getType());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment