NFD Integration Tests¶
NFD integration tests are a set of test cases in which one or more NFD instances are executed in a topology of virtual or physical machines, and tested with simple applications.
Integration tests repository:
Integration tests focus on correctness rather than performance.
They supplement unit tests.
The difference between unit tests and integration tests is:
a unit test case executes a module of NFD, and all inputs must be written as test code;
an integration test scenario executes one or more full NFD instances, and inputs are generated from simple applications such as ndnping and the traffic generator.
The ability to execute full NFD instances and applications enables an integration test scenario to cover features that are hard to test with unit tests.
Main Article: IntegrationScenarios
Most integration test scenarios fit in one of these categories:
- tool test: test tools used in scenarios, such as
- face test: test face implementations, such as UNIX socket face, UDP tunnel, etc.
- forwarding test: test forwarding behavior, such as FIB matching, ScopeControl, etc.
- management test: test management protocol implementations, such as HubDiscovery, remote prefix registration, etc.
To run integration tests:
- clone integration-tests repository
- build a topology according to multi-hosts.conf using Ubuntu 14.04 64-bit virtual or physical machines
- ensure every host can access Internet using a NIC separate from the NICs in the topology
- assign IPv4 and IPv6 addresses to each NIC, write assigned IPs into
- enable IPv4/IPv6 forwarding on node R, disable IPv4/IPv6 forwarding on other nodes
- enable SSH public key authentication; use same username on all machines
$HOME/.ssh/known_hostson node A so that
ssh <IP-of-B/C/D>does not require manual host key verification
- enable password-less sudo for the username
- copy the repository including modified
multi-hosts.confonto every host
- on every host, execute
- on node A, execute
NFD integration tests are known to work on Emulab emulation platform, VirtualBox VMs, and Vagrant with VirtualBox provider.
There are efforts to make them work on OpenVZ virtualization platform and mini-ndn emulator.
To develop a new integration test scenario
foo, create a directory
test_foo, and write the scenario as a Python unit test suite.
If desired, Python test code may invoke a non-Python script (eg. bash script) to perform the actual test.
The scenario may create log files under
If the same scenario is executed multiple times for different arguments (eg. test forwarding with different strategy settings), it's recommended to name the log files such that they are not overwritten when the scenario is executed with different arguments.
Code shared among multiple scenarios should be placed in
Code used to install dependencies on all nodes should be placed in