test/graph: add functional tests
[dpdk.git] / app / test / meson.build
index 7ab2b58..7d954c8 100644 (file)
@@ -51,6 +51,7 @@ test_sources = files('commands.c',
        'test_fib6_perf.c',
        'test_func_reentrancy.c',
        'test_flow_classify.c',
+       'test_graph.c',
        'test_hash.c',
        'test_hash_functions.c',
        'test_hash_multiwriter.c',
@@ -58,6 +59,7 @@ test_sources = files('commands.c',
        'test_hash_perf.c',
        'test_hash_readwrite_lf_perf.c',
        'test_interrupts.c',
+        'test_ipfrag.c',
        'test_ipsec.c',
        'test_ipsec_sad.c',
        'test_kni.c',
@@ -100,9 +102,15 @@ test_sources = files('commands.c',
        'test_rib.c',
        'test_rib6.c',
        'test_ring.c',
+       'test_ring_mpmc_stress.c',
+       'test_ring_hts_stress.c',
+       'test_ring_peek_stress.c',
        'test_ring_perf.c',
+       'test_ring_rts_stress.c',
+       'test_ring_stress.c',
        'test_rwlock.c',
        'test_sched.c',
+       'test_security.c',
        'test_service_cores.c',
        'test_spinlock.c',
        'test_stack.c',
@@ -121,6 +129,9 @@ test_sources = files('commands.c',
        'test_timer_racecond.c',
        'test_timer_secondary.c',
        'test_ticketlock.c',
+       'test_trace.c',
+       'test_trace_register.c',
+       'test_trace_perf.c',
        'test_version.c',
        'virtual_pmd.c'
 )
@@ -137,6 +148,7 @@ test_deps = ['acl',
        'eventdev',
        'fib',
        'flow_classify',
+       'graph',
        'hash',
        'ipsec',
        'latencystats',
@@ -150,91 +162,97 @@ test_deps = ['acl',
        'reorder',
        'rib',
        'ring',
+       'security',
        'stack',
        'timer'
 ]
 
-fast_test_names = [
-        'acl_autotest',
-        'alarm_autotest',
-        'atomic_autotest',
-        'byteorder_autotest',
-        'cmdline_autotest',
-        'common_autotest',
-        'cpuflags_autotest',
-        'cycles_autotest',
-        'debug_autotest',
-        'eal_flags_c_opt_autotest',
-        'eal_flags_master_opt_autotest',
-        'eal_flags_n_opt_autotest',
-        'eal_flags_hpet_autotest',
-        'eal_flags_no_huge_autotest',
-        'eal_flags_w_opt_autotest',
-        'eal_flags_b_opt_autotest',
-        'eal_flags_vdev_opt_autotest',
-        'eal_flags_r_opt_autotest',
-        'eal_flags_mem_autotest',
-        'eal_flags_file_prefix_autotest',
-        'eal_flags_misc_autotest',
-        'eal_fs_autotest',
-        'errno_autotest',
-        'event_ring_autotest',
-        'fib_autotest',
-        'fib6_autotest',
-        'func_reentrancy_autotest',
-        'flow_classify_autotest',
-        'hash_autotest',
-        'interrupt_autotest',
-        'logs_autotest',
-        'lpm_autotest',
-        'lpm6_autotest',
-        'malloc_autotest',
-        'mbuf_autotest',
-        'mcslock_autotest',
-        'memcpy_autotest',
-        'memory_autotest',
-        'mempool_autotest',
-        'memzone_autotest',
-        'meter_autotest',
-        'multiprocess_autotest',
-        'per_lcore_autotest',
-        'prefetch_autotest',
-        'rcu_qsbr_autotest',
-        'red_autotest',
-        'rib_autotest',
-        'rib6_autotest',
-        'ring_autotest',
-        'rwlock_test1_autotest',
-        'rwlock_rda_autotest',
-        'rwlock_rds_wrm_autotest',
-        'rwlock_rde_wro_autotest',
-        'sched_autotest',
-        'spinlock_autotest',
-        'stack_autotest',
-        'stack_lf_autotest',
-        'string_autotest',
-        'table_autotest',
-        'tailq_autotest',
-        'timer_autotest',
-        'user_delay_us',
-        'version_autotest',
-        'crc_autotest',
-        'delay_us_sleep_autotest',
-        'distributor_autotest',
-        'eventdev_common_autotest',
-        'fbarray_autotest',
-        'hash_readwrite_func_autotest',
-        'ipsec_autotest',
-        'kni_autotest',
-        'kvargs_autotest',
-        'member_autotest',
-        'metrics_autotest',
-        'power_cpufreq_autotest',
-        'power_autotest',
-        'power_kvm_vm_autotest',
-        'reorder_autotest',
-        'service_autotest',
-        'thash_autotest',
+# Each test is marked with flag true/false
+# to indicate whether it can run in no-huge mode.
+fast_tests = [
+        ['acl_autotest', true],
+        ['alarm_autotest', false],
+        ['atomic_autotest', false],
+        ['byteorder_autotest', true],
+        ['cmdline_autotest', true],
+        ['common_autotest', true],
+        ['cpuflags_autotest', true],
+        ['cycles_autotest', true],
+        ['debug_autotest', true],
+        ['eal_flags_c_opt_autotest', false],
+        ['eal_flags_master_opt_autotest', false],
+        ['eal_flags_n_opt_autotest', false],
+        ['eal_flags_hpet_autotest', false],
+        ['eal_flags_no_huge_autotest', false],
+        ['eal_flags_w_opt_autotest', false],
+        ['eal_flags_b_opt_autotest', false],
+        ['eal_flags_vdev_opt_autotest', false],
+        ['eal_flags_r_opt_autotest', false],
+        ['eal_flags_mem_autotest', false],
+        ['eal_flags_file_prefix_autotest', false],
+        ['eal_flags_misc_autotest', false],
+        ['eal_fs_autotest', true],
+        ['errno_autotest', true],
+        ['event_ring_autotest', true],
+        ['fib_autotest', true],
+        ['fib6_autotest', true],
+        ['func_reentrancy_autotest', false],
+        ['flow_classify_autotest', false],
+        ['hash_autotest', true],
+        ['interrupt_autotest', true],
+        ['ipfrag_autotest', false],
+        ['logs_autotest', true],
+        ['lpm_autotest', true],
+        ['lpm6_autotest', true],
+        ['malloc_autotest', false],
+        ['mbuf_autotest', false],
+        ['mcslock_autotest', false],
+        ['memcpy_autotest', true],
+        ['memory_autotest', false],
+        ['mempool_autotest', false],
+        ['memzone_autotest', false],
+        ['meter_autotest', true],
+        ['multiprocess_autotest', false],
+        ['per_lcore_autotest', true],
+        ['prefetch_autotest', true],
+        ['rcu_qsbr_autotest', true],
+        ['red_autotest', true],
+        ['rib_autotest', true],
+        ['rib6_autotest', true],
+        ['ring_autotest', true],
+        ['rwlock_test1_autotest', true],
+        ['rwlock_rda_autotest', true],
+        ['rwlock_rds_wrm_autotest', true],
+        ['rwlock_rde_wro_autotest', true],
+        ['sched_autotest', true],
+               ['security_autotest', false],
+        ['spinlock_autotest', true],
+        ['stack_autotest', false],
+        ['stack_lf_autotest', false],
+        ['string_autotest', true],
+        ['table_autotest', true],
+        ['tailq_autotest', true],
+        ['timer_autotest', false],
+        ['user_delay_us', true],
+        ['version_autotest', true],
+        ['crc_autotest', true],
+        ['delay_us_sleep_autotest', true],
+        ['distributor_autotest', false],
+        ['eventdev_common_autotest', true],
+        ['fbarray_autotest', true],
+        ['hash_readwrite_func_autotest', false],
+        ['ipsec_autotest', true],
+        ['kni_autotest', false],
+        ['kvargs_autotest', true],
+        ['member_autotest', true],
+        ['metrics_autotest', true],
+        ['power_cpufreq_autotest', false],
+        ['power_autotest', true],
+        ['power_kvm_vm_autotest', false],
+        ['reorder_autotest', true],
+        ['service_autotest', true],
+        ['thash_autotest', true],
+        ['trace_autotest', true],
 ]
 
 perf_test_names = [
@@ -270,6 +288,7 @@ perf_test_names = [
         'rand_perf_autotest',
         'hash_readwrite_perf_autotest',
         'hash_readwrite_lf_perf_autotest',
+        'trace_perf_autotest',
 ]
 
 driver_test_names = [
@@ -334,13 +353,13 @@ if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
        test_sources += 'test_link_bonding_mode4.c'
        test_sources += 'sample_packet_forward.c'
        test_sources += 'test_pdump.c'
-       fast_test_names += 'ring_pmd_autotest'
+       fast_tests += [['ring_pmd_autotest', true]]
        perf_test_names += 'ring_pmd_perf_autotest'
-       fast_test_names += 'event_eth_tx_adapter_autotest'
-       fast_test_names += 'bitratestats_autotest'
-       fast_test_names += 'latencystats_autotest'
+       fast_tests += [['event_eth_tx_adapter_autotest', false]]
+       fast_tests += [['bitratestats_autotest', true]]
+       fast_tests += [['latencystats_autotest', true]]
        driver_test_names += 'link_bonding_mode4_autotest'
-       fast_test_names += 'pdump_autotest'
+       fast_tests += [['pdump_autotest', true]]
 endif
 
 if dpdk_conf.has('RTE_LIBRTE_POWER')
@@ -353,13 +372,14 @@ if dpdk_conf.has('RTE_LIBRTE_PDUMP')
        test_deps += 'pdump'
 endif
 
-cflags = machine_args
 if cc.has_argument('-Wno-format-truncation')
     cflags += '-Wno-format-truncation'
 endif
 
 # specify -D_GNU_SOURCE unconditionally
 cflags += '-D_GNU_SOURCE'
+# Strict-aliasing rules are violated by uint8_t[] to context size casts.
+cflags += '-fno-strict-aliasing'
 
 test_dep_objs = []
 if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV')
@@ -368,7 +388,7 @@ if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV')
                test_dep_objs += compress_test_dep
                test_sources += 'test_compressdev.c'
                test_deps += 'compressdev'
-               fast_test_names += 'compressdev_autotest'
+               fast_tests += [['compressdev_autotest', false]]
        endif
 endif
 
@@ -391,10 +411,13 @@ dpdk_test = executable('dpdk-test',
        test_sources,
        link_whole: link_libs,
        dependencies: test_dep_objs,
-       c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
+       c_args: cflags,
        install_rpath: driver_install_path,
        install: true)
 
+has_hugepage = run_command('has-hugepage.sh').stdout().strip() != '0'
+message('hugepage availability: @0@'.format(has_hugepage))
+
 # some perf tests (eg: memcpy perf autotest)take very long
 # to complete, so timeout to 10 minutes
 timeout_seconds = 600
@@ -405,25 +428,35 @@ num_cores_arg = '-l ' + run_command(get_coremask).stdout().strip()
 
 default_test_args = [num_cores_arg]
 
-foreach arg : fast_test_names
+foreach arg : fast_tests
        test_args = default_test_args
+       run_test = true
+       if not has_hugepage
+               if arg[1]
+                       test_args += ['--no-huge', '-m', '2048']
+               else
+                       run_test = false
+               endif
+       endif
 
        if (get_option('default_library') == 'shared' and
-               arg == 'event_eth_tx_adapter_autotest')
+               arg[0] == 'event_eth_tx_adapter_autotest')
                foreach drv:dpdk_drivers
                        test_args += ['-d', drv.full_path().split('.a')[0] + '.so']
                endforeach
        endif
        if is_linux
-               test_args += ['--file-prefix=@0@'.format(arg)]
+               test_args += ['--file-prefix=@0@'.format(arg[0])]
        endif
 
-       test(arg, dpdk_test,
-               env : ['DPDK_TEST=' + arg],
-               args : test_args,
-               timeout : timeout_seconds_fast,
-               is_parallel : false,
-               suite : 'fast-tests')
+       if run_test
+               test(arg[0], dpdk_test,
+                       env : ['DPDK_TEST=' + arg[0]],
+                       args : test_args,
+                       timeout : timeout_seconds_fast,
+                       is_parallel : false,
+                       suite : 'fast-tests')
+       endif
 endforeach
 
 foreach arg : perf_test_names