IntegrationTests » History » Revision 1
Revision 1/3
| Next »
Junxiao Shi, 06/07/2015 08:13 AM
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:
Gerrit/NFD/integration-tests
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.
Scenarios¶
Main Article: IntegrationScenarios
Most integration test scenarios fit in one of these categories:
- tool test: test tools used in scenarios, such as
nfd-status
,ndnping
, etc. - 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.
Running¶
To run integration tests:
- clone integration-tests repository
- build a topology according to multi-hosts.conf using Ubuntu 12.04 64-bit virtual or physical machines
- ensure every host can access Internet using a NIC separate from the NICs in the topology
- enable SSH public key authentication; use same username on all machines
- enable password-less sudo for the username
- assign IPv4 and IPv6 addresses to each NIC, write assigned IPs into
multi-hosts.conf
- enable IPv4/IPv6 forwarding on node R, disable IPv4/IPv6 forwarding on other nodes
- copy the repository including modified
multi-hosts.conf
onto every host - on every host, execute
./install_apps.py install_all
- on node A, execute
./run_tests.py test_all
NFD integration tests are known to work on VirtualBox VMs and on Emulab emulation platform.
There are efforts to make them work on OpenVZ virtualization platform and mini-ndn emulator.
Development¶
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 test_foo/logs
subdirectory.
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 library_helpers
directory.
Code used to install dependencies on all nodes should be placed in install_helpers
directory.
Updated by Junxiao Shi over 9 years ago · 3 revisions