test: allow no-huge mode for fast-tests
In environments where hugepage are not available, such as containers, many cases in fast-tests suite should also run if no-huge EAL option is used. Flag is appended to each case in fast-tests suite to indicate whether it lives with no-huge mode. With the flag, fast-tests suite can be generated based on detected hugepage availability of building environment. All cases will be valid if hugepage is available, whereas only applicable cases will be added if environment has no hugepage support. Suggested-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com> Reviewed-by: Gavin Hu <gavin.hu@arm.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: David Marchand <david.marchand@redhat.com>
This commit is contained in:
parent
27fb5dd285
commit
77784ef0fb
@ -154,87 +154,89 @@ test_deps = ['acl',
|
|||||||
'timer'
|
'timer'
|
||||||
]
|
]
|
||||||
|
|
||||||
fast_test_names = [
|
# Each test is marked with flag true/false
|
||||||
'acl_autotest',
|
# to indicate whether it can run in no-huge mode.
|
||||||
'alarm_autotest',
|
fast_tests = [
|
||||||
'atomic_autotest',
|
['acl_autotest', true],
|
||||||
'byteorder_autotest',
|
['alarm_autotest', false],
|
||||||
'cmdline_autotest',
|
['atomic_autotest', false],
|
||||||
'common_autotest',
|
['byteorder_autotest', true],
|
||||||
'cpuflags_autotest',
|
['cmdline_autotest', true],
|
||||||
'cycles_autotest',
|
['common_autotest', true],
|
||||||
'debug_autotest',
|
['cpuflags_autotest', true],
|
||||||
'eal_flags_c_opt_autotest',
|
['cycles_autotest', true],
|
||||||
'eal_flags_master_opt_autotest',
|
['debug_autotest', true],
|
||||||
'eal_flags_n_opt_autotest',
|
['eal_flags_c_opt_autotest', false],
|
||||||
'eal_flags_hpet_autotest',
|
['eal_flags_master_opt_autotest', false],
|
||||||
'eal_flags_no_huge_autotest',
|
['eal_flags_n_opt_autotest', false],
|
||||||
'eal_flags_w_opt_autotest',
|
['eal_flags_hpet_autotest', false],
|
||||||
'eal_flags_b_opt_autotest',
|
['eal_flags_no_huge_autotest', false],
|
||||||
'eal_flags_vdev_opt_autotest',
|
['eal_flags_w_opt_autotest', false],
|
||||||
'eal_flags_r_opt_autotest',
|
['eal_flags_b_opt_autotest', false],
|
||||||
'eal_flags_mem_autotest',
|
['eal_flags_vdev_opt_autotest', false],
|
||||||
'eal_flags_file_prefix_autotest',
|
['eal_flags_r_opt_autotest', false],
|
||||||
'eal_flags_misc_autotest',
|
['eal_flags_mem_autotest', false],
|
||||||
'eal_fs_autotest',
|
['eal_flags_file_prefix_autotest', false],
|
||||||
'errno_autotest',
|
['eal_flags_misc_autotest', false],
|
||||||
'event_ring_autotest',
|
['eal_fs_autotest', true],
|
||||||
'fib_autotest',
|
['errno_autotest', true],
|
||||||
'fib6_autotest',
|
['event_ring_autotest', true],
|
||||||
'func_reentrancy_autotest',
|
['fib_autotest', true],
|
||||||
'flow_classify_autotest',
|
['fib6_autotest', true],
|
||||||
'hash_autotest',
|
['func_reentrancy_autotest', false],
|
||||||
'interrupt_autotest',
|
['flow_classify_autotest', false],
|
||||||
'logs_autotest',
|
['hash_autotest', true],
|
||||||
'lpm_autotest',
|
['interrupt_autotest', true],
|
||||||
'lpm6_autotest',
|
['logs_autotest', true],
|
||||||
'malloc_autotest',
|
['lpm_autotest', true],
|
||||||
'mbuf_autotest',
|
['lpm6_autotest', true],
|
||||||
'mcslock_autotest',
|
['malloc_autotest', false],
|
||||||
'memcpy_autotest',
|
['mbuf_autotest', false],
|
||||||
'memory_autotest',
|
['mcslock_autotest', false],
|
||||||
'mempool_autotest',
|
['memcpy_autotest', true],
|
||||||
'memzone_autotest',
|
['memory_autotest', false],
|
||||||
'meter_autotest',
|
['mempool_autotest', false],
|
||||||
'multiprocess_autotest',
|
['memzone_autotest', false],
|
||||||
'per_lcore_autotest',
|
['meter_autotest', true],
|
||||||
'prefetch_autotest',
|
['multiprocess_autotest', false],
|
||||||
'rcu_qsbr_autotest',
|
['per_lcore_autotest', true],
|
||||||
'red_autotest',
|
['prefetch_autotest', true],
|
||||||
'rib_autotest',
|
['rcu_qsbr_autotest', true],
|
||||||
'rib6_autotest',
|
['red_autotest', true],
|
||||||
'ring_autotest',
|
['rib_autotest', true],
|
||||||
'rwlock_test1_autotest',
|
['rib6_autotest', true],
|
||||||
'rwlock_rda_autotest',
|
['ring_autotest', true],
|
||||||
'rwlock_rds_wrm_autotest',
|
['rwlock_test1_autotest', true],
|
||||||
'rwlock_rde_wro_autotest',
|
['rwlock_rda_autotest', true],
|
||||||
'sched_autotest',
|
['rwlock_rds_wrm_autotest', true],
|
||||||
'spinlock_autotest',
|
['rwlock_rde_wro_autotest', true],
|
||||||
'stack_autotest',
|
['sched_autotest', true],
|
||||||
'stack_lf_autotest',
|
['spinlock_autotest', true],
|
||||||
'string_autotest',
|
['stack_autotest', false],
|
||||||
'table_autotest',
|
['stack_lf_autotest', false],
|
||||||
'tailq_autotest',
|
['string_autotest', true],
|
||||||
'timer_autotest',
|
['table_autotest', true],
|
||||||
'user_delay_us',
|
['tailq_autotest', true],
|
||||||
'version_autotest',
|
['timer_autotest', false],
|
||||||
'crc_autotest',
|
['user_delay_us', true],
|
||||||
'delay_us_sleep_autotest',
|
['version_autotest', true],
|
||||||
'distributor_autotest',
|
['crc_autotest', true],
|
||||||
'eventdev_common_autotest',
|
['delay_us_sleep_autotest', true],
|
||||||
'fbarray_autotest',
|
['distributor_autotest', false],
|
||||||
'hash_readwrite_func_autotest',
|
['eventdev_common_autotest', true],
|
||||||
'ipsec_autotest',
|
['fbarray_autotest', true],
|
||||||
'kni_autotest',
|
['hash_readwrite_func_autotest', false],
|
||||||
'kvargs_autotest',
|
['ipsec_autotest', true],
|
||||||
'member_autotest',
|
['kni_autotest', false],
|
||||||
'metrics_autotest',
|
['kvargs_autotest', true],
|
||||||
'power_cpufreq_autotest',
|
['member_autotest', true],
|
||||||
'power_autotest',
|
['metrics_autotest', true],
|
||||||
'power_kvm_vm_autotest',
|
['power_cpufreq_autotest', false],
|
||||||
'reorder_autotest',
|
['power_autotest', true],
|
||||||
'service_autotest',
|
['power_kvm_vm_autotest', false],
|
||||||
'thash_autotest',
|
['reorder_autotest', true],
|
||||||
|
['service_autotest', true],
|
||||||
|
['thash_autotest', true],
|
||||||
]
|
]
|
||||||
|
|
||||||
perf_test_names = [
|
perf_test_names = [
|
||||||
@ -334,13 +336,13 @@ if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
|
|||||||
test_sources += 'test_link_bonding_mode4.c'
|
test_sources += 'test_link_bonding_mode4.c'
|
||||||
test_sources += 'sample_packet_forward.c'
|
test_sources += 'sample_packet_forward.c'
|
||||||
test_sources += 'test_pdump.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'
|
perf_test_names += 'ring_pmd_perf_autotest'
|
||||||
fast_test_names += 'event_eth_tx_adapter_autotest'
|
fast_tests += [['event_eth_tx_adapter_autotest', false]]
|
||||||
fast_test_names += 'bitratestats_autotest'
|
fast_tests += [['bitratestats_autotest', true]]
|
||||||
fast_test_names += 'latencystats_autotest'
|
fast_tests += [['latencystats_autotest', true]]
|
||||||
driver_test_names += 'link_bonding_mode4_autotest'
|
driver_test_names += 'link_bonding_mode4_autotest'
|
||||||
fast_test_names += 'pdump_autotest'
|
fast_tests += [['pdump_autotest', true]]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if dpdk_conf.has('RTE_LIBRTE_POWER')
|
if dpdk_conf.has('RTE_LIBRTE_POWER')
|
||||||
@ -368,7 +370,7 @@ if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV')
|
|||||||
test_dep_objs += compress_test_dep
|
test_dep_objs += compress_test_dep
|
||||||
test_sources += 'test_compressdev.c'
|
test_sources += 'test_compressdev.c'
|
||||||
test_deps += 'compressdev'
|
test_deps += 'compressdev'
|
||||||
fast_test_names += 'compressdev_autotest'
|
fast_tests += [['compressdev_autotest', false]]
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -395,6 +397,17 @@ dpdk_test = executable('dpdk-test',
|
|||||||
install_rpath: driver_install_path,
|
install_rpath: driver_install_path,
|
||||||
install: true)
|
install: true)
|
||||||
|
|
||||||
|
has_hugepage = true
|
||||||
|
if is_linux
|
||||||
|
check_hugepage = run_command('cat',
|
||||||
|
'/proc/sys/vm/nr_hugepages')
|
||||||
|
if (check_hugepage.returncode() != 0 or
|
||||||
|
check_hugepage.stdout().strip() == '0')
|
||||||
|
has_hugepage = false
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
message('hugepage availability: @0@'.format(has_hugepage))
|
||||||
|
|
||||||
# some perf tests (eg: memcpy perf autotest)take very long
|
# some perf tests (eg: memcpy perf autotest)take very long
|
||||||
# to complete, so timeout to 10 minutes
|
# to complete, so timeout to 10 minutes
|
||||||
timeout_seconds = 600
|
timeout_seconds = 600
|
||||||
@ -405,25 +418,35 @@ num_cores_arg = '-l ' + run_command(get_coremask).stdout().strip()
|
|||||||
|
|
||||||
default_test_args = [num_cores_arg]
|
default_test_args = [num_cores_arg]
|
||||||
|
|
||||||
foreach arg : fast_test_names
|
foreach arg : fast_tests
|
||||||
test_args = default_test_args
|
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
|
if (get_option('default_library') == 'shared' and
|
||||||
arg == 'event_eth_tx_adapter_autotest')
|
arg[0] == 'event_eth_tx_adapter_autotest')
|
||||||
foreach drv:dpdk_drivers
|
foreach drv:dpdk_drivers
|
||||||
test_args += ['-d', drv.full_path().split('.a')[0] + '.so']
|
test_args += ['-d', drv.full_path().split('.a')[0] + '.so']
|
||||||
endforeach
|
endforeach
|
||||||
endif
|
endif
|
||||||
if is_linux
|
if is_linux
|
||||||
test_args += ['--file-prefix=@0@'.format(arg)]
|
test_args += ['--file-prefix=@0@'.format(arg[0])]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test(arg, dpdk_test,
|
if run_test
|
||||||
env : ['DPDK_TEST=' + arg],
|
test(arg[0], dpdk_test,
|
||||||
args : test_args,
|
env : ['DPDK_TEST=' + arg[0]],
|
||||||
timeout : timeout_seconds_fast,
|
args : test_args,
|
||||||
is_parallel : false,
|
timeout : timeout_seconds_fast,
|
||||||
suite : 'fast-tests')
|
is_parallel : false,
|
||||||
|
suite : 'fast-tests')
|
||||||
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
foreach arg : perf_test_names
|
foreach arg : perf_test_names
|
||||||
|
Loading…
Reference in New Issue
Block a user