User Tools

Site Tools


library-tests

How to run the library tests?

The ROHC library contains several tests that one may run to check for regressions. It is advised that all developers run these tests before submitting a patch (modification of the source code).

This procedure is for versions >= 1.6.0 only.

Running all automated tests

To run the library tests, you first have to get the source code of the ROHC library and build it on your system (do not append option --disable-rohc-tests at step 4 ; step 9 is not mandatory for running the tests).

Second, type:

$ make check

You may speed up the processing with you are running a SMP system:

$ make -jX check   # set X to your number of CPU plus one

There are several types of tests:

  • unit tests for encoding schemes such as LSB, W-LSB, Scaled TS, and variable_length_32_enc.
  • functional tests:
    • ROHC segmentation,
    • ROHC padding (at decompressor),
    • ROHC feedback-only packet (at decompressor),
    • ROHC feedback-2 packet,
    • context re-use,
    • RTP stream detection,
    • RTP UO disambiguation.
  • interoperability tests:
  • robustness tests:
    • check the robustness of the compressor public API,
    • check the robustness of the decompressor public API,
    • check the robustness against damaged packets,
    • check the robustness against malformed packets,
    • check the robustness against packets with empty payloads,
    • check the robustness against lossy networks,
    • check the robustness against networks with packet reordering,
    • check the robustness against loss of piggybacked feedback packets.
  • non-regression tests:
    • the regression tool uses PCAP captures of network packets (IPv4, IPv6, UDP, UDP-Lite, RTP…) to test the behaviour of the ROHC library. The tool reports for every network capture the statuses of the following steps:
      • initialize ROHC library
      • compress packets
      • check compressed packets with reference
      • decompress packets
      • check decompressed packets with original ones

Running one specific non-regression test independently

Every non-regression test may be run independently from each other. Start by listing all the existing automated tests:

  • for releases < 2.0.0:
    $ ls ./test/non_regression/test_non_regression_*.sh
  • for releases >= 2.0.0:
    $ ls ./test/non_regression/rfc*/test_non_regression_*.sh

Choose one non-regression test from the list and run it as follow:

  1. Run the test silently without any output, the code returned by the application is 0 for success and non-zero for failure:
  • for releases < 2.0.0:
    $ ./test/non_regression/test_non_regression_ipv4_icmp_maxcontexts0_wlsb4_smallcid.sh
    $ echo $?
  • for releases >= 2.0.0:
    $ ./test/non_regression/rfc3095/test_non_regression_ipv4_icmp_maxcontexts0_wlsb4_smallcid.sh
    $ echo $?
  1. Run the test verbosely with full output from the library, the return code reports success (0) or failure (1):
  • for releases < 2.0.0:
    $ ./test/non_regression/test_non_regression_ipv4_icmp_maxcontexts0_wlsb4_smallcid.sh verbose
    $ echo $?
  • for releases >= 2.0.0:
    $ ./test/non_regression/rfc3095/test_non_regression_ipv4_icmp_maxcontexts0_wlsb4_smallcid.sh verbose
    $ echo $?

Running one specific non-regression test manually

Every non-regression test may be run manually. To do so, you need to get 2 files:

  • a PCAP capture of non-compressed IP packets as source,
  • a PCAP capture of compressed ROHC packets to compare ROHC packets generated by the ROHC library with a reference.

Then, you start the application as follow to test the ROHC library with small CIDs:

$ ./test/non_regression/test_non_regression -c comparison.pcap smallcid source.pcap
$ echo $?

You may also start the application as follow to test the ROHC library with large CIDs:

$ ./test/non_regression/test_non_regression -c comparison.pcap largecid source.pcap
$ echo $?

If the non-regression application returns with code 0 the test was successful. If it returns with a non-zero code, then the test failed.

Many source and comparison PCAP captures are provided with the library. Look at files source.pcap in subdirectories of the directory ./test/non_regression/.

Example #1 with small CIDs and W-LSB width 4:

  • for releases < 2.0.0:
    $ ./test/non_regression/test_non_regression \
        -c ./test/non_regression/inputs/ipv4/icmp/rohc_maxcontexts0_wlsb4_smallcid.pcap \
        smallcid \
        ./test/non_regression/inputs/ipv4/icmp/source.pcap
    $ echo $?
  • for releases >= 2.0.0:
    $ ./test/non_regression/test_non_regression \
        -c ./test/non_regression/rfc3095/inputs/ipv4/icmp/rohc_maxcontexts0_wlsb4_smallcid.pcap \
        smallcid \
        ./test/non_regression/rfc3095/inputs/ipv4/icmp/source.pcap
    $ echo $?

Example #2 with large CIDs and W-LSB width 64:

  • for releases < 2.0.0:
    $ ./test/non_regression/test_non_regression \
        -c ./test/non_regression/inputs/ipv4/icmp/rohc_maxcontexts0_wlsb64_largecid.pcap \
        --wlsb-width 64 \
        largecid \
        ./test/non_regression/inputs/ipv4/icmp/source.pcap
    $ echo $?
  • for releases >= 2.0.0:
    $ ./test/non_regression/test_non_regression \
        -c ./test/non_regression/rfc3095/inputs/ipv4/icmp/rohc_maxcontexts0_wlsb64_largecid.pcap \
        --wlsb-width 64 \
        largecid \
        ./test/non_regression/rfc3095/inputs/ipv4/icmp/source.pcap
    $ echo $?

There are also some advanced options for the non-regression application that are not described here, so you might want to look at the usage of the non-regression application:

$ ./test/non_regression/test_non_regression -h

If you encounter a problem with non-regression tests, use the mailing lists to report your problem.

library-tests.txt · Last modified: 2015/05/25 14:31 by didier