Task #1501
closedUnit tests for RibManager
100%
Description
NRD is currently lacking test cases
Updated by Alex Afanasyev over 10 years ago
Unit test should test the functions of RibManager
and the use of config file by the manager. For example, my recent commit introduced a bug with configuration file (I forgot to update section name), which was discovered only later with manual runs of NFD/NRD.
However, after today's call I realized that implementation of these tests require additional support in the library, so the test can be really unit. At the same time, some preparation and initial implementation should be done in NFD/rib now:
- RibManager should accept Face as a parameter, so it can be customized in the test cases. The library will provide DummyFace and DummyTransport to be used to do unit tests.
- RibManager should allow swapping of the controller. This particular piece can be done only for the test cases using "WITH_TESTS" macro (e.g., similar to
core/global-io.hpp
)
Updated by Alex Afanasyev over 10 years ago
- Target version changed from v0.1 to v0.2
Updated by Junxiao Shi over 10 years ago
- Subject changed from Unit tests for NRD to Unit tests for RibManager
- Estimated time set to 2.00 h
This Task covers unit testing for RibManager
class only.
Future implemented features MUST include unit testings or they won't be approved.
Updated by Junxiao Shi over 10 years ago
- Assignee set to Vince Lehman
Lan decides to assign this Task to Vince.
Updated by Vince Lehman over 10 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 20
Updated by Vince Lehman over 10 years ago
- RibManager should accept Face as a parameter, so it can be customized in the test cases. The library will provide DummyFace and DummyTransport to be used to do unit tests.
- RibManager should allow swapping of the controller. This particular piece can be done only for the test cases using "WITH_TESTS" macro (e.g., similar to
core/global-io.hpp
)
Should these changes be made as well as the unit tests to test the config file and functions, or do the latter require additional library support?
Updated by Vince Lehman over 10 years ago
Are the requested changes still needed?
Updated by Alex Afanasyev over 10 years ago
We still don't have full coverage of unit tests of the RIB manager. You made a lot of very good test cases to test that RIB updates will generate expected set of FIB updates. However, I think we still need to have another test case(s) to ensure that RIB manager (or whoever else in the future) properly send out FIB management commands.
Updated by Alex Afanasyev over 10 years ago
The test cases should evaluate overall RibManager behavior. As suggested in note-1, RibManager (on in a future another class) should accept "Face" as a parameter. The test case should create a special face. Then, during the test, it should be checked that RibManager can:
- successfully receive incoming packets (directly injected through a special face)
- successfully generate FIB management commands as a response to the injected commands
Other tests to cover the implemented functionality.
Updated by Vince Lehman over 10 years ago
Will ndn::Face m_face in the RIB Manager need to be changed to an nfd::Face so DummyFace can be used in the unit tests?
Updated by Vince Lehman over 10 years ago
- Status changed from In Progress to Code review
- % Done changed from 80 to 90
Updated by Junxiao Shi over 10 years ago
- Status changed from Code review to Closed
- Start date deleted (
04/17/2014) - % Done changed from 90 to 100