1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017 Intel Corporation
4 if not get_option('tests')
8 test_sources = files('commands.c',
9 'packet_burst_generator.c',
18 'test_cmdline_cirbuf.c',
19 'test_cmdline_etheraddr.c',
20 'test_cmdline_ipaddr.c',
23 'test_cmdline_portlist.c',
24 'test_cmdline_string.c',
29 'test_cryptodev_asym.c',
30 'test_cryptodev_blockcipher.c',
31 'test_cryptodev_security_pdcp.c',
35 'test_distributor_perf.c',
41 'test_event_crypto_adapter.c',
42 'test_event_eth_rx_adapter.c',
44 'test_event_timer_adapter.c',
46 'test_external_mem.c',
52 'test_func_reentrancy.c',
53 'test_flow_classify.c',
55 'test_hash_functions.c',
56 'test_hash_multiwriter.c',
57 'test_hash_readwrite.c',
59 'test_hash_readwrite_lf_perf.c',
65 'test_link_bonding.c',
66 'test_link_bonding_rssconf.c',
80 'test_mempool_perf.c',
85 'test_mp_secondary.c',
89 'test_power_cpufreq.c',
90 'test_power_kvm_vm.c',
95 'test_rcu_qsbr_perf.c',
96 'test_reciprocal_division.c',
97 'test_reciprocal_division_perf.c',
106 'test_service_cores.c',
113 'test_table_combined.c',
114 'test_table_pipeline.c',
115 'test_table_ports.c',
116 'test_table_tables.c',
121 'test_timer_racecond.c',
122 'test_timer_secondary.c',
161 'byteorder_autotest',
167 'eal_flags_c_opt_autotest',
168 'eal_flags_master_opt_autotest',
169 'eal_flags_n_opt_autotest',
170 'eal_flags_hpet_autotest',
171 'eal_flags_no_huge_autotest',
172 'eal_flags_w_opt_autotest',
173 'eal_flags_b_opt_autotest',
174 'eal_flags_vdev_opt_autotest',
175 'eal_flags_r_opt_autotest',
176 'eal_flags_mem_autotest',
177 'eal_flags_file_prefix_autotest',
178 'eal_flags_misc_autotest',
181 'event_ring_autotest',
184 'func_reentrancy_autotest',
185 'flow_classify_autotest',
187 'interrupt_autotest',
199 'multiprocess_autotest',
200 'per_lcore_autotest',
207 'rwlock_test1_autotest',
208 'rwlock_rda_autotest',
209 'rwlock_rds_wrm_autotest',
210 'rwlock_rde_wro_autotest',
222 'delay_us_sleep_autotest',
223 'distributor_autotest',
224 'eventdev_common_autotest',
226 'hash_readwrite_func_autotest',
232 'power_cpufreq_autotest',
234 'power_kvm_vm_autotest',
241 'ring_perf_autotest',
242 'mempool_perf_autotest',
243 'memcpy_perf_autotest',
244 'hash_perf_autotest',
245 'timer_perf_autotest',
246 'reciprocal_division',
247 'reciprocal_division_perf',
254 'hash_multiwriter_autotest',
255 'timer_racecond_autotest',
257 'hash_functions_autotest',
258 'member_perf_autotest',
260 'lpm6_perf_autotest',
261 'rib6_slow_autotest',
262 'fib6_slow_autotest',
263 'fib6_perf_autotest',
264 'rcu_qsbr_perf_autotest',
266 'distributor_perf_autotest',
268 'stack_perf_autotest',
269 'stack_lf_perf_autotest',
270 'rand_perf_autotest',
271 'hash_readwrite_perf_autotest',
272 'hash_readwrite_lf_perf_autotest',
275 driver_test_names = [
276 'cryptodev_aesni_mb_autotest',
277 'cryptodev_aesni_gcm_autotest',
278 'cryptodev_dpaa_sec_autotest',
279 'cryptodev_dpaa2_sec_autotest',
280 'cryptodev_null_autotest',
281 'cryptodev_octeontx2_autotest',
282 'cryptodev_openssl_autotest',
283 'cryptodev_openssl_asym_autotest',
284 'cryptodev_qat_autotest',
285 'cryptodev_sw_armv8_autotest',
286 'cryptodev_sw_kasumi_autotest',
287 'cryptodev_sw_mvsam_autotest',
288 'cryptodev_sw_snow3g_autotest',
289 'cryptodev_sw_zuc_autotest',
290 'eventdev_selftest_octeontx',
291 'eventdev_selftest_sw',
292 'link_bonding_autotest',
293 'link_bonding_rssconf_autotest',
308 # The following linkages are an exception to allow running the
309 # unit tests without requiring that the developer install the
310 # DPDK libraries. Explicit linkage of drivers (plugin libraries)
311 # in applications should not be used.
312 if dpdk_conf.has('RTE_LIBRTE_RING_MEMPOOL')
313 test_deps += 'mempool_ring'
315 if dpdk_conf.has('RTE_LIBRTE_STACK_MEMPOOL')
316 test_deps += 'mempool_stack'
318 if dpdk_conf.has('RTE_LIBRTE_SKELETON_EVENTDEV_PMD')
319 test_deps += 'pmd_skeleton_event'
322 # The following linkages of drivers are required because
323 # they are used via a driver-specific API.
324 if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
325 test_deps += 'pmd_bond'
327 if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
328 test_deps += 'pmd_ring'
329 test_sources += 'test_pmd_ring_perf.c'
330 test_sources += 'test_pmd_ring.c'
331 test_sources += 'test_event_eth_tx_adapter.c'
332 test_sources += 'test_bitratestats.c'
333 test_sources += 'test_latencystats.c'
334 test_sources += 'test_link_bonding_mode4.c'
335 test_sources += 'sample_packet_forward.c'
336 test_sources += 'test_pdump.c'
337 fast_test_names += 'ring_pmd_autotest'
338 perf_test_names += 'ring_pmd_perf_autotest'
339 fast_test_names += 'event_eth_tx_adapter_autotest'
340 fast_test_names += 'bitratestats_autotest'
341 fast_test_names += 'latencystats_autotest'
342 driver_test_names += 'link_bonding_mode4_autotest'
343 fast_test_names += 'pdump_autotest'
346 if dpdk_conf.has('RTE_LIBRTE_POWER')
349 if dpdk_conf.has('RTE_LIBRTE_KNI')
352 if dpdk_conf.has('RTE_LIBRTE_PDUMP')
356 cflags = machine_args
357 if cc.has_argument('-Wno-format-truncation')
358 cflags += '-Wno-format-truncation'
361 # specify -D_GNU_SOURCE unconditionally
362 cflags += '-D_GNU_SOURCE'
365 if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV')
366 compress_test_dep = dependency('zlib', required: false)
367 if compress_test_dep.found()
368 test_dep_objs += compress_test_dep
369 test_sources += 'test_compressdev.c'
370 test_deps += 'compressdev'
371 fast_test_names += 'compressdev_autotest'
375 if dpdk_conf.has('RTE_LIBRTE_PMD_CRYPTO_SCHEDULER')
376 driver_test_names += 'cryptodev_scheduler_autotest'
380 def_lib = get_option('default_library')
381 test_dep_objs += get_variable(def_lib + '_rte_' + d)
383 test_dep_objs += cc.find_library('execinfo', required: false)
386 if get_option('default_library') == 'static'
387 link_libs = dpdk_drivers
390 dpdk_test = executable('dpdk-test',
392 link_whole: link_libs,
393 dependencies: test_dep_objs,
394 c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
395 install_rpath: driver_install_path,
398 # some perf tests (eg: memcpy perf autotest)take very long
399 # to complete, so timeout to 10 minutes
400 timeout_seconds = 600
401 timeout_seconds_fast = 10
403 get_coremask = find_program('get-coremask.sh')
404 num_cores_arg = '-l ' + run_command(get_coremask).stdout().strip()
406 test_args = [num_cores_arg]
408 foreach arg : fast_test_names
409 if (get_option('default_library') == 'shared' and
410 arg == 'event_eth_tx_adapter_autotest')
411 foreach drv:dpdk_drivers
412 test_args += ['-d', drv.full_path().split('.a')[0] + '.so']
415 if host_machine.system() == 'linux'
417 env : ['DPDK_TEST=' + arg],
419 ['--file-prefix=@0@'.format(arg)],
420 timeout : timeout_seconds_fast,
422 suite : 'fast-tests')
425 env : ['DPDK_TEST=' + arg],
427 timeout : timeout_seconds_fast,
429 suite : 'fast-tests')
433 foreach arg : perf_test_names
435 env : ['DPDK_TEST=' + arg],
437 timeout : timeout_seconds,
439 suite : 'perf-tests')
442 foreach arg : driver_test_names
444 env : ['DPDK_TEST=' + arg],
446 timeout : timeout_seconds,
448 suite : 'driver-tests')
451 foreach arg : dump_test_names
453 env : ['DPDK_TEST=' + arg],
455 timeout : timeout_seconds,
457 suite : 'debug-tests')