Project

General

Profile

Actions

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:

  1. clone integration-tests repository
  2. 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 multi-hosts.conf
    • 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
    • populate $HOME/.ssh/known_hosts on node A so that ssh <IP-of-B/C/D> does not require manual host key verification
    • enable password-less sudo for the username
  3. copy the repository including modified multi-hosts.conf onto every host
  4. on every host, execute ./install_apps.py install_all
  5. on node A, execute ./run_tests.py test_all

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.

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 Davide Pesavento over 1 year ago ยท 3 revisions