Project

General

Profile

Actions

Task #1501

closed

Unit tests for RibManager

Added by Alex Afanasyev over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
RIB
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
2.00 h

Description

NRD is currently lacking test cases

Actions #1

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)
Actions #2

Updated by Alex Afanasyev over 10 years ago

  • Target version changed from v0.1 to v0.2
Actions #3

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.

Actions #4

Updated by Junxiao Shi over 10 years ago

  • Assignee set to Vince Lehman

Lan decides to assign this Task to Vince.

Actions #5

Updated by Vince Lehman over 10 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 20
Actions #6

Updated by Vince Lehman over 10 years ago

  • % Done changed from 20 to 50
Actions #7

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?

Actions #8

Updated by Vince Lehman over 10 years ago

Are the requested changes still needed?

Actions #9

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.

Actions #10

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.

Actions #11

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?

Actions #12

Updated by Junxiao Shi over 10 years ago

No, it should be ndn::DummyFace.

Actions #13

Updated by Vince Lehman over 10 years ago

  • % Done changed from 50 to 80
Actions #14

Updated by Vince Lehman over 10 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 80 to 90
Actions #15

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
Actions

Also available in: Atom PDF