tests: MockNfdMgmtFixture requires specific command Interest
MockNfdMgmtFixture previously allows a test case to respond to
the "last" command Interest, which causes difficulty when the
management client sends multiple command Interests together. It
now requires a specific command Interest for sending a response.
refs #3866
Change-Id: I80eeed2cdced618725a73f21bfaa387d831ca11a
diff --git a/tests/tools/nfdc/rib-module.t.cpp b/tests/tools/nfdc/rib-module.t.cpp
index df0a696..2cdc21d 100644
--- a/tests/tools/nfdc/rib-module.t.cpp
+++ b/tests/tools/nfdc/rib-module.t.cpp
@@ -45,7 +45,7 @@
return;
}
- ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/rib/register");
+ ControlParameters req = MOCK_NFD_MGMT_REQUIRE_COMMAND_IS("/localhost/nfd/rib/register");
ndn::nfd::RibRegisterCommand cmd;
cmd.validateRequest(req);
cmd.applyDefaultsToRequest(req);
@@ -56,7 +56,7 @@
BOOST_CHECK_EQUAL(req.getFlags(), ndn::nfd::ROUTE_FLAGS_NONE);
BOOST_CHECK_EQUAL(req.hasExpirationPeriod(), false);
- this->succeedCommand(req);
+ this->succeedCommand(interest, req);
};
this->execute("route add /vxXoEaWeDB 10156 no-inherit");
@@ -73,7 +73,7 @@
return;
}
- ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/rib/register");
+ ControlParameters req = MOCK_NFD_MGMT_REQUIRE_COMMAND_IS("/localhost/nfd/rib/register");
ndn::nfd::RibRegisterCommand cmd;
cmd.validateRequest(req);
cmd.applyDefaultsToRequest(req);
@@ -88,7 +88,7 @@
ControlParameters resp = req;
resp.setExpirationPeriod(time::milliseconds(727411154)); // server side may change expiration
- this->succeedCommand(resp);
+ this->succeedCommand(interest, resp);
};
this->execute("route add /FLQAsaYnYf tcp4://32.121.182.82:6363 "
@@ -152,7 +152,7 @@
return;
}
- MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/rib/register");
+ MOCK_NFD_MGMT_REQUIRE_COMMAND_IS("/localhost/nfd/rib/register");
// no response to command
};