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 [[library-install-sources#native_build_on_unix-like_systems|get the source code of the ROHC library and build it]] on your system (do not append option ''<nowiki>--disable-rohc-tests</nowiki>'' at step 4 ; step 9 is not mandatory for running the tests). Second, type:<code> $ make check</code> You may speed up the processing with you are running a [[wp>Symmetric_multiprocessor_system|SMP]] system:<code> $ make -jX check # set X to your number of CPU plus one</code> 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: * compare ROHC packet formats with [[http://ats.aeroflex.com/advanced-network-test-products/development-performance-test/tm500-test-mobile|Aeroflex-TM500]]. * robustness tests: * check the robustness of the compressor public [[wp>API]], * check the robustness of the decompressor public [[wp>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 [[wp>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:<code> $ ls ./test/non_regression/test_non_regression_*.sh </code> * for releases >= 2.0.0:<code> $ ls ./test/non_regression/rfc*/test_non_regression_*.sh </code> Choose one non-regression test from the list and run it as follow: - 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:<code> $ ./test/non_regression/test_non_regression_ipv4_icmp_maxcontexts0_wlsb4_smallcid.sh $ echo $?</code> * for releases >= 2.0.0:<code> $ ./test/non_regression/rfc3095/test_non_regression_ipv4_icmp_maxcontexts0_wlsb4_smallcid.sh $ echo $?</code> - Run the test verbosely with full output from the library, the return code reports success (0) or failure (1): * for releases < 2.0.0:<code> $ ./test/non_regression/test_non_regression_ipv4_icmp_maxcontexts0_wlsb4_smallcid.sh verbose $ echo $?</code> * for releases >= 2.0.0:<code> $ ./test/non_regression/rfc3095/test_non_regression_ipv4_icmp_maxcontexts0_wlsb4_smallcid.sh verbose $ echo $?</code> ===== 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 [[wp>PCAP]] capture of non-compressed IP packets as source, * a [[wp>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:<code> $ ./test/non_regression/test_non_regression -c comparison.pcap smallcid source.pcap $ echo $?</code> You may also start the application as follow to test the ROHC library with large CIDs:<code> $ ./test/non_regression/test_non_regression -c comparison.pcap largecid source.pcap $ echo $?</code> 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:<code> $ ./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 $?</code> * for releases >= 2.0.0:<code> $ ./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 $?</code> Example #2 with large CIDs and W-LSB width 64: * for releases < 2.0.0:<code> $ ./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 $?</code> * for releases >= 2.0.0:<code> $ ./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 $?</code> 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:<code> $ ./test/non_regression/test_non_regression -h </code> If you encounter a problem with non-regression tests, use the [[http://lists.launchpad.net/rohc/|mailing lists]] to report your problem.

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