path: root/test/test
AgeCommit message (Collapse)Author
2019-02-26test: move to app directoryBruce Richardson
Since all other apps have been moved to the "app" folder, the autotest app remains alone in the test folder. Rather than having an entire top-level folder for this, we can move it back to where it all started in early versions of DPDK - the "app/" folder. This move has a couple of advantages: * This reduces clutter at the top level of the project, due to one less folder. * It eliminates the separate build task necessary for building the autotests using make "make test-build" which means that developers are less likely to miss something in their own compilation tests * It re-aligns the final location of the test binary in the app folder when building with make with it's location in the source tree. For meson builds, the autotest app is different from the other apps in that it needs a series of different test cases defined for it for use by "meson test". Therefore, it does not get built as part of the main loop in the app folder, but gets built separately at the end. Signed-off-by: Bruce Richardson <>
2019-02-22test/pmd_perf: fix the way to drain the portJulien Meunier
If the port has received less than ``pkt_per_port`` packets (for example, the port has missed some packets), the test is in an infinite loop. Instead of expecting a number of packet to receive, let the port to be drained by itself. If no more packets are received, the test can continue. Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx") Cc: Signed-off-by: Julien Meunier <> Reviewed-by: Ferruh Yigit <>
2019-02-12test: fix autotest listRami Rosen
This patch fixes a broken build; when running make test we get the following error: ... Traceback (most recent call last): File "test/test/", line 49, in <module> num_fails = runner.run_all_tests() File "test/test/", line 345, in run_all_tests self.parallel_tests) File "test/test/", line 264, in __filter_test test_cmd = test["Command"] KeyError: 'Command' ... The reason is that the pdump autotest entry uses "Comamnd" instead of "Command"; this patch fixes it. Bugzilla ID: 205 Fixes: 086eb64db39e ("test/pdump: add unit test for pdump library") Cc: Signed-off-by: Rami Rosen <> Reviewed-by: Ferruh Yigit <>
2019-02-12eal: support strlcat functionBruce Richardson
Add the strlcat function to DPDK to exist alongside the strlcpy one. While strncat is generally safe for use for concatenation, the API for the strlcat function is perhaps a little nicer to use, and supports truncation detection. See commit 5364de644a4b ("eal: support strlcpy function") for more details on the function selection logic, since we only should be using the DPDK-provided version when no system-provided version is present. Signed-off-by: Bruce Richardson <> Reviewed-by: Ferruh Yigit <>
2019-01-26test: check zero socket memory as validIlya Maximets
Dynamic memory mode allowes zero socket-mem because all the required memory could be allocated on demand. Fixes: 0a703f0f36c1 ("eal/linux: fix parsing zero socket memory and limits") Cc: Reported-by: Shuai Zhu <> Signed-off-by: Ilya Maximets <> Reviewed-by: David Marchand <> Acked-by: Anatoly Burakov <>
2019-01-20test/metrics: fix a negative caseHarman Kalra
Negative test case for passing invalid count size to rte_metrics_update_values() will pass if count value is any value greater than 1 because set size wrt to key id 1 is 1 and passing 0 as no of values to be updated will not hit the ERANGE check. Fixes: cd3804242901 ("test/metrics: add unit tests for metrics library") Cc: Signed-off-by: Harman Kalra <> Acked-by: Remy Horton <>
2019-01-19test: reorder test cases in mesonHari Kumar Vemula
Categorize testcases into suites: - test cases that runs quickly - performance test cases - test cases that depend on specific drivers - logging or dump related test cases Signed-off-by: Hari Kumar Vemula <> Acked-by: Bruce Richardson <>
2019-01-18test/pdump: add unit test for pdump libraryNaga Suresh Somarowthu
Unit test cases are added for pdump library. Primary process will act as server, forks a child secondary process. Secondary process acts as client. Server will do pdump init to serve any pdump client requests. Server will create a vdev, send/receive packets continuously in a separate thread. Client will create virtual rings to receive the packet dump. Client sends pdump enable/disable requests using either port/device id. Packet flow direction can be tx/rx/tx&rx. In Server, appropriate pdump callbacks are triggered, when packets are transmitted/received. Pdump packet is copied to client rings. Signed-off-by: Naga Suresh Somarowthu <> Reviewed-by: Reshma Pattan <>
2019-01-18test/latency: add unit tests for latencystats libraryNaga Suresh Somarowthu
Unit Test Cases added for latencystats library. Signed-off-by: Naga Suresh Somarowthu <> Reviewed-by: Reshma Pattan <>
2019-01-18test/bitrate: add unit tests for bitrate libraryNaga Suresh Somarowthu
Unit Test Cases for BitRate library. Signed-off-by: Naga Suresh Somarowthu <> Reviewed-by: Reshma Pattan <> Reviewed-by: Remy Horton <>
2019-01-18test: add helpers using ring PMD Rx/TxNaga Suresh Somarowthu
Added ring pmd based packet rx/tx helper functions for verifying Latency, Bitrate and pdump lib UTs. Signed-off-by: Naga Suresh Somarowthu <> Reviewed-by: Reshma Pattan <> Reviewed-by: Anatoly Burakov <>
2019-01-18test/compress: add varied buffer input/outputsMarko Kovacevic
Added unit test to check if a SGL buffer was added as an input and a Linear Buffer as output and vice versa so we can test if the application would process the different buffers properly. Signed-off-by: Marko Kovacevic <> Acked-by: Fiona Trahe <> Acked-by: Lee Daly <> Acked-by: Pablo de Lara <>
2019-01-18test/compress: add out of space testMarko Kovacevic
This patch adds new out of space testcase to check that the destination mbuf is smaller than required for the output of compression to ensure the driver doesn't crash and returns the valid error case. Signed-off-by: Marko Kovacevic <> Acked-by: Lee Daly <> Acked-by: Fiona Trahe <> Acked-by: Pablo de Lara <>
2019-01-18test/compress: refactor main test functionPablo de Lara
Since the start of the compression tests, the main test function, test_deflate_comp_decomp, has increased its parameter with each new test added. In order to make the code cleaner, and more scalable, these parameters have been divided into two structures, which are now passed as the sole arguments of the function. Signed-off-by: Pablo de Lara <>
2019-01-18test/ipsec: fix test suite setupBernard Iremonger
Check for valid crypto_null device before continuing. Use valid_dev instead of valid_devs[]. Replace valid_dev_count with valid_dev_found Call create_crypto_session for one driver only. Refactor code so that driver capabilities can be checked in the testsuite_setup function. Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test") Signed-off-by: Bernard Iremonger <> Acked-by: Konstantin Ananyev <>
2019-01-18test/ipsec: fix build on FreeBSDBernard Iremonger
Removed ip.h and in.h headers to fix unknown type errors when compiling on BSD. Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test") Signed-off-by: Bernard Iremonger <> Acked-by: Konstantin Ananyev <> Tested-by: Changqing Wu <>
2019-01-18test: fix build when disabling IPsec libraryDavid Marchand
Caught after pulling ipsec then compile in an existing build directory. Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test") Signed-off-by: David Marchand <> Acked-by: Konstantin Ananyev <>
2019-01-17eal: fix core number validationHari Kumar Vemula
When incorrect core value or range provided, as part of -l command line option, a crash occurs. Added valid range checks to fix the crash. Added ut check for negative core values. Added unit test case for invalid core number range. Fixes: d888cb8b9613 ("eal: add core list input format") Cc: Signed-off-by: Hari Kumar Vemula <> Reviewed-by: David Marchand <>
2019-01-15test/hash: fix perf resultDharmik Thakkar
Reset 'iter' and 'tbl_rw_test_param.found' on each iteration to give correct result for lost and duplicated keys. This patch also changes the default return value of the test to -1 when not enough resources are provided. Fixes: 0eb3726ebcf14 ("test/hash: add test for read/write concurrency") Cc: Signed-off-by: Dharmik Thakkar <> Reviewed-by: Ferruh Yigit <> Reviewed-by: Yipeng Wang <>
2019-01-15test/power: handle p-state modeDavid Hunt
The cpufreq test breakes when the system is using the intel_pstate driver for frequency management. The power library has recentyly been updated to allow use of the intel_pstate driver, this patch fixes the cpufreq test so that it can now use either acpi or pstate modes. The library will auto-detect, and set the environment appropriately. Fixes: ed7c51a6a680 ("app/test: vm power management") Cc: Signed-off-by: David Hunt <>
2019-01-11test/crypto: remove unsupported SGL tests on AESNI_MB PMDFiona Trahe
Remove AESNI_MB flag from SGL test cases which it doesn't support. Signed-off-by: Fiona Trahe <> Acked-by: Pablo de Lara <>
2019-01-10test/ipsec: introduce functional testKonstantin Ananyev
Create functional test for librte_ipsec. Note that the test requires null crypto pmd to pass successfully. Signed-off-by: Mohammad Abdul Awal <> Signed-off-by: Bernard Iremonger <> Signed-off-by: Konstantin Ananyev <> Acked-by: Declan Doherty <> Acked-by: Akhil Goyal <>
2019-01-10test/crypto: use separate session mempoolsFan Zhang
This patch uses the two session mempool approach to crypto unit test. One mempool is for session header objects, and the other is for session private data. Signed-off-by: Fan Zhang <> Acked-by: Fiona Trahe <> Acked-by: Akhil Goyal <>
2019-01-10cryptodev: change queue pair configure structureFan Zhang
This patch changes the cryptodev queue pair configure structure to enable two mempool passed into cryptodev PMD simutaneously. Signed-off-by: Fan Zhang <> Acked-by: Fiona Trahe <> Acked-by: Pablo de Lara <> Acked-by: Akhil Goyal <>
2019-01-10crypto/aesni_mb: support plain SHAFan Zhang
This patch adds the plain SHA1, SHA224, SHA256, SHA384, and SHA512 algorithms support to AESNI-MB PMD. The cryptodev unit test and documentation are updated accordingly. Signed-off-by: Damian Nowak <> Signed-off-by: Lukasz Krakowiak <> Signed-off-by: Fan Zhang <> Acked-by: Fiona Trahe <>
2019-01-10test/crypto: fix misleading trace messageFiona Trahe
Test was reporting digest verification failed for all operation errors. Fixed so it only reports this if the PMD actually reports an auth failure. Fixes: 9c0eed2f06ae ("app/test: rework crypto AES unit test") Cc: Signed-off-by: Fiona Trahe <> Acked-by: Pablo de Lara <>
2019-01-10crypto/aesni_mb: support AES-GMACFan Zhang
This patch adds the AES-GMAC authentication only support to AESNI-MB PMD, including the driver code, cryptodev unit test, and documentation updates. Signed-off-by: Fan Zhang <> Acked-by: Damian Nowak <>
2019-01-10test/compress: add checksum testsLee Daly
This patch adds a test which examines what type of checksum the PMD supports, Adler, CRC32 or Adler32_CRC32 and tests that feature if the PMD supports it. Signed-off-by: Lee Daly <> Acked-by: Tomasz Jozwiak <> Acked-by: Fiona Trahe <>
2019-01-10meter: support RFC4115 trTCMEelco Chaudron
This patch adds support for RFC4115 trTCM meters. Signed-off-by: Eelco Chaudron <> Acked-by: Cristian Dumitrescu <>
2018-12-22mbuf: implement generic format for sched fieldReshma Pattan
This patch implements the changes proposed in the deprecation notes [1][2]. librte_mbuf changes: The mbuf->hash.sched field is updated to support generic definition in line with the ethdev traffic manager and meter APIs. The new generic format contains: queue ID, traffic class, color. Added public APIs to set and get these new fields to and from mbuf. librte_sched changes: In addtion, following API functions of the sched library have been modified with an additional parameter of type struct rte_sched_port to accommodate the changes made to mbuf sched field. (i)rte_sched_port_pkt_write() (ii) rte_sched_port_pkt_read_tree_path() librte_pipeline, qos_sched UT, qos_sched app are updated to make use of new changes. Also mbuf->hash.txadapter has been added for eventdev txq, rte_event_eth_tx_adapter_txq_set and rte_event_eth_tx_adapter_txq_get() are updated to use mbuf->hash.txadapter.txq. doc: Release notes updated. Removed deprecation notice for mbuf->hash.sched and sched API. [1] [2] Signed-off-by: Jasvinder Singh <> Signed-off-by: Reshma Pattan <> Acked-by: Cristian Dumitrescu <> Acked-by: Konstantin Ananyev <> Acked-by: Olivier Matz <> Tested-by: Nikhil Rao <> Reviewed-by: Nikhil Rao <>
2018-12-21test/mem: check non-heap external memory APIAnatoly Burakov
Currently, extmem autotest only covers the external malloc heap API. Extend it to also cover the non-heap, register/unregister external memory API. Signed-off-by: Anatoly Burakov <>
2018-12-21test/mem: check external memseg listAnatoly Burakov
Extend the extmem autotest to check whether the memseg lists for externally allocated memory are always marked as external. Signed-off-by: Anatoly Burakov <>
2018-12-21test/mem: check external memory without IOVA tableAnatoly Burakov
Currently, only scenario with valid IOVA table is tested. Fix this by also testing without IOVA table - in these cases, EAL should always return RTE_BAD_IOVA for all memsegs, and contiguous memzone allocation should fail. Signed-off-by: Anatoly Burakov <>
2018-12-21test/mem: refactor and rename functionsAnatoly Burakov
We will be adding a new extmem test that will behave roughly similar to already existing, so clarify function names to distinguish between these tests, as well as factor out the common parts. Signed-off-by: Anatoly Burakov <>
2018-12-21eal: add 64-bit log2 functionAnatoly Burakov
Add missing implementation for 64-bit log2 function, and extend the unit test to test this new function. Also, remove duplicate reimplementation of this function from testpmd and memalloc. Signed-off-by: Anatoly Burakov <>
2018-12-21eal: add 64-bit fls functionAnatoly Burakov
Add missing implementation for 64-bit fls function, and extend unit test to test the new function as well. Signed-off-by: Anatoly Burakov <>
2018-12-21eal: add 64-bit bsf and 32-bit safe bsf functionsAnatoly Burakov
Add an rte_bsf64 function that follows the convention of existing rte_bsf32 function. Also, add missing implementation for safe version of rte_bsf32, and implement unit tests for all recently added bsf varieties. Signed-off-by: Anatoly Burakov <>
2018-12-20test/fbarray: add to mesonAnatoly Burakov
Currently, fbarray autotest is only built by make, but is missing from meson build files. Fixes: 7985860c18af ("test/fbarray: add autotests") Cc: Signed-off-by: Anatoly Burakov <> Acked-by: Bruce Richardson <>
2018-12-20test/mem: add external mem autotest to mesonAnatoly Burakov
The 'external_mem_autotest' was defined in the meson build, but the actual source file was not being compiled by meson. Fixes: b270daa43b3d ("test: support external memory") Cc: Signed-off-by: Anatoly Burakov <>
2018-12-20test/mem: check segment fd APIAnatoly Burakov
Use memory autotest to also test segment fd API. This will not do any checks - just see if the relevant API's return success or indicate that the API is not supported. Signed-off-by: Anatoly Burakov <> Acked-by: Tiwei Bie <> Reviewed-by: Maxime Coquelin <>
2018-12-20malloc: add option --match-allocationsJim Harris
SPDK uses the rte_mem_event_callback_register API to create RDMA memory regions (MRs) for newly allocated regions of memory. This is used in both the SPDK NVMe-oF target and the NVMe-oF host driver. DPDK creates internal malloc_elem structures for these allocated regions. As users malloc and free memory, DPDK will sometimes merge malloc_elems that originated from different allocations that were notified through the registered mem_event callback routine. This results in subsequent allocations that can span across multiple RDMA MRs. This requires SPDK to check each DPDK buffer to see if it crosses an MR boundary, and if so, would have to add considerable logic and complexity to describe that buffer before it can be accessed by the RNIC. It is somewhat analagous to rte_malloc returning a buffer that is not IOVA-contiguous. As a malloc_elem gets split and some of these elements get freed, it can also result in DPDK sending an RTE_MEM_EVENT_FREE notification for a subset of the original RTE_MEM_EVENT_ALLOC notification. This is also problematic for RDMA memory regions, since unregistering the memory region is all-or-nothing. It is not possible to unregister part of a memory region. To support these types of applications, this patch adds a new --match-allocations EAL init flag. When this flag is specified, malloc elements from different hugepage allocations will never be merged. Memory will also only be freed back to the system (with the requisite memory event callback) exactly as it was originally allocated. Since part of this patch is extending the size of struct malloc_elem, we also fix up the malloc autotests so they do not assume its size exactly fits in one cacheline. Signed-off-by: Jim Harris <> Reviewed-by: Anatoly Burakov <>
2018-12-19test/rwlock: add new test-casesKonstantin Ananyev
Add few functional and perfomance tests for rte_rwlock_read_trylock() and rte_rwlock_write_trylock(). Signed-off-by: Konstantin Ananyev <> Reviewed-by: Gavin Hu <>
2018-12-19test/compress: use bulk free operation APIFiona Trahe
Use the new rte_comp_op_bulk_free API. Add trace to catch any mempool elements not freed at test end. Signed-off-by: Fiona Trahe <> Acked-by: Shally Verma <> Acked-by: Lee Daly <>
2018-12-19test/compress: improve debug trace setupLee Daly
This removes the magic number from the assignment of the engine variable, which is used in the debug trace. Signed-off-by: Lee Daly <> Acked-by: Tomasz Jozwiak <>
2018-11-18test: release ring resources after PMD perf testPhil Yang
Need to release the port and the ring resources after test. Otherwise, it will cause failure to allocate memory when reentry the test. Fixes: ea764af ("app/test: add performance test for ring driver") Cc: Signed-off-by: Phil Yang <> Reviewed-by: Gavin Hu <>
2018-11-18test/power: skip KVM autotest if cannot runPallantla Poornima
power_kvm_vm_autotest should run on kvm vm and virtio-ports should exist, if not test should skip. Hence changed return as TEST_SKIPPED. Fixes: 0ea2dd4409 ("test: skip when required lib not available") Cc: Signed-off-by: Pallantla Poornima <> Acked-by: Reshma Pattan <>
2018-11-18test: fix interrupt checkQiming Yang
Fixed the interrupt type using error. Check valid alarm should use TEST_INTERRUPT_HANDLE_VALID_ALARM. Fixes: 493b8e173fe6 ("eal: add device event handle in interrupt thread") Cc: Signed-off-by: Qiming Yang <>
2018-11-18test: fix hugepage file handling in EAL flags autotestAnatoly Burakov
Before 18.05, DPDK could not release memory back to the system neither at runtime nor before shutting down. Over the course of 18.05 up to 18.11, code was introduced to release memory at runtime, as well as an rte_eal_cleanup() function that is supposed to release all EAL-allocated memory before shutting down DPDK. When 3f9e31d71d63 ("test: clean up on exit") was introduced, the test application started to use rte_eal_cleanup() to release all used memory after execution. However, the EAL flags autotest still relies on the old behavior of leaving stuff behind in the hugetlbfs. The fix is twofold. First, the test to check for leftover files in hugetlbfs is no longer valid as it is, because test application now removes all files from hugetlbfs after exit. However, if we use the --legacy-mem option, then old behavior of leaving files in hugetlbfs after execution is restored. So the first fix is to add --legacy-mem to all the tests that expect files in hugetlbfs to be leftover. However, we also need to test if default memory mode *doesn't* leave any files behind, so we also extend the test to check for these scenarios as well. So, both memtest1 and memtest2 are run in legacy and default mem modes, and are checked for any leftover files that are or are not supposed to be there. Fixes: 3f9e31d71d63 ("test: clean up on exit") Signed-off-by: Anatoly Burakov <>
2018-11-14test: fix clean up on failureAnatoly Burakov
One of the failure paths were not updated to clean up on exit, most likely due to rebase error. Fix the failure path to clean up instead of simply exiting. Fixes: 3f9e31d71d63 ("test: clean up on exit") Signed-off-by: Anatoly Burakov <>
2018-11-14test/reorder: fix out of bound accessFerruh Yigit
The value of array index 'i' is out of bound because of the previous loop it has been used. Assuming intention is using '0' since the check before free is robufs[0] check, fixing according. Fixes: ecd867faa860 ("test/reorder: fix freeing mbuf twice") Cc: Signed-off-by: Ferruh Yigit <>