app/test: enable subset of tests on Windows
PATCH v6 11/12 app/test: replace .sh scripts with .py scripts
In reply to Jie Zhou- Add python script to get coremask
- Add python script to check if system supports hugepages
- Remove two corresponding .sh scripts
- Replace calling of .sh with corresponding .py in meson.build
--- app/test/get-coremask.sh | 13 ------------- app/test/get_coremask.py | 12 ++++++++++++ app/test/has-hugepage.sh | 11 ----------- app/test/has_hugepage.py | 25 +++++++++++++++++++++++++ app/test/meson.build | 7 ++++--- 5 files changed, 41 insertions(+), 27 deletions(-) delete mode 100755 app/test/get-coremask.sh create mode 100644 app/test/get_coremask.py delete mode 100755 app/test/has-hugepage.sh create mode 100644 app/test/has_hugepage.py
app/test/get-coremask.sh deleted +0 -13
@@ -1,13 +0,0 @@ -#! /bin/sh -e -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2019 Intel Corporation - -if [ "$(uname)" = "Linux" ] ; then - cat /sys/devices/system/cpu/present -elif [ "$(uname)" = "FreeBSD" ] ; then - ncpus=$(/sbin/sysctl -n hw.ncpu) - echo 0-$(expr $ncpus - 1) -else -# fallback - echo 0-3 -fi
app/test/get_coremask.py new file +12 -0
@@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021 Microsoft Corporation +"""This script returns the system cpu range""" + +import multiprocessing + +cpucount = multiprocessing.cpu_count() +if cpucount is None: + # use fallback cpu count + print("0-3") +else: + print("0-" + str(cpucount - 1))
app/test/has-hugepage.sh deleted +0 -11
@@ -1,11 +0,0 @@ -#! /bin/sh -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2020 Mellanox Technologies, Ltd - -if [ "$(uname)" = "Linux" ] ; then - cat /proc/sys/vm/nr_hugepages || echo 0 -elif [ "$(uname)" = "FreeBSD" ] ; then - echo 1 # assume FreeBSD always has hugepages -else - echo 0 -fi
app/test/has_hugepage.py new file +25 -0
@@ -0,0 +1,25 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021 Microsoft Corporation +"""This script checks if the system supports huge pages""" + +import platform +import ctypes + +osName = platform.system() +if osName == "Linux": + with open("/proc/sys/vm/nr_hugepages") as file_o: + content = file_o.read() + print(content) +elif osName == "FreeBSD": + # Assume FreeBSD always has hugepages enabled + print("1") +elif osName == "Windows": + # On Windows, determine if large page is supported based on the + # value returned by GetLargePageMinimum. If the return value is zero, + # the processor does not support large pages. + if ctypes.windll.kernel32.GetLargePageMinimum() > 0: + print("1") + else: + print("0") +else: + print("0")
app/test/meson.build +4 -3
@@ -451,7 +451,7 @@ dpdk_test = executable('dpdk-test', driver_install_path), install: true) -has_hugepage = run_command('has-hugepage.sh').stdout().strip() != '0' +has_hugepage = run_command(py3, 'has_hugepage.py').stdout().strip() != '0' message('hugepage availability: @0@'.format(has_hugepage)) # some perf tests (eg: memcpy perf autotest)take very long
@@ -459,8 +459,9 @@ message('hugepage availability: @0@'.format(has_hugepage)) timeout_seconds = 600 timeout_seconds_fast = 10 -get_coremask = find_program('get-coremask.sh') -num_cores_arg = '-l ' + run_command(get_coremask).stdout().strip() +list_of_cores = run_command(py3, 'get_coremask.py').stdout().strip() +message('list of cores: @0@'.format(list_of_cores)) +num_cores_arg = '-l ' + list_of_cores default_test_args = [num_cores_arg]
Signature · 1 line
2.32.0.windows.2
PATCH v6 12/12 app/test: enable subset of unit tests on Windows
In reply to Jie Zhou- For fast tests and perf tests, add test stubs to skip not supported ones.
- For driver tests, just skip on Windows totally to avoid unnecessary amount of test stubs. For example, there are about 30 cryptodev related tests (even though in the meson for CI it only listed about half) which will be enabled by "patch-18949: app/test:
enable crypto unit tests on Windows".
- For dump tests, currently the tests hang on Windows which require further investigation. Keep the dump test list just for non-Windows for easier tracking.
--- app/test/meson.build | 107 ++++++++++++----------- app/test/test_acl.c | 12 +++ app/test/test_bpf.c | 15 +++- app/test/test_cksum.c | 12 +++ app/test/test_cmdline_ipaddr.c | 5 ++ app/test/test_cryptodev.c | 4 + app/test/test_cryptodev_asym.c | 4 + app/test/test_cryptodev_blockcipher.c | 4 + app/test/test_cryptodev_security_ipsec.c | 4 + app/test/test_cryptodev_security_pdcp.c | 4 + app/test/test_debug.c | 17 +++- app/test/test_distributor.c | 13 +++ app/test/test_distributor_perf.c | 13 +++ app/test/test_eal_flags.c | 97 ++++++++++++++++++++ app/test/test_eal_fs.c | 12 +++ app/test/test_efd.c | 12 +++ app/test/test_efd_perf.c | 12 +++ app/test/test_event_crypto_adapter.c | 15 +++- app/test/test_event_eth_rx_adapter.c | 25 +++++- app/test/test_event_eth_tx_adapter.c | 12 +++ app/test/test_event_ring.c | 16 +++- app/test/test_event_timer_adapter.c | 16 +++- app/test/test_eventdev.c | 20 ++++- app/test/test_external_mem.c | 17 +++- app/test/test_fib.c | 22 ++++- app/test/test_fib6.c | 24 ++++- app/test/test_fib6_perf.c | 16 +++- app/test/test_fib_perf.c | 15 +++- app/test/test_flow_classify.c | 13 +++ app/test/test_func_reentrancy.c | 12 +++ app/test/test_graph.c | 18 +++- app/test/test_graph_perf.c | 16 +++- app/test/test_hash_perf.c | 12 +++ app/test/test_ipfrag.c | 16 +++- app/test/test_ipsec.c | 15 +++- app/test/test_ipsec_perf.c | 15 +++- app/test/test_ipsec_sad.c | 14 ++- app/test/test_kni.c | 10 +-- app/test/test_lcores.c | 12 +++ app/test/test_lpm6.c | 14 ++- app/test/test_lpm6_perf.c | 13 +++ app/test/test_lpm_perf.c | 12 +++ app/test/test_malloc.c | 17 +++- app/test/test_mbuf.c | 13 ++- app/test/test_member.c | 16 +++- app/test/test_member_perf.c | 16 +++- app/test/test_memcpy_perf.c | 18 +++- app/test/test_mempool_perf.c | 12 +++ app/test/test_mp_secondary.c | 15 +++- app/test/test_rawdev.c | 17 +++- app/test/test_rcu_qsbr_perf.c | 12 +++ app/test/test_reciprocal_division.c | 12 +++ app/test/test_reciprocal_division_perf.c | 12 +++ app/test/test_red.c | 29 +++++- app/test/test_reorder.c | 15 +++- app/test/test_rib.c | 22 ++++- app/test/test_rib6.c | 22 ++++- app/test/test_sched.c | 14 ++- app/test/test_security.c | 16 +++- app/test/test_table.c | 13 +++ app/test/test_table_acl.c | 3 + app/test/test_table_combined.c | 4 + app/test/test_table_pipeline.c | 4 + app/test/test_table_ports.c | 4 + app/test/test_table_tables.c | 4 + app/test/test_timer_secondary.c | 13 +++ app/test/test_trace.c | 32 ++++++- 67 files changed, 978 insertions(+), 114 deletions(-)
app/test/meson.build +56 -51
@@ -1,12 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() -endif - if not get_option('tests') subdir_done() endif
@@ -154,36 +148,19 @@ test_sources = files( ) test_deps = [ - 'acl', 'bus_pci', 'bus_vdev', 'bitratestats', - 'bpf', 'cfgfile', 'cmdline', - 'cryptodev', - 'distributor', 'efd', 'ethdev', - 'eventdev', - 'fib', - 'flow_classify', - 'graph', 'hash', - 'ipsec', 'latencystats', 'lpm', - 'member', 'metrics', - 'node', - 'pipeline', - 'port', - 'rawdev', 'rcu', - 'reorder', - 'rib', 'ring', - 'security', 'stack', 'telemetry', 'timer',
@@ -318,38 +295,66 @@ perf_test_names = [ ] driver_test_names = [ - 'cryptodev_aesni_mb_autotest', - 'cryptodev_aesni_gcm_autotest', - 'cryptodev_cn9k_autotest', - 'cryptodev_cn10k_autotest', - 'cryptodev_dpaa_sec_autotest', - 'cryptodev_dpaa2_sec_autotest', - 'cryptodev_null_autotest', - 'cryptodev_octeontx2_autotest', - 'cryptodev_openssl_autotest', - 'cryptodev_openssl_asym_autotest', - 'cryptodev_qat_autotest', - 'cryptodev_sw_armv8_autotest', - 'cryptodev_sw_kasumi_autotest', - 'cryptodev_sw_mvsam_autotest', - 'cryptodev_sw_snow3g_autotest', - 'cryptodev_sw_zuc_autotest', - 'eventdev_selftest_octeontx', - 'eventdev_selftest_sw', - 'rawdev_autotest', ] dump_test_names = [ - 'dump_struct_sizes', - 'dump_mempool', - 'dump_malloc_stats', - 'dump_devargs', - 'dump_log_types', - 'dump_ring', - 'dump_physmem', - 'dump_memzone', ] +if not is_windows + test_deps += [ + 'acl', + 'bpf', + 'cryptodev', + 'distributor', + 'eventdev', + 'fib', + 'flow_classify', + 'graph', + 'ipsec', + 'member', + 'node', + 'pipeline', + 'port', + 'rawdev', + 'reorder', + 'rib', + 'security', + ] + + driver_test_names += [ + 'cryptodev_aesni_mb_autotest', + 'cryptodev_aesni_gcm_autotest', + 'cryptodev_cn9k_autotest', + 'cryptodev_cn10k_autotest', + 'cryptodev_dpaa_sec_autotest', + 'cryptodev_dpaa2_sec_autotest', + 'cryptodev_null_autotest', + 'cryptodev_octeontx2_autotest', + 'cryptodev_openssl_autotest', + 'cryptodev_openssl_asym_autotest', + 'cryptodev_qat_autotest', + 'cryptodev_sw_armv8_autotest', + 'cryptodev_sw_kasumi_autotest', + 'cryptodev_sw_mvsam_autotest', + 'cryptodev_sw_snow3g_autotest', + 'cryptodev_sw_zuc_autotest', + 'eventdev_selftest_octeontx', + 'eventdev_selftest_sw', + 'rawdev_autotest', + ] + + dump_test_names += [ + 'dump_struct_sizes', + 'dump_mempool', + 'dump_malloc_stats', + 'dump_devargs', + 'dump_log_types', + 'dump_ring', + 'dump_physmem', + 'dump_memzone', + ] +endif + # The following linkages are an exception to allow running the # unit tests without requiring that the developer install the # DPDK libraries. Explicit linkage of drivers (plugin libraries)
@@ -363,7 +368,7 @@ endif if dpdk_conf.has('RTE_EVENT_SKELETON') test_deps += 'event_skeleton' endif -if dpdk_conf.has('RTE_LIB_TELEMETRY') +if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY') test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c'] fast_tests += [['telemetry_json_autotest', true], ['telemetry_data_autotest', true]] endif
app/test/test_acl.c +12 -0
@@ -11,6 +11,16 @@#include <rte_mbuf.h> #include <rte_byteorder.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_acl (void ) +{ +printf ("acl not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <rte_acl.h> #include <rte_common.h>
@@ -1741,4 +1751,6 @@ test_acl(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (acl_autotest, test_acl);
app/test/test_bpf.c +14 -1
@@ -13,11 +13,22 @@#include <rte_random.h> #include <rte_byteorder.h> #include <rte_errno.h> +#include "test.h" + +#if !defined(RTE_LIB_BPF ) + +static int +test_bpf (void ) +{ +printf ("BPF not supported, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <rte_bpf.h> #include <rte_ether.h> #include <rte_ip.h> -#include "test.h" /* * Basic functional tests for librte_bpf.
@@ -3232,4 +3243,6 @@ test_bpf(void) return rc; } +#endif +REGISTER_TEST_COMMAND (bpf_autotest, test_bpf);
app/test/test_cksum.c +12 -0
@@ -13,6 +13,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_cksum (void ) +{ +printf ("cksum not supported, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MEMPOOL_CACHE_SIZE 0#define MBUF_DATA_SIZE 256#define NB_MBUF 128
@@ -268,4 +278,6 @@ test_cksum(void) }#undef GOTO_FAIL +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (cksum_autotest, test_cksum);
app/test/test_cmdline_ipaddr.c +5 -0
@@ -2,9 +2,12 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <stdio.h> #include <string.h> #include <inttypes.h> +#include <netinet/in.h> #include <sys/socket.h>
@@ -669,3 +672,5 @@ test_parse_ipaddr_invalid_param(void) }return 0 ; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev.c +4 -0
@@ -3,6 +3,8 @@* Copyright 2020 NXP */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <time.h> #include <rte_common.h>
@@ -15462,3 +15464,5 @@ REGISTER_TEST_COMMAND(cryptodev_nitrox_autotest, test_cryptodev_nitrox);REGISTER_TEST_COMMAND (cryptodev_bcmfs_autotest, test_cryptodev_bcmfs);REGISTER_TEST_COMMAND (cryptodev_cn9k_autotest, test_cryptodev_cn9k);REGISTER_TEST_COMMAND (cryptodev_cn10k_autotest, test_cryptodev_cn10k); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_asym.c +4 -0
@@ -3,6 +3,8 @@* Copyright (c) 2019 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_bus_vdev.h> #include <rte_common.h> #include <rte_hexdump.h>
@@ -2429,3 +2431,5 @@ REGISTER_TEST_COMMAND(cryptodev_octeontx2_asym_autotest, test_cryptodev_octeontx2_asym);REGISTER_TEST_COMMAND (cryptodev_cn9k_asym_autotest, test_cryptodev_cn9k_asym);REGISTER_TEST_COMMAND (cryptodev_cn10k_asym_autotest, test_cryptodev_cn10k_asym); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_blockcipher.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2015-2017 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_common.h> #include <rte_hexdump.h> #include <rte_mbuf.h>
@@ -1218,3 +1220,5 @@ free_blockcipher_test_suite(struct unit_test_suite *ts) {free (ts); } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_security_ipsec.c +4 -0
@@ -2,6 +2,8 @@* Copyright(C) 2021 Marvell. */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_common.h> #include <rte_cryptodev.h> #include <rte_esp.h>
@@ -672,3 +674,5 @@ test_ipsec_status_check(struct rte_crypto_op *op, return ret; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_security_pdcp.c +4 -0
@@ -4,6 +4,8 @@* Copyright 2018-2019 NXP */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <time.h> #include <rte_common.h>
@@ -587,3 +589,5 @@ test_PDCP_PROTO_uplane_decap_all(void) return n - i; }; + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_debug.c +15 -2
@@ -2,8 +2,21 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_debug (void ) +{ +printf ("debug not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/resource.h> #include <sys/time.h> #include <sys/wait.h>
@@ -14,8 +27,6 @@#include <rte_eal.h> #include <rte_service_component.h> -#include "test.h" -/* * Debug test * ==========
@@ -127,4 +138,6 @@ test_debug(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (debug_autotest, test_debug);
app/test/test_distributor.c +13 -0
@@ -11,6 +11,17 @@#include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_mbuf_dyn.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_distributor (void ) +{ +printf ("distributor not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_distributor.h> #include <rte_string_fns.h>
@@ -939,4 +950,6 @@ test_distributor(void) return -1; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (distributor_autotest, test_distributor);
app/test/test_distributor_perf.c +13 -0
@@ -10,6 +10,17 @@#include <rte_cycles.h> #include <rte_common.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_distributor_perf (void ) +{ +printf ("distributor perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_distributor.h> #include <rte_pause.h>
@@ -267,4 +278,6 @@ test_distributor_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (distributor_perf_autotest, test_distributor_perf);
app/test/test_eal_flags.c +97 -0
109 lines not on this page · raw message
app/test/test_eal_fs.c +12 -0
@@ -10,6 +10,16 @@#include "eal_filesystem.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_eal_fs (void ) +{ +printf ("eal_fs not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +static int test_parse_sysfs_value (void ) {
@@ -173,4 +183,6 @@ test_eal_fs(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (eal_fs_autotest, test_eal_fs);
app/test/test_efd.c +12 -0
@@ -12,6 +12,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_efd (void ) +{ +printf ("efd not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define EFD_TEST_KEY_LEN 8#define TABLE_SIZE (1 << 21)#define ITERATIONS 3
@@ -462,4 +472,6 @@ test_efd(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (efd_autotest, test_efd);
app/test/test_efd_perf.c +12 -0
@@ -15,6 +15,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_efd_perf (void ) +{ +printf ("efd_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define NUM_KEYSIZES 10#define NUM_SHUFFLES 10#define MAX_KEYSIZE 64
@@ -382,4 +392,6 @@ test_efd_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (efd_perf_autotest, test_efd_perf);
app/test/test_event_crypto_adapter.c +14 -1
@@ -3,16 +3,27 @@* All rights reserved. */ +#include "test.h" #include <string.h> #include <rte_common.h> #include <rte_mempool.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_crypto_adapter (void ) +{ +printf ("event_crypto_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_cryptodev.h> #include <rte_eventdev.h> #include <rte_bus_vdev.h> #include <rte_service.h> #include <rte_event_crypto_adapter.h> -#include "test.h" #define PKT_TRACE 0#define NUM 1
@@ -1003,5 +1014,7 @@ test_event_crypto_adapter(void) return unit_test_suite_runner(&functional_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_crypto_adapter_autotest, test_event_crypto_adapter);
app/test/test_event_eth_rx_adapter.c +23 -2
@@ -1,18 +1,37 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ + +#include "test.h" +#include <string.h> #include <rte_common.h> #include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_ethdev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_eth_rx_adapter_common (void ) +{ +printf ("event_eth_rx_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_event_eth_rx_intr_adapter_common (void ) +{ +printf ("event_eth_rx_intr_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_bus_vdev.h> #include <rte_event_eth_rx_adapter.h> -#include "test.h" -#define MAX_NUM_RX_QUEUE 64#define NB_MBUFS (8192 * num_ports * MAX_NUM_RX_QUEUE)#define MBUF_CACHE_SIZE 512
@@ -786,6 +805,8 @@ test_event_eth_rx_intr_adapter_common(void)return unit_test_suite_runner (&event_eth_rx_intr_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_eth_rx_adapter_autotest, test_event_eth_rx_adapter_common); REGISTER_TEST_COMMAND(event_eth_rx_intr_adapter_autotest,
app/test/test_event_eth_tx_adapter.c +12 -0
@@ -16,6 +16,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_eth_tx_adapter_common (void ) +{ +printf ("event_eth_tx_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_NUM_QUEUE RTE_PMD_RING_MAX_RX_RINGS#define TEST_INST_ID 0#define TEST_DEV_ID 0
@@ -696,5 +706,7 @@ test_event_eth_tx_adapter_common(void) return unit_test_suite_runner(&event_eth_tx_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_eth_tx_adapter_autotest, test_event_eth_tx_adapter_common);
app/test/test_event_ring.c +14 -2
@@ -2,11 +2,21 @@* Copyright(c) 2010-2017 Intel Corporation */ +#include "test.h" +#include <string.h> -#include <rte_event_ring.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_ring (void ) +{ +printf ("event_ring not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} -#include "test.h" +#else + +#include <rte_event_ring.h> /* * Event Ring
@@ -244,4 +254,6 @@ test_event_ring(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_ring_autotest, test_event_ring);
app/test/test_event_timer_adapter.c +14 -2
@@ -2,6 +2,7 @@* Copyright(c) 2017 Cavium, Inc * Copyright(c) 2017-2018 Intel Corporation. */ +#include "test.h" #include <math.h>
@@ -11,6 +12,17 @@#include <rte_debug.h> #include <rte_eal.h> #include <rte_ethdev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_timer_adapter_func (void ) +{ +printf ("event_timer_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_event_timer_adapter.h> #include <rte_mempool.h>
@@ -22,8 +34,6 @@#include <rte_service.h> #include <stdbool.h> -#include "test.h" -/* 4K timers corresponds to sw evdev max inflight events */ #define MAX_TIMERS (4 * 1024)#define BKT_TCK_NSEC
@@ -1953,4 +1963,6 @@ test_event_timer_adapter_func(void) return unit_test_suite_runner(&event_timer_adptr_functional_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_timer_adapter_test, test_event_timer_adapter_func);
app/test/test_eventdev.c +18 -2
@@ -1,18 +1,28 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2016 Cavium, Inc */ +#include "test.h" #include <rte_common.h> #include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_memcpy.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_eventdev_common (void ) +{ +printf ("eventdev_common not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_dev.h> #include <rte_bus_vdev.h> -#include "test.h" -#define TEST_DEV_ID 0 static int
@@ -1048,7 +1058,11 @@ test_eventdev_selftest_cn10k(void) return test_eventdev_selftest_impl("event_cn10k", ""); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (eventdev_common_autotest, test_eventdev_common); + +#ifndef RTE_EXEC_ENV_WINDOWS REGISTER_TEST_COMMAND (eventdev_selftest_sw, test_eventdev_selftest_sw);REGISTER_TEST_COMMAND (eventdev_selftest_octeontx, test_eventdev_selftest_octeontx);
@@ -1058,3 +1072,5 @@ REGISTER_TEST_COMMAND(eventdev_selftest_dpaa2, test_eventdev_selftest_dpaa2);REGISTER_TEST_COMMAND (eventdev_selftest_dlb2, test_eventdev_selftest_dlb2);REGISTER_TEST_COMMAND (eventdev_selftest_cn9k, test_eventdev_selftest_cn9k);REGISTER_TEST_COMMAND (eventdev_selftest_cn10k, test_eventdev_selftest_cn10k); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_external_mem.c +15 -2
@@ -2,11 +2,24 @@* Copyright(c) 2018 Intel Corporation */ +#include "test.h" +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> + + +#ifdef RTE_EXEC_ENV_WINDOWS +static int test_external_mem (void ) +{ +printf ("external_mem not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/mman.h> #include <sys/wait.h>
@@ -19,8 +32,6 @@#include <rte_ring.h> #include <rte_string_fns.h> -#include "test.h" -#define EXTERNAL_MEM_SZ (RTE_PGSIZE_4K << 10)/* 4M of data */ static int
@@ -574,4 +585,6 @@ test_external_mem(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (external_mem_autotest, test_external_mem);
app/test/test_fib.c +21 -1
@@ -9,10 +9,28 @@#include <rte_ip.h> #include <rte_log.h> -#include <rte_fib.h> #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib (void ) +{ +printf ("fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_fib (void ) +{ +printf ("slow_fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib.h> +typedef int32_t (*rte_fib_test )(void );static int32_t test_create_invalid (void );
@@ -410,5 +428,7 @@ test_slow_fib(void) return unit_test_suite_runner(&fib_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib_autotest, test_fib);REGISTER_TEST_COMMAND (fib_slow_autotest, test_slow_fib);
app/test/test_fib6.c +22 -2
@@ -9,11 +9,29 @@#include <rte_memory.h> #include <rte_log.h> -#include <rte_rib6.h> -#include <rte_fib6.h> #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib6 (void ) +{ +printf ("fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_fib6 (void ) +{ +printf ("slow_fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_rib6.h> +#include <rte_fib6.h> +typedef int32_t (*rte_fib6_test )(void );static int32_t test_create_invalid (void );
@@ -419,5 +437,7 @@ test_slow_fib6(void) return unit_test_suite_runner(&fib6_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib6_autotest, test_fib6);REGISTER_TEST_COMMAND (fib6_slow_autotest, test_slow_fib6);
app/test/test_fib6_perf.c +15 -1
@@ -10,9 +10,21 @@#include <rte_cycles.h> #include <rte_random.h> #include <rte_memory.h> -#include <rte_fib6.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib6_perf (void ) +{ +printf ("fib6_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib6.h> +#include "test_lpm6_data.h" #define TEST_FIB_ASSERT (cond) do { \
@@ -154,4 +166,6 @@ test_fib6_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib6_perf_autotest, test_fib6_perf);
app/test/test_fib_perf.c +14 -1
@@ -12,11 +12,22 @@#include <rte_random.h> #include <rte_branch_prediction.h> #include <rte_ip.h> -#include <rte_fib.h> #include "test.h" #include "test_xmmt_ops.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib_perf (void ) +{ +printf ("fib_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib.h> +#define TEST_FIB_ASSERT (cond) do { \ if (!(cond)) { \ printf("Error at line %d:\n", __LINE__); \
@@ -408,4 +419,6 @@ test_fib_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib_perf_autotest, test_fib_perf);
app/test/test_flow_classify.c +13 -0
@@ -11,6 +11,17 @@#include <rte_mbuf.h> #include <rte_byteorder.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_flow_classify (void ) +{ +printf ("flow_classify not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_acl.h> #include <rte_common.h> #include <rte_table_acl.h>
@@ -879,4 +890,6 @@ test_flow_classify(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (flow_classify_autotest, test_flow_classify);
app/test/test_func_reentrancy.c +12 -0
@@ -41,6 +41,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_func_reentrancy (void ) +{ +printf ("reentrancy not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +typedef int (*case_func_t )(void * arg);typedef void (*case_clean_t )(unsigned lcore_id);
@@ -512,4 +522,6 @@ test_func_reentrancy(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (func_reentrancy_autotest, test_func_reentrancy);
app/test/test_graph.c +16 -2
@@ -1,6 +1,8 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2020 Marvell International Ltd. */ +#include "test.h" +#include <assert.h> #include <inttypes.h> #include <signal.h>
@@ -9,14 +11,23 @@#include <unistd.h> #include <rte_errno.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_node_list_dump (void ) +{ +printf ("node_list_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_graph.h> #include <rte_graph_worker.h> #include <rte_mbuf.h> #include <rte_mbuf_dyn.h> #include <rte_random.h> -#include "test.h" -static uint16_t test_node_worker_source (struct rte_graph *graph,struct rte_node *node,void **objs,uint16_t nb_objs);
@@ -841,4 +852,7 @@ test_node_list_dump(void) return TEST_SUCCESS; } + +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (node_list_dump, test_node_list_dump);
app/test/test_graph_perf.c +14 -2
@@ -1,6 +1,8 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2020 Marvell International Ltd. */ +#include "test.h" +#include <inttypes.h> #include <signal.h> #include <stdio.h>
@@ -9,14 +11,22 @@#include <rte_common.h> #include <rte_cycles.h> #include <rte_errno.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_graph_perf_func (void ) +{ +printf ("graph_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_graph.h> #include <rte_graph_worker.h> #include <rte_lcore.h> #include <rte_malloc.h> #include <rte_mbuf.h> -#include "test.h" -#define TEST_GRAPH_PERF_MZ "graph_perf_data"#define TEST_GRAPH_SRC_NAME "test_graph_perf_source"#define TEST_GRAPH_SRC_BRST_ONE_NAME "test_graph_perf_source_one"
@@ -1060,4 +1070,6 @@ test_graph_perf_func(void) return unit_test_suite_runner(&graph_perf_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (graph_perf_autotest, test_graph_perf_func);
app/test/test_hash_perf.c +12 -0
@@ -17,6 +17,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_hash_perf (void ) +{ +printf ("hash_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ENTRIES (1 << 19)#define KEYS_TO_ADD (MAX_ENTRIES)#define ADD_PERCENT 0.75/* 75% table utilization */
@@ -749,4 +759,6 @@ test_hash_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (hash_perf_autotest, test_hash_perf);
app/test/test_ipfrag.c +14 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Red Hat, Inc. */ +#include "test.h" #include <time.h>
@@ -8,13 +9,22 @@#include <rte_cycles.h> #include <rte_hexdump.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipfrag (void ) +{ +printf ("ipfrag not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ip_frag.h> #include <rte_mbuf.h> #include <rte_memcpy.h> #include <rte_random.h> -#include "test.h" -#define NUM_MBUFS 128#define BURST 32
@@ -259,4 +269,6 @@ test_ipfrag(void) return unit_test_suite_runner(&ipfrag_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipfrag_autotest, test_ipfrag);
app/test/test_ipsec.c +14 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2018 Intel Corporation */ +#include "test.h" #include <time.h>
@@ -13,15 +14,25 @@#include <rte_bus_vdev.h> #include <rte_ip.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipsec (void ) +{ +printf ("ipsec not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_crypto.h> #include <rte_cryptodev.h> #include <rte_lcore.h> +#include <rte_ipsec.h> #include <rte_random.h> #include <rte_esp.h> #include <rte_security_driver.h> -#include "test.h" #include "test_cryptodev.h" #define VDEV_ARGS_SIZE 100
@@ -2536,4 +2547,6 @@ test_ipsec(void) return unit_test_suite_runner(&ipsec_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_autotest, test_ipsec);
app/test/test_ipsec_perf.c +14 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <rte_ip.h>
@@ -8,10 +9,20 @@#include <rte_ring.h> #include <rte_mbuf.h> #include <rte_cycles.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_libipsec_perf (void ) +{ +printf ("ipsec_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ipsec.h> #include <rte_random.h> -#include "test.h" #include "test_cryptodev.h" #define RING_SIZE 4096
@@ -611,4 +622,6 @@ test_libipsec_perf(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_perf_autotest, test_libipsec_perf);
app/test/test_ipsec_sad.c +13 -1
@@ -1,16 +1,26 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipsec_sad (void ) +{ +printf ("ipsec_sad not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ipsec_sad.h> #include <rte_memory.h> -#include "test.h" #include "test_xmmt_ops.h" typedef int32_t (*rte_ipsec_sad_test )(void );
@@ -884,4 +894,6 @@ test_ipsec_sad(void) return unit_test_suite_runner(&ipsec_sad_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_sad_autotest, test_ipsec_sad);
app/test/test_kni.c +5 -5
@@ -2,15 +2,12 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> #include <unistd.h> #include <string.h> -#include <sys/wait.h> -#include <dirent.h> - -#include "test.h" -#if !defined(RTE_EXEC_ENV_LINUX ) || !defined(RTE_LIB_KNI ) static int
@@ -22,6 +19,9 @@ test_kni(void)#else +#include <sys/wait.h> +#include <dirent.h> +#include <rte_string_fns.h> #include <rte_mempool.h> #include <rte_ethdev.h>
app/test/test_lcores.c +12 -0
@@ -11,6 +11,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lcores(void) +{ + printf("lcore not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + struct thread_context { enum { INIT, ERROR, DONE } state; bool lcore_id_any;
@@ -370,4 +380,6 @@ test_lcores(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lcores_autotest, test_lcores);
app/test/test_lpm6.c +13 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h>
@@ -8,9 +9,18 @@#include <string.h> #include <rte_memory.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm6 (void ) +{ +printf ("lpm6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_lpm6.h> -#include "test.h" #include "test_lpm6_data.h" #define TEST_LPM_ASSERT (cond) do { \
@@ -1792,4 +1802,6 @@ test_lpm6(void) return global_status; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm6_autotest, test_lpm6);
app/test/test_lpm6_perf.c +13 -0
@@ -13,6 +13,17 @@#include <rte_lpm6.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm6_perf (void ) +{ +printf ("lpm6_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include "test_lpm6_data.h" #define TEST_LPM_ASSERT (cond) do { \
@@ -160,4 +171,6 @@ test_lpm6_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm6_perf_autotest, test_lpm6_perf);
app/test/test_lpm_perf.c +12 -0
@@ -18,6 +18,16 @@#include "test.h" #include "test_xmmt_ops.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm_perf (void ) +{ +printf ("lpm6_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +struct rte_lpm *lpm;static struct rte_rcu_qsbr *rv;static volatile uint8_t writer_done;
@@ -763,4 +773,6 @@ test_lpm_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm_perf_autotest, test_lpm_perf);
app/test/test_malloc.c +14 -3
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2019 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h>
@@ -8,6 +9,17 @@#include <stdarg.h> #include <errno.h> #include <stdlib.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_malloc (void ) +{ +printf ("malloc not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/mman.h> #include <sys/queue.h> #include <unistd.h>
@@ -23,11 +35,8 @@#include <rte_random.h> #include <rte_string_fns.h> -#include "test.h" -#define N 10000 -static int is_mem_on_socket (int32_t socket);
@@ -1080,4 +1089,6 @@ test_malloc(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (malloc_autotest, test_malloc);
app/test/test_mbuf.c +12 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <string.h> #include <stdarg.h>
@@ -34,7 +35,15 @@#include <rte_tcp.h> #include <rte_mbuf_dyn.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_mbuf (void ) +{ +printf ("mbuf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #define MEMPOOL_CACHE_SIZE 32#define MBUF_DATA_SIZE 2048
@@ -2883,4 +2892,6 @@ test_mbuf(void) }#undef GOTO_FAIL +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (mbuf_autotest, test_mbuf);
app/test/test_member.c +14 -2
@@ -3,17 +3,27 @@*/ /* This test is for membership library's simple feature test */ +#include "test.h" #include <rte_memcpy.h> #include <rte_malloc.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_member (void ) +{ +printf ("member not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_member.h> #include <rte_byteorder.h> #include <rte_random.h> #include <rte_debug.h> #include <rte_ip.h> -#include "test.h" -struct rte_member_setsum *setsum_ht;struct rte_member_setsum *setsum_cache;struct rte_member_setsum *setsum_vbf;
@@ -712,4 +722,6 @@ test_member(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (member_autotest, test_member);
app/test/test_member_perf.c +14 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <inttypes.h>
@@ -11,9 +12,18 @@#include <rte_random.h> #include <rte_memcpy.h> #include <rte_thash.h> -#include <rte_member.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_member_perf (void ) +{ +printf ("member_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_member.h> #define NUM_KEYSIZES 10#define NUM_SHUFFLES 10
@@ -622,4 +632,6 @@ test_member_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (member_perf_autotest, test_member_perf);
app/test/test_memcpy_perf.c +15 -3
@@ -2,21 +2,31 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdint.h> #include <stdio.h> #include <string.h> #include <stdlib.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_memcpy_perf (void ) +{ +printf ("memcpy_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/time.h> #include <rte_common.h> #include <rte_cycles.h> #include <rte_random.h> #include <rte_malloc.h> -#include <rte_memcpy.h> -#include "test.h" -/* * Set this to the maximum buffer size you want to test. If it is 0, then the * values in the buf_sizes[] array below will be used.
@@ -347,4 +357,6 @@ test_memcpy_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (memcpy_perf_autotest, test_memcpy_perf);
app/test/test_mempool_perf.c +12 -0
@@ -28,6 +28,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_mempool_perf (void ) +{ +printf ("mempool_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +/* * Mempool performance * =======
@@ -393,4 +403,6 @@ test_mempool_perf(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (mempool_perf_autotest, test_mempool_perf);
app/test/test_mp_secondary.c +13 -2
@@ -14,9 +14,18 @@#include <errno.h> #include <string.h> #include <unistd.h> -#ifndef RTE_EXEC_ENV_WINDOWS + +#ifdef RTE_EXEC_ENV_WINDOWS +int +test_mp_secondary (void ) +{ +printf ("mp_secondary not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/wait.h> -#endif #include <libgen.h> #include <dirent.h> #include <limits.h>
@@ -214,4 +223,6 @@ test_mp_secondary(void) return run_object_creation_tests(); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (multiprocess_autotest, test_mp_secondary);
app/test/test_rawdev.c +15 -2
@@ -1,16 +1,27 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2017 NXP */ +#include "test.h" +#include <rte_common.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_dev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rawdev_selftests (void ) +{ +printf ("rawdev not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_rawdev.h> #include <rte_bus_vdev.h> -#include "test.h" -static int test_rawdev_selftest_impl (const char *pmd,const char *opts) {
@@ -54,4 +65,6 @@ test_rawdev_selftests(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rawdev_autotest, test_rawdev_selftests);
app/test/test_rcu_qsbr_perf.c +12 -0
@@ -15,6 +15,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rcu_qsbr_main (void ) +{ +printf ("rcu_qsbr_main not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +/* Check condition and return an error if true. */ static uint16_t enabled_core_ids[RTE_MAX_LCORE ];static unsigned int num_cores;
@@ -687,4 +697,6 @@ test_rcu_qsbr_main(void) return -1; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rcu_qsbr_perf_autotest, test_rcu_qsbr_main);
app/test/test_reciprocal_division.c +12 -0
@@ -13,6 +13,16 @@#include <rte_random.h> #include <rte_reciprocal.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reciprocal (void ) +{ +printf ("reciprocal not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ITERATIONS (1ULL << 32)#define DIVIDE_ITER (100)
@@ -164,4 +174,6 @@ test_reciprocal(void) return result; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reciprocal_division, test_reciprocal);
app/test/test_reciprocal_division_perf.c +12 -0
@@ -13,6 +13,16 @@#include <rte_random.h> #include <rte_reciprocal.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reciprocal_division_perf (void ) +{ +printf ("reciprocal_division_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ITERATIONS (1ULL << 32)#define DIVIDE_ITER (1ULL << 28)
@@ -205,4 +215,6 @@ test_reciprocal_division_perf(void) return result; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reciprocal_division_perf, test_reciprocal_division_perf);
app/test/test_red.c +27 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdlib.h> #include <stdio.h>
@@ -8,12 +9,34 @@#include <stdint.h> #include <unistd.h> #include <inttypes.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_red (void ) +{ +printf ("red not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_red_perf (void ) +{ +printf ("red_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_red_all (void ) +{ +printf ("red_all not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#include <sys/time.h> #include <time.h> #include <math.h> -#include "test.h" -#include <rte_red.h> #ifdef __INTEL_COMPILER
@@ -1851,6 +1874,8 @@ test_red_all(void) return tell_the_result(num_tests, num_pass); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (red_autotest, test_red);REGISTER_TEST_COMMAND (red_perf, test_red_perf);REGISTER_TEST_COMMAND (red_all, test_red_all);
app/test/test_reorder.c +13 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <unistd.h>
@@ -9,12 +10,20 @@#include <rte_cycles.h> #include <rte_errno.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reorder (void ) +{ +printf ("reorder not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#include <rte_reorder.h> #include <rte_lcore.h> #include <rte_malloc.h> -#include "test.h" -#define BURST 32#define REORDER_BUFFER_SIZE 16384#define NUM_MBUFS (2*REORDER_BUFFER_SIZE)
@@ -390,4 +399,6 @@ test_reorder(void) return unit_test_suite_runner(&reorder_test_suite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reorder_autotest, test_reorder);
app/test/test_rib.c +20 -2
@@ -2,15 +2,31 @@* Copyright(c) 2018 Vladimir Medvedkin <[email protected]> * Copyright(c) 2019 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <rte_ip.h> -#include <rte_rib.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rib (void ) +{ +printf ("rib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_rib (void ) +{ +printf ("slow_rib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else + +#include <rte_rib.h> typedef int32_t (*rte_rib_test )(void );
@@ -363,5 +379,7 @@ test_slow_rib(void) return unit_test_suite_runner(&rib_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rib_autotest, test_rib);REGISTER_TEST_COMMAND (rib_slow_autotest, test_slow_rib);
app/test/test_rib6.c +20 -2
@@ -3,14 +3,31 @@* Copyright(c) 2019 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <rte_ip.h> -#include <rte_rib6.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rib6 (void ) +{ +printf ("rib6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_rib6 (void ) +{ +printf ("slow_rib6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else + +#include <rte_rib6.h> typedef int32_t (*rte_rib6_test )(void );
@@ -368,5 +385,6 @@ test_slow_rib6(void) return unit_test_suite_runner(&rib6_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ REGISTER_TEST_COMMAND (rib6_autotest, test_rib6);REGISTER_TEST_COMMAND (rib6_slow_autotest, test_slow_rib6);
app/test/test_sched.c +13 -1
@@ -14,8 +14,18 @@#include <rte_ether.h> #include <rte_ip.h> #include <rte_byteorder.h> -#include <rte_sched.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_sched (void ) +{ +printf ("sched not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_sched.h> #define SUBPORT 0#define PIPE 1
@@ -204,4 +214,6 @@ test_sched(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (sched_autotest, test_sched);
app/test/test_security.c +15 -1
@@ -1,12 +1,24 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved */ +#include "test.h" #include <rte_errno.h> #include <rte_log.h> #include <rte_memory.h> #include <rte_mempool.h> #include <rte_ether.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_security (void ) +{ +printf ("security not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_security.h> #include <rte_security_driver.h>
@@ -20,7 +32,7 @@#endif #include <rte_test.h> -#include "test.h" +/** * Security
@@ -2639,4 +2651,6 @@ test_security(void) return unit_test_suite_runner(&security_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (security_autotest, test_security);
app/test/test_table.c +13 -0
@@ -7,6 +7,17 @@#include <rte_string_fns.h> #include <string.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_table (void ) +{ +printf ("table not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include "test_table.h" #include "test_table_pipeline.h" #include "test_table_ports.h"
@@ -194,4 +205,6 @@ test_table(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (table_autotest, test_table);
app/test/test_table_acl.c +3 -0
@@ -2,6 +2,7 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS #include <rte_ip.h> #include <rte_string_fns.h> #include <rte_hexdump.h>
@@ -728,3 +729,5 @@ test_table_acl(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_combined.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2016 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include "test_table_combined.h" #include "test_table.h"
@@ -840,3 +842,5 @@ test_table_hash_cuckoo_combined(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_pipeline.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include <rte_pipeline.h> #include <rte_log.h>
@@ -569,3 +571,5 @@ test_table_pipeline(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_ports.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include "test_table_ports.h" #include "test_table.h"
@@ -189,3 +191,5 @@ test_port_ring_writer(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_tables.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2016 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include <rte_byteorder.h> #include <rte_table_lpm_ipv6.h>
@@ -1052,3 +1054,5 @@ test_table_hash_cuckoo(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_timer_secondary.c +13 -0
@@ -16,6 +16,17 @@#include <rte_random.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +int +test_timer_secondary (void ) +{ +printf ("timer_secondary not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include "process.h" #define NUM_TIMERS (1 << 20)/* ~1M timers */
@@ -213,4 +224,6 @@ test_timer_secondary(void) return TEST_FAILED; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (timer_secondary_autotest, test_timer_secondary);
app/test/test_trace.c +28 -4
@@ -9,6 +9,30 @@#include "test.h" #include "test_trace.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_trace (void ) +{ +printf ("trace not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_trace_dump (void ) +{ +printf ("trace_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_trace_metadata_dump (void ) +{ +printf ("trace_metadata_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +static int32_t test_trace_point_globbing (void ) {
@@ -194,8 +218,6 @@ test_trace(void)return unit_test_suite_runner (&trace_tests); } -REGISTER_TEST_COMMAND (trace_autotest, test_trace); -static int test_trace_dump (void ) {
@@ -203,12 +225,14 @@ test_trace_dump(void) return 0; } -REGISTER_TEST_COMMAND (trace_dump, test_trace_dump); -static int test_trace_metadata_dump (void ) {return rte_trace_metadata_dump (stdout); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + +REGISTER_TEST_COMMAND (trace_autotest, test_trace); +REGISTER_TEST_COMMAND (trace_dump, test_trace_dump);REGISTER_TEST_COMMAND (trace_metadata_dump, test_trace_metadata_dump);
Signature · 1 line
2.32.0.windows.2
v7 cover app/test: enable subset of tests on Windows
In reply to Jie ZhouThis patchset is to enable a subset of unit tests on windows. It mainly includes:
- Replace POSIX specific codes
- Fix some lib and tests per failures investigation
- Replace .sh script with .py script for meson.build
- Enable build and run subset of unit tests on Windows
Future work:
- Work with CI/CD lab to onboard unit tests on Windows to catch regression
- Onboard more tests when more libraries are enabled on Windows
---
V2 changes:
- Fix compilation error on FreeBSD
- Fix email mismatch issue
- Add a missing space around "*"
---
V3 changes:
- Fix a misc c coding style issue
- Revise some commit title and message body
- Fix violations of PEP8 in new added Python scripts
- Add error handling in get_coremask.py
- Fix has_hugepage.py to check system support of hugepages instead of checking privileges
- Fix test meson.build to run Python scripts using py3
- Consolidate lists of source files, test dep, etc. across all platforms, with conditional extending on some platform(s)
---
V4 changes:
- Remove building of ip_frag, rib, and reorder libraries on Windows. These three libs usually can be built on Windows without change. However, in between the time of V3 and V4, there is regression in upstream caused build failures of these three libs. Will separately investigate and enable these libraries.
- Remove previous patch#2 (Enable mempool/stack on Windows) from this patchset as it was separated out and merged as patch-19314.
- Consolidate the source files, deps, tests lists across platforms as much as possible.
---
V5 changes:
- Remove a space between function name and open parenthesis '('
- Add back a header mistakenly deleted
---
V6 changes:
- Fix inconsistent static vs. non-static declarations
---
V7 changes:
- Remove get_coremask.py as it is not needed any more in meson.build
- Remove enablement of efd and lpm and their corresponding unit tests. The enablement of these two libs and their UTs will be in separate patches after this patch set.
Jie Zhou (11):
eal/windows: return ENOTSUP for not supported API app/test: remove unnecessary headers app/test: replace POSIX specific code app/test: exclude ENOTSUP as failure app/test: skip interrupt tests on Windows app/test: temporarily "skip" one cmdline test case app/test: skip two logs_autotest cases on Windows app/test: differentiate a strerror on different OS app/test: remove two alarm_autotest cases app/test: replace .sh scripts with .py scripts app/test: enable subset of unit tests on Windows
app/test/commands.c | 2 - app/test/has-hugepage.sh | 11 --- app/test/has_hugepage.py | 25 +++++ app/test/meson.build | 116 ++++++++++++----------- app/test/packet_burst_generator.c | 1 + app/test/process.h | 4 +- app/test/test.c | 5 +- app/test/test_acl.c | 12 +++ app/test/test_alarm.c | 4 + app/test/test_bpf.c | 15 ++- app/test/test_byteorder.c | 2 +- app/test/test_cksum.c | 12 +++ app/test/test_cmdline.c | 2 + app/test/test_cmdline_ipaddr.c | 5 + app/test/test_cmdline_lib.c | 5 +- app/test/test_crc.c | 1 - app/test/test_cryptodev.c | 4 + app/test/test_cryptodev_asym.c | 4 + app/test/test_cryptodev_blockcipher.c | 4 + app/test/test_cryptodev_security_ipsec.c | 4 + app/test/test_cryptodev_security_pdcp.c | 4 + app/test/test_debug.c | 17 +++- app/test/test_distributor.c | 13 +++ app/test/test_distributor_perf.c | 13 +++ app/test/test_dmadev.c | 14 ++- app/test/test_dmadev_api.c | 4 + app/test/test_eal_flags.c | 97 +++++++++++++++++++ app/test/test_eal_fs.c | 12 +++ app/test/test_efd.c | 15 ++- app/test/test_efd_perf.c | 16 +++- app/test/test_errno.c | 12 ++- app/test/test_event_crypto_adapter.c | 15 ++- app/test/test_event_eth_rx_adapter.c | 25 ++++- app/test/test_event_eth_tx_adapter.c | 12 +++ app/test/test_event_ring.c | 16 +++- app/test/test_event_timer_adapter.c | 16 +++- app/test/test_eventdev.c | 20 +++- app/test/test_external_mem.c | 18 +++- app/test/test_fib.c | 22 ++++- app/test/test_fib6.c | 24 ++++- app/test/test_fib6_perf.c | 16 +++- app/test/test_fib_perf.c | 15 ++- app/test/test_flow_classify.c | 13 +++ app/test/test_func_reentrancy.c | 12 +++ app/test/test_graph.c | 18 +++- app/test/test_graph_perf.c | 16 +++- app/test/test_hash_perf.c | 12 +++ app/test/test_interrupts.c | 10 ++ app/test/test_ipfrag.c | 16 +++- app/test/test_ipsec.c | 15 ++- app/test/test_ipsec_perf.c | 15 ++- app/test/test_ipsec_sad.c | 14 ++- app/test/test_kni.c | 10 +- app/test/test_lcores.c | 12 +++ app/test/test_logs.c | 6 +- app/test/test_lpm.c | 14 ++- app/test/test_lpm6.c | 14 ++- app/test/test_lpm6_perf.c | 14 ++- app/test/test_lpm_perf.c | 13 ++- app/test/test_malloc.c | 17 +++- app/test/test_mbuf.c | 13 ++- app/test/test_member.c | 16 +++- app/test/test_member_perf.c | 16 +++- app/test/test_memcpy_perf.c | 18 +++- app/test/test_memory.c | 3 +- app/test/test_mempool_perf.c | 12 +++ app/test/test_mp_secondary.c | 13 +++ app/test/test_pmd_perf.c | 6 +- app/test/test_rawdev.c | 17 +++- app/test/test_rcu_qsbr_perf.c | 12 +++ app/test/test_reciprocal_division.c | 12 +++ app/test/test_reciprocal_division_perf.c | 12 +++ app/test/test_red.c | 29 +++++- app/test/test_reorder.c | 15 ++- app/test/test_rib.c | 22 ++++- app/test/test_rib6.c | 22 ++++- app/test/test_ring_stress.c | 3 +- app/test/test_ring_stress_impl.h | 2 +- app/test/test_sched.c | 14 ++- app/test/test_security.c | 16 +++- app/test/test_table.c | 13 +++ app/test/test_table_acl.c | 3 + app/test/test_table_combined.c | 4 + app/test/test_table_pipeline.c | 4 + app/test/test_table_ports.c | 4 + app/test/test_table_tables.c | 4 + app/test/test_telemetry_data.c | 2 + app/test/test_timer_secondary.c | 13 +++ app/test/test_trace.c | 32 ++++++- lib/eal/common/eal_common_errno.c | 4 + lib/eal/windows/eal_memalloc.c | 6 +- 91 files changed, 1105 insertions(+), 152 deletions(-) delete mode 100755 app/test/has-hugepage.sh create mode 100644 app/test/has_hugepage.py
Signature · 1 line
2.32.0.windows.2
PATCH v7 1/11 eal/windows: return ENOTSUP for not supported API
UT memory_autotest on Windows has 2 failed cases on eal APIs eal_memalloc_get_seg_fd and eal_memalloc_get_seg_fd_offset. These 2 APIs are not supported on Windows yet. Should return ENOTSUP such that in test_memory.c these 2 ENOTSUP cases will not be marked as failures, same as other ENOTSUP cases.
--- lib/eal/windows/eal_memalloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/eal/windows/eal_memalloc.c +3 -3
@@ -17,7 +17,7 @@ eal_memalloc_get_seg_fd(int list_idx, int seg_idx)RTE_SET_USED (list_idx);RTE_SET_USED (seg_idx);EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; }int
@@ -28,7 +28,7 @@ eal_memalloc_get_seg_fd_offset(int list_idx, int seg_idx, size_t *offset)RTE_SET_USED (seg_idx);RTE_SET_USED (offset);EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; } static int
@@ -428,7 +428,7 @@ eal_memalloc_sync_with_primary(void) {/* No multi-process support. */ EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; }int
Signature · 1 line
2.32.0.windows.2
PATCH v7 2/11 app/test: remove unnecessary headers
In reply to Jie ZhouRemove unnecessary header inclusion
--- app/test/commands.c | 2 -- app/test/test.c | 1 - app/test/test_cmdline_lib.c | 1 - 3 files changed, 4 deletions(-)
app/test/commands.c +0 -2
@@ -8,8 +8,6 @@#include <stdint.h> #include <string.h> #include <stdlib.h> -#include <netinet/in.h> -#include <termios.h> #include <inttypes.h> #include <errno.h> #include <sys/queue.h>
app/test/test.c +0 -1
@@ -8,7 +8,6 @@#include <stdarg.h> #include <stdlib.h> #include <errno.h> -#include <termios.h> #include <ctype.h> #include <sys/queue.h>
app/test/test_cmdline_lib.c +0 -1
@@ -8,7 +8,6 @@#include <stdarg.h> #include <stdlib.h> #include <errno.h> -#include <termios.h> #include <ctype.h> #include <sys/queue.h>
Signature · 1 line
2.32.0.windows.2
PATCH v7 3/11 app/test: replace POSIX specific code
In reply to Jie Zhou- Include rte_os_shim.h
- Replace sleep and usleep with rte_delay_us_sleep
- #ifndef RTE_EXEC_ENV_WINDOWS for POSIX code only
--- app/test/packet_burst_generator.c | 1 + app/test/process.h | 4 +++- app/test/test.c | 4 ++++ app/test/test_byteorder.c | 2 +- app/test/test_cmdline.c | 2 ++ app/test/test_crc.c | 1 - app/test/test_mp_secondary.c | 2 ++ app/test/test_pmd_perf.c | 6 +++++- app/test/test_ring_stress.c | 3 ++- app/test/test_ring_stress_impl.h | 2 +- app/test/test_telemetry_data.c | 2 ++ 11 files changed, 23 insertions(+), 6 deletions(-)
app/test/packet_burst_generator.c +1 -0
@@ -5,6 +5,7 @@#include <rte_byteorder.h> #include <rte_mbuf.h> #include <rte_ip.h> +#include <rte_os_shim.h> #include "packet_burst_generator.h"
app/test/process.h +3 -1
@@ -7,12 +7,14 @@#include <errno.h> /* errno */ #include <limits.h> /* PATH_MAX */ +#ifndef RTE_EXEC_ENV_WINDOWS #include <libgen.h> /* basename et al */ +#include <sys/wait.h> +#endif #include <stdlib.h> /* NULL */ #include <string.h> /* strerror */ #include <unistd.h> /* readlink */ #include <dirent.h> -#include <sys/wait.h> #include <rte_string_fns.h> /* strlcpy */
app/test/test.c +4 -0
@@ -62,7 +62,9 @@ do_recursive_call(void)const char *env_var;int (*action_fn)(void ); } actions[] = { +#ifndef RTE_EXEC_ENV_WINDOWS { "run_secondary_instances", test_mp_secondary }, +#endif #ifdef RTE_LIB_PDUMP #ifdef RTE_NET_RING { "run_pdump_server_tests", test_pdump },
@@ -81,7 +83,9 @@ do_recursive_call(void) { "test_file_prefix", no_action }, { "test_no_huge_flag", no_action }, #ifdef RTE_LIB_TIMER +#ifndef RTE_EXEC_ENV_WINDOWS { "timer_secondary_spawn_wait", test_timer_secondary }, +#endif #endif };
app/test/test_byteorder.c +1 -1
@@ -46,7 +46,7 @@ test_byteorder(void)return -1 ; res_u16 =rte_bswap16 (0x1337 ); -printf ("const %" PRIx16" -> %" PRIx16"\n" ,0x1337 , res_u16); +printf ("const %" PRIx16" -> %" PRIx16"\n" , (uint16_t )0x1337 , res_u16);if (res_u16 !=0x3713 )return -1 ;
app/test/test_cmdline.c +2 -0
@@ -31,6 +31,7 @@ test_cmdline(void)return -1 ;if (test_parse_num_invalid_param () <0 )return -1 ; +#ifndef RTE_EXEC_ENV_WINDOWS printf ("Testing parsing IP addresses...\n" );if (test_parse_ipaddr_valid () <0 )return -1 ;
@@ -38,6 +39,7 @@ test_cmdline(void)return -1 ;if (test_parse_ipaddr_invalid_param () <0 )return -1 ; +#endif printf ("Testing parsing strings...\n" );if (test_parse_string_valid () <0 )return -1 ;
app/test/test_crc.c +0 -1
@@ -14,7 +14,6 @@#define CRC32_VEC_LEN2 348#define CRC16_VEC_LEN1 12#define CRC16_VEC_LEN2 2 -#define LINE_LEN 75/* CRC test vector */ static const uint8_t crc_vec[CRC_VEC_LEN ] = {
app/test/test_mp_secondary.c +2 -0
@@ -14,7 +14,9 @@#include <errno.h> #include <string.h> #include <unistd.h> +#ifndef RTE_EXEC_ENV_WINDOWS #include <sys/wait.h> +#endif #include <libgen.h> #include <dirent.h> #include <limits.h>
app/test/test_pmd_perf.c +5 -1
@@ -297,6 +297,7 @@ reset_count(void) idle =0 ; } +#ifndef RTE_EXEC_ENV_WINDOWS static void stats_display (uint16_t port_id) {
@@ -326,6 +327,7 @@ signal_handler(int signum)if (signum ==SIGUSR2 ) stats_display(0); } +#endif struct rte_mbuf **tx_burst;
@@ -637,7 +639,7 @@ exec_burst(uint32_t flags, int lcore) i = (i >= conf->nb_ports -1 ) ?0 : (i +1 ); } -sleep (5 ); +rte_delay_us (5 *US_PER_S );/* only when polling second */ if (flags ==SC_BURST_XMIT_FIRST )
@@ -668,8 +670,10 @@ test_pmd_perf(void)printf ("Start PMD RXTX cycles cost test.\n" ); +#ifndef RTE_EXEC_ENV_WINDOWS signal (SIGUSR1 , signal_handler);signal (SIGUSR2 , signal_handler); +#endif nb_ports =rte_eth_dev_count_avail ();if (nb_ports <NB_ETHPORTS_USED ) {
app/test/test_ring_stress.c +2 -1
@@ -43,9 +43,10 @@ test_ring_stress(void) n += test_ring_rts_stress.nb_case; k +=run_test (&test_ring_rts_stress); +#ifndef RTE_EXEC_ENV_WINDOWS n += test_ring_hts_stress.nb_case; k +=run_test (&test_ring_hts_stress); - +#endif n += test_ring_mt_peek_stress.nb_case; k +=run_test (&test_ring_mt_peek_stress);
app/test/test_ring_stress_impl.h +1 -1
@@ -360,7 +360,7 @@ test_mt1(int (*test)(void *))/* signal worker to start test */ __atomic_store_n (&wrk_cmd,WRK_CMD_RUN , __ATOMIC_RELEASE); -usleep (run_time *US_PER_S ); +rte_delay_us (run_time *US_PER_S );/* signal worker to start test */ __atomic_store_n (&wrk_cmd,WRK_CMD_STOP , __ATOMIC_RELEASE);
app/test/test_telemetry_data.c +2 -0
@@ -4,7 +4,9 @@#include <string.h> #include <sys/socket.h> +#ifndef RTE_EXEC_ENV_WINDOWS #include <sys/un.h> +#endif #include <unistd.h> #include <limits.h>
Signature · 1 line
2.32.0.windows.2
PATCH v7 4/11 app/test: exclude ENOTSUP as failure
In reply to Jie ZhouCheck rte_errno to exclude ENOTSUP as failures in test_memory.c
--- app/test/test_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
app/test/test_memory.c +2 -1
@@ -10,6 +10,7 @@#include <rte_memory.h> #include <rte_common.h> #include <rte_memzone.h> +#include <rte_errno.h> #include "test.h"
@@ -63,7 +64,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,/* we're able to get memseg fd - try getting its offset */ ret =rte_memseg_get_fd_offset_thread_unsafe (ms, &offset);if (ret <0 ) { -if (errno ==ENOTSUP ) +if (rte_errno ==ENOTSUP )return 1 ;return -1 ; }
Signature · 1 line
2.32.0.windows.2
PATCH v7 5/11 app/test: skip interrupt tests on Windows
In reply to Jie ZhouEven though test_interrupts.c can compile on Windows, skip interrupt tests for now since majority of eal_interrupt on Windows are stubs. Will remove the skip after interrupt being fully enabled on Windows.
--- app/test/test_interrupts.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
app/test/test_interrupts.c +10 -0
@@ -12,6 +12,15 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_interrupt (void ) +{ +printf ("Interrupt on Windows is not fully supported yet, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#define TEST_INTERRUPT_CHECK_INTERVAL 100/* ms */ /* predefined interrupt handle types */
@@ -590,5 +599,6 @@ test_interrupt(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ REGISTER_TEST_COMMAND (interrupt_autotest, test_interrupt);
Signature · 1 line
2.32.0.windows.2
PATCH v7 6/11 app/test: temporarily "skip" one cmdline test case
In reply to Jie Zhoucmdline tests pass except one failure at the test_cmdline_socket_fns test case with error: failed to open /dev/null for reading!
Temporarily "skip" this case while enable all other passing cases.
Issue is tracked internally and will add the corresponding case on Windows in future.
--- app/test/test_cmdline_lib.c | 4 ++++ 1 file changed, 4 insertions(+)
app/test/test_cmdline_lib.c +4 -0
@@ -146,6 +146,9 @@ test_cmdline_vt100_fns(void)static int test_cmdline_socket_fns (void ) { +#ifdef RTE_EXEC_ENV_WINDOWS +return 0 ; +#else cmdline_parse_ctx_t ctx;struct cmdline *cl;
@@ -184,6 +187,7 @@ test_cmdline_socket_fns(void)printf ("Error: function accepted null parameter!\n" );cmdline_free (cl);return -1 ; +#endif } static int
Signature · 1 line
2.32.0.windows.2
PATCH v7 7/11 app/test: skip two logs_autotest cases on Windows
In reply to Jie ZhouDPDK logs_autotest on Windows failed at "dynamic log types" tests. The failures are on 2 test cases for rte_log_set_level_regexp API, due to regular expression is not supported on Windows in DPDK yet and regcomp/regexec are just stubs on Windows (in regex.h).
In app\test\test_logs.c, ifndef these two test cases, and for the rte_log_set_level_pattern validation case following these two cases, differentiate the expected log level passed into macro CHECK_LEVELS
Now logs_autotest completes for all dynamic log types and static log types.
--- app/test/test_logs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
app/test/test_logs.c +5 -1
@@ -113,6 +113,7 @@ test_logs(void)rte_log_set_level (logtype1,RTE_LOG_ERR );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR ); +#ifndef RTE_EXEC_ENV_WINDOWS rte_log_set_level_regexp ("type$" ,RTE_LOG_EMERG );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR );
@@ -121,7 +122,10 @@ test_logs(void)rte_log_set_level_pattern ("logtype" ,RTE_LOG_DEBUG );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_EMERG ,RTE_LOG_EMERG ); - +#else + ret =rte_log_set_level_pattern ("logtype" ,RTE_LOG_DEBUG ); +CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR ); +#endif /* set logtype level low to so we can test global level */ rte_log_set_level_pattern ("logtype*" ,RTE_LOG_DEBUG );CHECK_LEVELS (RTE_LOG_DEBUG ,RTE_LOG_DEBUG ,RTE_LOG_DEBUG );
Signature · 1 line
2.32.0.windows.2
PATCH v7 8/11 app/test: differentiate a strerror on different OS
In reply to Jie ZhouOn Windows, strerror returns just "Unknown error" for errnum greater than MAX_ERRNO, while linux and freebsd returns "Unknown error <num>", which is the current expectation for errno_autotest. Differentiate the error string on Windows to remove a "duplicate error code" failure.
--- app/test/test_errno.c | 12 +++++++++++- lib/eal/common/eal_common_errno.c | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-)
app/test/test_errno.c +11 -1
@@ -18,13 +18,19 @@ test_errno(void) {const char *rte_retval;const char *libc_retval; + +#ifndef RTE_EXEC_ENV_WINDOWS #ifdef RTE_EXEC_ENV_FREEBSD /* BSD has a colon in the string, unlike linux */ const char unknown_code_result[] ="Unknown error: %d" ;#else const char unknown_code_result[] ="Unknown error %d" ;#endif -char expected_libc_retval[sizeof (unknown_code_result)+3 ]; +char expected_libc_retval[sizeof (unknown_code_result) +3 ]; +#else +/* Windows doesn't return error number for error greater than MAX_errno*/ +static const char expected_libc_retval[] ="Unknown error" ; +#endif /* use a small selection of standard errors for testing */ int std_errs[] = {EAGAIN ,EBADF ,EACCES ,EINTR ,EINVAL };
@@ -54,11 +60,13 @@ test_errno(void) rte_retval, libc_retval);if (strcmp (rte_retval, libc_retval) ==0 )return -1 ; +#ifndef RTE_EXEC_ENV_WINDOWS /* generate appropriate error string for unknown error number * and then check that this is what we got back. If not, we have * a duplicate error number that conflicts with errno.h */ snprintf (expected_libc_retval,sizeof (expected_libc_retval), unknown_code_result, rte_errs[i]); +#endif if ((strcmp (expected_libc_retval, libc_retval) !=0 ) && (strcmp ("" , libc_retval) !=0 )){printf ("Error, duplicate error code %d\n" , rte_errs[i]);
@@ -69,8 +77,10 @@ test_errno(void)/* ensure that beyond RTE_MAX_ERRNO, we always get an unknown code */ rte_retval =rte_strerror (RTE_MAX_ERRNO +1 ); libc_retval =strerror (RTE_MAX_ERRNO +1 ); +#ifndef RTE_EXEC_ENV_WINDOWS snprintf (expected_libc_retval,sizeof (expected_libc_retval), unknown_code_result,RTE_MAX_ERRNO +1 ); +#endif printf ("rte_strerror: '%s', strerror: '%s'\n" , rte_retval, libc_retval); if ((strcmp(rte_retval, libc_retval) != 0) ||
lib/eal/common/eal_common_errno.c +4 -0
@@ -37,7 +37,11 @@ rte_strerror(int errnum)/* since some implementations of strerror_r throw an error * themselves if errnum is too big, we handle that case here */ if (errnum >= RTE_MAX_ERRNO) +#ifdef RTE_EXEC_ENV_WINDOWS +snprintf (ret,RETVAL_SZ ,"Unknown error%s" , sep); +#else snprintf (ret,RETVAL_SZ ,"Unknown error%s %d" , sep, errnum); +#endif else switch (errnum){case E_RTE_SECONDARY :
Signature · 1 line
2.32.0.windows.2
PATCH v7 9/11 app/test: remove two alarm_autotest cases
In reply to Jie ZhouRemove two alarm_autotest test cases which do bogus range check on Windows.
--- app/test/test_alarm.c | 4 ++++ 1 file changed, 4 insertions(+)
app/test/test_alarm.c +4 -0
@@ -10,6 +10,7 @@#include "test.h" +#ifndef RTE_EXEC_ENV_WINDOWS static volatile int flag; static void
@@ -18,6 +19,7 @@ test_alarm_callback(void *cb_arg) flag =1 ; printf("Callback setting flag - OK. [cb_arg = %p]\n", cb_arg); } +#endif static int test_alarm (void )
@@ -27,6 +29,7 @@ test_alarm(void)return 0 ;#endif +#ifndef RTE_EXEC_ENV_WINDOWS /* check if it will fail to set alarm with wrong us value */ printf ("check if it will fail to set alarm with wrong ms values\n" ); if (rte_eal_alarm_set(0, test_alarm_callback,
@@ -39,6 +42,7 @@ test_alarm(void)printf ("should not be successful with (UINT64_MAX-1) us value\n" ); return -1; } +#endif /* check if it will fail to set alarm with null callback parameter */ printf ("check if it will fail to set alarm with null callback parameter\n" );
Signature · 1 line
2.32.0.windows.2
PATCH v7 10/11 app/test: replace .sh scripts with .py scripts
In reply to Jie Zhou- Add python script to check if system supports hugepages
- Remove corresponding .sh scripts
- Replace calling of .sh with corresponding .py in meson.build
--- app/test/has-hugepage.sh | 11 ----------- app/test/has_hugepage.py | 25 +++++++++++++++++++++++++ app/test/meson.build | 2 +- 3 files changed, 26 insertions(+), 12 deletions(-) delete mode 100755 app/test/has-hugepage.sh create mode 100644 app/test/has_hugepage.py
app/test/has-hugepage.sh deleted +0 -11
@@ -1,11 +0,0 @@ -#! /bin/sh -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2020 Mellanox Technologies, Ltd - -if [ "$(uname)" = "Linux" ] ; then - cat /proc/sys/vm/nr_hugepages || echo 0 -elif [ "$(uname)" = "FreeBSD" ] ; then - echo 1 # assume FreeBSD always has hugepages -else - echo 0 -fi
app/test/has_hugepage.py new file +25 -0
@@ -0,0 +1,25 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021 Microsoft Corporation +"""This script checks if the system supports huge pages""" + +import platform +import ctypes + +osName = platform.system() +if osName == "Linux": + with open("/proc/sys/vm/nr_hugepages") as file_o: + content = file_o.read() + print(content) +elif osName == "FreeBSD": + # Assume FreeBSD always has hugepages enabled + print("1") +elif osName == "Windows": + # On Windows, determine if large page is supported based on the + # value returned by GetLargePageMinimum. If the return value is zero, + # the processor does not support large pages. + if ctypes.windll.kernel32.GetLargePageMinimum() > 0: + print("1") + else: + print("0") +else: + print("0")
app/test/meson.build +1 -1
@@ -463,7 +463,7 @@ dpdk_test = executable('dpdk-test', driver_install_path), install: true) -has_hugepage = run_command('has-hugepage.sh').stdout().strip() != '0' +has_hugepage = run_command(py3, 'has_hugepage.py').stdout().strip() != '0' message('hugepage availability: @0@'.format(has_hugepage)) # some perf tests (eg: memcpy perf autotest)take very long
Signature · 1 line
2.32.0.windows.2
PATCH v7 11/11 app/test: enable subset of unit tests on Windows
In reply to Jie Zhou- For fast tests and perf tests, add test stubs to skip not supported ones.
- For driver tests, for now skip on Windows totally to avoid unnecessary amount of test stubs. For example, there are about 30 cryptodev related tests (even though in the meson for CI it only listed about half) which will be enabled by "patch-18949: app/test:
enable crypto unit tests on Windows".
- For dump tests, currently the tests hang on Windows which require further investigation. Keep the dump test list just for non-Windows for easier tracking.
--- app/test/meson.build | 114 ++++++++++++----------- app/test/test_acl.c | 12 +++ app/test/test_bpf.c | 15 ++- app/test/test_cksum.c | 12 +++ app/test/test_cmdline_ipaddr.c | 5 + app/test/test_cryptodev.c | 4 + app/test/test_cryptodev_asym.c | 4 + app/test/test_cryptodev_blockcipher.c | 4 + app/test/test_cryptodev_security_ipsec.c | 4 + app/test/test_cryptodev_security_pdcp.c | 4 + app/test/test_debug.c | 17 +++- app/test/test_distributor.c | 13 +++ app/test/test_distributor_perf.c | 13 +++ app/test/test_dmadev.c | 14 ++- app/test/test_dmadev_api.c | 4 + app/test/test_eal_flags.c | 97 +++++++++++++++++++ app/test/test_eal_fs.c | 12 +++ app/test/test_efd.c | 15 ++- app/test/test_efd_perf.c | 16 +++- app/test/test_event_crypto_adapter.c | 15 ++- app/test/test_event_eth_rx_adapter.c | 25 ++++- app/test/test_event_eth_tx_adapter.c | 12 +++ app/test/test_event_ring.c | 16 +++- app/test/test_event_timer_adapter.c | 16 +++- app/test/test_eventdev.c | 20 +++- app/test/test_external_mem.c | 18 +++- app/test/test_fib.c | 22 ++++- app/test/test_fib6.c | 24 ++++- app/test/test_fib6_perf.c | 16 +++- app/test/test_fib_perf.c | 15 ++- app/test/test_flow_classify.c | 13 +++ app/test/test_func_reentrancy.c | 12 +++ app/test/test_graph.c | 18 +++- app/test/test_graph_perf.c | 16 +++- app/test/test_hash_perf.c | 12 +++ app/test/test_ipfrag.c | 16 +++- app/test/test_ipsec.c | 15 ++- app/test/test_ipsec_perf.c | 15 ++- app/test/test_ipsec_sad.c | 14 ++- app/test/test_kni.c | 10 +- app/test/test_lcores.c | 12 +++ app/test/test_lpm.c | 14 ++- app/test/test_lpm6.c | 14 ++- app/test/test_lpm6_perf.c | 14 ++- app/test/test_lpm_perf.c | 13 ++- app/test/test_malloc.c | 17 +++- app/test/test_mbuf.c | 13 ++- app/test/test_member.c | 16 +++- app/test/test_member_perf.c | 16 +++- app/test/test_memcpy_perf.c | 18 +++- app/test/test_mempool_perf.c | 12 +++ app/test/test_mp_secondary.c | 15 ++- app/test/test_rawdev.c | 17 +++- app/test/test_rcu_qsbr_perf.c | 12 +++ app/test/test_reciprocal_division.c | 12 +++ app/test/test_reciprocal_division_perf.c | 12 +++ app/test/test_red.c | 29 +++++- app/test/test_reorder.c | 15 ++- app/test/test_rib.c | 22 ++++- app/test/test_rib6.c | 22 ++++- app/test/test_sched.c | 14 ++- app/test/test_security.c | 16 +++- app/test/test_table.c | 13 +++ app/test/test_table_acl.c | 3 + app/test/test_table_combined.c | 4 + app/test/test_table_pipeline.c | 4 + app/test/test_table_ports.c | 4 + app/test/test_table_tables.c | 4 + app/test/test_timer_secondary.c | 13 +++ app/test/test_trace.c | 32 ++++++- 70 files changed, 1015 insertions(+), 126 deletions(-)
app/test/meson.build +59 -55
@@ -1,12 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() -endif - if not get_option('tests') subdir_done() endif
@@ -157,37 +151,17 @@ test_sources = files( ) test_deps = [ - 'acl', 'bus_pci', 'bus_vdev', 'bitratestats', - 'bpf', 'cfgfile', 'cmdline', - 'cryptodev', - 'distributor', - 'dmadev', - 'efd', 'ethdev', - 'eventdev', - 'fib', - 'flow_classify', - 'graph', 'hash', - 'ipsec', 'latencystats', - 'lpm', - 'member', 'metrics', - 'node', - 'pipeline', - 'port', - 'rawdev', 'rcu', - 'reorder', - 'rib', 'ring', - 'security', 'stack', 'telemetry', 'timer',
@@ -325,39 +299,69 @@ perf_test_names = [ ] driver_test_names = [ - 'cryptodev_aesni_mb_autotest', - 'cryptodev_aesni_gcm_autotest', - 'cryptodev_cn9k_autotest', - 'cryptodev_cn10k_autotest', - 'cryptodev_dpaa_sec_autotest', - 'cryptodev_dpaa2_sec_autotest', - 'cryptodev_null_autotest', - 'cryptodev_octeontx2_autotest', - 'cryptodev_openssl_autotest', - 'cryptodev_openssl_asym_autotest', - 'cryptodev_qat_autotest', - 'cryptodev_sw_armv8_autotest', - 'cryptodev_sw_kasumi_autotest', - 'cryptodev_sw_mvsam_autotest', - 'cryptodev_sw_snow3g_autotest', - 'cryptodev_sw_zuc_autotest', - 'dmadev_autotest', - 'eventdev_selftest_octeontx', - 'eventdev_selftest_sw', - 'rawdev_autotest', ] dump_test_names = [ - 'dump_struct_sizes', - 'dump_mempool', - 'dump_malloc_stats', - 'dump_devargs', - 'dump_log_types', - 'dump_ring', - 'dump_physmem', - 'dump_memzone', ] +if not is_windows + test_deps += [ + 'acl', + 'bpf', + 'cryptodev', + 'distributor', + 'dmadev', + 'efd', + 'eventdev', + 'fib', + 'flow_classify', + 'graph', + 'ipsec', + 'lpm', + 'member', + 'node', + 'pipeline', + 'port', + 'rawdev', + 'reorder', + 'rib', + 'security', + ] + + driver_test_names += [ + 'cryptodev_aesni_mb_autotest', + 'cryptodev_aesni_gcm_autotest', + 'cryptodev_cn9k_autotest', + 'cryptodev_cn10k_autotest', + 'cryptodev_dpaa_sec_autotest', + 'cryptodev_dpaa2_sec_autotest', + 'cryptodev_null_autotest', + 'cryptodev_octeontx2_autotest', + 'cryptodev_openssl_autotest', + 'cryptodev_openssl_asym_autotest', + 'cryptodev_qat_autotest', + 'cryptodev_sw_armv8_autotest', + 'cryptodev_sw_kasumi_autotest', + 'cryptodev_sw_mvsam_autotest', + 'cryptodev_sw_snow3g_autotest', + 'cryptodev_sw_zuc_autotest', + 'eventdev_selftest_octeontx', + 'eventdev_selftest_sw', + 'rawdev_autotest', + ] + + dump_test_names += [ + 'dump_struct_sizes', + 'dump_mempool', + 'dump_malloc_stats', + 'dump_devargs', + 'dump_log_types', + 'dump_ring', + 'dump_physmem', + 'dump_memzone', + ] +endif + # The following linkages are an exception to allow running the # unit tests without requiring that the developer install the # DPDK libraries. Explicit linkage of drivers (plugin libraries)
@@ -371,7 +375,7 @@ endif if dpdk_conf.has('RTE_EVENT_SKELETON') test_deps += 'event_skeleton' endif -if dpdk_conf.has('RTE_LIB_TELEMETRY') +if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY') test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c'] fast_tests += [['telemetry_json_autotest', true], ['telemetry_data_autotest', true]] endif
app/test/test_acl.c +12 -0
@@ -11,6 +11,16 @@#include <rte_mbuf.h> #include <rte_byteorder.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_acl (void ) +{ +printf ("acl not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <rte_acl.h> #include <rte_common.h>
@@ -1741,4 +1751,6 @@ test_acl(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (acl_autotest, test_acl);
app/test/test_bpf.c +14 -1
@@ -14,11 +14,22 @@#include <rte_random.h> #include <rte_byteorder.h> #include <rte_errno.h> +#include "test.h" + +#if !defined(RTE_LIB_BPF ) + +static int +test_bpf (void ) +{ +printf ("BPF not supported, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <rte_bpf.h> #include <rte_ether.h> #include <rte_ip.h> -#include "test.h" /* * Basic functional tests for librte_bpf.
@@ -3248,6 +3259,8 @@ test_bpf(void) return rc; } +#endif +REGISTER_TEST_COMMAND (bpf_autotest, test_bpf);#ifdef RTE_PORT_PCAP
app/test/test_cksum.c +12 -0
@@ -13,6 +13,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_cksum (void ) +{ +printf ("cksum not supported, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MEMPOOL_CACHE_SIZE 0#define MBUF_DATA_SIZE 256#define NB_MBUF 128
@@ -268,4 +278,6 @@ test_cksum(void) }#undef GOTO_FAIL +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (cksum_autotest, test_cksum);
app/test/test_cmdline_ipaddr.c +5 -0
@@ -2,9 +2,12 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <stdio.h> #include <string.h> #include <inttypes.h> +#include <netinet/in.h> #include <sys/socket.h>
@@ -669,3 +672,5 @@ test_parse_ipaddr_invalid_param(void) }return 0 ; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev.c +4 -0
@@ -3,6 +3,8 @@* Copyright 2020 NXP */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <time.h> #include <rte_common.h>
@@ -15715,3 +15717,5 @@ REGISTER_TEST_COMMAND(cryptodev_nitrox_autotest, test_cryptodev_nitrox);REGISTER_TEST_COMMAND (cryptodev_bcmfs_autotest, test_cryptodev_bcmfs);REGISTER_TEST_COMMAND (cryptodev_cn9k_autotest, test_cryptodev_cn9k);REGISTER_TEST_COMMAND (cryptodev_cn10k_autotest, test_cryptodev_cn10k); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_asym.c +4 -0
@@ -3,6 +3,8 @@* Copyright (c) 2019 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_bus_vdev.h> #include <rte_common.h> #include <rte_hexdump.h>
@@ -2429,3 +2431,5 @@ REGISTER_TEST_COMMAND(cryptodev_octeontx2_asym_autotest, test_cryptodev_octeontx2_asym);REGISTER_TEST_COMMAND (cryptodev_cn9k_asym_autotest, test_cryptodev_cn9k_asym);REGISTER_TEST_COMMAND (cryptodev_cn10k_asym_autotest, test_cryptodev_cn10k_asym); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_blockcipher.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2015-2017 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_common.h> #include <rte_hexdump.h> #include <rte_mbuf.h>
@@ -1218,3 +1220,5 @@ free_blockcipher_test_suite(struct unit_test_suite *ts) {free (ts); } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_security_ipsec.c +4 -0
@@ -2,6 +2,8 @@* Copyright(C) 2021 Marvell. */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_common.h> #include <rte_cryptodev.h> #include <rte_esp.h>
@@ -672,3 +674,5 @@ test_ipsec_status_check(struct rte_crypto_op *op, return ret; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_security_pdcp.c +4 -0
@@ -4,6 +4,8 @@* Copyright 2018-2019 NXP */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <time.h> #include <rte_common.h>
@@ -587,3 +589,5 @@ test_PDCP_PROTO_uplane_decap_all(void) return n - i; }; + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_debug.c +15 -2
@@ -2,8 +2,21 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_debug (void ) +{ +printf ("debug not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/resource.h> #include <sys/time.h> #include <sys/wait.h>
@@ -14,8 +27,6 @@#include <rte_eal.h> #include <rte_service_component.h> -#include "test.h" -/* * Debug test * ==========
@@ -127,4 +138,6 @@ test_debug(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (debug_autotest, test_debug);
app/test/test_distributor.c +13 -0
@@ -11,6 +11,17 @@#include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_mbuf_dyn.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_distributor (void ) +{ +printf ("distributor not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_distributor.h> #include <rte_string_fns.h>
@@ -939,4 +950,6 @@ test_distributor(void) return -1; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (distributor_autotest, test_distributor);
app/test/test_distributor_perf.c +13 -0
@@ -10,6 +10,17 @@#include <rte_cycles.h> #include <rte_common.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_distributor_perf (void ) +{ +printf ("distributor perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_distributor.h> #include <rte_pause.h>
@@ -267,4 +278,6 @@ test_distributor_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (distributor_perf_autotest, test_distributor_perf);
app/test/test_dmadev.c +13 -1
@@ -2,6 +2,17 @@* Copyright(c) 2021 HiSilicon Limited * Copyright(c) 2021 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_dma (void ) +{ +printf ("dma not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <inttypes.h>
@@ -13,7 +24,6 @@#include <rte_bus_vdev.h> #include <rte_dmadev_pmd.h> -#include "test.h" #include "test_dmadev_api.h" #define ERR_RETURN (...) do { print_err(__func__, __LINE__, __VA_ARGS__); return -1; } while (0)
@@ -864,4 +874,6 @@ test_dma(void) return 0; } +#endif //ifdef RTE_EXEC_ENV_WINDOWS +REGISTER_TEST_COMMAND (dmadev_autotest, test_dma);
app/test/test_dmadev_api.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2021 HiSilicon Limited */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include <rte_cycles.h>
@@ -572,3 +574,5 @@ test_dma_api(uint16_t dev_id) return 0; }; + +#endif //ifndef RTE_EXEC_ENV_WINDOWS
app/test/test_eal_flags.c +97 -0
109 lines not on this page · raw message
app/test/test_eal_fs.c +12 -0
@@ -10,6 +10,16 @@#include "eal_filesystem.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_eal_fs (void ) +{ +printf ("eal_fs not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +static int test_parse_sysfs_value (void ) {
@@ -173,4 +183,6 @@ test_eal_fs(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (eal_fs_autotest, test_eal_fs);
app/test/test_efd.c +13 -2
@@ -1,6 +1,17 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2016-2017 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_efd (void ) +{ +printf ("efd not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <rte_memcpy.h> #include <rte_malloc.h>
@@ -10,8 +21,6 @@#include <rte_debug.h> #include <rte_ip.h> -#include "test.h" -#define EFD_TEST_KEY_LEN 8#define TABLE_SIZE (1 << 21)#define ITERATIONS 3
@@ -462,4 +471,6 @@ test_efd(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (efd_autotest, test_efd);
app/test/test_efd_perf.c +14 -2
@@ -2,6 +2,18 @@* Copyright(c) 2016-2017 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_efd_perf (void ) +{ +printf ("efd_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <stdio.h> #include <inttypes.h>
@@ -13,8 +25,6 @@#include <rte_memcpy.h> #include <rte_thash.h> -#include "test.h" -#define NUM_KEYSIZES 10#define NUM_SHUFFLES 10#define MAX_KEYSIZE 64
@@ -382,4 +392,6 @@ test_efd_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (efd_perf_autotest, test_efd_perf);
app/test/test_event_crypto_adapter.c +14 -1
@@ -3,16 +3,27 @@* All rights reserved. */ +#include "test.h" #include <string.h> #include <rte_common.h> #include <rte_mempool.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_crypto_adapter (void ) +{ +printf ("event_crypto_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_cryptodev.h> #include <rte_eventdev.h> #include <rte_bus_vdev.h> #include <rte_service.h> #include <rte_event_crypto_adapter.h> -#include "test.h" #define PKT_TRACE 0#define NUM 1
@@ -1011,5 +1022,7 @@ test_event_crypto_adapter(void) return unit_test_suite_runner(&functional_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_crypto_adapter_autotest, test_event_crypto_adapter);
app/test/test_event_eth_rx_adapter.c +23 -2
@@ -1,18 +1,37 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ + +#include "test.h" +#include <string.h> #include <rte_common.h> #include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_ethdev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_eth_rx_adapter_common (void ) +{ +printf ("event_eth_rx_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_event_eth_rx_intr_adapter_common (void ) +{ +printf ("event_eth_rx_intr_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_bus_vdev.h> #include <rte_event_eth_rx_adapter.h> -#include "test.h" -#define MAX_NUM_RX_QUEUE 64#define NB_MBUFS (8192 * num_ports * MAX_NUM_RX_QUEUE)#define MBUF_CACHE_SIZE 512
@@ -967,6 +986,8 @@ test_event_eth_rx_intr_adapter_common(void)return unit_test_suite_runner (&event_eth_rx_intr_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_eth_rx_adapter_autotest, test_event_eth_rx_adapter_common); REGISTER_TEST_COMMAND(event_eth_rx_intr_adapter_autotest,
app/test/test_event_eth_tx_adapter.c +12 -0
@@ -16,6 +16,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_eth_tx_adapter_common (void ) +{ +printf ("event_eth_tx_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_NUM_QUEUE RTE_PMD_RING_MAX_RX_RINGS#define TEST_INST_ID 0#define TEST_DEV_ID 0
@@ -696,5 +706,7 @@ test_event_eth_tx_adapter_common(void) return unit_test_suite_runner(&event_eth_tx_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_eth_tx_adapter_autotest, test_event_eth_tx_adapter_common);
app/test/test_event_ring.c +14 -2
@@ -2,11 +2,21 @@* Copyright(c) 2010-2017 Intel Corporation */ +#include "test.h" +#include <string.h> -#include <rte_event_ring.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_ring (void ) +{ +printf ("event_ring not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} -#include "test.h" +#else + +#include <rte_event_ring.h> /* * Event Ring
@@ -244,4 +254,6 @@ test_event_ring(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_ring_autotest, test_event_ring);
app/test/test_event_timer_adapter.c +14 -2
@@ -2,6 +2,7 @@* Copyright(c) 2017 Cavium, Inc * Copyright(c) 2017-2018 Intel Corporation. */ +#include "test.h" #include <math.h>
@@ -11,6 +12,17 @@#include <rte_debug.h> #include <rte_eal.h> #include <rte_ethdev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_timer_adapter_func (void ) +{ +printf ("event_timer_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_event_timer_adapter.h> #include <rte_mempool.h>
@@ -22,8 +34,6 @@#include <rte_service.h> #include <stdbool.h> -#include "test.h" -/* 4K timers corresponds to sw evdev max inflight events */ #define MAX_TIMERS (4 * 1024)#define BKT_TCK_NSEC
@@ -1951,4 +1961,6 @@ test_event_timer_adapter_func(void) return unit_test_suite_runner(&event_timer_adptr_functional_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_timer_adapter_test, test_event_timer_adapter_func);
app/test/test_eventdev.c +18 -2
@@ -1,18 +1,28 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2016 Cavium, Inc */ +#include "test.h" #include <rte_common.h> #include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_memcpy.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_eventdev_common (void ) +{ +printf ("eventdev_common not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_dev.h> #include <rte_bus_vdev.h> -#include "test.h" -#define TEST_DEV_ID 0 static int
@@ -1048,7 +1058,11 @@ test_eventdev_selftest_cn10k(void) return test_eventdev_selftest_impl("event_cn10k", ""); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (eventdev_common_autotest, test_eventdev_common); + +#ifndef RTE_EXEC_ENV_WINDOWS REGISTER_TEST_COMMAND (eventdev_selftest_sw, test_eventdev_selftest_sw);REGISTER_TEST_COMMAND (eventdev_selftest_octeontx, test_eventdev_selftest_octeontx);
@@ -1058,3 +1072,5 @@ REGISTER_TEST_COMMAND(eventdev_selftest_dpaa2, test_eventdev_selftest_dpaa2);REGISTER_TEST_COMMAND (eventdev_selftest_dlb2, test_eventdev_selftest_dlb2);REGISTER_TEST_COMMAND (eventdev_selftest_cn9k, test_eventdev_selftest_cn9k);REGISTER_TEST_COMMAND (eventdev_selftest_cn10k, test_eventdev_selftest_cn10k); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_external_mem.c +16 -2
@@ -2,11 +2,25 @@* Copyright(c) 2018 Intel Corporation */ +#include "test.h" +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> + + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_external_mem (void ) +{ +printf ("external_mem not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/mman.h> #include <sys/wait.h>
@@ -19,8 +33,6 @@#include <rte_ring.h> #include <rte_string_fns.h> -#include "test.h" -#define EXTERNAL_MEM_SZ (RTE_PGSIZE_4K << 10)/* 4M of data */ static int
@@ -574,4 +586,6 @@ test_external_mem(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (external_mem_autotest, test_external_mem);
app/test/test_fib.c +21 -1
@@ -9,10 +9,28 @@#include <rte_ip.h> #include <rte_log.h> -#include <rte_fib.h> #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib (void ) +{ +printf ("fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_fib (void ) +{ +printf ("slow_fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib.h> +typedef int32_t (*rte_fib_test )(void );static int32_t test_create_invalid (void );
@@ -410,5 +428,7 @@ test_slow_fib(void) return unit_test_suite_runner(&fib_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib_autotest, test_fib);REGISTER_TEST_COMMAND (fib_slow_autotest, test_slow_fib);
app/test/test_fib6.c +22 -2
@@ -9,11 +9,29 @@#include <rte_memory.h> #include <rte_log.h> -#include <rte_rib6.h> -#include <rte_fib6.h> #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib6 (void ) +{ +printf ("fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_fib6 (void ) +{ +printf ("slow_fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_rib6.h> +#include <rte_fib6.h> +typedef int32_t (*rte_fib6_test )(void );static int32_t test_create_invalid (void );
@@ -419,5 +437,7 @@ test_slow_fib6(void) return unit_test_suite_runner(&fib6_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib6_autotest, test_fib6);REGISTER_TEST_COMMAND (fib6_slow_autotest, test_slow_fib6);
app/test/test_fib6_perf.c +15 -1
@@ -10,9 +10,21 @@#include <rte_cycles.h> #include <rte_random.h> #include <rte_memory.h> -#include <rte_fib6.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib6_perf (void ) +{ +printf ("fib6_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib6.h> +#include "test_lpm6_data.h" #define TEST_FIB_ASSERT (cond) do { \
@@ -154,4 +166,6 @@ test_fib6_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib6_perf_autotest, test_fib6_perf);
app/test/test_fib_perf.c +14 -1
@@ -12,11 +12,22 @@#include <rte_random.h> #include <rte_branch_prediction.h> #include <rte_ip.h> -#include <rte_fib.h> #include "test.h" #include "test_xmmt_ops.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib_perf (void ) +{ +printf ("fib_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib.h> +#define TEST_FIB_ASSERT (cond) do { \ if (!(cond)) { \ printf("Error at line %d:\n", __LINE__); \
@@ -408,4 +419,6 @@ test_fib_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib_perf_autotest, test_fib_perf);
app/test/test_flow_classify.c +13 -0
@@ -11,6 +11,17 @@#include <rte_mbuf.h> #include <rte_byteorder.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_flow_classify (void ) +{ +printf ("flow_classify not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_acl.h> #include <rte_common.h> #include <rte_table_acl.h>
@@ -879,4 +890,6 @@ test_flow_classify(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (flow_classify_autotest, test_flow_classify);
app/test/test_func_reentrancy.c +12 -0
@@ -41,6 +41,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_func_reentrancy (void ) +{ +printf ("reentrancy not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +typedef int (*case_func_t )(void * arg);typedef void (*case_clean_t )(unsigned lcore_id);
@@ -512,4 +522,6 @@ test_func_reentrancy(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (func_reentrancy_autotest, test_func_reentrancy);
app/test/test_graph.c +16 -2
@@ -1,6 +1,8 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2020 Marvell International Ltd. */ +#include "test.h" +#include <assert.h> #include <inttypes.h> #include <signal.h>
@@ -9,14 +11,23 @@#include <unistd.h> #include <rte_errno.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_node_list_dump (void ) +{ +printf ("node_list_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_graph.h> #include <rte_graph_worker.h> #include <rte_mbuf.h> #include <rte_mbuf_dyn.h> #include <rte_random.h> -#include "test.h" -static uint16_t test_node_worker_source (struct rte_graph *graph,struct rte_node *node,void **objs,uint16_t nb_objs);
@@ -841,4 +852,7 @@ test_node_list_dump(void) return TEST_SUCCESS; } + +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (node_list_dump, test_node_list_dump);
app/test/test_graph_perf.c +14 -2
@@ -1,6 +1,8 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2020 Marvell International Ltd. */ +#include "test.h" +#include <inttypes.h> #include <signal.h> #include <stdio.h>
@@ -9,14 +11,22 @@#include <rte_common.h> #include <rte_cycles.h> #include <rte_errno.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_graph_perf_func (void ) +{ +printf ("graph_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_graph.h> #include <rte_graph_worker.h> #include <rte_lcore.h> #include <rte_malloc.h> #include <rte_mbuf.h> -#include "test.h" -#define TEST_GRAPH_PERF_MZ "graph_perf_data"#define TEST_GRAPH_SRC_NAME "test_graph_perf_source"#define TEST_GRAPH_SRC_BRST_ONE_NAME "test_graph_perf_source_one"
@@ -1060,4 +1070,6 @@ test_graph_perf_func(void) return unit_test_suite_runner(&graph_perf_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (graph_perf_autotest, test_graph_perf_func);
app/test/test_hash_perf.c +12 -0
@@ -17,6 +17,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_hash_perf (void ) +{ +printf ("hash_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ENTRIES (1 << 19)#define KEYS_TO_ADD (MAX_ENTRIES)#define ADD_PERCENT 0.75/* 75% table utilization */
@@ -749,4 +759,6 @@ test_hash_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (hash_perf_autotest, test_hash_perf);
app/test/test_ipfrag.c +14 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Red Hat, Inc. */ +#include "test.h" #include <time.h>
@@ -8,13 +9,22 @@#include <rte_cycles.h> #include <rte_hexdump.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipfrag (void ) +{ +printf ("ipfrag not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ip_frag.h> #include <rte_mbuf.h> #include <rte_memcpy.h> #include <rte_random.h> -#include "test.h" -#define NUM_MBUFS 128#define BURST 32
@@ -259,4 +269,6 @@ test_ipfrag(void) return unit_test_suite_runner(&ipfrag_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipfrag_autotest, test_ipfrag);
app/test/test_ipsec.c +14 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2018 Intel Corporation */ +#include "test.h" #include <time.h>
@@ -13,15 +14,25 @@#include <rte_bus_vdev.h> #include <rte_ip.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipsec (void ) +{ +printf ("ipsec not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_crypto.h> #include <rte_cryptodev.h> #include <rte_lcore.h> +#include <rte_ipsec.h> #include <rte_random.h> #include <rte_esp.h> #include <rte_security_driver.h> -#include "test.h" #include "test_cryptodev.h" #define VDEV_ARGS_SIZE 100
@@ -2536,4 +2547,6 @@ test_ipsec(void) return unit_test_suite_runner(&ipsec_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_autotest, test_ipsec);
app/test/test_ipsec_perf.c +14 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <rte_ip.h>
@@ -8,10 +9,20 @@#include <rte_ring.h> #include <rte_mbuf.h> #include <rte_cycles.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_libipsec_perf (void ) +{ +printf ("ipsec_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ipsec.h> #include <rte_random.h> -#include "test.h" #include "test_cryptodev.h" #define RING_SIZE 4096
@@ -611,4 +622,6 @@ test_libipsec_perf(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_perf_autotest, test_libipsec_perf);
app/test/test_ipsec_sad.c +13 -1
@@ -1,16 +1,26 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipsec_sad (void ) +{ +printf ("ipsec_sad not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ipsec_sad.h> #include <rte_memory.h> -#include "test.h" #include "test_xmmt_ops.h" typedef int32_t (*rte_ipsec_sad_test )(void );
@@ -884,4 +894,6 @@ test_ipsec_sad(void) return unit_test_suite_runner(&ipsec_sad_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_sad_autotest, test_ipsec_sad);
app/test/test_kni.c +5 -5
@@ -2,15 +2,12 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> #include <unistd.h> #include <string.h> -#include <sys/wait.h> -#include <dirent.h> - -#include "test.h" -#if !defined(RTE_EXEC_ENV_LINUX ) || !defined(RTE_LIB_KNI ) static int
@@ -22,6 +19,9 @@ test_kni(void)#else +#include <sys/wait.h> +#include <dirent.h> +#include <rte_string_fns.h> #include <rte_mempool.h> #include <rte_ethdev.h>
app/test/test_lcores.c +12 -0
@@ -11,6 +11,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lcores(void) +{ + printf("lcore not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + struct thread_context { enum { INIT, ERROR, DONE } state; bool lcore_id_any;
@@ -411,4 +421,6 @@ test_lcores(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lcores_autotest, test_lcores);
app/test/test_lpm.c +13 -1
@@ -1,6 +1,17 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm (void ) +{ +printf ("lpm not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <stdio.h> #include <stdint.h>
@@ -10,7 +21,6 @@#include <rte_lpm.h> #include <rte_malloc.h> -#include "test.h" #include "test_xmmt_ops.h" #define TEST_LPM_ASSERT (cond) do { \
@@ -1584,4 +1594,6 @@ test_lpm(void) return global_status; } +#endif //ifdef RTE_EXEC_ENV_WINDOWS +REGISTER_TEST_COMMAND (lpm_autotest, test_lpm);
app/test/test_lpm6.c +13 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h>
@@ -8,9 +9,18 @@#include <string.h> #include <rte_memory.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm6 (void ) +{ +printf ("lpm6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_lpm6.h> -#include "test.h" #include "test_lpm6_data.h" #define TEST_LPM_ASSERT (cond) do { \
@@ -1792,4 +1802,6 @@ test_lpm6(void) return global_status; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm6_autotest, test_lpm6);
app/test/test_lpm6_perf.c +13 -1
@@ -1,6 +1,17 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm6_perf (void ) +{ +printf ("lpm6_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <stdio.h> #include <stdint.h>
@@ -12,7 +23,6 @@#include <rte_memory.h> #include <rte_lpm6.h> -#include "test.h" #include "test_lpm6_data.h" #define TEST_LPM_ASSERT (cond) do { \
@@ -160,4 +170,6 @@ test_lpm6_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm6_perf_autotest, test_lpm6_perf);
app/test/test_lpm_perf.c +12 -1
@@ -2,7 +2,17 @@* Copyright(c) 2010-2014 Intel Corporation * Copyright(c) 2020 Arm Limited */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm_perf (void ) +{ +printf ("lpm_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else #include <stdio.h> #include <stdint.h> #include <stdlib.h>
@@ -15,7 +25,6 @@#include <rte_ip.h> #include <rte_lpm.h> -#include "test.h" #include "test_xmmt_ops.h" struct rte_lpm *lpm;
@@ -763,4 +772,6 @@ test_lpm_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm_perf_autotest, test_lpm_perf);
app/test/test_malloc.c +14 -3
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2019 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h>
@@ -8,6 +9,17 @@#include <stdarg.h> #include <errno.h> #include <stdlib.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_malloc (void ) +{ +printf ("malloc not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/mman.h> #include <sys/queue.h> #include <unistd.h>
@@ -23,11 +35,8 @@#include <rte_random.h> #include <rte_string_fns.h> -#include "test.h" -#define N 10000 -static int is_mem_on_socket (int32_t socket);
@@ -1080,4 +1089,6 @@ test_malloc(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (malloc_autotest, test_malloc);
app/test/test_mbuf.c +12 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <string.h> #include <stdarg.h>
@@ -34,7 +35,15 @@#include <rte_tcp.h> #include <rte_mbuf_dyn.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_mbuf (void ) +{ +printf ("mbuf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #define MEMPOOL_CACHE_SIZE 32#define MBUF_DATA_SIZE 2048
@@ -2972,4 +2981,6 @@ test_mbuf(void) }#undef GOTO_FAIL +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (mbuf_autotest, test_mbuf);
app/test/test_member.c +14 -2
@@ -3,17 +3,27 @@*/ /* This test is for membership library's simple feature test */ +#include "test.h" #include <rte_memcpy.h> #include <rte_malloc.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_member (void ) +{ +printf ("member not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_member.h> #include <rte_byteorder.h> #include <rte_random.h> #include <rte_debug.h> #include <rte_ip.h> -#include "test.h" -struct rte_member_setsum *setsum_ht;struct rte_member_setsum *setsum_cache;struct rte_member_setsum *setsum_vbf;
@@ -712,4 +722,6 @@ test_member(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (member_autotest, test_member);
app/test/test_member_perf.c +14 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <inttypes.h>
@@ -11,9 +12,18 @@#include <rte_random.h> #include <rte_memcpy.h> #include <rte_thash.h> -#include <rte_member.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_member_perf (void ) +{ +printf ("member_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_member.h> #define NUM_KEYSIZES 10#define NUM_SHUFFLES 10
@@ -622,4 +632,6 @@ test_member_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (member_perf_autotest, test_member_perf);
app/test/test_memcpy_perf.c +15 -3
@@ -2,21 +2,31 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdint.h> #include <stdio.h> #include <string.h> #include <stdlib.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_memcpy_perf (void ) +{ +printf ("memcpy_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/time.h> #include <rte_common.h> #include <rte_cycles.h> #include <rte_random.h> #include <rte_malloc.h> -#include <rte_memcpy.h> -#include "test.h" -/* * Set this to the maximum buffer size you want to test. If it is 0, then the * values in the buf_sizes[] array below will be used.
@@ -347,4 +357,6 @@ test_memcpy_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (memcpy_perf_autotest, test_memcpy_perf);
app/test/test_mempool_perf.c +12 -0
@@ -28,6 +28,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_mempool_perf (void ) +{ +printf ("mempool_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +/* * Mempool performance * =======
@@ -393,4 +403,6 @@ test_mempool_perf(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (mempool_perf_autotest, test_mempool_perf);
app/test/test_mp_secondary.c +13 -2
@@ -14,9 +14,18 @@#include <errno.h> #include <string.h> #include <unistd.h> -#ifndef RTE_EXEC_ENV_WINDOWS + +#ifdef RTE_EXEC_ENV_WINDOWS +int +test_mp_secondary (void ) +{ +printf ("mp_secondary not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/wait.h> -#endif #include <libgen.h> #include <dirent.h> #include <limits.h>
@@ -214,4 +223,6 @@ test_mp_secondary(void) return run_object_creation_tests(); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (multiprocess_autotest, test_mp_secondary);
app/test/test_rawdev.c +15 -2
@@ -1,16 +1,27 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2017 NXP */ +#include "test.h" +#include <rte_common.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_dev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rawdev_selftests (void ) +{ +printf ("rawdev not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_rawdev.h> #include <rte_bus_vdev.h> -#include "test.h" -static int test_rawdev_selftest_impl (const char *pmd,const char *opts) {
@@ -54,4 +65,6 @@ test_rawdev_selftests(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rawdev_autotest, test_rawdev_selftests);
app/test/test_rcu_qsbr_perf.c +12 -0
@@ -15,6 +15,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rcu_qsbr_main (void ) +{ +printf ("rcu_qsbr_main not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +/* Check condition and return an error if true. */ static uint16_t enabled_core_ids[RTE_MAX_LCORE ];static unsigned int num_cores;
@@ -687,4 +697,6 @@ test_rcu_qsbr_main(void) return -1; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rcu_qsbr_perf_autotest, test_rcu_qsbr_main);
app/test/test_reciprocal_division.c +12 -0
@@ -13,6 +13,16 @@#include <rte_random.h> #include <rte_reciprocal.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reciprocal (void ) +{ +printf ("reciprocal not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ITERATIONS (1ULL << 32)#define DIVIDE_ITER (100)
@@ -164,4 +174,6 @@ test_reciprocal(void) return result; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reciprocal_division, test_reciprocal);
app/test/test_reciprocal_division_perf.c +12 -0
@@ -13,6 +13,16 @@#include <rte_random.h> #include <rte_reciprocal.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reciprocal_division_perf (void ) +{ +printf ("reciprocal_division_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ITERATIONS (1ULL << 32)#define DIVIDE_ITER (1ULL << 28)
@@ -205,4 +215,6 @@ test_reciprocal_division_perf(void) return result; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reciprocal_division_perf, test_reciprocal_division_perf);
app/test/test_red.c +27 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdlib.h> #include <stdio.h>
@@ -8,12 +9,34 @@#include <stdint.h> #include <unistd.h> #include <inttypes.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_red (void ) +{ +printf ("red not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_red_perf (void ) +{ +printf ("red_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_red_all (void ) +{ +printf ("red_all not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#include <sys/time.h> #include <time.h> #include <math.h> -#include "test.h" -#include <rte_red.h> #ifdef __INTEL_COMPILER
@@ -1851,6 +1874,8 @@ test_red_all(void) return tell_the_result(num_tests, num_pass); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (red_autotest, test_red);REGISTER_TEST_COMMAND (red_perf, test_red_perf);REGISTER_TEST_COMMAND (red_all, test_red_all);
app/test/test_reorder.c +13 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <unistd.h>
@@ -9,12 +10,20 @@#include <rte_cycles.h> #include <rte_errno.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reorder (void ) +{ +printf ("reorder not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#include <rte_reorder.h> #include <rte_lcore.h> #include <rte_malloc.h> -#include "test.h" -#define BURST 32#define REORDER_BUFFER_SIZE 16384#define NUM_MBUFS (2*REORDER_BUFFER_SIZE)
@@ -390,4 +399,6 @@ test_reorder(void) return unit_test_suite_runner(&reorder_test_suite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reorder_autotest, test_reorder);
app/test/test_rib.c +20 -2
@@ -2,15 +2,31 @@* Copyright(c) 2018 Vladimir Medvedkin <[email protected]> * Copyright(c) 2019 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <rte_ip.h> -#include <rte_rib.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rib (void ) +{ +printf ("rib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_rib (void ) +{ +printf ("slow_rib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else + +#include <rte_rib.h> typedef int32_t (*rte_rib_test )(void );
@@ -363,5 +379,7 @@ test_slow_rib(void) return unit_test_suite_runner(&rib_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rib_autotest, test_rib);REGISTER_TEST_COMMAND (rib_slow_autotest, test_slow_rib);
app/test/test_rib6.c +20 -2
@@ -3,14 +3,31 @@* Copyright(c) 2019 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <rte_ip.h> -#include <rte_rib6.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rib6 (void ) +{ +printf ("rib6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_rib6 (void ) +{ +printf ("slow_rib6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else + +#include <rte_rib6.h> typedef int32_t (*rte_rib6_test )(void );
@@ -368,5 +385,6 @@ test_slow_rib6(void) return unit_test_suite_runner(&rib6_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ REGISTER_TEST_COMMAND (rib6_autotest, test_rib6);REGISTER_TEST_COMMAND (rib6_slow_autotest, test_slow_rib6);
app/test/test_sched.c +13 -1
@@ -14,8 +14,18 @@#include <rte_ether.h> #include <rte_ip.h> #include <rte_byteorder.h> -#include <rte_sched.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_sched (void ) +{ +printf ("sched not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_sched.h> #define SUBPORT 0#define PIPE 1
@@ -204,4 +214,6 @@ test_sched(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (sched_autotest, test_sched);
app/test/test_security.c +15 -1
@@ -1,12 +1,24 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved */ +#include "test.h" #include <rte_errno.h> #include <rte_log.h> #include <rte_memory.h> #include <rte_mempool.h> #include <rte_ether.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_security (void ) +{ +printf ("security not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_security.h> #include <rte_security_driver.h>
@@ -20,7 +32,7 @@#endif #include <rte_test.h> -#include "test.h" +/** * Security
@@ -2639,4 +2651,6 @@ test_security(void) return unit_test_suite_runner(&security_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (security_autotest, test_security);
app/test/test_table.c +13 -0
@@ -7,6 +7,17 @@#include <rte_string_fns.h> #include <string.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_table (void ) +{ +printf ("table not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include "test_table.h" #include "test_table_pipeline.h" #include "test_table_ports.h"
@@ -194,4 +205,6 @@ test_table(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (table_autotest, test_table);
app/test/test_table_acl.c +3 -0
@@ -2,6 +2,7 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS #include <rte_ip.h> #include <rte_string_fns.h> #include <rte_hexdump.h>
@@ -728,3 +729,5 @@ test_table_acl(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_combined.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2016 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include "test_table_combined.h" #include "test_table.h"
@@ -840,3 +842,5 @@ test_table_hash_cuckoo_combined(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_pipeline.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include <rte_pipeline.h> #include <rte_log.h>
@@ -569,3 +571,5 @@ test_table_pipeline(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_ports.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include "test_table_ports.h" #include "test_table.h"
@@ -189,3 +191,5 @@ test_port_ring_writer(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_tables.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2016 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include <rte_byteorder.h> #include <rte_table_lpm_ipv6.h>
@@ -1052,3 +1054,5 @@ test_table_hash_cuckoo(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_timer_secondary.c +13 -0
@@ -16,6 +16,17 @@#include <rte_random.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +int +test_timer_secondary (void ) +{ +printf ("timer_secondary not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include "process.h" #define NUM_TIMERS (1 << 20)/* ~1M timers */
@@ -213,4 +224,6 @@ test_timer_secondary(void) return TEST_FAILED; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (timer_secondary_autotest, test_timer_secondary);
app/test/test_trace.c +28 -4
@@ -9,6 +9,30 @@#include "test.h" #include "test_trace.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_trace (void ) +{ +printf ("trace not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_trace_dump (void ) +{ +printf ("trace_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_trace_metadata_dump (void ) +{ +printf ("trace_metadata_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +static int32_t test_trace_point_globbing (void ) {
@@ -194,8 +218,6 @@ test_trace(void)return unit_test_suite_runner (&trace_tests); } -REGISTER_TEST_COMMAND (trace_autotest, test_trace); -static int test_trace_dump (void ) {
@@ -203,12 +225,14 @@ test_trace_dump(void) return 0; } -REGISTER_TEST_COMMAND (trace_dump, test_trace_dump); -static int test_trace_metadata_dump (void ) {return rte_trace_metadata_dump (stdout); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + +REGISTER_TEST_COMMAND (trace_autotest, test_trace); +REGISTER_TEST_COMMAND (trace_dump, test_trace_dump);REGISTER_TEST_COMMAND (trace_metadata_dump, test_trace_metadata_dump);
Signature · 1 line
2.32.0.windows.2
v8 cover app/test: enable subset of tests on Windows
In reply to Jie ZhouThis patchset is to enable a subset of unit tests on windows. It mainly includes:
- Replace POSIX specific codes
- Fix some lib and tests per failures investigation
- Replace .sh script with .py script for meson.build
- Enable build and run subset of unit tests on Windows
Future work:
- Work with CI/CD lab to onboard unit tests on Windows to catch regression
- Onboard more tests when more libraries are enabled on Windows
---
V2 changes:
- Fix compilation error on FreeBSD
- Fix email mismatch issue
- Add a missing space around "*"
---
V3 changes:
- Fix a misc c coding style issue
- Revise some commit title and message body
- Fix violations of PEP8 in new added Python scripts
- Add error handling in get_coremask.py
- Fix has_hugepage.py to check system support of hugepages instead of checking privileges
- Fix test meson.build to run Python scripts using py3
- Consolidate lists of source files, test dep, etc. across all platforms, with conditional extending on some platform(s)
---
V4 changes:
- Remove building of ip_frag, rib, and reorder libraries on Windows. These three libs usually can be built on Windows without change. However, in between the time of V3 and V4, there is regression in upstream caused build failures of these three libs. Will separately investigate and enable these libraries.
- Remove previous patch#2 (Enable mempool/stack on Windows) from this patchset as it was separated out and merged as patch-19314.
- Consolidate the source files, deps, tests lists across platforms as much as possible.
---
V5 changes:
- Remove a space between function name and open parenthesis '('
- Add back a header mistakenly deleted
---
V6 changes:
- Fix inconsistent static vs. non-static declarations
---
V7 changes:
- Remove get_coremask.py as it is not needed any more in meson.build
- Remove enablement of efd and lpm and their corresponding unit tests. The enablement of these two libs and their UTs will be in separate patches after this patch set.
V8 changes:
- Fix coding style issue of using C99 // comments
Jie Zhou (11):
eal/windows: return ENOTSUP for not supported API app/test: remove unnecessary headers app/test: replace POSIX specific code app/test: exclude ENOTSUP as failure app/test: skip interrupt tests on Windows app/test: temporarily "skip" one cmdline test case app/test: skip two logs_autotest cases on Windows app/test: differentiate a strerror on different OS app/test: remove two alarm_autotest cases app/test: replace .sh scripts with .py scripts app/test: enable subset of unit tests on Windows
app/test/commands.c | 2 - app/test/has-hugepage.sh | 11 --- app/test/has_hugepage.py | 25 +++++ app/test/meson.build | 116 ++++++++++++----------- app/test/packet_burst_generator.c | 1 + app/test/process.h | 4 +- app/test/test.c | 5 +- app/test/test_acl.c | 12 +++ app/test/test_alarm.c | 4 + app/test/test_bpf.c | 15 ++- app/test/test_byteorder.c | 2 +- app/test/test_cksum.c | 12 +++ app/test/test_cmdline.c | 2 + app/test/test_cmdline_ipaddr.c | 5 + app/test/test_cmdline_lib.c | 5 +- app/test/test_crc.c | 1 - app/test/test_cryptodev.c | 4 + app/test/test_cryptodev_asym.c | 4 + app/test/test_cryptodev_blockcipher.c | 4 + app/test/test_cryptodev_security_ipsec.c | 4 + app/test/test_cryptodev_security_pdcp.c | 4 + app/test/test_debug.c | 17 +++- app/test/test_distributor.c | 13 +++ app/test/test_distributor_perf.c | 13 +++ app/test/test_dmadev.c | 14 ++- app/test/test_dmadev_api.c | 4 + app/test/test_eal_flags.c | 97 +++++++++++++++++++ app/test/test_eal_fs.c | 12 +++ app/test/test_efd.c | 15 ++- app/test/test_efd_perf.c | 16 +++- app/test/test_errno.c | 12 ++- app/test/test_event_crypto_adapter.c | 15 ++- app/test/test_event_eth_rx_adapter.c | 25 ++++- app/test/test_event_eth_tx_adapter.c | 12 +++ app/test/test_event_ring.c | 16 +++- app/test/test_event_timer_adapter.c | 16 +++- app/test/test_eventdev.c | 20 +++- app/test/test_external_mem.c | 18 +++- app/test/test_fib.c | 22 ++++- app/test/test_fib6.c | 24 ++++- app/test/test_fib6_perf.c | 16 +++- app/test/test_fib_perf.c | 15 ++- app/test/test_flow_classify.c | 13 +++ app/test/test_func_reentrancy.c | 12 +++ app/test/test_graph.c | 18 +++- app/test/test_graph_perf.c | 16 +++- app/test/test_hash_perf.c | 12 +++ app/test/test_interrupts.c | 10 ++ app/test/test_ipfrag.c | 16 +++- app/test/test_ipsec.c | 15 ++- app/test/test_ipsec_perf.c | 15 ++- app/test/test_ipsec_sad.c | 14 ++- app/test/test_kni.c | 10 +- app/test/test_lcores.c | 12 +++ app/test/test_logs.c | 6 +- app/test/test_lpm.c | 14 ++- app/test/test_lpm6.c | 14 ++- app/test/test_lpm6_perf.c | 14 ++- app/test/test_lpm_perf.c | 13 ++- app/test/test_malloc.c | 17 +++- app/test/test_mbuf.c | 13 ++- app/test/test_member.c | 16 +++- app/test/test_member_perf.c | 16 +++- app/test/test_memcpy_perf.c | 18 +++- app/test/test_memory.c | 3 +- app/test/test_mempool_perf.c | 12 +++ app/test/test_mp_secondary.c | 13 +++ app/test/test_pmd_perf.c | 6 +- app/test/test_rawdev.c | 17 +++- app/test/test_rcu_qsbr_perf.c | 12 +++ app/test/test_reciprocal_division.c | 12 +++ app/test/test_reciprocal_division_perf.c | 12 +++ app/test/test_red.c | 29 +++++- app/test/test_reorder.c | 15 ++- app/test/test_rib.c | 22 ++++- app/test/test_rib6.c | 22 ++++- app/test/test_ring_stress.c | 3 +- app/test/test_ring_stress_impl.h | 2 +- app/test/test_sched.c | 14 ++- app/test/test_security.c | 16 +++- app/test/test_table.c | 13 +++ app/test/test_table_acl.c | 3 + app/test/test_table_combined.c | 4 + app/test/test_table_pipeline.c | 4 + app/test/test_table_ports.c | 4 + app/test/test_table_tables.c | 4 + app/test/test_telemetry_data.c | 2 + app/test/test_timer_secondary.c | 13 +++ app/test/test_trace.c | 32 ++++++- lib/eal/common/eal_common_errno.c | 4 + lib/eal/windows/eal_memalloc.c | 6 +- 91 files changed, 1105 insertions(+), 152 deletions(-) delete mode 100755 app/test/has-hugepage.sh create mode 100644 app/test/has_hugepage.py
Signature · 1 line
2.32.0.windows.2
PATCH v8 1/11 eal/windows: return ENOTSUP for not supported API
UT memory_autotest on Windows has 2 failed cases on eal APIs eal_memalloc_get_seg_fd and eal_memalloc_get_seg_fd_offset. These 2 APIs are not supported on Windows yet. Should return ENOTSUP such that in test_memory.c these 2 ENOTSUP cases will not be marked as failures, same as other ENOTSUP cases.
--- lib/eal/windows/eal_memalloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/eal/windows/eal_memalloc.c +3 -3
@@ -17,7 +17,7 @@ eal_memalloc_get_seg_fd(int list_idx, int seg_idx)RTE_SET_USED (list_idx);RTE_SET_USED (seg_idx);EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; }int
@@ -28,7 +28,7 @@ eal_memalloc_get_seg_fd_offset(int list_idx, int seg_idx, size_t *offset)RTE_SET_USED (seg_idx);RTE_SET_USED (offset);EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; } static int
@@ -428,7 +428,7 @@ eal_memalloc_sync_with_primary(void) {/* No multi-process support. */ EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; }int
Signature · 1 line
2.32.0.windows.2
PATCH v8 2/11 app/test: remove unnecessary headers
In reply to Jie ZhouRemove unnecessary header inclusion
--- app/test/commands.c | 2 -- app/test/test.c | 1 - app/test/test_cmdline_lib.c | 1 - 3 files changed, 4 deletions(-)
app/test/commands.c +0 -2
@@ -8,8 +8,6 @@#include <stdint.h> #include <string.h> #include <stdlib.h> -#include <netinet/in.h> -#include <termios.h> #include <inttypes.h> #include <errno.h> #include <sys/queue.h>
app/test/test.c +0 -1
@@ -8,7 +8,6 @@#include <stdarg.h> #include <stdlib.h> #include <errno.h> -#include <termios.h> #include <ctype.h> #include <sys/queue.h>
app/test/test_cmdline_lib.c +0 -1
@@ -8,7 +8,6 @@#include <stdarg.h> #include <stdlib.h> #include <errno.h> -#include <termios.h> #include <ctype.h> #include <sys/queue.h>
Signature · 1 line
2.32.0.windows.2
PATCH v8 3/11 app/test: replace POSIX specific code
In reply to Jie Zhou- Include rte_os_shim.h
- Replace sleep and usleep with rte_delay_us_sleep
- #ifndef RTE_EXEC_ENV_WINDOWS for POSIX code only
--- app/test/packet_burst_generator.c | 1 + app/test/process.h | 4 +++- app/test/test.c | 4 ++++ app/test/test_byteorder.c | 2 +- app/test/test_cmdline.c | 2 ++ app/test/test_crc.c | 1 - app/test/test_mp_secondary.c | 2 ++ app/test/test_pmd_perf.c | 6 +++++- app/test/test_ring_stress.c | 3 ++- app/test/test_ring_stress_impl.h | 2 +- app/test/test_telemetry_data.c | 2 ++ 11 files changed, 23 insertions(+), 6 deletions(-)
app/test/packet_burst_generator.c +1 -0
@@ -5,6 +5,7 @@#include <rte_byteorder.h> #include <rte_mbuf.h> #include <rte_ip.h> +#include <rte_os_shim.h> #include "packet_burst_generator.h"
app/test/process.h +3 -1
@@ -7,12 +7,14 @@#include <errno.h> /* errno */ #include <limits.h> /* PATH_MAX */ +#ifndef RTE_EXEC_ENV_WINDOWS #include <libgen.h> /* basename et al */ +#include <sys/wait.h> +#endif #include <stdlib.h> /* NULL */ #include <string.h> /* strerror */ #include <unistd.h> /* readlink */ #include <dirent.h> -#include <sys/wait.h> #include <rte_string_fns.h> /* strlcpy */
app/test/test.c +4 -0
@@ -62,7 +62,9 @@ do_recursive_call(void)const char *env_var;int (*action_fn)(void ); } actions[] = { +#ifndef RTE_EXEC_ENV_WINDOWS { "run_secondary_instances", test_mp_secondary }, +#endif #ifdef RTE_LIB_PDUMP #ifdef RTE_NET_RING { "run_pdump_server_tests", test_pdump },
@@ -81,7 +83,9 @@ do_recursive_call(void) { "test_file_prefix", no_action }, { "test_no_huge_flag", no_action }, #ifdef RTE_LIB_TIMER +#ifndef RTE_EXEC_ENV_WINDOWS { "timer_secondary_spawn_wait", test_timer_secondary }, +#endif #endif };
app/test/test_byteorder.c +1 -1
@@ -46,7 +46,7 @@ test_byteorder(void)return -1 ; res_u16 =rte_bswap16 (0x1337 ); -printf ("const %" PRIx16" -> %" PRIx16"\n" ,0x1337 , res_u16); +printf ("const %" PRIx16" -> %" PRIx16"\n" , (uint16_t )0x1337 , res_u16);if (res_u16 !=0x3713 )return -1 ;
app/test/test_cmdline.c +2 -0
@@ -31,6 +31,7 @@ test_cmdline(void)return -1 ;if (test_parse_num_invalid_param () <0 )return -1 ; +#ifndef RTE_EXEC_ENV_WINDOWS printf ("Testing parsing IP addresses...\n" );if (test_parse_ipaddr_valid () <0 )return -1 ;
@@ -38,6 +39,7 @@ test_cmdline(void)return -1 ;if (test_parse_ipaddr_invalid_param () <0 )return -1 ; +#endif printf ("Testing parsing strings...\n" );if (test_parse_string_valid () <0 )return -1 ;
app/test/test_crc.c +0 -1
@@ -14,7 +14,6 @@#define CRC32_VEC_LEN2 348#define CRC16_VEC_LEN1 12#define CRC16_VEC_LEN2 2 -#define LINE_LEN 75/* CRC test vector */ static const uint8_t crc_vec[CRC_VEC_LEN ] = {
app/test/test_mp_secondary.c +2 -0
@@ -14,7 +14,9 @@#include <errno.h> #include <string.h> #include <unistd.h> +#ifndef RTE_EXEC_ENV_WINDOWS #include <sys/wait.h> +#endif #include <libgen.h> #include <dirent.h> #include <limits.h>
app/test/test_pmd_perf.c +5 -1
@@ -297,6 +297,7 @@ reset_count(void) idle =0 ; } +#ifndef RTE_EXEC_ENV_WINDOWS static void stats_display (uint16_t port_id) {
@@ -326,6 +327,7 @@ signal_handler(int signum)if (signum ==SIGUSR2 ) stats_display(0); } +#endif struct rte_mbuf **tx_burst;
@@ -637,7 +639,7 @@ exec_burst(uint32_t flags, int lcore) i = (i >= conf->nb_ports -1 ) ?0 : (i +1 ); } -sleep (5 ); +rte_delay_us (5 *US_PER_S );/* only when polling second */ if (flags ==SC_BURST_XMIT_FIRST )
@@ -668,8 +670,10 @@ test_pmd_perf(void)printf ("Start PMD RXTX cycles cost test.\n" ); +#ifndef RTE_EXEC_ENV_WINDOWS signal (SIGUSR1 , signal_handler);signal (SIGUSR2 , signal_handler); +#endif nb_ports =rte_eth_dev_count_avail ();if (nb_ports <NB_ETHPORTS_USED ) {
app/test/test_ring_stress.c +2 -1
@@ -43,9 +43,10 @@ test_ring_stress(void) n += test_ring_rts_stress.nb_case; k +=run_test (&test_ring_rts_stress); +#ifndef RTE_EXEC_ENV_WINDOWS n += test_ring_hts_stress.nb_case; k +=run_test (&test_ring_hts_stress); - +#endif n += test_ring_mt_peek_stress.nb_case; k +=run_test (&test_ring_mt_peek_stress);
app/test/test_ring_stress_impl.h +1 -1
@@ -360,7 +360,7 @@ test_mt1(int (*test)(void *))/* signal worker to start test */ __atomic_store_n (&wrk_cmd,WRK_CMD_RUN , __ATOMIC_RELEASE); -usleep (run_time *US_PER_S ); +rte_delay_us (run_time *US_PER_S );/* signal worker to start test */ __atomic_store_n (&wrk_cmd,WRK_CMD_STOP , __ATOMIC_RELEASE);
app/test/test_telemetry_data.c +2 -0
@@ -4,7 +4,9 @@#include <string.h> #include <sys/socket.h> +#ifndef RTE_EXEC_ENV_WINDOWS #include <sys/un.h> +#endif #include <unistd.h> #include <limits.h>
Signature · 1 line
2.32.0.windows.2
Re: [PATCH v8 03/11] app/test: replace POSIX specific code
2021-10-25 19:45 (UTC-0700), Jie Zhou:
Quoted 6 lines
- Include
rte_os_shim.h
- Replace sleep and usleep withrte_delay_us_sleep
- #ifndefRTE_EXEC_ENV_WINDOWSfor POSIX code onlySigned-off-by Jie Zhou <[email protected]>---
This patch can be combined with the previous one:
they serve the same purpose---to remove Unix-specific code.
Please try to summarize in the commit message
which parts of the tests suites are excluded, e.g. multi-process. It is more useful then stating what was changed in the code.
[...]
Quoted 13 lines
app/test/test_cmdline.c +1
-0@@ -31,6 +31,7 @@ test_cmdline(void)return -1 ;if (test_parse_num_invalid_param () <0 )return -1 ; +#ifndef RTE_EXEC_ENV_WINDOWS printf ("Testing parsing IP addresses...\n" );if (test_parse_ipaddr_valid () <0 )return -1 ;
app/test/test_cmdline.c test_cmdline(void) · line 45
Quoted 7 lines
app/test/test_cmdline.c +1
-0@@ -38,6 +39,7 @@ test_cmdline(void)return -1 ;if (test_parse_ipaddr_invalid_param () <0 )return -1 ; +#endif printf ("Testing parsing strings...\n" );if (test_parse_string_valid () <0 )return -1 ;
What's wrong with parsing IP addresses on Windows?
[...]
Quoted 5 lines
app/test/test_mp_secondary.c +0
-0
app/test/test_mp_secondary.c line 22
Quoted 9 lines
app/test/test_mp_secondary.c +2
-0@@ -14,7 +14,9 @@#include <errno.h> #include <string.h> #include <unistd.h> +#ifndef RTE_EXEC_ENV_WINDOWS #include <sys/wait.h> +#endif #include <libgen.h> #include <dirent.h> #include <limits.h>
<libgen.h> is absent on Windows for sure, but you don't exclude it. Does this file even need modification?
It's not going to be compiled for Windows.
[...]
app/test/test_ring_stress.c test_ring_stress(void) · line 49
Quoted 13 lines
app/test/test_ring_stress.c +2
-1@@ -43,9 +43,10 @@ test_ring_stress(void) n += test_ring_rts_stress.nb_case; k +=run_test (&test_ring_rts_stress); +#ifndef RTE_EXEC_ENV_WINDOWS n += test_ring_hts_stress.nb_case; k +=run_test (&test_ring_hts_stress); - +#endif
Can you please elaborate what is the issue with this case? It is also one of the details you usually want to put into the commit message.
Re: [PATCH v8 03/11] app/test: replace POSIX specific code
Quoted 8 lines · Dmitry Kozlyuk
2021-10-25 19:45 (UTC-0700), Jie Zhou:
Quoted 6 lines
- Include
rte_os_shim.h
- Replace sleep and usleep withrte_delay_us_sleep
- #ifndefRTE_EXEC_ENV_WINDOWSfor POSIX code onlySigned-off-by Jie Zhou <[email protected]>---
Quoted 7 lines
This patch can be combined with the previous one:
they serve the same purpose---to remove Unix-specific code.Please try to summarize in the commit message
which parts of the tests suites are excluded, e.g. multi-process. It is more useful then stating what was changed in the code.
Will combine and revise the message.
Quoted 15 lines
[...]
Quoted 14 lines
app/test/test_cmdline.c +1
-0@@ -31,6 +31,7 @@ test_cmdline(void)return -1 ;if (test_parse_num_invalid_param () <0 )return -1 ; +#ifndef RTE_EXEC_ENV_WINDOWS printf ("Testing parsing IP addresses...\n" );if (test_parse_ipaddr_valid () <0 )return -1 ;@@ -38,6 +39,7 @@ test_cmdline(void)return -1 ;
Quoted 9 lines
app/test/test_cmdline.c test_cmdline(void) · line 45
Quoted 6 lines
app/test/test_cmdline.c +1
-0if (test_parse_ipaddr_invalid_param () <0 )return -1 ; +#endif printf ("Testing parsing strings...\n" );if (test_parse_string_valid () <0 )return -1 ;What's wrong with parsing IP addresses on Windows?
test_cmdline_ipaddr.c uses linux netinet/in.h specific u6_addr. Skip these 3 cases for now and prefer a separate patch to make it work on Windows. Or maybe there is already DPDK support on this which I am not aware of? Thanks.
Quoted 11 lines
[...]
Quoted 10 lines
app/test/test_mp_secondary.c +1
-0@@ -14,7 +14,9 @@#include <errno.h> #include <string.h> #include <unistd.h> +#ifndef RTE_EXEC_ENV_WINDOWS #include <sys/wait.h>
Quoted 9 lines
app/test/test_mp_secondary.c line 22
Quoted 4 lines
app/test/test_mp_secondary.c +1
-0+#endif #include <libgen.h> #include <dirent.h> #include <limits.h> <
libgen.h> is absent on Windows for sure, but you don't exclude it. Does this file even need modification?
It's not going to be compiled for Windows.
This is replaced with the test stub in the patch#11 (of V8) to make it compile on Windows. Sorry for the confusion. Will make sure remove this unnecessary part from V9.
Quoted 9 lines
[...]
Quoted 8 lines
app/test/test_ring_stress.c +0
-0@@ -43,9 +43,10 @@ test_ring_stress(void) n += test_ring_rts_stress.nb_case; k +=run_test (&test_ring_rts_stress);
Quoted 9 lines
app/test/test_ring_stress.c test_ring_stress(void) · line 49
Quoted 5 lines
app/test/test_ring_stress.c +2
-1+#ifndef RTE_EXEC_ENV_WINDOWS n += test_ring_hts_stress.nb_case; k +=run_test (&test_ring_hts_stress); - +#endif Can you please elaborate what is the issue with this case? It is also one of the details you usually want to put into the commit message.
Cannot remember what caused this case being skipped in the first place, but it can work now. So removed the ifndef. Thanks.
Re: [PATCH v8 03/11] app/test: replace POSIX specific code
2021-11-30 17:05 (UTC-0800), Jie Zhou:
Quoted 1 line · Dmitry Kozlyuk
[...]
Quoted 24 lines
Quoted 15 lines
[...]
Quoted 14 lines
app/test/test_cmdline.c +1
-0@@ -31,6 +31,7 @@ test_cmdline(void)return -1 ;if (test_parse_num_invalid_param () <0 )return -1 ; +#ifndef RTE_EXEC_ENV_WINDOWS printf ("Testing parsing IP addresses...\n" );if (test_parse_ipaddr_valid () <0 )return -1 ;@@ -38,6 +39,7 @@ test_cmdline(void)return -1 ;Quoted 9 lines
app/test/test_cmdline.c test_cmdline(void) · line 45
Quoted 6 lines
app/test/test_cmdline.c +1
-0if (test_parse_ipaddr_invalid_param () <0 )return -1 ; +#endif printf ("Testing parsing strings...\n" );if (test_parse_string_valid () <0 )return -1 ;What's wrong with parsing IP addresses on Windows?
Quoted 3 lines
test_cmdline_ipaddr.cuses linuxnetinet/in.hspecificu6_addr. Skip these 3 cases for now and prefer a separate patch to make it work on Windows. Or maybe there is already DPDK support on this which I am not aware of? Thanks.
Understood, only please explain this in the commit log.
PATCH v8 4/11 app/test: exclude ENOTSUP as failure
In reply to Jie ZhouCheck rte_errno to exclude ENOTSUP as failures in test_memory.c
--- app/test/test_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
app/test/test_memory.c +2 -1
@@ -10,6 +10,7 @@#include <rte_memory.h> #include <rte_common.h> #include <rte_memzone.h> +#include <rte_errno.h> #include "test.h"
@@ -63,7 +64,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,/* we're able to get memseg fd - try getting its offset */ ret =rte_memseg_get_fd_offset_thread_unsafe (ms, &offset);if (ret <0 ) { -if (errno ==ENOTSUP ) +if (rte_errno ==ENOTSUP )return 1 ;return -1 ; }
Signature · 1 line
2.32.0.windows.2
Re: [PATCH v8 04/11] app/test: exclude ENOTSUP as failure
2021-10-25 19:45 (UTC-0700), Jie Zhou:
Quoted 20 lines
Check
rte_errnoto exclude ENOTSUP as failures intest_memory.cSigned-off-by Jie Zhou <[email protected]>--- app/test/test_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)app/test/test_memory.c +1
-0@@ -10,6 +10,7 @@#include <rte_memory.h> #include <rte_common.h> #include <rte_memzone.h> +#include <rte_errno.h> #include "test.h"
app/test/test_memory.c check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms, · line 70
Quoted 8 lines
app/test/test_memory.c +1
-1@@ -63,7 +64,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,/* we're able to get memseg fd - try getting its offset */ ret =rte_memseg_get_fd_offset_thread_unsafe (ms, &offset);if (ret <0 ) { -if (errno ==ENOTSUP ) +if (rte_errno ==ENOTSUP )return 1 ;return -1 ; }
The commit title and message contradict what is inside.
ENOTSUP was excluded previously, but errno was checked instead of rte_errno. It should be stated what was wrong and how it is fixed (with a Fixes tag).
Re: [PATCH v8 04/11] app/test: exclude ENOTSUP as failure
Quoted 20 lines · Dmitry Kozlyuk
2021-10-25 19:45 (UTC-0700), Jie Zhou:
Quoted 19 lines
Check
rte_errnoto exclude ENOTSUP as failures intest_memory.cSigned-off-by Jie Zhou <[email protected]>--- app/test/test_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)app/test/test_memory.c +1
-0@@ -10,6 +10,7 @@#include <rte_memory.h> #include <rte_common.h> #include <rte_memzone.h> +#include <rte_errno.h> #include "test.h"
Quoted 13 lines
app/test/test_memory.c check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms, · line 70
Quoted 9 lines
app/test/test_memory.c +1
-1@@ -63,7 +64,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,/* we're able to get memseg fd - try getting its offset */ ret =rte_memseg_get_fd_offset_thread_unsafe (ms, &offset);if (ret <0 ) { -if (errno ==ENOTSUP ) +if (rte_errno ==ENOTSUP )return 1 ;return -1 ; }The commit title and message contradict what is inside.
ENOTSUP was excluded previously, but errno was checked instead ofrte_errno. It should be stated what was wrong and how it is fixed (with a Fixes tag).
Will add the Fixes info and revise the title and message.
PATCH v8 5/11 app/test: skip interrupt tests on Windows
In reply to Jie ZhouEven though test_interrupts.c can compile on Windows, skip interrupt tests for now since majority of eal_interrupt on Windows are stubs. Will remove the skip after interrupt being fully enabled on Windows.
--- app/test/test_interrupts.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
app/test/test_interrupts.c +10 -0
@@ -12,6 +12,15 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_interrupt (void ) +{ +printf ("Interrupt on Windows is not fully supported yet, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#define TEST_INTERRUPT_CHECK_INTERVAL 100/* ms */ /* predefined interrupt handle types */
@@ -590,5 +599,6 @@ test_interrupt(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ REGISTER_TEST_COMMAND (interrupt_autotest, test_interrupt);
Signature · 1 line
2.32.0.windows.2
PATCH v8 6/11 app/test: temporarily "skip" one cmdline test case
In reply to Jie Zhoucmdline tests pass except one failure at the test_cmdline_socket_fns test case with error: failed to open /dev/null for reading!
Temporarily "skip" this case while enable all other passing cases.
Issue is tracked internally and will add the corresponding case on Windows in future.
--- app/test/test_cmdline_lib.c | 4 ++++ 1 file changed, 4 insertions(+)
app/test/test_cmdline_lib.c +4 -0
@@ -146,6 +146,9 @@ test_cmdline_vt100_fns(void)static int test_cmdline_socket_fns (void ) { +#ifdef RTE_EXEC_ENV_WINDOWS +return 0 ; +#else cmdline_parse_ctx_t ctx;struct cmdline *cl;
@@ -184,6 +187,7 @@ test_cmdline_socket_fns(void)printf ("Error: function accepted null parameter!\n" );cmdline_free (cl);return -1 ; +#endif } static int
Signature · 1 line
2.32.0.windows.2
Re: [PATCH v8 06/11] app/test: temporarily "skip" one cmdline test case
2021-10-25 19:45 (UTC-0700), Jie Zhou:
Quoted 2 lines
cmdline tests pass except one failure at the
test_cmdline_socket_fnstest case with error: failed to open/dev/nullfor reading!
Can't it be something like this?
#ifndef RTE_EXEC_ENV_WINDOWS
#define NULL_INPUT "/dev/null"
#else
#define NULL_INPUT "NUL"
#endif
Re: [PATCH v8 06/11] app/test: temporarily "skip" one cmdline test case
Quoted 11 lines · Dmitry Kozlyuk
2021-10-25 19:45 (UTC-0700), Jie Zhou:
Quoted 2 lines
cmdline tests pass except one failure at the
test_cmdline_socket_fnstest case with error: failed to open/dev/nullfor reading!Can't it be something like this?
#ifndef
RTE_EXEC_ENV_WINDOWS
#defineNULL_INPUT"/dev/null"
#else
#defineNULL_INPUT"NUL"
#endif
Yes, it works. Thanks!
PATCH v8 7/11 app/test: skip two logs_autotest cases on Windows
In reply to Jie ZhouDPDK logs_autotest on Windows failed at "dynamic log types" tests. The failures are on 2 test cases for rte_log_set_level_regexp API, due to regular expression is not supported on Windows in DPDK yet and regcomp/regexec are just stubs on Windows (in regex.h).
In app\test\test_logs.c, ifndef these two test cases, and for the rte_log_set_level_pattern validation case following these two cases, differentiate the expected log level passed into macro CHECK_LEVELS
Now logs_autotest completes for all dynamic log types and static log types.
--- app/test/test_logs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
app/test/test_logs.c +5 -1
@@ -113,6 +113,7 @@ test_logs(void)rte_log_set_level (logtype1,RTE_LOG_ERR );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR ); +#ifndef RTE_EXEC_ENV_WINDOWS rte_log_set_level_regexp ("type$" ,RTE_LOG_EMERG );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR );
@@ -121,7 +122,10 @@ test_logs(void)rte_log_set_level_pattern ("logtype" ,RTE_LOG_DEBUG );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_EMERG ,RTE_LOG_EMERG ); - +#else + ret =rte_log_set_level_pattern ("logtype" ,RTE_LOG_DEBUG ); +CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR ); +#endif /* set logtype level low to so we can test global level */ rte_log_set_level_pattern ("logtype*" ,RTE_LOG_DEBUG );CHECK_LEVELS (RTE_LOG_DEBUG ,RTE_LOG_DEBUG ,RTE_LOG_DEBUG );
Signature · 1 line
2.32.0.windows.2
PATCH v8 8/11 app/test: differentiate a strerror on different OS
In reply to Jie ZhouOn Windows, strerror returns just "Unknown error" for errnum greater than MAX_ERRNO, while linux and freebsd returns "Unknown error <num>", which is the current expectation for errno_autotest. Differentiate the error string on Windows to remove a "duplicate error code" failure.
--- app/test/test_errno.c | 12 +++++++++++- lib/eal/common/eal_common_errno.c | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-)
app/test/test_errno.c +11 -1
@@ -18,13 +18,19 @@ test_errno(void) {const char *rte_retval;const char *libc_retval; + +#ifndef RTE_EXEC_ENV_WINDOWS #ifdef RTE_EXEC_ENV_FREEBSD /* BSD has a colon in the string, unlike linux */ const char unknown_code_result[] ="Unknown error: %d" ;#else const char unknown_code_result[] ="Unknown error %d" ;#endif -char expected_libc_retval[sizeof (unknown_code_result)+3 ]; +char expected_libc_retval[sizeof (unknown_code_result) +3 ]; +#else +/* Windows doesn't return error number for error greater than MAX_errno*/ +static const char expected_libc_retval[] ="Unknown error" ; +#endif /* use a small selection of standard errors for testing */ int std_errs[] = {EAGAIN ,EBADF ,EACCES ,EINTR ,EINVAL };
@@ -54,11 +60,13 @@ test_errno(void) rte_retval, libc_retval);if (strcmp (rte_retval, libc_retval) ==0 )return -1 ; +#ifndef RTE_EXEC_ENV_WINDOWS /* generate appropriate error string for unknown error number * and then check that this is what we got back. If not, we have * a duplicate error number that conflicts with errno.h */ snprintf (expected_libc_retval,sizeof (expected_libc_retval), unknown_code_result, rte_errs[i]); +#endif if ((strcmp (expected_libc_retval, libc_retval) !=0 ) && (strcmp ("" , libc_retval) !=0 )){printf ("Error, duplicate error code %d\n" , rte_errs[i]);
@@ -69,8 +77,10 @@ test_errno(void)/* ensure that beyond RTE_MAX_ERRNO, we always get an unknown code */ rte_retval =rte_strerror (RTE_MAX_ERRNO +1 ); libc_retval =strerror (RTE_MAX_ERRNO +1 ); +#ifndef RTE_EXEC_ENV_WINDOWS snprintf (expected_libc_retval,sizeof (expected_libc_retval), unknown_code_result,RTE_MAX_ERRNO +1 ); +#endif printf ("rte_strerror: '%s', strerror: '%s'\n" , rte_retval, libc_retval); if ((strcmp(rte_retval, libc_retval) != 0) ||
lib/eal/common/eal_common_errno.c +4 -0
@@ -37,7 +37,11 @@ rte_strerror(int errnum)/* since some implementations of strerror_r throw an error * themselves if errnum is too big, we handle that case here */ if (errnum >= RTE_MAX_ERRNO) +#ifdef RTE_EXEC_ENV_WINDOWS +snprintf (ret,RETVAL_SZ ,"Unknown error%s" , sep); +#else snprintf (ret,RETVAL_SZ ,"Unknown error%s %d" , sep, errnum); +#endif else switch (errnum){case E_RTE_SECONDARY :
Signature · 1 line
2.32.0.windows.2
PATCH v8 9/11 app/test: remove two alarm_autotest cases
In reply to Jie ZhouRemove two alarm_autotest test cases which do bogus range check on Windows.
--- app/test/test_alarm.c | 4 ++++ 1 file changed, 4 insertions(+)
app/test/test_alarm.c +4 -0
@@ -10,6 +10,7 @@#include "test.h" +#ifndef RTE_EXEC_ENV_WINDOWS static volatile int flag; static void
@@ -18,6 +19,7 @@ test_alarm_callback(void *cb_arg) flag =1 ; printf("Callback setting flag - OK. [cb_arg = %p]\n", cb_arg); } +#endif static int test_alarm (void )
@@ -27,6 +29,7 @@ test_alarm(void)return 0 ;#endif +#ifndef RTE_EXEC_ENV_WINDOWS /* check if it will fail to set alarm with wrong us value */ printf ("check if it will fail to set alarm with wrong ms values\n" ); if (rte_eal_alarm_set(0, test_alarm_callback,
@@ -39,6 +42,7 @@ test_alarm(void)printf ("should not be successful with (UINT64_MAX-1) us value\n" ); return -1; } +#endif /* check if it will fail to set alarm with null callback parameter */ printf ("check if it will fail to set alarm with null callback parameter\n" );
Signature · 1 line
2.32.0.windows.2
PATCH v8 10/11 app/test: replace .sh scripts with .py scripts
In reply to Jie Zhou- Add python script to check if system supports hugepages
- Remove corresponding .sh scripts
- Replace calling of .sh with corresponding .py in meson.build
--- app/test/has-hugepage.sh | 11 ----------- app/test/has_hugepage.py | 25 +++++++++++++++++++++++++ app/test/meson.build | 2 +- 3 files changed, 26 insertions(+), 12 deletions(-) delete mode 100755 app/test/has-hugepage.sh create mode 100644 app/test/has_hugepage.py
app/test/has-hugepage.sh deleted +0 -11
@@ -1,11 +0,0 @@ -#! /bin/sh -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2020 Mellanox Technologies, Ltd - -if [ "$(uname)" = "Linux" ] ; then - cat /proc/sys/vm/nr_hugepages || echo 0 -elif [ "$(uname)" = "FreeBSD" ] ; then - echo 1 # assume FreeBSD always has hugepages -else - echo 0 -fi
app/test/has_hugepage.py new file +25 -0
@@ -0,0 +1,25 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021 Microsoft Corporation +"""This script checks if the system supports huge pages""" + +import platform +import ctypes + +osName = platform.system() +if osName == "Linux": + with open("/proc/sys/vm/nr_hugepages") as file_o: + content = file_o.read() + print(content) +elif osName == "FreeBSD": + # Assume FreeBSD always has hugepages enabled + print("1") +elif osName == "Windows": + # On Windows, determine if large page is supported based on the + # value returned by GetLargePageMinimum. If the return value is zero, + # the processor does not support large pages. + if ctypes.windll.kernel32.GetLargePageMinimum() > 0: + print("1") + else: + print("0") +else: + print("0")
app/test/meson.build +1 -1
@@ -463,7 +463,7 @@ dpdk_test = executable('dpdk-test', driver_install_path), install: true) -has_hugepage = run_command('has-hugepage.sh').stdout().strip() != '0' +has_hugepage = run_command(py3, 'has_hugepage.py').stdout().strip() != '0' message('hugepage availability: @0@'.format(has_hugepage)) # some perf tests (eg: memcpy perf autotest)take very long
Signature · 1 line
2.32.0.windows.2
Re: [PATCH v8 10/11] app/test: replace .sh scripts with .py scripts
2021-10-25 19:46 (UTC-0700), Jie Zhou:
Quoted 36 lines
- Add python script to check if system supports hugepages
- Remove corresponding .sh scripts
- Replace calling of .sh with corresponding .py in meson.buildSigned-off-by Jie Zhou <[email protected]>--- app/test/has-hugepage.sh | 11 ----------- app/test/has_hugepage.py | 25 +++++++++++++++++++++++++ app/test/meson.build | 2 +- 3 files changed, 26 insertions(+), 12 deletions(-) delete mode 100755 app/test/has-hugepage.sh create mode 100644 app/test/has_hugepage.pyapp/test/has-hugepage.sh deleted +0
-11@@ -1,11 +0,0 @@ -#! /bin/sh -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2020 Mellanox Technologies, Ltd - -if [ "$(uname)" = "Linux" ] ; then - cat /proc/sys/vm/nr_hugepages || echo 0 -elif [ "$(uname)" = "FreeBSD" ] ; then - echo 1 # assume FreeBSD always has hugepages -else - echo 0 -fiapp/test/has_hugepage.py new file +0
-0
app/test/has_hugepage.py line 8
Quoted 8 lines
app/test/has_hugepage.py new file +8
-0@@ -0,0 +1,25 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021 Microsoft Corporation +"""This script checks if the system supports huge pages""" + +import platform +import ctypes + +osName = platform.system()
Please follow Python's preferred naming style, "os_name".
app/test/has_hugepage.py line 12
Quoted 4 lines
app/test/has_hugepage.py new file +4
-0+if osName == "Linux": + with open("/proc/sys/vm/nr_hugepages") as file_o: + content = file_o.read() + print(content)
Compared to shell version, lost is the logic to print 0 in case of a failure.
app/test/has_hugepage.py line 19
Quoted 7 lines
app/test/has_hugepage.py new file +7
-0+elif osName == "FreeBSD": + # Assume FreeBSD always has hugepages enabled + print("1") +elif osName == "Windows": + # On Windows, determine if large page is supported based on the + # value returned by GetLargePageMinimum. If the return value is zero, + # the processor does not support large pages.
I honestly don't see what this comment adds to the code below :)
Quoted 6 lines
app/test/has_hugepage.py new file +6
-0+ if ctypes.windll.kernel32.GetLargePageMinimum() > 0: + print("1") + else: + print("0") +else: + print("0")
[...]
Re: [PATCH v8 10/11] app/test: replace .sh scripts with .py scripts
Quoted 65 lines · Dmitry Kozlyuk
2021-10-25 19:46 (UTC-0700), Jie Zhou:
Quoted 36 lines
- Add python script to check if system supports hugepages
- Remove corresponding .sh scripts
- Replace calling of .sh with corresponding .py in meson.buildSigned-off-by Jie Zhou <[email protected]>--- app/test/has-hugepage.sh | 11 ----------- app/test/has_hugepage.py | 25 +++++++++++++++++++++++++ app/test/meson.build | 2 +- 3 files changed, 26 insertions(+), 12 deletions(-) delete mode 100755 app/test/has-hugepage.sh create mode 100644 app/test/has_hugepage.pyapp/test/has-hugepage.sh deleted +0
-11@@ -1,11 +0,0 @@ -#! /bin/sh -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2020 Mellanox Technologies, Ltd - -if [ "$(uname)" = "Linux" ] ; then - cat /proc/sys/vm/nr_hugepages || echo 0 -elif [ "$(uname)" = "FreeBSD" ] ; then - echo 1 # assume FreeBSD always has hugepages -else - echo 0 -fiapp/test/has_hugepage.py new file +0
-0app/test/has_hugepage.py line 8
Quoted 8 lines
app/test/has_hugepage.py new file +8
-0@@ -0,0 +1,25 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021 Microsoft Corporation +"""This script checks if the system supports huge pages""" + +import platform +import ctypes + +osName = platform.system()Please follow Python's preferred naming style, "
os_name".app/test/has_hugepage.py line 12
Quoted 4 lines
app/test/has_hugepage.py new file +4
-0+if osName == "Linux": + with open("/proc/sys/vm/nr_hugepages") as file_o: + content = file_o.read() + print(content)Compared to shell version, lost is the logic to print 0 in case of a failure.
app/test/has_hugepage.py line 19
Quoted 7 lines
app/test/has_hugepage.py new file +7
-0+elif osName == "FreeBSD": + # Assume FreeBSD always has hugepages enabled + print("1") +elif osName == "Windows": + # On Windows, determine if large page is supported based on the + # value returned by GetLargePageMinimum. If the return value is zero, + # the processor does not support large pages.I honestly don't see what this comment adds to the code below :)
Quoted 7 lines
Quoted 6 lines
app/test/has_hugepage.py new file +6
-0+ if ctypes.windll.kernel32.GetLargePageMinimum() > 0: + print("1") + else: + print("0") +else: + print("0")[...]
Thanks Dmitry. Addressed all in V9.
PATCH v8 11/11 app/test: enable subset of unit tests on Windows
In reply to Jie Zhou- For fast tests and perf tests, add test stubs to skip not supported ones.
- For driver tests, for now skip on Windows totally to avoid unnecessary amount of test stubs. For example, there are about 30 cryptodev related tests (even though in the meson for CI it only listed about half) which will be enabled by "patch-18949: app/test:
enable crypto unit tests on Windows".
- For dump tests, currently the tests hang on Windows which require further investigation. Keep the dump test list just for non-Windows for easier tracking.
--- app/test/meson.build | 114 ++++++++++++----------- app/test/test_acl.c | 12 +++ app/test/test_bpf.c | 15 ++- app/test/test_cksum.c | 12 +++ app/test/test_cmdline_ipaddr.c | 5 + app/test/test_cryptodev.c | 4 + app/test/test_cryptodev_asym.c | 4 + app/test/test_cryptodev_blockcipher.c | 4 + app/test/test_cryptodev_security_ipsec.c | 4 + app/test/test_cryptodev_security_pdcp.c | 4 + app/test/test_debug.c | 17 +++- app/test/test_distributor.c | 13 +++ app/test/test_distributor_perf.c | 13 +++ app/test/test_dmadev.c | 14 ++- app/test/test_dmadev_api.c | 4 + app/test/test_eal_flags.c | 97 +++++++++++++++++++ app/test/test_eal_fs.c | 12 +++ app/test/test_efd.c | 15 ++- app/test/test_efd_perf.c | 16 +++- app/test/test_event_crypto_adapter.c | 15 ++- app/test/test_event_eth_rx_adapter.c | 25 ++++- app/test/test_event_eth_tx_adapter.c | 12 +++ app/test/test_event_ring.c | 16 +++- app/test/test_event_timer_adapter.c | 16 +++- app/test/test_eventdev.c | 20 +++- app/test/test_external_mem.c | 18 +++- app/test/test_fib.c | 22 ++++- app/test/test_fib6.c | 24 ++++- app/test/test_fib6_perf.c | 16 +++- app/test/test_fib_perf.c | 15 ++- app/test/test_flow_classify.c | 13 +++ app/test/test_func_reentrancy.c | 12 +++ app/test/test_graph.c | 18 +++- app/test/test_graph_perf.c | 16 +++- app/test/test_hash_perf.c | 12 +++ app/test/test_ipfrag.c | 16 +++- app/test/test_ipsec.c | 15 ++- app/test/test_ipsec_perf.c | 15 ++- app/test/test_ipsec_sad.c | 14 ++- app/test/test_kni.c | 10 +- app/test/test_lcores.c | 12 +++ app/test/test_lpm.c | 14 ++- app/test/test_lpm6.c | 14 ++- app/test/test_lpm6_perf.c | 14 ++- app/test/test_lpm_perf.c | 13 ++- app/test/test_malloc.c | 17 +++- app/test/test_mbuf.c | 13 ++- app/test/test_member.c | 16 +++- app/test/test_member_perf.c | 16 +++- app/test/test_memcpy_perf.c | 18 +++- app/test/test_mempool_perf.c | 12 +++ app/test/test_mp_secondary.c | 15 ++- app/test/test_rawdev.c | 17 +++- app/test/test_rcu_qsbr_perf.c | 12 +++ app/test/test_reciprocal_division.c | 12 +++ app/test/test_reciprocal_division_perf.c | 12 +++ app/test/test_red.c | 29 +++++- app/test/test_reorder.c | 15 ++- app/test/test_rib.c | 22 ++++- app/test/test_rib6.c | 22 ++++- app/test/test_sched.c | 14 ++- app/test/test_security.c | 16 +++- app/test/test_table.c | 13 +++ app/test/test_table_acl.c | 3 + app/test/test_table_combined.c | 4 + app/test/test_table_pipeline.c | 4 + app/test/test_table_ports.c | 4 + app/test/test_table_tables.c | 4 + app/test/test_timer_secondary.c | 13 +++ app/test/test_trace.c | 32 ++++++- 70 files changed, 1015 insertions(+), 126 deletions(-)
app/test/meson.build +59 -55
@@ -1,12 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() -endif - if not get_option('tests') subdir_done() endif
@@ -157,37 +151,17 @@ test_sources = files( ) test_deps = [ - 'acl', 'bus_pci', 'bus_vdev', 'bitratestats', - 'bpf', 'cfgfile', 'cmdline', - 'cryptodev', - 'distributor', - 'dmadev', - 'efd', 'ethdev', - 'eventdev', - 'fib', - 'flow_classify', - 'graph', 'hash', - 'ipsec', 'latencystats', - 'lpm', - 'member', 'metrics', - 'node', - 'pipeline', - 'port', - 'rawdev', 'rcu', - 'reorder', - 'rib', 'ring', - 'security', 'stack', 'telemetry', 'timer',
@@ -325,39 +299,69 @@ perf_test_names = [ ] driver_test_names = [ - 'cryptodev_aesni_mb_autotest', - 'cryptodev_aesni_gcm_autotest', - 'cryptodev_cn9k_autotest', - 'cryptodev_cn10k_autotest', - 'cryptodev_dpaa_sec_autotest', - 'cryptodev_dpaa2_sec_autotest', - 'cryptodev_null_autotest', - 'cryptodev_octeontx2_autotest', - 'cryptodev_openssl_autotest', - 'cryptodev_openssl_asym_autotest', - 'cryptodev_qat_autotest', - 'cryptodev_sw_armv8_autotest', - 'cryptodev_sw_kasumi_autotest', - 'cryptodev_sw_mvsam_autotest', - 'cryptodev_sw_snow3g_autotest', - 'cryptodev_sw_zuc_autotest', - 'dmadev_autotest', - 'eventdev_selftest_octeontx', - 'eventdev_selftest_sw', - 'rawdev_autotest', ] dump_test_names = [ - 'dump_struct_sizes', - 'dump_mempool', - 'dump_malloc_stats', - 'dump_devargs', - 'dump_log_types', - 'dump_ring', - 'dump_physmem', - 'dump_memzone', ] +if not is_windows + test_deps += [ + 'acl', + 'bpf', + 'cryptodev', + 'distributor', + 'dmadev', + 'efd', + 'eventdev', + 'fib', + 'flow_classify', + 'graph', + 'ipsec', + 'lpm', + 'member', + 'node', + 'pipeline', + 'port', + 'rawdev', + 'reorder', + 'rib', + 'security', + ] + + driver_test_names += [ + 'cryptodev_aesni_mb_autotest', + 'cryptodev_aesni_gcm_autotest', + 'cryptodev_cn9k_autotest', + 'cryptodev_cn10k_autotest', + 'cryptodev_dpaa_sec_autotest', + 'cryptodev_dpaa2_sec_autotest', + 'cryptodev_null_autotest', + 'cryptodev_octeontx2_autotest', + 'cryptodev_openssl_autotest', + 'cryptodev_openssl_asym_autotest', + 'cryptodev_qat_autotest', + 'cryptodev_sw_armv8_autotest', + 'cryptodev_sw_kasumi_autotest', + 'cryptodev_sw_mvsam_autotest', + 'cryptodev_sw_snow3g_autotest', + 'cryptodev_sw_zuc_autotest', + 'eventdev_selftest_octeontx', + 'eventdev_selftest_sw', + 'rawdev_autotest', + ] + + dump_test_names += [ + 'dump_struct_sizes', + 'dump_mempool', + 'dump_malloc_stats', + 'dump_devargs', + 'dump_log_types', + 'dump_ring', + 'dump_physmem', + 'dump_memzone', + ] +endif + # The following linkages are an exception to allow running the # unit tests without requiring that the developer install the # DPDK libraries. Explicit linkage of drivers (plugin libraries)
@@ -371,7 +375,7 @@ endif if dpdk_conf.has('RTE_EVENT_SKELETON') test_deps += 'event_skeleton' endif -if dpdk_conf.has('RTE_LIB_TELEMETRY') +if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY') test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c'] fast_tests += [['telemetry_json_autotest', true], ['telemetry_data_autotest', true]] endif
app/test/test_acl.c +12 -0
@@ -11,6 +11,16 @@#include <rte_mbuf.h> #include <rte_byteorder.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_acl (void ) +{ +printf ("acl not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <rte_acl.h> #include <rte_common.h>
@@ -1741,4 +1751,6 @@ test_acl(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (acl_autotest, test_acl);
app/test/test_bpf.c +14 -1
@@ -14,11 +14,22 @@#include <rte_random.h> #include <rte_byteorder.h> #include <rte_errno.h> +#include "test.h" + +#if !defined(RTE_LIB_BPF ) + +static int +test_bpf (void ) +{ +printf ("BPF not supported, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <rte_bpf.h> #include <rte_ether.h> #include <rte_ip.h> -#include "test.h" /* * Basic functional tests for librte_bpf.
@@ -3248,6 +3259,8 @@ test_bpf(void) return rc; } +#endif +REGISTER_TEST_COMMAND (bpf_autotest, test_bpf);#ifdef RTE_PORT_PCAP
app/test/test_cksum.c +12 -0
@@ -13,6 +13,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_cksum (void ) +{ +printf ("cksum not supported, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MEMPOOL_CACHE_SIZE 0#define MBUF_DATA_SIZE 256#define NB_MBUF 128
@@ -268,4 +278,6 @@ test_cksum(void) }#undef GOTO_FAIL +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (cksum_autotest, test_cksum);
app/test/test_cmdline_ipaddr.c +5 -0
@@ -2,9 +2,12 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <stdio.h> #include <string.h> #include <inttypes.h> +#include <netinet/in.h> #include <sys/socket.h>
@@ -669,3 +672,5 @@ test_parse_ipaddr_invalid_param(void) }return 0 ; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev.c +4 -0
@@ -3,6 +3,8 @@* Copyright 2020 NXP */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <time.h> #include <rte_common.h>
@@ -15715,3 +15717,5 @@ REGISTER_TEST_COMMAND(cryptodev_nitrox_autotest, test_cryptodev_nitrox);REGISTER_TEST_COMMAND (cryptodev_bcmfs_autotest, test_cryptodev_bcmfs);REGISTER_TEST_COMMAND (cryptodev_cn9k_autotest, test_cryptodev_cn9k);REGISTER_TEST_COMMAND (cryptodev_cn10k_autotest, test_cryptodev_cn10k); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_asym.c +4 -0
@@ -3,6 +3,8 @@* Copyright (c) 2019 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_bus_vdev.h> #include <rte_common.h> #include <rte_hexdump.h>
@@ -2429,3 +2431,5 @@ REGISTER_TEST_COMMAND(cryptodev_octeontx2_asym_autotest, test_cryptodev_octeontx2_asym);REGISTER_TEST_COMMAND (cryptodev_cn9k_asym_autotest, test_cryptodev_cn9k_asym);REGISTER_TEST_COMMAND (cryptodev_cn10k_asym_autotest, test_cryptodev_cn10k_asym); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_blockcipher.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2015-2017 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_common.h> #include <rte_hexdump.h> #include <rte_mbuf.h>
@@ -1218,3 +1220,5 @@ free_blockcipher_test_suite(struct unit_test_suite *ts) {free (ts); } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_security_ipsec.c +4 -0
@@ -2,6 +2,8 @@* Copyright(C) 2021 Marvell. */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_common.h> #include <rte_cryptodev.h> #include <rte_esp.h>
@@ -672,3 +674,5 @@ test_ipsec_status_check(struct rte_crypto_op *op, return ret; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_security_pdcp.c +4 -0
@@ -4,6 +4,8 @@* Copyright 2018-2019 NXP */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <time.h> #include <rte_common.h>
@@ -587,3 +589,5 @@ test_PDCP_PROTO_uplane_decap_all(void) return n - i; }; + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_debug.c +15 -2
@@ -2,8 +2,21 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_debug (void ) +{ +printf ("debug not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/resource.h> #include <sys/time.h> #include <sys/wait.h>
@@ -14,8 +27,6 @@#include <rte_eal.h> #include <rte_service_component.h> -#include "test.h" -/* * Debug test * ==========
@@ -127,4 +138,6 @@ test_debug(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (debug_autotest, test_debug);
app/test/test_distributor.c +13 -0
@@ -11,6 +11,17 @@#include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_mbuf_dyn.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_distributor (void ) +{ +printf ("distributor not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_distributor.h> #include <rte_string_fns.h>
@@ -939,4 +950,6 @@ test_distributor(void) return -1; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (distributor_autotest, test_distributor);
app/test/test_distributor_perf.c +13 -0
@@ -10,6 +10,17 @@#include <rte_cycles.h> #include <rte_common.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_distributor_perf (void ) +{ +printf ("distributor perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_distributor.h> #include <rte_pause.h>
@@ -267,4 +278,6 @@ test_distributor_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (distributor_perf_autotest, test_distributor_perf);
app/test/test_dmadev.c +13 -1
@@ -2,6 +2,17 @@* Copyright(c) 2021 HiSilicon Limited * Copyright(c) 2021 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_dma (void ) +{ +printf ("dma not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <inttypes.h>
@@ -13,7 +24,6 @@#include <rte_bus_vdev.h> #include <rte_dmadev_pmd.h> -#include "test.h" #include "test_dmadev_api.h" #define ERR_RETURN (...) do { print_err(__func__, __LINE__, __VA_ARGS__); return -1; } while (0)
@@ -864,4 +874,6 @@ test_dma(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (dmadev_autotest, test_dma);
app/test/test_dmadev_api.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2021 HiSilicon Limited */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include <rte_cycles.h>
@@ -572,3 +574,5 @@ test_dma_api(uint16_t dev_id) return 0; }; + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_eal_flags.c +97 -0
109 lines not on this page · raw message
app/test/test_eal_fs.c +12 -0
@@ -10,6 +10,16 @@#include "eal_filesystem.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_eal_fs (void ) +{ +printf ("eal_fs not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +static int test_parse_sysfs_value (void ) {
@@ -173,4 +183,6 @@ test_eal_fs(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (eal_fs_autotest, test_eal_fs);
app/test/test_efd.c +13 -2
@@ -1,6 +1,17 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2016-2017 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_efd (void ) +{ +printf ("efd not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <rte_memcpy.h> #include <rte_malloc.h>
@@ -10,8 +21,6 @@#include <rte_debug.h> #include <rte_ip.h> -#include "test.h" -#define EFD_TEST_KEY_LEN 8#define TABLE_SIZE (1 << 21)#define ITERATIONS 3
@@ -462,4 +471,6 @@ test_efd(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (efd_autotest, test_efd);
app/test/test_efd_perf.c +14 -2
@@ -2,6 +2,18 @@* Copyright(c) 2016-2017 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_efd_perf (void ) +{ +printf ("efd_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <stdio.h> #include <inttypes.h>
@@ -13,8 +25,6 @@#include <rte_memcpy.h> #include <rte_thash.h> -#include "test.h" -#define NUM_KEYSIZES 10#define NUM_SHUFFLES 10#define MAX_KEYSIZE 64
@@ -382,4 +392,6 @@ test_efd_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (efd_perf_autotest, test_efd_perf);
app/test/test_event_crypto_adapter.c +14 -1
@@ -3,16 +3,27 @@* All rights reserved. */ +#include "test.h" #include <string.h> #include <rte_common.h> #include <rte_mempool.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_crypto_adapter (void ) +{ +printf ("event_crypto_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_cryptodev.h> #include <rte_eventdev.h> #include <rte_bus_vdev.h> #include <rte_service.h> #include <rte_event_crypto_adapter.h> -#include "test.h" #define PKT_TRACE 0#define NUM 1
@@ -1011,5 +1022,7 @@ test_event_crypto_adapter(void) return unit_test_suite_runner(&functional_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_crypto_adapter_autotest, test_event_crypto_adapter);
app/test/test_event_eth_rx_adapter.c +23 -2
@@ -1,18 +1,37 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ + +#include "test.h" +#include <string.h> #include <rte_common.h> #include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_ethdev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_eth_rx_adapter_common (void ) +{ +printf ("event_eth_rx_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_event_eth_rx_intr_adapter_common (void ) +{ +printf ("event_eth_rx_intr_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_bus_vdev.h> #include <rte_event_eth_rx_adapter.h> -#include "test.h" -#define MAX_NUM_RX_QUEUE 64#define NB_MBUFS (8192 * num_ports * MAX_NUM_RX_QUEUE)#define MBUF_CACHE_SIZE 512
@@ -967,6 +986,8 @@ test_event_eth_rx_intr_adapter_common(void)return unit_test_suite_runner (&event_eth_rx_intr_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_eth_rx_adapter_autotest, test_event_eth_rx_adapter_common); REGISTER_TEST_COMMAND(event_eth_rx_intr_adapter_autotest,
app/test/test_event_eth_tx_adapter.c +12 -0
@@ -16,6 +16,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_eth_tx_adapter_common (void ) +{ +printf ("event_eth_tx_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_NUM_QUEUE RTE_PMD_RING_MAX_RX_RINGS#define TEST_INST_ID 0#define TEST_DEV_ID 0
@@ -696,5 +706,7 @@ test_event_eth_tx_adapter_common(void) return unit_test_suite_runner(&event_eth_tx_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_eth_tx_adapter_autotest, test_event_eth_tx_adapter_common);
app/test/test_event_ring.c +14 -2
@@ -2,11 +2,21 @@* Copyright(c) 2010-2017 Intel Corporation */ +#include "test.h" +#include <string.h> -#include <rte_event_ring.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_ring (void ) +{ +printf ("event_ring not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} -#include "test.h" +#else + +#include <rte_event_ring.h> /* * Event Ring
@@ -244,4 +254,6 @@ test_event_ring(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_ring_autotest, test_event_ring);
app/test/test_event_timer_adapter.c +14 -2
@@ -2,6 +2,7 @@* Copyright(c) 2017 Cavium, Inc * Copyright(c) 2017-2018 Intel Corporation. */ +#include "test.h" #include <math.h>
@@ -11,6 +12,17 @@#include <rte_debug.h> #include <rte_eal.h> #include <rte_ethdev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_timer_adapter_func (void ) +{ +printf ("event_timer_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_event_timer_adapter.h> #include <rte_mempool.h>
@@ -22,8 +34,6 @@#include <rte_service.h> #include <stdbool.h> -#include "test.h" -/* 4K timers corresponds to sw evdev max inflight events */ #define MAX_TIMERS (4 * 1024)#define BKT_TCK_NSEC
@@ -1951,4 +1961,6 @@ test_event_timer_adapter_func(void) return unit_test_suite_runner(&event_timer_adptr_functional_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_timer_adapter_test, test_event_timer_adapter_func);
app/test/test_eventdev.c +18 -2
@@ -1,18 +1,28 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2016 Cavium, Inc */ +#include "test.h" #include <rte_common.h> #include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_memcpy.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_eventdev_common (void ) +{ +printf ("eventdev_common not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_dev.h> #include <rte_bus_vdev.h> -#include "test.h" -#define TEST_DEV_ID 0 static int
@@ -1048,7 +1058,11 @@ test_eventdev_selftest_cn10k(void) return test_eventdev_selftest_impl("event_cn10k", ""); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (eventdev_common_autotest, test_eventdev_common); + +#ifndef RTE_EXEC_ENV_WINDOWS REGISTER_TEST_COMMAND (eventdev_selftest_sw, test_eventdev_selftest_sw);REGISTER_TEST_COMMAND (eventdev_selftest_octeontx, test_eventdev_selftest_octeontx);
@@ -1058,3 +1072,5 @@ REGISTER_TEST_COMMAND(eventdev_selftest_dpaa2, test_eventdev_selftest_dpaa2);REGISTER_TEST_COMMAND (eventdev_selftest_dlb2, test_eventdev_selftest_dlb2);REGISTER_TEST_COMMAND (eventdev_selftest_cn9k, test_eventdev_selftest_cn9k);REGISTER_TEST_COMMAND (eventdev_selftest_cn10k, test_eventdev_selftest_cn10k); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_external_mem.c +16 -2
@@ -2,11 +2,25 @@* Copyright(c) 2018 Intel Corporation */ +#include "test.h" +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> + + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_external_mem (void ) +{ +printf ("external_mem not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/mman.h> #include <sys/wait.h>
@@ -19,8 +33,6 @@#include <rte_ring.h> #include <rte_string_fns.h> -#include "test.h" -#define EXTERNAL_MEM_SZ (RTE_PGSIZE_4K << 10)/* 4M of data */ static int
@@ -574,4 +586,6 @@ test_external_mem(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (external_mem_autotest, test_external_mem);
app/test/test_fib.c +21 -1
@@ -9,10 +9,28 @@#include <rte_ip.h> #include <rte_log.h> -#include <rte_fib.h> #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib (void ) +{ +printf ("fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_fib (void ) +{ +printf ("slow_fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib.h> +typedef int32_t (*rte_fib_test )(void );static int32_t test_create_invalid (void );
@@ -410,5 +428,7 @@ test_slow_fib(void) return unit_test_suite_runner(&fib_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib_autotest, test_fib);REGISTER_TEST_COMMAND (fib_slow_autotest, test_slow_fib);
app/test/test_fib6.c +22 -2
@@ -9,11 +9,29 @@#include <rte_memory.h> #include <rte_log.h> -#include <rte_rib6.h> -#include <rte_fib6.h> #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib6 (void ) +{ +printf ("fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_fib6 (void ) +{ +printf ("slow_fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_rib6.h> +#include <rte_fib6.h> +typedef int32_t (*rte_fib6_test )(void );static int32_t test_create_invalid (void );
@@ -419,5 +437,7 @@ test_slow_fib6(void) return unit_test_suite_runner(&fib6_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib6_autotest, test_fib6);REGISTER_TEST_COMMAND (fib6_slow_autotest, test_slow_fib6);
app/test/test_fib6_perf.c +15 -1
@@ -10,9 +10,21 @@#include <rte_cycles.h> #include <rte_random.h> #include <rte_memory.h> -#include <rte_fib6.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib6_perf (void ) +{ +printf ("fib6_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib6.h> +#include "test_lpm6_data.h" #define TEST_FIB_ASSERT (cond) do { \
@@ -154,4 +166,6 @@ test_fib6_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib6_perf_autotest, test_fib6_perf);
app/test/test_fib_perf.c +14 -1
@@ -12,11 +12,22 @@#include <rte_random.h> #include <rte_branch_prediction.h> #include <rte_ip.h> -#include <rte_fib.h> #include "test.h" #include "test_xmmt_ops.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib_perf (void ) +{ +printf ("fib_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib.h> +#define TEST_FIB_ASSERT (cond) do { \ if (!(cond)) { \ printf("Error at line %d:\n", __LINE__); \
@@ -408,4 +419,6 @@ test_fib_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib_perf_autotest, test_fib_perf);
app/test/test_flow_classify.c +13 -0
@@ -11,6 +11,17 @@#include <rte_mbuf.h> #include <rte_byteorder.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_flow_classify (void ) +{ +printf ("flow_classify not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_acl.h> #include <rte_common.h> #include <rte_table_acl.h>
@@ -879,4 +890,6 @@ test_flow_classify(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (flow_classify_autotest, test_flow_classify);
app/test/test_func_reentrancy.c +12 -0
@@ -41,6 +41,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_func_reentrancy (void ) +{ +printf ("reentrancy not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +typedef int (*case_func_t )(void * arg);typedef void (*case_clean_t )(unsigned lcore_id);
@@ -512,4 +522,6 @@ test_func_reentrancy(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (func_reentrancy_autotest, test_func_reentrancy);
app/test/test_graph.c +16 -2
@@ -1,6 +1,8 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2020 Marvell International Ltd. */ +#include "test.h" +#include <assert.h> #include <inttypes.h> #include <signal.h>
@@ -9,14 +11,23 @@#include <unistd.h> #include <rte_errno.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_node_list_dump (void ) +{ +printf ("node_list_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_graph.h> #include <rte_graph_worker.h> #include <rte_mbuf.h> #include <rte_mbuf_dyn.h> #include <rte_random.h> -#include "test.h" -static uint16_t test_node_worker_source (struct rte_graph *graph,struct rte_node *node,void **objs,uint16_t nb_objs);
@@ -841,4 +852,7 @@ test_node_list_dump(void) return TEST_SUCCESS; } + +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (node_list_dump, test_node_list_dump);
app/test/test_graph_perf.c +14 -2
@@ -1,6 +1,8 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2020 Marvell International Ltd. */ +#include "test.h" +#include <inttypes.h> #include <signal.h> #include <stdio.h>
@@ -9,14 +11,22 @@#include <rte_common.h> #include <rte_cycles.h> #include <rte_errno.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_graph_perf_func (void ) +{ +printf ("graph_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_graph.h> #include <rte_graph_worker.h> #include <rte_lcore.h> #include <rte_malloc.h> #include <rte_mbuf.h> -#include "test.h" -#define TEST_GRAPH_PERF_MZ "graph_perf_data"#define TEST_GRAPH_SRC_NAME "test_graph_perf_source"#define TEST_GRAPH_SRC_BRST_ONE_NAME "test_graph_perf_source_one"
@@ -1060,4 +1070,6 @@ test_graph_perf_func(void) return unit_test_suite_runner(&graph_perf_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (graph_perf_autotest, test_graph_perf_func);
app/test/test_hash_perf.c +12 -0
@@ -17,6 +17,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_hash_perf (void ) +{ +printf ("hash_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ENTRIES (1 << 19)#define KEYS_TO_ADD (MAX_ENTRIES)#define ADD_PERCENT 0.75/* 75% table utilization */
@@ -749,4 +759,6 @@ test_hash_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (hash_perf_autotest, test_hash_perf);
app/test/test_ipfrag.c +14 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Red Hat, Inc. */ +#include "test.h" #include <time.h>
@@ -8,13 +9,22 @@#include <rte_cycles.h> #include <rte_hexdump.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipfrag (void ) +{ +printf ("ipfrag not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ip_frag.h> #include <rte_mbuf.h> #include <rte_memcpy.h> #include <rte_random.h> -#include "test.h" -#define NUM_MBUFS 128#define BURST 32
@@ -259,4 +269,6 @@ test_ipfrag(void) return unit_test_suite_runner(&ipfrag_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipfrag_autotest, test_ipfrag);
app/test/test_ipsec.c +14 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2018 Intel Corporation */ +#include "test.h" #include <time.h>
@@ -13,15 +14,25 @@#include <rte_bus_vdev.h> #include <rte_ip.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipsec (void ) +{ +printf ("ipsec not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_crypto.h> #include <rte_cryptodev.h> #include <rte_lcore.h> +#include <rte_ipsec.h> #include <rte_random.h> #include <rte_esp.h> #include <rte_security_driver.h> -#include "test.h" #include "test_cryptodev.h" #define VDEV_ARGS_SIZE 100
@@ -2536,4 +2547,6 @@ test_ipsec(void) return unit_test_suite_runner(&ipsec_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_autotest, test_ipsec);
app/test/test_ipsec_perf.c +14 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <rte_ip.h>
@@ -8,10 +9,20 @@#include <rte_ring.h> #include <rte_mbuf.h> #include <rte_cycles.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_libipsec_perf (void ) +{ +printf ("ipsec_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ipsec.h> #include <rte_random.h> -#include "test.h" #include "test_cryptodev.h" #define RING_SIZE 4096
@@ -611,4 +622,6 @@ test_libipsec_perf(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_perf_autotest, test_libipsec_perf);
app/test/test_ipsec_sad.c +13 -1
@@ -1,16 +1,26 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipsec_sad (void ) +{ +printf ("ipsec_sad not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ipsec_sad.h> #include <rte_memory.h> -#include "test.h" #include "test_xmmt_ops.h" typedef int32_t (*rte_ipsec_sad_test )(void );
@@ -884,4 +894,6 @@ test_ipsec_sad(void) return unit_test_suite_runner(&ipsec_sad_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_sad_autotest, test_ipsec_sad);
app/test/test_kni.c +5 -5
@@ -2,15 +2,12 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> #include <unistd.h> #include <string.h> -#include <sys/wait.h> -#include <dirent.h> - -#include "test.h" -#if !defined(RTE_EXEC_ENV_LINUX ) || !defined(RTE_LIB_KNI ) static int
@@ -22,6 +19,9 @@ test_kni(void)#else +#include <sys/wait.h> +#include <dirent.h> +#include <rte_string_fns.h> #include <rte_mempool.h> #include <rte_ethdev.h>
app/test/test_lcores.c +12 -0
@@ -11,6 +11,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lcores(void) +{ + printf("lcore not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + struct thread_context { enum { INIT, ERROR, DONE } state; bool lcore_id_any;
@@ -411,4 +421,6 @@ test_lcores(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lcores_autotest, test_lcores);
app/test/test_lpm.c +13 -1
@@ -1,6 +1,17 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm (void ) +{ +printf ("lpm not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <stdio.h> #include <stdint.h>
@@ -10,7 +21,6 @@#include <rte_lpm.h> #include <rte_malloc.h> -#include "test.h" #include "test_xmmt_ops.h" #define TEST_LPM_ASSERT (cond) do { \
@@ -1584,4 +1594,6 @@ test_lpm(void) return global_status; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm_autotest, test_lpm);
app/test/test_lpm6.c +13 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h>
@@ -8,9 +9,18 @@#include <string.h> #include <rte_memory.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm6 (void ) +{ +printf ("lpm6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_lpm6.h> -#include "test.h" #include "test_lpm6_data.h" #define TEST_LPM_ASSERT (cond) do { \
@@ -1792,4 +1802,6 @@ test_lpm6(void) return global_status; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm6_autotest, test_lpm6);
app/test/test_lpm6_perf.c +13 -1
@@ -1,6 +1,17 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm6_perf (void ) +{ +printf ("lpm6_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <stdio.h> #include <stdint.h>
@@ -12,7 +23,6 @@#include <rte_memory.h> #include <rte_lpm6.h> -#include "test.h" #include "test_lpm6_data.h" #define TEST_LPM_ASSERT (cond) do { \
@@ -160,4 +170,6 @@ test_lpm6_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm6_perf_autotest, test_lpm6_perf);
app/test/test_lpm_perf.c +12 -1
@@ -2,7 +2,17 @@* Copyright(c) 2010-2014 Intel Corporation * Copyright(c) 2020 Arm Limited */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm_perf (void ) +{ +printf ("lpm_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else #include <stdio.h> #include <stdint.h> #include <stdlib.h>
@@ -15,7 +25,6 @@#include <rte_ip.h> #include <rte_lpm.h> -#include "test.h" #include "test_xmmt_ops.h" struct rte_lpm *lpm;
@@ -763,4 +772,6 @@ test_lpm_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm_perf_autotest, test_lpm_perf);
app/test/test_malloc.c +14 -3
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2019 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h>
@@ -8,6 +9,17 @@#include <stdarg.h> #include <errno.h> #include <stdlib.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_malloc (void ) +{ +printf ("malloc not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/mman.h> #include <sys/queue.h> #include <unistd.h>
@@ -23,11 +35,8 @@#include <rte_random.h> #include <rte_string_fns.h> -#include "test.h" -#define N 10000 -static int is_mem_on_socket (int32_t socket);
@@ -1080,4 +1089,6 @@ test_malloc(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (malloc_autotest, test_malloc);
app/test/test_mbuf.c +12 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <string.h> #include <stdarg.h>
@@ -34,7 +35,15 @@#include <rte_tcp.h> #include <rte_mbuf_dyn.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_mbuf (void ) +{ +printf ("mbuf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #define MEMPOOL_CACHE_SIZE 32#define MBUF_DATA_SIZE 2048
@@ -2972,4 +2981,6 @@ test_mbuf(void) }#undef GOTO_FAIL +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (mbuf_autotest, test_mbuf);
app/test/test_member.c +14 -2
@@ -3,17 +3,27 @@*/ /* This test is for membership library's simple feature test */ +#include "test.h" #include <rte_memcpy.h> #include <rte_malloc.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_member (void ) +{ +printf ("member not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_member.h> #include <rte_byteorder.h> #include <rte_random.h> #include <rte_debug.h> #include <rte_ip.h> -#include "test.h" -struct rte_member_setsum *setsum_ht;struct rte_member_setsum *setsum_cache;struct rte_member_setsum *setsum_vbf;
@@ -712,4 +722,6 @@ test_member(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (member_autotest, test_member);
app/test/test_member_perf.c +14 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <inttypes.h>
@@ -11,9 +12,18 @@#include <rte_random.h> #include <rte_memcpy.h> #include <rte_thash.h> -#include <rte_member.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_member_perf (void ) +{ +printf ("member_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_member.h> #define NUM_KEYSIZES 10#define NUM_SHUFFLES 10
@@ -622,4 +632,6 @@ test_member_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (member_perf_autotest, test_member_perf);
app/test/test_memcpy_perf.c +15 -3
@@ -2,21 +2,31 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdint.h> #include <stdio.h> #include <string.h> #include <stdlib.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_memcpy_perf (void ) +{ +printf ("memcpy_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/time.h> #include <rte_common.h> #include <rte_cycles.h> #include <rte_random.h> #include <rte_malloc.h> -#include <rte_memcpy.h> -#include "test.h" -/* * Set this to the maximum buffer size you want to test. If it is 0, then the * values in the buf_sizes[] array below will be used.
@@ -347,4 +357,6 @@ test_memcpy_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (memcpy_perf_autotest, test_memcpy_perf);
app/test/test_mempool_perf.c +12 -0
@@ -28,6 +28,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_mempool_perf (void ) +{ +printf ("mempool_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +/* * Mempool performance * =======
@@ -393,4 +403,6 @@ test_mempool_perf(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (mempool_perf_autotest, test_mempool_perf);
app/test/test_mp_secondary.c +13 -2
@@ -14,9 +14,18 @@#include <errno.h> #include <string.h> #include <unistd.h> -#ifndef RTE_EXEC_ENV_WINDOWS + +#ifdef RTE_EXEC_ENV_WINDOWS +int +test_mp_secondary (void ) +{ +printf ("mp_secondary not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/wait.h> -#endif #include <libgen.h> #include <dirent.h> #include <limits.h>
@@ -214,4 +223,6 @@ test_mp_secondary(void) return run_object_creation_tests(); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (multiprocess_autotest, test_mp_secondary);
app/test/test_rawdev.c +15 -2
@@ -1,16 +1,27 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2017 NXP */ +#include "test.h" +#include <rte_common.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_dev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rawdev_selftests (void ) +{ +printf ("rawdev not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_rawdev.h> #include <rte_bus_vdev.h> -#include "test.h" -static int test_rawdev_selftest_impl (const char *pmd,const char *opts) {
@@ -54,4 +65,6 @@ test_rawdev_selftests(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rawdev_autotest, test_rawdev_selftests);
app/test/test_rcu_qsbr_perf.c +12 -0
@@ -15,6 +15,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rcu_qsbr_main (void ) +{ +printf ("rcu_qsbr_main not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +/* Check condition and return an error if true. */ static uint16_t enabled_core_ids[RTE_MAX_LCORE ];static unsigned int num_cores;
@@ -687,4 +697,6 @@ test_rcu_qsbr_main(void) return -1; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rcu_qsbr_perf_autotest, test_rcu_qsbr_main);
app/test/test_reciprocal_division.c +12 -0
@@ -13,6 +13,16 @@#include <rte_random.h> #include <rte_reciprocal.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reciprocal (void ) +{ +printf ("reciprocal not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ITERATIONS (1ULL << 32)#define DIVIDE_ITER (100)
@@ -164,4 +174,6 @@ test_reciprocal(void) return result; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reciprocal_division, test_reciprocal);
app/test/test_reciprocal_division_perf.c +12 -0
@@ -13,6 +13,16 @@#include <rte_random.h> #include <rte_reciprocal.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reciprocal_division_perf (void ) +{ +printf ("reciprocal_division_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ITERATIONS (1ULL << 32)#define DIVIDE_ITER (1ULL << 28)
@@ -205,4 +215,6 @@ test_reciprocal_division_perf(void) return result; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reciprocal_division_perf, test_reciprocal_division_perf);
app/test/test_red.c +27 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdlib.h> #include <stdio.h>
@@ -8,12 +9,34 @@#include <stdint.h> #include <unistd.h> #include <inttypes.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_red (void ) +{ +printf ("red not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_red_perf (void ) +{ +printf ("red_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_red_all (void ) +{ +printf ("red_all not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#include <sys/time.h> #include <time.h> #include <math.h> -#include "test.h" -#include <rte_red.h> #ifdef __INTEL_COMPILER
@@ -1851,6 +1874,8 @@ test_red_all(void) return tell_the_result(num_tests, num_pass); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (red_autotest, test_red);REGISTER_TEST_COMMAND (red_perf, test_red_perf);REGISTER_TEST_COMMAND (red_all, test_red_all);
app/test/test_reorder.c +13 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <unistd.h>
@@ -9,12 +10,20 @@#include <rte_cycles.h> #include <rte_errno.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reorder (void ) +{ +printf ("reorder not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#include <rte_reorder.h> #include <rte_lcore.h> #include <rte_malloc.h> -#include "test.h" -#define BURST 32#define REORDER_BUFFER_SIZE 16384#define NUM_MBUFS (2*REORDER_BUFFER_SIZE)
@@ -390,4 +399,6 @@ test_reorder(void) return unit_test_suite_runner(&reorder_test_suite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reorder_autotest, test_reorder);
app/test/test_rib.c +20 -2
@@ -2,15 +2,31 @@* Copyright(c) 2018 Vladimir Medvedkin <[email protected]> * Copyright(c) 2019 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <rte_ip.h> -#include <rte_rib.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rib (void ) +{ +printf ("rib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_rib (void ) +{ +printf ("slow_rib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else + +#include <rte_rib.h> typedef int32_t (*rte_rib_test )(void );
@@ -363,5 +379,7 @@ test_slow_rib(void) return unit_test_suite_runner(&rib_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rib_autotest, test_rib);REGISTER_TEST_COMMAND (rib_slow_autotest, test_slow_rib);
app/test/test_rib6.c +20 -2
@@ -3,14 +3,31 @@* Copyright(c) 2019 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <rte_ip.h> -#include <rte_rib6.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rib6 (void ) +{ +printf ("rib6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_rib6 (void ) +{ +printf ("slow_rib6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else + +#include <rte_rib6.h> typedef int32_t (*rte_rib6_test )(void );
@@ -368,5 +385,6 @@ test_slow_rib6(void) return unit_test_suite_runner(&rib6_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ REGISTER_TEST_COMMAND (rib6_autotest, test_rib6);REGISTER_TEST_COMMAND (rib6_slow_autotest, test_slow_rib6);
app/test/test_sched.c +13 -1
@@ -14,8 +14,18 @@#include <rte_ether.h> #include <rte_ip.h> #include <rte_byteorder.h> -#include <rte_sched.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_sched (void ) +{ +printf ("sched not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_sched.h> #define SUBPORT 0#define PIPE 1
@@ -204,4 +214,6 @@ test_sched(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (sched_autotest, test_sched);
app/test/test_security.c +15 -1
@@ -1,12 +1,24 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved */ +#include "test.h" #include <rte_errno.h> #include <rte_log.h> #include <rte_memory.h> #include <rte_mempool.h> #include <rte_ether.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_security (void ) +{ +printf ("security not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_security.h> #include <rte_security_driver.h>
@@ -20,7 +32,7 @@#endif #include <rte_test.h> -#include "test.h" +/** * Security
@@ -2639,4 +2651,6 @@ test_security(void) return unit_test_suite_runner(&security_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (security_autotest, test_security);
app/test/test_table.c +13 -0
@@ -7,6 +7,17 @@#include <rte_string_fns.h> #include <string.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_table (void ) +{ +printf ("table not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include "test_table.h" #include "test_table_pipeline.h" #include "test_table_ports.h"
@@ -194,4 +205,6 @@ test_table(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (table_autotest, test_table);
app/test/test_table_acl.c +3 -0
@@ -2,6 +2,7 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS #include <rte_ip.h> #include <rte_string_fns.h> #include <rte_hexdump.h>
@@ -728,3 +729,5 @@ test_table_acl(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_combined.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2016 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include "test_table_combined.h" #include "test_table.h"
@@ -840,3 +842,5 @@ test_table_hash_cuckoo_combined(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_pipeline.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include <rte_pipeline.h> #include <rte_log.h>
@@ -569,3 +571,5 @@ test_table_pipeline(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_ports.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include "test_table_ports.h" #include "test_table.h"
@@ -189,3 +191,5 @@ test_port_ring_writer(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_tables.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2016 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include <rte_byteorder.h> #include <rte_table_lpm_ipv6.h>
@@ -1052,3 +1054,5 @@ test_table_hash_cuckoo(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_timer_secondary.c +13 -0
@@ -16,6 +16,17 @@#include <rte_random.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +int +test_timer_secondary (void ) +{ +printf ("timer_secondary not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include "process.h" #define NUM_TIMERS (1 << 20)/* ~1M timers */
@@ -213,4 +224,6 @@ test_timer_secondary(void) return TEST_FAILED; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (timer_secondary_autotest, test_timer_secondary);
app/test/test_trace.c +28 -4
@@ -9,6 +9,30 @@#include "test.h" #include "test_trace.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_trace (void ) +{ +printf ("trace not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_trace_dump (void ) +{ +printf ("trace_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_trace_metadata_dump (void ) +{ +printf ("trace_metadata_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +static int32_t test_trace_point_globbing (void ) {
@@ -194,8 +218,6 @@ test_trace(void)return unit_test_suite_runner (&trace_tests); } -REGISTER_TEST_COMMAND (trace_autotest, test_trace); -static int test_trace_dump (void ) {
@@ -203,12 +225,14 @@ test_trace_dump(void) return 0; } -REGISTER_TEST_COMMAND (trace_dump, test_trace_dump); -static int test_trace_metadata_dump (void ) {return rte_trace_metadata_dump (stdout); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + +REGISTER_TEST_COMMAND (trace_autotest, test_trace); +REGISTER_TEST_COMMAND (trace_dump, test_trace_dump);REGISTER_TEST_COMMAND (trace_metadata_dump, test_trace_metadata_dump);
Signature · 1 line
2.32.0.windows.2
v9 cover app/test: enable subset of tests on Windows
In reply to Jie ZhouFrom: Jie Zhou <[email protected]>
This patchset is to enable a subset of unit tests on windows. It mainly includes:
- Replace POSIX specific codes
- Add test stubs for not supported ones on Windows
- Fix some lib and tests per failures investigation
- Replace .sh script with .py script for meson.build
- Enable build and run subset of unit tests on Windows
Future work:
- Work with CI/CD lab to onboard unit tests on Windows to catch regression
- Enable more tests
---
V2 changes:
- Fix compilation error on FreeBSD
- Fix email mismatch issue
- Add a missing space around "*"
---
V3 changes:
- Fix a misc c coding style issue
- Revise some commit title and message body
- Fix violations of PEP8 in new added Python scripts
- Add error handling in get_coremask.py
- Fix has_hugepage.py to check system support of hugepages instead of checking privileges
- Fix test meson.build to run Python scripts using py3
- Consolidate lists of source files, test dep, etc. across all platforms, with conditional extending on some platform(s)
---
V4 changes:
- Remove building of ip_frag, rib, and reorder libraries on Windows. These three libs usually can be built on Windows without change. However, in between the time of V3 and V4, there is regression in upstream caused build failures of these three libs. Will separately investigate and enable these libraries.
- Remove previous patch#2 (Enable mempool/stack on Windows) from this patchset as it was separated out and merged as patch-19314.
- Consolidate the source files, deps, tests lists across platforms as much as possible.
---
V5 changes:
- Remove a space between function name and open parenthesis '('
- Add back a header mistakenly deleted
---
V6 changes:
- Fix inconsistent static vs. non-static declarations
---
V7 changes:
- Remove get_coremask.py as it is not needed any more in meson.build
- Remove enablement of efd and lpm and their corresponding unit tests. The enablement of these two libs and their UTs will be in separate patches after this patch set.
V8 changes:
- Fix coding style issue of using C99 // comments
V9 changes:
- Fix has_hugepage.py with adding failure handling on Linux, using proper variable name to follow Python convention, and removing unnecessary comment.
- Enable previously skipped test_cmdline_socket_fns test cases
- Revise title and message, and add Fixes info for current Patch#3
- Combine 2 patches (previous #2 and #3 in V8) into one and with more detailed message
Jie Zhou (9):
eal/windows: return ENOTSUP for not supported API app/test: remove POSIX-specific code app/test: fix incorrect errno variable app/test: skip interrupt tests on Windows app/test: skip two logs_autotest cases on Windows app/test: differentiate a strerror on different OS app/test: remove two alarm_autotest cases app/test: replace .sh script with .py script app/test: enable subset of unit tests on Windows
app/test/commands.c | 2 - app/test/has-hugepage.sh | 11 --- app/test/has_hugepage.py | 26 +++++ app/test/meson.build | 119 ++++++++++++----------- app/test/packet_burst_generator.c | 1 + app/test/process.h | 4 +- app/test/test.c | 5 +- app/test/test_acl.c | 12 +++ app/test/test_alarm.c | 4 + app/test/test_bpf.c | 15 ++- app/test/test_byteorder.c | 2 +- app/test/test_cksum.c | 12 +++ app/test/test_cmdline.c | 2 + app/test/test_cmdline_ipaddr.c | 5 + app/test/test_cmdline_lib.c | 13 ++- app/test/test_crc.c | 1 - app/test/test_cryptodev.c | 4 + app/test/test_cryptodev_asym.c | 4 + app/test/test_cryptodev_blockcipher.c | 4 + app/test/test_cryptodev_security_ipsec.c | 4 + app/test/test_cryptodev_security_pdcp.c | 4 + app/test/test_debug.c | 17 +++- app/test/test_distributor.c | 13 +++ app/test/test_distributor_perf.c | 13 +++ app/test/test_dmadev.c | 14 ++- app/test/test_dmadev_api.c | 4 + app/test/test_eal_flags.c | 90 +++++++++++++++++ app/test/test_eal_fs.c | 12 +++ app/test/test_efd.c | 15 ++- app/test/test_efd_perf.c | 16 ++- app/test/test_errno.c | 12 ++- app/test/test_event_crypto_adapter.c | 15 ++- app/test/test_event_eth_rx_adapter.c | 25 ++++- app/test/test_event_eth_tx_adapter.c | 12 +++ app/test/test_event_ring.c | 16 ++- app/test/test_event_timer_adapter.c | 16 ++- app/test/test_eventdev.c | 20 +++- app/test/test_external_mem.c | 18 +++- app/test/test_fib.c | 22 ++++- app/test/test_fib6.c | 24 ++++- app/test/test_fib6_perf.c | 16 ++- app/test/test_fib_perf.c | 15 ++- app/test/test_flow_classify.c | 13 +++ app/test/test_func_reentrancy.c | 12 +++ app/test/test_graph.c | 18 +++- app/test/test_graph_perf.c | 16 ++- app/test/test_hash_perf.c | 12 +++ app/test/test_interrupts.c | 10 ++ app/test/test_ipfrag.c | 16 ++- app/test/test_ipsec.c | 15 ++- app/test/test_ipsec_perf.c | 15 ++- app/test/test_ipsec_sad.c | 14 ++- app/test/test_kni.c | 10 +- app/test/test_lcores.c | 12 +++ app/test/test_logs.c | 6 +- app/test/test_lpm.c | 14 ++- app/test/test_lpm6.c | 14 ++- app/test/test_lpm6_perf.c | 14 ++- app/test/test_lpm_perf.c | 13 ++- app/test/test_malloc.c | 17 +++- app/test/test_mbuf.c | 13 ++- app/test/test_member.c | 16 ++- app/test/test_member_perf.c | 16 ++- app/test/test_memcpy_perf.c | 18 +++- app/test/test_memory.c | 2 +- app/test/test_mempool_perf.c | 12 +++ app/test/test_mp_secondary.c | 12 +++ app/test/test_pie.c | 30 +++++- app/test/test_pmd_perf.c | 6 +- app/test/test_rawdev.c | 17 +++- app/test/test_rcu_qsbr_perf.c | 12 +++ app/test/test_reciprocal_division.c | 12 +++ app/test/test_reciprocal_division_perf.c | 12 +++ app/test/test_red.c | 29 +++++- app/test/test_reorder.c | 15 ++- app/test/test_rib.c | 22 ++++- app/test/test_rib6.c | 22 ++++- app/test/test_ring_stress_impl.h | 2 +- app/test/test_sched.c | 14 ++- app/test/test_security.c | 16 ++- app/test/test_table.c | 13 +++ app/test/test_table_acl.c | 3 + app/test/test_table_combined.c | 4 + app/test/test_table_pipeline.c | 4 + app/test/test_table_ports.c | 4 + app/test/test_table_tables.c | 4 + app/test/test_telemetry_data.c | 2 + app/test/test_timer_secondary.c | 13 +++ app/test/test_trace.c | 32 +++++- lib/eal/common/eal_common_errno.c | 4 + lib/eal/windows/eal_memalloc.c | 6 +- 91 files changed, 1131 insertions(+), 156 deletions(-) delete mode 100755 app/test/has-hugepage.sh create mode 100644 app/test/has_hugepage.py
Signature · 1 line
2.31.0.vfs.0.1
PATCH v9 1/9 eal/windows: return ENOTSUP for not supported API
UT memory_autotest on Windows has 2 failed cases on eal APIs eal_memalloc_get_seg_fd and eal_memalloc_get_seg_fd_offset. These 2 APIs are not supported on Windows yet. Should return ENOTSUP such that in test_memory.c these 2 ENOTSUP cases will not be marked as failures, same as other ENOTSUP cases.
--- lib/eal/windows/eal_memalloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/eal/windows/eal_memalloc.c +3 -3
@@ -17,7 +17,7 @@ eal_memalloc_get_seg_fd(int list_idx, int seg_idx)RTE_SET_USED (list_idx);RTE_SET_USED (seg_idx);EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; }int
@@ -28,7 +28,7 @@ eal_memalloc_get_seg_fd_offset(int list_idx, int seg_idx, size_t *offset)RTE_SET_USED (seg_idx);RTE_SET_USED (offset);EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; } static int
@@ -428,7 +428,7 @@ eal_memalloc_sync_with_primary(void) {/* No multi-process support. */ EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; }int
Signature · 1 line
2.31.0.vfs.0.1
PATCH v9 2/9 app/test: remove POSIX-specific code
In reply to Jie Zhou- Remove header inclusion of netinet/in.h and terminos.h
- Include rte_os_shim.h
- Replace sleep and usleep with rte_delay_us_sleep
- Use NUL on Windows as /dev/null for Linux
- Exclude tests not yet supported on Windows, e.g. multi-process, and IP address parsing (the test cases use linux netinet/in.h u6_addr and better have a separate patch to add such tests on Windows)
--- app/test/commands.c | 2 -- app/test/packet_burst_generator.c | 1 + app/test/process.h | 4 +++- app/test/test.c | 5 ++++- app/test/test_byteorder.c | 2 +- app/test/test_cmdline.c | 2 ++ app/test/test_cmdline_lib.c | 13 +++++++++---- app/test/test_crc.c | 1 - app/test/test_pmd_perf.c | 6 +++++- app/test/test_ring_stress_impl.h | 2 +- app/test/test_telemetry_data.c | 2 ++ 11 files changed, 28 insertions(+), 12 deletions(-)
app/test/commands.c +0 -2
@@ -8,8 +8,6 @@#include <stdint.h> #include <string.h> #include <stdlib.h> -#include <netinet/in.h> -#include <termios.h> #include <inttypes.h> #include <errno.h> #include <sys/queue.h>
app/test/packet_burst_generator.c +1 -0
@@ -5,6 +5,7 @@#include <rte_byteorder.h> #include <rte_mbuf.h> #include <rte_ip.h> +#include <rte_os_shim.h> #include "packet_burst_generator.h"
app/test/process.h +3 -1
@@ -7,12 +7,14 @@#include <errno.h> /* errno */ #include <limits.h> /* PATH_MAX */ +#ifndef RTE_EXEC_ENV_WINDOWS #include <libgen.h> /* basename et al */ +#include <sys/wait.h> +#endif #include <stdlib.h> /* NULL */ #include <string.h> /* strerror */ #include <unistd.h> /* readlink */ #include <dirent.h> -#include <sys/wait.h> #include <rte_string_fns.h> /* strlcpy */
app/test/test.c +4 -1
@@ -8,7 +8,6 @@#include <stdarg.h> #include <stdlib.h> #include <errno.h> -#include <termios.h> #include <ctype.h> #include <sys/queue.h>
@@ -63,7 +62,9 @@ do_recursive_call(void)const char *env_var;int (*action_fn)(void ); } actions[] = { +#ifndef RTE_EXEC_ENV_WINDOWS { "run_secondary_instances", test_mp_secondary }, +#endif #ifdef RTE_LIB_PDUMP #ifdef RTE_NET_RING { "run_pdump_server_tests", test_pdump },
@@ -82,7 +83,9 @@ do_recursive_call(void) { "test_file_prefix", no_action }, { "test_no_huge_flag", no_action }, #ifdef RTE_LIB_TIMER +#ifndef RTE_EXEC_ENV_WINDOWS { "timer_secondary_spawn_wait", test_timer_secondary }, +#endif #endif };
app/test/test_byteorder.c +1 -1
@@ -46,7 +46,7 @@ test_byteorder(void)return -1 ; res_u16 =rte_bswap16 (0x1337 ); -printf ("const %" PRIx16" -> %" PRIx16"\n" ,0x1337 , res_u16); +printf ("const %" PRIx16" -> %" PRIx16"\n" , (uint16_t )0x1337 , res_u16);if (res_u16 !=0x3713 )return -1 ;
app/test/test_cmdline.c +2 -0
@@ -31,6 +31,7 @@ test_cmdline(void)return -1 ;if (test_parse_num_invalid_param () <0 )return -1 ; +#ifndef RTE_EXEC_ENV_WINDOWS printf ("Testing parsing IP addresses...\n" );if (test_parse_ipaddr_valid () <0 )return -1 ;
@@ -38,6 +39,7 @@ test_cmdline(void)return -1 ;if (test_parse_ipaddr_invalid_param () <0 )return -1 ; +#endif printf ("Testing parsing strings...\n" );if (test_parse_string_valid () <0 )return -1 ;
app/test/test_cmdline_lib.c +9 -4
@@ -8,7 +8,6 @@#include <stdarg.h> #include <stdlib.h> #include <errno.h> -#include <termios.h> #include <ctype.h> #include <sys/queue.h>
@@ -22,6 +21,12 @@#include "test_cmdline.h" +#ifndef RTE_EXEC_ENV_WINDOWS +#define NULL_INPUT "/dev/null" +#else +#define NULL_INPUT "NUL" +#endif +/****************************************************************/ /* static functions required for some tests */ static void
@@ -156,10 +161,10 @@ test_cmdline_socket_fns(void) cl =cmdline_stdin_new (&ctx,NULL );if (cl !=NULL ) goto error; - cl =cmdline_file_new (NULL ,"prompt" ,"/dev/null" ); + cl =cmdline_file_new (NULL ,"prompt" ,NULL_INPUT );if (cl !=NULL ) goto error; - cl =cmdline_file_new (&ctx,NULL ,"/dev/null" ); + cl =cmdline_file_new (&ctx,NULL ,NULL_INPUT );if (cl !=NULL ) goto error; cl =cmdline_file_new (&ctx,"prompt" ,NULL );
@@ -171,7 +176,7 @@ test_cmdline_socket_fns(void)cmdline_free (cl);return -1 ; } - cl =cmdline_file_new (&ctx,"prompt" ,"/dev/null" ); + cl =cmdline_file_new (&ctx,"prompt" ,NULL_INPUT );if (cl ==NULL ) {printf ("Error: failed to open /dev/null for reading!" );return -1 ;
app/test/test_crc.c +0 -1
@@ -14,7 +14,6 @@#define CRC32_VEC_LEN2 348#define CRC16_VEC_LEN1 12#define CRC16_VEC_LEN2 2 -#define LINE_LEN 75/* CRC test vector */ static const uint8_t crc_vec[CRC_VEC_LEN ] = {
app/test/test_pmd_perf.c +5 -1
@@ -296,6 +296,7 @@ reset_count(void) idle =0 ; } +#ifndef RTE_EXEC_ENV_WINDOWS static void stats_display (uint16_t port_id) {
@@ -325,6 +326,7 @@ signal_handler(int signum)if (signum ==SIGUSR2 ) stats_display(0); } +#endif struct rte_mbuf **tx_burst;
@@ -638,7 +640,7 @@ exec_burst(uint32_t flags, int lcore) i = (i >= conf->nb_ports -1 ) ?0 : (i +1 ); } -sleep (5 ); +rte_delay_us (5 *US_PER_S );/* only when polling second */ if (flags ==SC_BURST_XMIT_FIRST )
@@ -669,8 +671,10 @@ test_pmd_perf(void)printf ("Start PMD RXTX cycles cost test.\n" ); +#ifndef RTE_EXEC_ENV_WINDOWS signal (SIGUSR1 , signal_handler);signal (SIGUSR2 , signal_handler); +#endif nb_ports =rte_eth_dev_count_avail ();if (nb_ports <NB_ETHPORTS_USED ) {
app/test/test_ring_stress_impl.h +1 -1
@@ -360,7 +360,7 @@ test_mt1(int (*test)(void *))/* signal worker to start test */ __atomic_store_n (&wrk_cmd,WRK_CMD_RUN , __ATOMIC_RELEASE); -usleep (run_time *US_PER_S ); +rte_delay_us (run_time *US_PER_S );/* signal worker to start test */ __atomic_store_n (&wrk_cmd,WRK_CMD_STOP , __ATOMIC_RELEASE);
app/test/test_telemetry_data.c +2 -0
@@ -4,7 +4,9 @@#include <string.h> #include <sys/socket.h> +#ifndef RTE_EXEC_ENV_WINDOWS #include <sys/un.h> +#endif #include <unistd.h> #include <limits.h>
Signature · 1 line
2.31.0.vfs.0.1
PATCH v9 3/9 app/test: fix incorrect errno variable
In reply to Jie ZhouFix incorrect errno variable used in memory autotest. Use rte_errno instead.
--- app/test/test_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test_memory.c +1 -1
@@ -63,7 +63,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,/* we're able to get memseg fd - try getting its offset */ ret =rte_memseg_get_fd_offset_thread_unsafe (ms, &offset);if (ret <0 ) { -if (errno ==ENOTSUP ) +if (rte_errno ==ENOTSUP )return 1 ;return -1 ; }
Signature · 1 line
2.31.0.vfs.0.1
PATCH v9 4/9 app/test: skip interrupt tests on Windows
In reply to Jie ZhouEven though test_interrupts.c can compile on Windows, skip interrupt tests for now since majority of eal_interrupt on Windows are stubs. Will remove the skip after interrupt being fully enabled on Windows.
--- app/test/test_interrupts.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
app/test/test_interrupts.c +10 -0
@@ -12,6 +12,15 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_interrupt (void ) +{ +printf ("Interrupt on Windows is not fully supported yet, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#define TEST_INTERRUPT_CHECK_INTERVAL 100/* ms */ /* predefined interrupt handle types */
@@ -590,5 +599,6 @@ test_interrupt(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ REGISTER_TEST_COMMAND (interrupt_autotest, test_interrupt);
Signature · 1 line
2.31.0.vfs.0.1
PATCH v9 5/9 app/test: skip two logs_autotest cases on Windows
In reply to Jie ZhouDPDK logs_autotest on Windows failed at "dynamic log types" tests. The failures are on 2 test cases for rte_log_set_level_regexp API, due to regular expression is not supported on Windows in DPDK yet and regcomp/regexec are just stubs on Windows (in regex.h).
In app\test\test_logs.c, ifndef these two test cases, and for the rte_log_set_level_pattern validation case following these two cases, differentiate the expected log level passed into macro CHECK_LEVELS
Now logs_autotest completes for all dynamic log types and static log types.
--- app/test/test_logs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
app/test/test_logs.c +5 -1
@@ -113,6 +113,7 @@ test_logs(void)rte_log_set_level (logtype1,RTE_LOG_ERR );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR ); +#ifndef RTE_EXEC_ENV_WINDOWS rte_log_set_level_regexp ("type$" ,RTE_LOG_EMERG );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR );
@@ -121,7 +122,10 @@ test_logs(void)rte_log_set_level_pattern ("logtype" ,RTE_LOG_DEBUG );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_EMERG ,RTE_LOG_EMERG ); - +#else + ret =rte_log_set_level_pattern ("logtype" ,RTE_LOG_DEBUG ); +CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR ); +#endif /* set logtype level low to so we can test global level */ rte_log_set_level_pattern ("logtype*" ,RTE_LOG_DEBUG );CHECK_LEVELS (RTE_LOG_DEBUG ,RTE_LOG_DEBUG ,RTE_LOG_DEBUG );
Signature · 1 line
2.31.0.vfs.0.1
PATCH v9 6/9 app/test: differentiate a strerror on different OS
In reply to Jie ZhouOn Windows, strerror returns just "Unknown error" for errnum greater than MAX_ERRNO, while linux and freebsd returns "Unknown error <num>", which is the current expectation for errno_autotest. Differentiate the error string on Windows to remove a "duplicate error code" failure.
--- app/test/test_errno.c | 12 +++++++++++- lib/eal/common/eal_common_errno.c | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-)
app/test/test_errno.c +11 -1
@@ -18,13 +18,19 @@ test_errno(void) {const char *rte_retval;const char *libc_retval; + +#ifndef RTE_EXEC_ENV_WINDOWS #ifdef RTE_EXEC_ENV_FREEBSD /* BSD has a colon in the string, unlike linux */ const char unknown_code_result[] ="Unknown error: %d" ;#else const char unknown_code_result[] ="Unknown error %d" ;#endif -char expected_libc_retval[sizeof (unknown_code_result)+3 ]; +char expected_libc_retval[sizeof (unknown_code_result) +3 ]; +#else +/* Windows doesn't return error number for error greater than MAX_errno*/ +static const char expected_libc_retval[] ="Unknown error" ; +#endif /* use a small selection of standard errors for testing */ int std_errs[] = {EAGAIN ,EBADF ,EACCES ,EINTR ,EINVAL };
@@ -54,11 +60,13 @@ test_errno(void) rte_retval, libc_retval);if (strcmp (rte_retval, libc_retval) ==0 )return -1 ; +#ifndef RTE_EXEC_ENV_WINDOWS /* generate appropriate error string for unknown error number * and then check that this is what we got back. If not, we have * a duplicate error number that conflicts with errno.h */ snprintf (expected_libc_retval,sizeof (expected_libc_retval), unknown_code_result, rte_errs[i]); +#endif if ((strcmp (expected_libc_retval, libc_retval) !=0 ) && (strcmp ("" , libc_retval) !=0 )){printf ("Error, duplicate error code %d\n" , rte_errs[i]);
@@ -69,8 +77,10 @@ test_errno(void)/* ensure that beyond RTE_MAX_ERRNO, we always get an unknown code */ rte_retval =rte_strerror (RTE_MAX_ERRNO +1 ); libc_retval =strerror (RTE_MAX_ERRNO +1 ); +#ifndef RTE_EXEC_ENV_WINDOWS snprintf (expected_libc_retval,sizeof (expected_libc_retval), unknown_code_result,RTE_MAX_ERRNO +1 ); +#endif printf ("rte_strerror: '%s', strerror: '%s'\n" , rte_retval, libc_retval); if ((strcmp(rte_retval, libc_retval) != 0) ||
lib/eal/common/eal_common_errno.c +4 -0
@@ -37,7 +37,11 @@ rte_strerror(int errnum)/* since some implementations of strerror_r throw an error * themselves if errnum is too big, we handle that case here */ if (errnum >= RTE_MAX_ERRNO) +#ifdef RTE_EXEC_ENV_WINDOWS +snprintf (ret,RETVAL_SZ ,"Unknown error%s" , sep); +#else snprintf (ret,RETVAL_SZ ,"Unknown error%s %d" , sep, errnum); +#endif else switch (errnum){case E_RTE_SECONDARY :
Signature · 1 line
2.31.0.vfs.0.1
PATCH v9 7/9 app/test: remove two alarm_autotest cases
In reply to Jie ZhouRemove two alarm_autotest test cases which do bogus range check on Windows.
--- app/test/test_alarm.c | 4 ++++ 1 file changed, 4 insertions(+)
app/test/test_alarm.c +4 -0
@@ -10,6 +10,7 @@#include "test.h" +#ifndef RTE_EXEC_ENV_WINDOWS static volatile int flag; static void
@@ -18,6 +19,7 @@ test_alarm_callback(void *cb_arg) flag =1 ; printf("Callback setting flag - OK. [cb_arg = %p]\n", cb_arg); } +#endif static int test_alarm (void )
@@ -27,6 +29,7 @@ test_alarm(void)return 0 ;#endif +#ifndef RTE_EXEC_ENV_WINDOWS /* check if it will fail to set alarm with wrong us value */ printf ("check if it will fail to set alarm with wrong ms values\n" ); if (rte_eal_alarm_set(0, test_alarm_callback,
@@ -39,6 +42,7 @@ test_alarm(void)printf ("should not be successful with (UINT64_MAX-1) us value\n" ); return -1; } +#endif /* check if it will fail to set alarm with null callback parameter */ printf ("check if it will fail to set alarm with null callback parameter\n" );
Signature · 1 line
2.31.0.vfs.0.1
PATCH v9 8/9 app/test: replace .sh script with .py script
In reply to Jie Zhou- Add python script to check if system supports hugepages
- Remove corresponding .sh script
- Replace calling of .sh with corresponding .py in meson.build
--- app/test/has-hugepage.sh | 11 ----------- app/test/has_hugepage.py | 26 ++++++++++++++++++++++++++ app/test/meson.build | 2 +- 3 files changed, 27 insertions(+), 12 deletions(-) delete mode 100755 app/test/has-hugepage.sh create mode 100644 app/test/has_hugepage.py
app/test/has-hugepage.sh deleted +0 -11
@@ -1,11 +0,0 @@ -#! /bin/sh -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2020 Mellanox Technologies, Ltd - -if [ "$(uname)" = "Linux" ] ; then - cat /proc/sys/vm/nr_hugepages || echo 0 -elif [ "$(uname)" = "FreeBSD" ] ; then - echo 1 # assume FreeBSD always has hugepages -else - echo 0 -fi
app/test/has_hugepage.py new file +26 -0
@@ -0,0 +1,26 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021 Microsoft Corporation +"""This script checks if the system supports huge pages""" + +import platform +import ctypes + +os_name = platform.system() +if os_name == "Linux": + try: + with open("/proc/sys/vm/nr_hugepages") as file_o: + content = file_o.read() + print(content) + except: + print("0") + +elif os_name == "FreeBSD": + # Assume FreeBSD always has hugepages enabled + print("1") +elif os_name == "Windows": + if ctypes.windll.kernel32.GetLargePageMinimum() > 0: + print("1") + else: + print("0") +else: + print("0")
app/test/meson.build +1 -1
@@ -492,7 +492,7 @@ dpdk_test = executable('dpdk-test', driver_install_path), install: true) -has_hugepage = run_command('has-hugepage.sh').stdout().strip() != '0' +has_hugepage = run_command(py3, 'has_hugepage.py').stdout().strip() != '0' message('hugepage availability: @0@'.format(has_hugepage)) # some perf tests (eg: memcpy perf autotest)take very long
Signature · 1 line
2.31.0.vfs.0.1
PATCH v9 9/9 app/test: enable subset of unit tests on Windows
In reply to Jie Zhou- For fast tests and perf tests, add test stubs to skip not supported ones.
- For driver tests, for now skip on Windows totally to avoid unnecessary amount of test stubs. For example, there are about 30 cryptodev related tests (even though in the meson for CI it only listed about half) which will be enabled by "patch-18949: app/test:
enable crypto unit tests on Windows".
- For dump tests, currently the tests hang on Windows which require further investigation. Keep the dump test list just for non-Windows for easier tracking.
--- app/test/meson.build | 117 ++++++++++++----------- app/test/test_acl.c | 12 +++ app/test/test_bpf.c | 15 ++- app/test/test_cksum.c | 12 +++ app/test/test_cmdline_ipaddr.c | 5 + app/test/test_cryptodev.c | 4 + app/test/test_cryptodev_asym.c | 4 + app/test/test_cryptodev_blockcipher.c | 4 + app/test/test_cryptodev_security_ipsec.c | 4 + app/test/test_cryptodev_security_pdcp.c | 4 + app/test/test_debug.c | 17 +++- app/test/test_distributor.c | 13 +++ app/test/test_distributor_perf.c | 13 +++ app/test/test_dmadev.c | 14 ++- app/test/test_dmadev_api.c | 4 + app/test/test_eal_flags.c | 90 +++++++++++++++++ app/test/test_eal_fs.c | 12 +++ app/test/test_efd.c | 15 ++- app/test/test_efd_perf.c | 16 +++- app/test/test_event_crypto_adapter.c | 15 ++- app/test/test_event_eth_rx_adapter.c | 25 ++++- app/test/test_event_eth_tx_adapter.c | 12 +++ app/test/test_event_ring.c | 16 +++- app/test/test_event_timer_adapter.c | 16 +++- app/test/test_eventdev.c | 20 +++- app/test/test_external_mem.c | 18 +++- app/test/test_fib.c | 22 ++++- app/test/test_fib6.c | 24 ++++- app/test/test_fib6_perf.c | 16 +++- app/test/test_fib_perf.c | 15 ++- app/test/test_flow_classify.c | 13 +++ app/test/test_func_reentrancy.c | 12 +++ app/test/test_graph.c | 18 +++- app/test/test_graph_perf.c | 16 +++- app/test/test_hash_perf.c | 12 +++ app/test/test_ipfrag.c | 16 +++- app/test/test_ipsec.c | 15 ++- app/test/test_ipsec_perf.c | 15 ++- app/test/test_ipsec_sad.c | 14 ++- app/test/test_kni.c | 10 +- app/test/test_lcores.c | 12 +++ app/test/test_lpm.c | 14 ++- app/test/test_lpm6.c | 14 ++- app/test/test_lpm6_perf.c | 14 ++- app/test/test_lpm_perf.c | 13 ++- app/test/test_malloc.c | 17 +++- app/test/test_mbuf.c | 13 ++- app/test/test_member.c | 16 +++- app/test/test_member_perf.c | 16 +++- app/test/test_memcpy_perf.c | 18 +++- app/test/test_mempool_perf.c | 12 +++ app/test/test_mp_secondary.c | 12 +++ app/test/test_pie.c | 30 +++++- app/test/test_rawdev.c | 17 +++- app/test/test_rcu_qsbr_perf.c | 12 +++ app/test/test_reciprocal_division.c | 12 +++ app/test/test_reciprocal_division_perf.c | 12 +++ app/test/test_red.c | 29 +++++- app/test/test_reorder.c | 15 ++- app/test/test_rib.c | 22 ++++- app/test/test_rib6.c | 22 ++++- app/test/test_sched.c | 14 ++- app/test/test_security.c | 16 +++- app/test/test_table.c | 13 +++ app/test/test_table_acl.c | 3 + app/test/test_table_combined.c | 4 + app/test/test_table_pipeline.c | 4 + app/test/test_table_ports.c | 4 + app/test/test_table_tables.c | 4 + app/test/test_timer_secondary.c | 13 +++ app/test/test_trace.c | 32 ++++++- 71 files changed, 1038 insertions(+), 126 deletions(-)
app/test/meson.build +62 -55
@@ -1,12 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() -endif - if not get_option('tests') subdir_done() endif
@@ -158,34 +152,17 @@ test_sources = files( ) test_deps = [ - 'acl', 'bus_pci', 'bus_vdev', - 'bpf', + 'bitratestats', 'cfgfile', 'cmdline', - 'cryptodev', - 'distributor', - 'dmadev', - 'efd', 'ethdev', - 'eventdev', - 'fib', - 'flow_classify', - 'graph', 'hash', - 'ipsec', - 'lpm', - 'member', - 'node', - 'pipeline', - 'port', - 'rawdev', + 'latencystats', + 'metrics', 'rcu', - 'reorder', - 'rib', 'ring', - 'security', 'stack', 'telemetry', 'timer',
@@ -334,39 +311,69 @@ perf_test_names = [ ] driver_test_names = [ - 'cryptodev_aesni_mb_autotest', - 'cryptodev_aesni_gcm_autotest', - 'cryptodev_cn9k_autotest', - 'cryptodev_cn10k_autotest', - 'cryptodev_dpaa_sec_autotest', - 'cryptodev_dpaa2_sec_autotest', - 'cryptodev_null_autotest', - 'cryptodev_octeontx2_autotest', - 'cryptodev_openssl_autotest', - 'cryptodev_openssl_asym_autotest', - 'cryptodev_qat_autotest', - 'cryptodev_sw_armv8_autotest', - 'cryptodev_sw_kasumi_autotest', - 'cryptodev_sw_mvsam_autotest', - 'cryptodev_sw_snow3g_autotest', - 'cryptodev_sw_zuc_autotest', - 'dmadev_autotest', - 'eventdev_selftest_octeontx', - 'eventdev_selftest_sw', - 'rawdev_autotest', ] dump_test_names = [ - 'dump_struct_sizes', - 'dump_mempool', - 'dump_malloc_stats', - 'dump_devargs', - 'dump_log_types', - 'dump_ring', - 'dump_physmem', - 'dump_memzone', ] +if not is_windows + test_deps += [ + 'acl', + 'bpf', + 'cryptodev', + 'distributor', + 'dmadev', + 'efd', + 'eventdev', + 'fib', + 'flow_classify', + 'graph', + 'ipsec', + 'lpm', + 'member', + 'node', + 'pipeline', + 'port', + 'rawdev', + 'reorder', + 'rib', + 'security', + ] + + driver_test_names += [ + 'cryptodev_aesni_mb_autotest', + 'cryptodev_aesni_gcm_autotest', + 'cryptodev_cn9k_autotest', + 'cryptodev_cn10k_autotest', + 'cryptodev_dpaa_sec_autotest', + 'cryptodev_dpaa2_sec_autotest', + 'cryptodev_null_autotest', + 'cryptodev_octeontx2_autotest', + 'cryptodev_openssl_autotest', + 'cryptodev_openssl_asym_autotest', + 'cryptodev_qat_autotest', + 'cryptodev_sw_armv8_autotest', + 'cryptodev_sw_kasumi_autotest', + 'cryptodev_sw_mvsam_autotest', + 'cryptodev_sw_snow3g_autotest', + 'cryptodev_sw_zuc_autotest', + 'eventdev_selftest_octeontx', + 'eventdev_selftest_sw', + 'rawdev_autotest', + ] + + dump_test_names += [ + 'dump_struct_sizes', + 'dump_mempool', + 'dump_malloc_stats', + 'dump_devargs', + 'dump_log_types', + 'dump_ring', + 'dump_physmem', + 'dump_memzone', + ] +endif + # The following linkages are an exception to allow running the # unit tests without requiring that the developer install the # DPDK libraries. Explicit linkage of drivers (plugin libraries)
@@ -385,7 +392,7 @@ if dpdk_conf.has('RTE_LIB_METRICS') test_sources += ['test_metrics.c'] fast_tests += [['metrics_autotest', true]] endif -if dpdk_conf.has('RTE_LIB_TELEMETRY') +if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY') test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c'] fast_tests += [['telemetry_json_autotest', true], ['telemetry_data_autotest', true]] endif
app/test/test_acl.c +12 -0
@@ -11,6 +11,16 @@#include <rte_mbuf.h> #include <rte_byteorder.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_acl (void ) +{ +printf ("acl not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <rte_acl.h> #include <rte_common.h>
@@ -1741,4 +1751,6 @@ test_acl(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (acl_autotest, test_acl);
app/test/test_bpf.c +14 -1
@@ -14,11 +14,22 @@#include <rte_random.h> #include <rte_byteorder.h> #include <rte_errno.h> +#include "test.h" + +#if !defined(RTE_LIB_BPF ) + +static int +test_bpf (void ) +{ +printf ("BPF not supported, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <rte_bpf.h> #include <rte_ether.h> #include <rte_ip.h> -#include "test.h" /* * Basic functional tests for librte_bpf.
@@ -3248,6 +3259,8 @@ test_bpf(void) return rc; } +#endif +REGISTER_TEST_COMMAND (bpf_autotest, test_bpf);#ifdef RTE_HAS_LIBPCAP
app/test/test_cksum.c +12 -0
@@ -13,6 +13,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_cksum (void ) +{ +printf ("cksum not supported, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MEMPOOL_CACHE_SIZE 0#define MBUF_DATA_SIZE 256#define NB_MBUF 128
@@ -268,4 +278,6 @@ test_cksum(void) }#undef GOTO_FAIL +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (cksum_autotest, test_cksum);
app/test/test_cmdline_ipaddr.c +5 -0
@@ -2,9 +2,12 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <stdio.h> #include <string.h> #include <inttypes.h> +#include <netinet/in.h> #include <sys/socket.h>
@@ -669,3 +672,5 @@ test_parse_ipaddr_invalid_param(void) }return 0 ; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev.c +4 -0
@@ -3,6 +3,8 @@* Copyright 2020 NXP */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <time.h> #include <rte_common.h>
@@ -15739,3 +15741,5 @@ REGISTER_TEST_COMMAND(cryptodev_nitrox_autotest, test_cryptodev_nitrox);REGISTER_TEST_COMMAND (cryptodev_bcmfs_autotest, test_cryptodev_bcmfs);REGISTER_TEST_COMMAND (cryptodev_cn9k_autotest, test_cryptodev_cn9k);REGISTER_TEST_COMMAND (cryptodev_cn10k_autotest, test_cryptodev_cn10k); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_asym.c +4 -0
@@ -3,6 +3,8 @@* Copyright (c) 2019 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_bus_vdev.h> #include <rte_common.h> #include <rte_hexdump.h>
@@ -2429,3 +2431,5 @@ REGISTER_TEST_COMMAND(cryptodev_octeontx2_asym_autotest, test_cryptodev_octeontx2_asym);REGISTER_TEST_COMMAND (cryptodev_cn9k_asym_autotest, test_cryptodev_cn9k_asym);REGISTER_TEST_COMMAND (cryptodev_cn10k_asym_autotest, test_cryptodev_cn10k_asym); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_blockcipher.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2015-2017 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_common.h> #include <rte_hexdump.h> #include <rte_mbuf.h>
@@ -1221,3 +1223,5 @@ free_blockcipher_test_suite(struct unit_test_suite *ts) {free (ts); } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_security_ipsec.c +4 -0
@@ -2,6 +2,8 @@* Copyright(C) 2021 Marvell. */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <rte_common.h> #include <rte_cryptodev.h> #include <rte_esp.h>
@@ -672,3 +674,5 @@ test_ipsec_status_check(struct rte_crypto_op *op, return ret; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_cryptodev_security_pdcp.c +4 -0
@@ -4,6 +4,8 @@* Copyright 2018-2019 NXP */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <time.h> #include <rte_common.h>
@@ -587,3 +589,5 @@ test_PDCP_PROTO_uplane_decap_all(void) return n - i; }; + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_debug.c +15 -2
@@ -2,8 +2,21 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_debug (void ) +{ +printf ("debug not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/resource.h> #include <sys/time.h> #include <sys/wait.h>
@@ -14,8 +27,6 @@#include <rte_eal.h> #include <rte_service_component.h> -#include "test.h" -/* * Debug test * ==========
@@ -127,4 +138,6 @@ test_debug(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (debug_autotest, test_debug);
app/test/test_distributor.c +13 -0
@@ -11,6 +11,17 @@#include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_mbuf_dyn.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_distributor (void ) +{ +printf ("distributor not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_distributor.h> #include <rte_string_fns.h>
@@ -939,4 +950,6 @@ test_distributor(void) return -1; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (distributor_autotest, test_distributor);
app/test/test_distributor_perf.c +13 -0
@@ -10,6 +10,17 @@#include <rte_cycles.h> #include <rte_common.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_distributor_perf (void ) +{ +printf ("distributor perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_distributor.h> #include <rte_pause.h>
@@ -264,4 +275,6 @@ test_distributor_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (distributor_perf_autotest, test_distributor_perf);
app/test/test_dmadev.c +13 -1
@@ -2,6 +2,17 @@* Copyright(c) 2021 HiSilicon Limited * Copyright(c) 2021 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_dma (void ) +{ +printf ("dma not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <inttypes.h>
@@ -13,7 +24,6 @@#include <rte_bus_vdev.h> #include <rte_dmadev_pmd.h> -#include "test.h" #include "test_dmadev_api.h" #define ERR_RETURN (...) do { print_err(__func__, __LINE__, __VA_ARGS__); return -1; } while (0)
@@ -864,4 +874,6 @@ test_dma(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (dmadev_autotest, test_dma);
app/test/test_dmadev_api.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2021 HiSilicon Limited */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include <rte_cycles.h>
@@ -572,3 +574,5 @@ test_dma_api(uint16_t dev_id) return 0; }; + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_eal_flags.c +90 -0
102 lines not on this page · raw message
app/test/test_eal_fs.c +12 -0
@@ -10,6 +10,16 @@#include "eal_filesystem.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_eal_fs (void ) +{ +printf ("eal_fs not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +static int test_parse_sysfs_value (void ) {
@@ -173,4 +183,6 @@ test_eal_fs(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (eal_fs_autotest, test_eal_fs);
app/test/test_efd.c +13 -2
@@ -1,6 +1,17 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2016-2017 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_efd (void ) +{ +printf ("efd not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <rte_memcpy.h> #include <rte_malloc.h>
@@ -10,8 +21,6 @@#include <rte_debug.h> #include <rte_ip.h> -#include "test.h" -#define EFD_TEST_KEY_LEN 8#define TABLE_SIZE (1 << 21)#define ITERATIONS 3
@@ -462,4 +471,6 @@ test_efd(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (efd_autotest, test_efd);
app/test/test_efd_perf.c +14 -2
@@ -2,6 +2,18 @@* Copyright(c) 2016-2017 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_efd_perf (void ) +{ +printf ("efd_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <stdio.h> #include <inttypes.h>
@@ -13,8 +25,6 @@#include <rte_memcpy.h> #include <rte_thash.h> -#include "test.h" -#define NUM_KEYSIZES 10#define NUM_SHUFFLES 10#define MAX_KEYSIZE 64
@@ -382,4 +392,6 @@ test_efd_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (efd_perf_autotest, test_efd_perf);
app/test/test_event_crypto_adapter.c +14 -1
@@ -3,16 +3,27 @@* All rights reserved. */ +#include "test.h" #include <string.h> #include <rte_common.h> #include <rte_mempool.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_crypto_adapter (void ) +{ +printf ("event_crypto_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_cryptodev.h> #include <rte_eventdev.h> #include <rte_bus_vdev.h> #include <rte_service.h> #include <rte_event_crypto_adapter.h> -#include "test.h" #define PKT_TRACE 0#define NUM 1
@@ -1011,5 +1022,7 @@ test_event_crypto_adapter(void) return unit_test_suite_runner(&functional_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_crypto_adapter_autotest, test_event_crypto_adapter);
app/test/test_event_eth_rx_adapter.c +23 -2
@@ -1,18 +1,37 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ + +#include "test.h" +#include <string.h> #include <rte_common.h> #include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_ethdev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_eth_rx_adapter_common (void ) +{ +printf ("event_eth_rx_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_event_eth_rx_intr_adapter_common (void ) +{ +printf ("event_eth_rx_intr_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_bus_vdev.h> #include <rte_event_eth_rx_adapter.h> -#include "test.h" -#define MAX_NUM_RX_QUEUE 64#define NB_MBUFS (8192 * num_ports * MAX_NUM_RX_QUEUE)#define MBUF_CACHE_SIZE 512
@@ -1027,6 +1046,8 @@ test_event_eth_rx_intr_adapter_common(void)return unit_test_suite_runner (&event_eth_rx_intr_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_eth_rx_adapter_autotest, test_event_eth_rx_adapter_common); REGISTER_TEST_COMMAND(event_eth_rx_intr_adapter_autotest,
app/test/test_event_eth_tx_adapter.c +12 -0
@@ -16,6 +16,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_eth_tx_adapter_common (void ) +{ +printf ("event_eth_tx_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_NUM_QUEUE RTE_PMD_RING_MAX_RX_RINGS#define TEST_INST_ID 0#define TEST_DEV_ID 0
@@ -696,5 +706,7 @@ test_event_eth_tx_adapter_common(void) return unit_test_suite_runner(&event_eth_tx_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_eth_tx_adapter_autotest, test_event_eth_tx_adapter_common);
app/test/test_event_ring.c +14 -2
@@ -2,11 +2,21 @@* Copyright(c) 2010-2017 Intel Corporation */ +#include "test.h" +#include <string.h> -#include <rte_event_ring.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_ring (void ) +{ +printf ("event_ring not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} -#include "test.h" +#else + +#include <rte_event_ring.h> /* * Event Ring
@@ -244,4 +254,6 @@ test_event_ring(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_ring_autotest, test_event_ring);
app/test/test_event_timer_adapter.c +14 -2
@@ -2,6 +2,7 @@* Copyright(c) 2017 Cavium, Inc * Copyright(c) 2017-2018 Intel Corporation. */ +#include "test.h" #include <math.h>
@@ -10,6 +11,17 @@#include <rte_debug.h> #include <rte_eal.h> #include <rte_ethdev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_event_timer_adapter_func (void ) +{ +printf ("event_timer_adapter not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_event_timer_adapter.h> #include <rte_mempool.h>
@@ -21,8 +33,6 @@#include <rte_service.h> #include <stdbool.h> -#include "test.h" -/* 4K timers corresponds to sw evdev max inflight events */ #define MAX_TIMERS (4 * 1024)#define BKT_TCK_NSEC
@@ -1950,4 +1960,6 @@ test_event_timer_adapter_func(void) return unit_test_suite_runner(&event_timer_adptr_functional_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (event_timer_adapter_test, test_event_timer_adapter_func);
app/test/test_eventdev.c +18 -2
@@ -1,18 +1,28 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2016 Cavium, Inc */ +#include "test.h" #include <rte_common.h> #include <rte_hexdump.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_memcpy.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_eventdev_common (void ) +{ +printf ("eventdev_common not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_eventdev.h> #include <rte_dev.h> #include <rte_bus_vdev.h> -#include "test.h" -#define TEST_DEV_ID 0 static int
@@ -1048,7 +1058,11 @@ test_eventdev_selftest_cn10k(void) return test_eventdev_selftest_impl("event_cn10k", ""); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (eventdev_common_autotest, test_eventdev_common); + +#ifndef RTE_EXEC_ENV_WINDOWS REGISTER_TEST_COMMAND (eventdev_selftest_sw, test_eventdev_selftest_sw);REGISTER_TEST_COMMAND (eventdev_selftest_octeontx, test_eventdev_selftest_octeontx);
@@ -1058,3 +1072,5 @@ REGISTER_TEST_COMMAND(eventdev_selftest_dpaa2, test_eventdev_selftest_dpaa2);REGISTER_TEST_COMMAND (eventdev_selftest_dlb2, test_eventdev_selftest_dlb2);REGISTER_TEST_COMMAND (eventdev_selftest_cn9k, test_eventdev_selftest_cn9k);REGISTER_TEST_COMMAND (eventdev_selftest_cn10k, test_eventdev_selftest_cn10k); + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_external_mem.c +16 -2
@@ -2,11 +2,25 @@* Copyright(c) 2018 Intel Corporation */ +#include "test.h" +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> + + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_external_mem (void ) +{ +printf ("external_mem not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/mman.h> #include <sys/wait.h>
@@ -19,8 +33,6 @@#include <rte_ring.h> #include <rte_string_fns.h> -#include "test.h" -#define EXTERNAL_MEM_SZ (RTE_PGSIZE_4K << 10)/* 4M of data */ static int
@@ -574,4 +586,6 @@ test_external_mem(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (external_mem_autotest, test_external_mem);
app/test/test_fib.c +21 -1
@@ -9,10 +9,28 @@#include <rte_ip.h> #include <rte_log.h> -#include <rte_fib.h> #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib (void ) +{ +printf ("fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_fib (void ) +{ +printf ("slow_fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib.h> +typedef int32_t (*rte_fib_test )(void );static int32_t test_create_invalid (void );
@@ -415,5 +433,7 @@ test_slow_fib(void) return unit_test_suite_runner(&fib_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib_autotest, test_fib);REGISTER_TEST_COMMAND (fib_slow_autotest, test_slow_fib);
app/test/test_fib6.c +22 -2
@@ -9,11 +9,29 @@#include <rte_memory.h> #include <rte_log.h> -#include <rte_rib6.h> -#include <rte_fib6.h> #include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib6 (void ) +{ +printf ("fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_fib6 (void ) +{ +printf ("slow_fib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_rib6.h> +#include <rte_fib6.h> +typedef int32_t (*rte_fib6_test )(void );static int32_t test_create_invalid (void );
@@ -424,5 +442,7 @@ test_slow_fib6(void) return unit_test_suite_runner(&fib6_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib6_autotest, test_fib6);REGISTER_TEST_COMMAND (fib6_slow_autotest, test_slow_fib6);
app/test/test_fib6_perf.c +15 -1
@@ -10,9 +10,21 @@#include <rte_cycles.h> #include <rte_random.h> #include <rte_memory.h> -#include <rte_fib6.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib6_perf (void ) +{ +printf ("fib6_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib6.h> +#include "test_lpm6_data.h" #define TEST_FIB_ASSERT (cond) do { \
@@ -155,4 +167,6 @@ test_fib6_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib6_perf_autotest, test_fib6_perf);
app/test/test_fib_perf.c +14 -1
@@ -12,11 +12,22 @@#include <rte_random.h> #include <rte_branch_prediction.h> #include <rte_ip.h> -#include <rte_fib.h> #include "test.h" #include "test_xmmt_ops.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_fib_perf (void ) +{ +printf ("fib_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_fib.h> +#define TEST_FIB_ASSERT (cond) do { \ if (!(cond)) { \ printf("Error at line %d:\n", __LINE__); \
@@ -409,4 +420,6 @@ test_fib_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (fib_perf_autotest, test_fib_perf);
app/test/test_flow_classify.c +13 -0
@@ -11,6 +11,17 @@#include <rte_mbuf.h> #include <rte_byteorder.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_flow_classify (void ) +{ +printf ("flow_classify not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_acl.h> #include <rte_common.h> #include <rte_table_acl.h>
@@ -879,4 +890,6 @@ test_flow_classify(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (flow_classify_autotest, test_flow_classify);
app/test/test_func_reentrancy.c +12 -0
@@ -40,6 +40,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_func_reentrancy (void ) +{ +printf ("reentrancy not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +typedef int (*case_func_t )(void * arg);typedef void (*case_clean_t )(unsigned lcore_id);
@@ -511,4 +521,6 @@ test_func_reentrancy(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (func_reentrancy_autotest, test_func_reentrancy);
app/test/test_graph.c +16 -2
@@ -1,6 +1,8 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2020 Marvell International Ltd. */ +#include "test.h" +#include <assert.h> #include <inttypes.h> #include <signal.h>
@@ -9,14 +11,23 @@#include <unistd.h> #include <rte_errno.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_node_list_dump (void ) +{ +printf ("node_list_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_graph.h> #include <rte_graph_worker.h> #include <rte_mbuf.h> #include <rte_mbuf_dyn.h> #include <rte_random.h> -#include "test.h" -static uint16_t test_node_worker_source (struct rte_graph *graph,struct rte_node *node,void **objs,uint16_t nb_objs);
@@ -841,4 +852,7 @@ test_node_list_dump(void) return TEST_SUCCESS; } + +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (node_list_dump, test_node_list_dump);
app/test/test_graph_perf.c +14 -2
@@ -1,6 +1,8 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2020 Marvell International Ltd. */ +#include "test.h" +#include <inttypes.h> #include <signal.h> #include <stdio.h>
@@ -9,14 +11,22 @@#include <rte_common.h> #include <rte_cycles.h> #include <rte_errno.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_graph_perf_func (void ) +{ +printf ("graph_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_graph.h> #include <rte_graph_worker.h> #include <rte_lcore.h> #include <rte_malloc.h> #include <rte_mbuf.h> -#include "test.h" -#define TEST_GRAPH_PERF_MZ "graph_perf_data"#define TEST_GRAPH_SRC_NAME "test_graph_perf_source"#define TEST_GRAPH_SRC_BRST_ONE_NAME "test_graph_perf_source_one"
@@ -1060,4 +1070,6 @@ test_graph_perf_func(void) return unit_test_suite_runner(&graph_perf_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (graph_perf_autotest, test_graph_perf_func);
app/test/test_hash_perf.c +12 -0
@@ -17,6 +17,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_hash_perf (void ) +{ +printf ("hash_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ENTRIES (1 << 19)#define KEYS_TO_ADD (MAX_ENTRIES)#define ADD_PERCENT 0.75/* 75% table utilization */
@@ -749,4 +759,6 @@ test_hash_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (hash_perf_autotest, test_hash_perf);
app/test/test_ipfrag.c +14 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Red Hat, Inc. */ +#include "test.h" #include <time.h>
@@ -8,13 +9,22 @@#include <rte_cycles.h> #include <rte_hexdump.h> #include <rte_ip.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipfrag (void ) +{ +printf ("ipfrag not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ip_frag.h> #include <rte_mbuf.h> #include <rte_memcpy.h> #include <rte_random.h> -#include "test.h" -#define NUM_MBUFS 128#define BURST 32
@@ -322,4 +332,6 @@ test_ipfrag(void) return unit_test_suite_runner(&ipfrag_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipfrag_autotest, test_ipfrag);
app/test/test_ipsec.c +14 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2018 Intel Corporation */ +#include "test.h" #include <time.h>
@@ -13,15 +14,25 @@#include <rte_bus_vdev.h> #include <rte_ip.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipsec (void ) +{ +printf ("ipsec not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_crypto.h> #include <rte_cryptodev.h> #include <rte_lcore.h> +#include <rte_ipsec.h> #include <rte_random.h> #include <rte_esp.h> #include <rte_security_driver.h> -#include "test.h" #include "test_cryptodev.h" #define VDEV_ARGS_SIZE 100
@@ -2536,4 +2547,6 @@ test_ipsec(void) return unit_test_suite_runner(&ipsec_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_autotest, test_ipsec);
app/test/test_ipsec_perf.c +14 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2020 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <rte_ip.h>
@@ -8,10 +9,20 @@#include <rte_ring.h> #include <rte_mbuf.h> #include <rte_cycles.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_libipsec_perf (void ) +{ +printf ("ipsec_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ipsec.h> #include <rte_random.h> -#include "test.h" #include "test_cryptodev.h" #define RING_SIZE 4096
@@ -611,4 +622,6 @@ test_libipsec_perf(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_perf_autotest, test_libipsec_perf);
app/test/test_ipsec_sad.c +13 -1
@@ -1,16 +1,26 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_ipsec_sad (void ) +{ +printf ("ipsec_sad not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_ipsec_sad.h> #include <rte_memory.h> -#include "test.h" #include "test_xmmt_ops.h" typedef int32_t (*rte_ipsec_sad_test )(void );
@@ -884,4 +894,6 @@ test_ipsec_sad(void) return unit_test_suite_runner(&ipsec_sad_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (ipsec_sad_autotest, test_ipsec_sad);
app/test/test_kni.c +5 -5
@@ -2,15 +2,12 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> #include <unistd.h> #include <string.h> -#include <sys/wait.h> -#include <dirent.h> - -#include "test.h" -#if !defined(RTE_EXEC_ENV_LINUX ) || !defined(RTE_LIB_KNI ) static int
@@ -22,6 +19,9 @@ test_kni(void)#else +#include <sys/wait.h> +#include <dirent.h> +#include <rte_string_fns.h> #include <rte_mempool.h> #include <rte_ethdev.h>
app/test/test_lcores.c +12 -0
@@ -11,6 +11,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lcores(void) +{ + printf("lcore not supported on Windows, skipping test\n"); + return TEST_SKIPPED; +} + +#else + struct thread_context { enum { INIT, ERROR, DONE } state; bool lcore_id_any;
@@ -411,4 +421,6 @@ test_lcores(void) return TEST_SUCCESS; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lcores_autotest, test_lcores);
app/test/test_lpm.c +13 -1
@@ -1,6 +1,17 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm (void ) +{ +printf ("lpm not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <stdio.h> #include <stdint.h>
@@ -10,7 +21,6 @@#include <rte_lpm.h> #include <rte_malloc.h> -#include "test.h" #include "test_xmmt_ops.h" #define TEST_LPM_ASSERT (cond) do { \
@@ -1584,4 +1594,6 @@ test_lpm(void) return global_status; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm_autotest, test_lpm);
app/test/test_lpm6.c +13 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h>
@@ -8,9 +9,18 @@#include <string.h> #include <rte_memory.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm6 (void ) +{ +printf ("lpm6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_lpm6.h> -#include "test.h" #include "test_lpm6_data.h" #define TEST_LPM_ASSERT (cond) do { \
@@ -1792,4 +1802,6 @@ test_lpm6(void) return global_status; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm6_autotest, test_lpm6);
app/test/test_lpm6_perf.c +13 -1
@@ -1,6 +1,17 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm6_perf (void ) +{ +printf ("lpm6_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <stdio.h> #include <stdint.h>
@@ -12,7 +23,6 @@#include <rte_memory.h> #include <rte_lpm6.h> -#include "test.h" #include "test_lpm6_data.h" #define TEST_LPM_ASSERT (cond) do { \
@@ -160,4 +170,6 @@ test_lpm6_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm6_perf_autotest, test_lpm6_perf);
app/test/test_lpm_perf.c +12 -1
@@ -2,7 +2,17 @@* Copyright(c) 2010-2014 Intel Corporation * Copyright(c) 2020 Arm Limited */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_lpm_perf (void ) +{ +printf ("lpm_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else #include <stdio.h> #include <stdint.h> #include <stdlib.h>
@@ -15,7 +25,6 @@#include <rte_ip.h> #include <rte_lpm.h> -#include "test.h" #include "test_xmmt_ops.h" struct rte_lpm *lpm;
@@ -763,4 +772,6 @@ test_lpm_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (lpm_perf_autotest, test_lpm_perf);
app/test/test_malloc.c +14 -3
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2019 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h>
@@ -8,6 +9,17 @@#include <stdarg.h> #include <errno.h> #include <stdlib.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_malloc (void ) +{ +printf ("malloc not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/mman.h> #include <sys/queue.h> #include <unistd.h>
@@ -23,11 +35,8 @@#include <rte_random.h> #include <rte_string_fns.h> -#include "test.h" -#define N 10000 -static int is_mem_on_socket (int32_t socket);
@@ -1080,4 +1089,6 @@ test_malloc(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (malloc_autotest, test_malloc);
app/test/test_mbuf.c +12 -1
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <string.h> #include <stdarg.h>
@@ -33,7 +34,15 @@#include <rte_tcp.h> #include <rte_mbuf_dyn.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_mbuf (void ) +{ +printf ("mbuf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #define MEMPOOL_CACHE_SIZE 32#define MBUF_DATA_SIZE 2048
@@ -2981,4 +2990,6 @@ test_mbuf(void) }#undef GOTO_FAIL +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (mbuf_autotest, test_mbuf);
app/test/test_member.c +14 -2
@@ -3,17 +3,27 @@*/ /* This test is for membership library's simple feature test */ +#include "test.h" #include <rte_memcpy.h> #include <rte_malloc.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_member (void ) +{ +printf ("member not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_member.h> #include <rte_byteorder.h> #include <rte_random.h> #include <rte_debug.h> #include <rte_ip.h> -#include "test.h" -struct rte_member_setsum *setsum_ht;struct rte_member_setsum *setsum_cache;struct rte_member_setsum *setsum_vbf;
@@ -712,4 +722,6 @@ test_member(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (member_autotest, test_member);
app/test/test_member_perf.c +14 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <inttypes.h>
@@ -11,9 +12,18 @@#include <rte_random.h> #include <rte_memcpy.h> #include <rte_thash.h> -#include <rte_member.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_member_perf (void ) +{ +printf ("member_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_member.h> #define NUM_KEYSIZES 10#define NUM_SHUFFLES 10
@@ -622,4 +632,6 @@ test_member_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (member_perf_autotest, test_member_perf);
app/test/test_memcpy_perf.c +15 -3
@@ -2,21 +2,31 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" +#include <stdint.h> #include <stdio.h> #include <string.h> #include <stdlib.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_memcpy_perf (void ) +{ +printf ("memcpy_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <sys/time.h> #include <rte_common.h> #include <rte_cycles.h> #include <rte_random.h> #include <rte_malloc.h> -#include <rte_memcpy.h> -#include "test.h" -/* * Set this to the maximum buffer size you want to test. If it is 0, then the * values in the buf_sizes[] array below will be used.
@@ -347,4 +357,6 @@ test_memcpy_perf(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (memcpy_perf_autotest, test_memcpy_perf);
app/test/test_mempool_perf.c +12 -0
@@ -28,6 +28,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_mempool_perf (void ) +{ +printf ("mempool_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +/* * Mempool performance * =======
@@ -393,4 +403,6 @@ test_mempool_perf(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (mempool_perf_autotest, test_mempool_perf);
app/test/test_mp_secondary.c +12 -0
@@ -14,6 +14,16 @@#include <errno.h> #include <string.h> #include <unistd.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +int +test_mp_secondary (void ) +{ +printf ("mp_secondary not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else #include <sys/wait.h> #include <libgen.h> #include <dirent.h>
@@ -211,4 +221,6 @@ test_mp_secondary(void) return run_object_creation_tests(); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (multiprocess_autotest, test_mp_secondary);
app/test/test_pie.c +28 -2
@@ -2,6 +2,32 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_pie (void ) +{ +printf ("pie not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_pie_perf (void ) +{ +printf ("pie_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_pie_all (void ) +{ +printf ("pie_all not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -12,8 +38,6 @@#include <time.h> #include <math.h> -#include "test.h" -#include <rte_pie.h> #ifdef __INTEL_COMPILER
@@ -1060,6 +1084,8 @@ test_pie_all(void) return tell_the_result(num_tests, num_pass); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (pie_autotest, test_pie);REGISTER_TEST_COMMAND (pie_perf, test_pie_perf);REGISTER_TEST_COMMAND (pie_all, test_pie_all);
app/test/test_rawdev.c +15 -2
@@ -1,16 +1,27 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2017 NXP */ +#include "test.h" +#include <rte_common.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_dev.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rawdev_selftests (void ) +{ +printf ("rawdev not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_rawdev.h> #include <rte_bus_vdev.h> -#include "test.h" -static int test_rawdev_selftest_impl (const char *pmd,const char *opts) {
@@ -54,4 +65,6 @@ test_rawdev_selftests(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rawdev_autotest, test_rawdev_selftests);
app/test/test_rcu_qsbr_perf.c +12 -0
@@ -15,6 +15,16 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rcu_qsbr_main (void ) +{ +printf ("rcu_qsbr_main not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +/* Check condition and return an error if true. */ static uint16_t enabled_core_ids[RTE_MAX_LCORE ];static unsigned int num_cores;
@@ -687,4 +697,6 @@ test_rcu_qsbr_main(void) return -1; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rcu_qsbr_perf_autotest, test_rcu_qsbr_main);
app/test/test_reciprocal_division.c +12 -0
@@ -13,6 +13,16 @@#include <rte_random.h> #include <rte_reciprocal.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reciprocal (void ) +{ +printf ("reciprocal not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ITERATIONS (1ULL << 32)#define DIVIDE_ITER (100)
@@ -164,4 +174,6 @@ test_reciprocal(void) return result; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reciprocal_division, test_reciprocal);
app/test/test_reciprocal_division_perf.c +12 -0
@@ -13,6 +13,16 @@#include <rte_random.h> #include <rte_reciprocal.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reciprocal_division_perf (void ) +{ +printf ("reciprocal_division_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#define MAX_ITERATIONS (1ULL << 32)#define DIVIDE_ITER (1ULL << 28)
@@ -205,4 +215,6 @@ test_reciprocal_division_perf(void) return result; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reciprocal_division_perf, test_reciprocal_division_perf);
app/test/test_red.c +27 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdlib.h> #include <stdio.h>
@@ -8,12 +9,34 @@#include <stdint.h> #include <unistd.h> #include <inttypes.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_red (void ) +{ +printf ("red not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_red_perf (void ) +{ +printf ("red_perf not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_red_all (void ) +{ +printf ("red_all not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#include <sys/time.h> #include <time.h> #include <math.h> -#include "test.h" -#include <rte_red.h> #ifdef __INTEL_COMPILER
@@ -1851,6 +1874,8 @@ test_red_all(void) return tell_the_result(num_tests, num_pass); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (red_autotest, test_red);REGISTER_TEST_COMMAND (red_perf, test_red_perf);REGISTER_TEST_COMMAND (red_all, test_red_all);
app/test/test_reorder.c +13 -2
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2010-2014 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <unistd.h>
@@ -9,12 +10,20 @@#include <rte_cycles.h> #include <rte_errno.h> #include <rte_mbuf.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_reorder (void ) +{ +printf ("reorder not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#include <rte_reorder.h> #include <rte_lcore.h> #include <rte_malloc.h> -#include "test.h" -#define BURST 32#define REORDER_BUFFER_SIZE 16384#define NUM_MBUFS (2*REORDER_BUFFER_SIZE)
@@ -390,4 +399,6 @@ test_reorder(void) return unit_test_suite_runner(&reorder_test_suite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (reorder_autotest, test_reorder);
app/test/test_rib.c +20 -2
@@ -2,15 +2,31 @@* Copyright(c) 2018 Vladimir Medvedkin <[email protected]> * Copyright(c) 2019 Intel Corporation */ +#include "test.h" #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <rte_ip.h> -#include <rte_rib.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rib (void ) +{ +printf ("rib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_rib (void ) +{ +printf ("slow_rib not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else + +#include <rte_rib.h> typedef int32_t (*rte_rib_test )(void );
@@ -363,5 +379,7 @@ test_slow_rib(void) return unit_test_suite_runner(&rib_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (rib_autotest, test_rib);REGISTER_TEST_COMMAND (rib_slow_autotest, test_slow_rib);
app/test/test_rib6.c +20 -2
@@ -3,14 +3,31 @@* Copyright(c) 2019 Intel Corporation */ +#include "test.h" +#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <rte_ip.h> -#include <rte_rib6.h> -#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_rib6 (void ) +{ +printf ("rib6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_slow_rib6 (void ) +{ +printf ("slow_rib6 not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} +#else + +#include <rte_rib6.h> typedef int32_t (*rte_rib6_test )(void );
@@ -368,5 +385,6 @@ test_slow_rib6(void) return unit_test_suite_runner(&rib6_slow_tests); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ REGISTER_TEST_COMMAND (rib6_autotest, test_rib6);REGISTER_TEST_COMMAND (rib6_slow_autotest, test_slow_rib6);
app/test/test_sched.c +13 -1
@@ -14,8 +14,18 @@#include <rte_ether.h> #include <rte_ip.h> #include <rte_byteorder.h> -#include <rte_sched.h> +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_sched (void ) +{ +printf ("sched not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else + +#include <rte_sched.h> #define SUBPORT 0#define PIPE 1
@@ -204,4 +214,6 @@ test_sched(void) return 0; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (sched_autotest, test_sched);
app/test/test_security.c +15 -1
@@ -1,12 +1,24 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved */ +#include "test.h" #include <rte_errno.h> #include <rte_log.h> #include <rte_memory.h> #include <rte_mempool.h> #include <rte_ether.h> + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_security (void ) +{ +printf ("security not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include <rte_security.h> #include <rte_security_driver.h>
@@ -20,7 +32,7 @@#endif #include <rte_test.h> -#include "test.h" +/** * Security
@@ -2639,4 +2651,6 @@ test_security(void) return unit_test_suite_runner(&security_testsuite); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (security_autotest, test_security);
app/test/test_table.c +13 -0
@@ -7,6 +7,17 @@#include <rte_string_fns.h> #include <string.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_table (void ) +{ +printf ("table not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include "test_table.h" #include "test_table_pipeline.h" #include "test_table_ports.h"
@@ -194,4 +205,6 @@ test_table(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (table_autotest, test_table);
app/test/test_table_acl.c +3 -0
@@ -2,6 +2,7 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS #include <rte_ip.h> #include <rte_string_fns.h> #include <rte_hexdump.h>
@@ -728,3 +729,5 @@ test_table_acl(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_combined.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2016 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include "test_table_combined.h" #include "test_table.h"
@@ -840,3 +842,5 @@ test_table_hash_cuckoo_combined(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_pipeline.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include <rte_pipeline.h> #include <rte_log.h>
@@ -569,3 +571,5 @@ test_table_pipeline(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_ports.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2014 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include "test_table_ports.h" #include "test_table.h"
@@ -189,3 +191,5 @@ test_port_ring_writer(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_table_tables.c +4 -0
@@ -2,6 +2,8 @@* Copyright(c) 2010-2016 Intel Corporation */ +#ifndef RTE_EXEC_ENV_WINDOWS +#include <string.h> #include <rte_byteorder.h> #include <rte_table_lpm_ipv6.h>
@@ -1052,3 +1054,5 @@ test_table_hash_cuckoo(void) return 0; } + +#endif /*ifndef RTE_EXEC_ENV_WINDOWS*/
app/test/test_timer_secondary.c +13 -0
@@ -15,6 +15,17 @@#include <rte_random.h> #include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +int +test_timer_secondary (void ) +{ +printf ("timer_secondary not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +#include "process.h" #define NUM_TIMERS (1 << 20)/* ~1M timers */
@@ -212,4 +223,6 @@ test_timer_secondary(void) return TEST_FAILED; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ +REGISTER_TEST_COMMAND (timer_secondary_autotest, test_timer_secondary);
app/test/test_trace.c +28 -4
@@ -9,6 +9,30 @@#include "test.h" #include "test_trace.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_trace (void ) +{ +printf ("trace not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_trace_dump (void ) +{ +printf ("trace_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +static int +test_trace_metadata_dump (void ) +{ +printf ("trace_metadata_dump not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else +static int32_t test_trace_point_globbing (void ) {
@@ -194,8 +218,6 @@ test_trace(void)return unit_test_suite_runner (&trace_tests); } -REGISTER_TEST_COMMAND (trace_autotest, test_trace); -static int test_trace_dump (void ) {
@@ -203,12 +225,14 @@ test_trace_dump(void) return 0; } -REGISTER_TEST_COMMAND (trace_dump, test_trace_dump); -static int test_trace_metadata_dump (void ) {return rte_trace_metadata_dump (stdout); } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ + +REGISTER_TEST_COMMAND (trace_autotest, test_trace); +REGISTER_TEST_COMMAND (trace_dump, test_trace_dump);REGISTER_TEST_COMMAND (trace_metadata_dump, test_trace_metadata_dump);
Signature · 1 line
2.31.0.vfs.0.1
Re: [PATCH v9 9/9] app/test: enable subset of unit tests on Windows
Quoted 9 lines · On Wed, 1 Dec 2021 10:05:38 -0800 Jie Zhou <[email protected]> wrote:
app/test/test_dmadev.c +1
-0@@ -2,6 +2,17 @@* Copyright(c) 2021 HiSilicon Limited * Copyright(c) 2021 Intel Corporation */ +#include "test.h"
app/test/test_dmadev.c line 15
Quoted 10 lines
app/test/test_dmadev.c +10
-0+ +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_dma (void ) +{ +printf ("dma not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else
Rather than littering code with ifdefs is it not possible to just not build these tests on Windows?
Re: [PATCH v9 9/9] app/test: enable subset of unit tests on Windows
Quoted 17 lines · Stephen Hemminger
Quoted 14 lines · On Wed, 1 Dec 2021 10:05:38 -0800 Jie Zhou <[email protected]> wrote:
app/test/test_dmadev.c +6
-0@@ -2,6 +2,17 @@* Copyright(c) 2021 HiSilicon Limited * Copyright(c) 2021 Intel Corporation */ +#include "test.h" + +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_dma (void ) +{
Quoted 8 lines
app/test/test_dmadev.c line 15
Quoted 5 lines
app/test/test_dmadev.c +5
-0+printf ("dma not supported on Windows, skipping test\n" ); + return TEST_SKIPPED; +} + +#else Rather than littering code with ifdefs is it not possible to just not build these tests on Windows?
Originally I took the approach not building on Windows, but then the community reached to a point that instead of maintaining two lists of source files to be build on Windows and on non-Windows, we use the same list, and add test stubs for not-yet-supported-on-windows ones.
RE: [EXTERNAL] Re: [PATCH v9 9/9] app/test: enable subset of unit tests on Windows
In reply to Stephen HemmingerPlease don't delay integration of this patch set further to port individual tests. Individual tests can be ported to windows with significantly reduced sensitivity to the churn once the conditional mechanisms are in place.
We spend enormous amounts of time continuously rebasing it every time one of the existing tests is churned or new tests are added it's a losing game given the rate of review the community provides for windows patches.
Thanks
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Wednesday, December 1, 2021 10:46 AM
To: Jie Zhou <[email protected]>
Cc: [email protected]; Dmitry Kozlyuk <[email protected]>; Tyler Retzlaff <[email protected]>; [email protected]; Dmitry Malloy <[email protected]>; Kadam, Pallavi <[email protected]>; talshn <[email protected]>; thomas <[email protected]>; [email protected]
Subject: [EXTERNAL] Re: [PATCH v9 9/9] app/test: enable subset of unit tests on Windows
Quoted 9 lines · On Wed, 1 Dec 2021 10:05:38 -0800 Jie Zhou <[email protected]> wrote:
app/test/test_dmadev.c index renamed from app/test/test_dmadev.c +0
-0
b206db27ae..c2ea9090cf100644app/test/test_dmadev.c +1
-0@@ -2,6 +2,17 @@* Copyright(c) 2021 HiSilicon Limited * Copyright(c) 2021 Intel Corporation */ +#include "test.h"
app/test/test_dmadev.c line 15
Quoted 10 lines
app/test/test_dmadev.c +10
-0+ +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_dma (void ) +{ +printf ("dma not supported on Windows, skipping test\n" ); +return TEST_SKIPPED ; +} + +#else
Rather than littering code with ifdefs is it not possible to just not build these tests on Windows?
v10 cover app/test: enable subset of tests on Windows
In reply to Jie ZhouThis patchset is to enable a subset of unit tests on windows. It mainly includes:
- Replace POSIX specific codes
- Add test stubs for not supported ones on Windows
- Fix some lib and tests per failures investigation
- Replace .sh script with .py script for meson.build
- Enable build and run subset of unit tests on Windows
Future work:
- Work with CI/CD lab to onboard unit tests on Windows to catch regression
- Enable more tests
---
V2 changes:
- Fix compilation error on FreeBSD
- Fix email mismatch issue
- Add a missing space around "*"
---
V3 changes:
- Fix a misc c coding style issue
- Revise some commit title and message body
- Fix violations of PEP8 in new added Python scripts
- Add error handling in get_coremask.py
- Fix has_hugepage.py to check system support of hugepages instead of checking privileges
- Fix test meson.build to run Python scripts using py3
- Consolidate lists of source files, test dep, etc. across all platforms, with conditional extending on some platform(s)
---
V4 changes:
- Remove building of ip_frag, rib, and reorder libraries on Windows. These three libs usually can be built on Windows without change. However, in between the time of V3 and V4, there is regression in upstream caused build failures of these three libs. Will separately investigate and enable these libraries.
- Remove previous patch#2 (Enable mempool/stack on Windows) from this patchset as it was separated out and merged as patch-19314.
- Consolidate the source files, deps, tests lists across platforms as much as possible.
---
V5 changes:
- Remove a space between function name and open parenthesis '('
- Add back a header mistakenly deleted
---
V6 changes:
- Fix inconsistent static vs. non-static declarations
---
V7 changes:
- Remove get_coremask.py as it is not needed any more in meson.build
- Remove enablement of efd and lpm and their corresponding unit tests. The enablement of these two libs and their UTs will be in separate patches after this patch set.
V8 changes:
- Fix coding style issue of using C99 // comments
V9 changes:
- Fix has_hugepage.py with adding failure handling on Linux, using proper variable name to follow Python convention, and removing unnecessary comment.
- Enable previously skipped test_cmdline_socket_fns test cases
- Revise title and message, and add Fixes info for current Patch#3
- Combine 2 patches (previous #2 and #3 in V8) into one and with more detailed message
V10 changes:
- Fix indentation
Jie Zhou (9):
eal/windows: return ENOTSUP for not supported API app/test: remove POSIX-specific code app/test: fix incorrect errno variable app/test: skip interrupt tests on Windows app/test: skip two logs_autotest cases on Windows app/test: differentiate a strerror on different OS app/test: remove two alarm_autotest cases app/test: replace .sh script with .py script app/test: enable subset of unit tests on Windows
app/test/commands.c | 2 - app/test/has-hugepage.sh | 11 --- app/test/has_hugepage.py | 26 +++++ app/test/meson.build | 119 ++++++++++++----------- app/test/packet_burst_generator.c | 1 + app/test/process.h | 4 +- app/test/test.c | 5 +- app/test/test_acl.c | 12 +++ app/test/test_alarm.c | 4 + app/test/test_bpf.c | 15 ++- app/test/test_byteorder.c | 2 +- app/test/test_cksum.c | 12 +++ app/test/test_cmdline.c | 2 + app/test/test_cmdline_ipaddr.c | 5 + app/test/test_cmdline_lib.c | 13 ++- app/test/test_crc.c | 1 - app/test/test_cryptodev.c | 4 + app/test/test_cryptodev_asym.c | 4 + app/test/test_cryptodev_blockcipher.c | 4 + app/test/test_cryptodev_security_ipsec.c | 4 + app/test/test_cryptodev_security_pdcp.c | 4 + app/test/test_debug.c | 17 +++- app/test/test_distributor.c | 13 +++ app/test/test_distributor_perf.c | 13 +++ app/test/test_dmadev.c | 14 ++- app/test/test_dmadev_api.c | 4 + app/test/test_eal_flags.c | 90 +++++++++++++++++ app/test/test_eal_fs.c | 12 +++ app/test/test_efd.c | 15 ++- app/test/test_efd_perf.c | 16 ++- app/test/test_errno.c | 12 ++- app/test/test_event_crypto_adapter.c | 15 ++- app/test/test_event_eth_rx_adapter.c | 25 ++++- app/test/test_event_eth_tx_adapter.c | 12 +++ app/test/test_event_ring.c | 16 ++- app/test/test_event_timer_adapter.c | 16 ++- app/test/test_eventdev.c | 20 +++- app/test/test_external_mem.c | 18 +++- app/test/test_fib.c | 22 ++++- app/test/test_fib6.c | 24 ++++- app/test/test_fib6_perf.c | 16 ++- app/test/test_fib_perf.c | 15 ++- app/test/test_flow_classify.c | 13 +++ app/test/test_func_reentrancy.c | 12 +++ app/test/test_graph.c | 18 +++- app/test/test_graph_perf.c | 16 ++- app/test/test_hash_perf.c | 12 +++ app/test/test_interrupts.c | 10 ++ app/test/test_ipfrag.c | 16 ++- app/test/test_ipsec.c | 15 ++- app/test/test_ipsec_perf.c | 15 ++- app/test/test_ipsec_sad.c | 14 ++- app/test/test_kni.c | 10 +- app/test/test_lcores.c | 12 +++ app/test/test_logs.c | 6 +- app/test/test_lpm.c | 14 ++- app/test/test_lpm6.c | 14 ++- app/test/test_lpm6_perf.c | 14 ++- app/test/test_lpm_perf.c | 13 ++- app/test/test_malloc.c | 17 +++- app/test/test_mbuf.c | 13 ++- app/test/test_member.c | 16 ++- app/test/test_member_perf.c | 16 ++- app/test/test_memcpy_perf.c | 18 +++- app/test/test_memory.c | 2 +- app/test/test_mempool_perf.c | 12 +++ app/test/test_mp_secondary.c | 12 +++ app/test/test_pie.c | 30 +++++- app/test/test_pmd_perf.c | 6 +- app/test/test_rawdev.c | 17 +++- app/test/test_rcu_qsbr_perf.c | 12 +++ app/test/test_reciprocal_division.c | 12 +++ app/test/test_reciprocal_division_perf.c | 12 +++ app/test/test_red.c | 29 +++++- app/test/test_reorder.c | 15 ++- app/test/test_rib.c | 22 ++++- app/test/test_rib6.c | 22 ++++- app/test/test_ring_stress_impl.h | 2 +- app/test/test_sched.c | 14 ++- app/test/test_security.c | 16 ++- app/test/test_table.c | 13 +++ app/test/test_table_acl.c | 3 + app/test/test_table_combined.c | 4 + app/test/test_table_pipeline.c | 4 + app/test/test_table_ports.c | 4 + app/test/test_table_tables.c | 4 + app/test/test_telemetry_data.c | 2 + app/test/test_timer_secondary.c | 13 +++ app/test/test_trace.c | 32 +++++- lib/eal/common/eal_common_errno.c | 4 + lib/eal/windows/eal_memalloc.c | 6 +- 91 files changed, 1131 insertions(+), 156 deletions(-) delete mode 100755 app/test/has-hugepage.sh create mode 100644 app/test/has_hugepage.py
Signature · 1 line
2.31.0.vfs.0.1
PATCH v10 1/9 eal/windows: return ENOTSUP for not supported API
UT memory_autotest on Windows has 2 failed cases on eal APIs eal_memalloc_get_seg_fd and eal_memalloc_get_seg_fd_offset. These 2 APIs are not supported on Windows yet. Should return ENOTSUP such that in test_memory.c these 2 ENOTSUP cases will not be marked as failures, same as other ENOTSUP cases.
--- lib/eal/windows/eal_memalloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/eal/windows/eal_memalloc.c +3 -3
@@ -17,7 +17,7 @@ eal_memalloc_get_seg_fd(int list_idx, int seg_idx)RTE_SET_USED (list_idx);RTE_SET_USED (seg_idx);EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; }int
@@ -28,7 +28,7 @@ eal_memalloc_get_seg_fd_offset(int list_idx, int seg_idx, size_t *offset)RTE_SET_USED (seg_idx);RTE_SET_USED (offset);EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; } static int
@@ -428,7 +428,7 @@ eal_memalloc_sync_with_primary(void) {/* No multi-process support. */ EAL_LOG_NOT_IMPLEMENTED (); -return -1 ; +return -ENOTSUP ; }int
Signature · 1 line
2.31.0.vfs.0.1
PATCH v10 2/9 app/test: remove POSIX-specific code
In reply to Jie Zhou- Remove header inclusion of netinet/in.h and terminos.h
- Include rte_os_shim.h
- Replace sleep and usleep with rte_delay_us_sleep
- Use NUL on Windows as /dev/null for Linux
- Exclude tests not supported on Windows yet, e.g. multi-process, and IP address parsing (the test cases use linux netinet/in.h u6_addr and better have a sperate patch to add such tests on Windows)
--- app/test/commands.c | 2 -- app/test/packet_burst_generator.c | 1 + app/test/process.h | 4 +++- app/test/test.c | 5 ++++- app/test/test_byteorder.c | 2 +- app/test/test_cmdline.c | 2 ++ app/test/test_cmdline_lib.c | 13 +++++++++---- app/test/test_crc.c | 1 - app/test/test_pmd_perf.c | 6 +++++- app/test/test_ring_stress_impl.h | 2 +- app/test/test_telemetry_data.c | 2 ++ 11 files changed, 28 insertions(+), 12 deletions(-)
app/test/commands.c +0 -2
@@ -8,8 +8,6 @@#include <stdint.h> #include <string.h> #include <stdlib.h> -#include <netinet/in.h> -#include <termios.h> #include <inttypes.h> #include <errno.h> #include <sys/queue.h>
app/test/packet_burst_generator.c +1 -0
@@ -5,6 +5,7 @@#include <rte_byteorder.h> #include <rte_mbuf.h> #include <rte_ip.h> +#include <rte_os_shim.h> #include "packet_burst_generator.h"
app/test/process.h +3 -1
@@ -7,12 +7,14 @@#include <errno.h> /* errno */ #include <limits.h> /* PATH_MAX */ +#ifndef RTE_EXEC_ENV_WINDOWS #include <libgen.h> /* basename et al */ +#include <sys/wait.h> +#endif #include <stdlib.h> /* NULL */ #include <string.h> /* strerror */ #include <unistd.h> /* readlink */ #include <dirent.h> -#include <sys/wait.h> #include <rte_string_fns.h> /* strlcpy */
app/test/test.c +4 -1
@@ -8,7 +8,6 @@#include <stdarg.h> #include <stdlib.h> #include <errno.h> -#include <termios.h> #include <ctype.h> #include <sys/queue.h>
@@ -63,7 +62,9 @@ do_recursive_call(void)const char *env_var;int (*action_fn)(void ); } actions[] = { +#ifndef RTE_EXEC_ENV_WINDOWS { "run_secondary_instances", test_mp_secondary }, +#endif #ifdef RTE_LIB_PDUMP #ifdef RTE_NET_RING { "run_pdump_server_tests", test_pdump },
@@ -82,7 +83,9 @@ do_recursive_call(void) { "test_file_prefix", no_action }, { "test_no_huge_flag", no_action }, #ifdef RTE_LIB_TIMER +#ifndef RTE_EXEC_ENV_WINDOWS { "timer_secondary_spawn_wait", test_timer_secondary }, +#endif #endif };
app/test/test_byteorder.c +1 -1
@@ -46,7 +46,7 @@ test_byteorder(void)return -1 ; res_u16 =rte_bswap16 (0x1337 ); -printf ("const %" PRIx16" -> %" PRIx16"\n" ,0x1337 , res_u16); +printf ("const %" PRIx16" -> %" PRIx16"\n" , (uint16_t )0x1337 , res_u16);if (res_u16 !=0x3713 )return -1 ;
app/test/test_cmdline.c +2 -0
@@ -31,6 +31,7 @@ test_cmdline(void)return -1 ;if (test_parse_num_invalid_param () <0 )return -1 ; +#ifndef RTE_EXEC_ENV_WINDOWS printf ("Testing parsing IP addresses...\n" );if (test_parse_ipaddr_valid () <0 )return -1 ;
@@ -38,6 +39,7 @@ test_cmdline(void)return -1 ;if (test_parse_ipaddr_invalid_param () <0 )return -1 ; +#endif printf ("Testing parsing strings...\n" );if (test_parse_string_valid () <0 )return -1 ;
app/test/test_cmdline_lib.c +9 -4
@@ -8,7 +8,6 @@#include <stdarg.h> #include <stdlib.h> #include <errno.h> -#include <termios.h> #include <ctype.h> #include <sys/queue.h>
@@ -22,6 +21,12 @@#include "test_cmdline.h" +#ifndef RTE_EXEC_ENV_WINDOWS +#define NULL_INPUT "/dev/null" +#else +#define NULL_INPUT "NUL" +#endif +/****************************************************************/ /* static functions required for some tests */ static void
@@ -156,10 +161,10 @@ test_cmdline_socket_fns(void) cl =cmdline_stdin_new (&ctx,NULL );if (cl !=NULL ) goto error; - cl =cmdline_file_new (NULL ,"prompt" ,"/dev/null" ); + cl =cmdline_file_new (NULL ,"prompt" ,NULL_INPUT );if (cl !=NULL ) goto error; - cl =cmdline_file_new (&ctx,NULL ,"/dev/null" ); + cl =cmdline_file_new (&ctx,NULL ,NULL_INPUT );if (cl !=NULL ) goto error; cl =cmdline_file_new (&ctx,"prompt" ,NULL );
@@ -171,7 +176,7 @@ test_cmdline_socket_fns(void)cmdline_free (cl);return -1 ; } - cl =cmdline_file_new (&ctx,"prompt" ,"/dev/null" ); + cl =cmdline_file_new (&ctx,"prompt" ,NULL_INPUT );if (cl ==NULL ) {printf ("Error: failed to open /dev/null for reading!" );return -1 ;
app/test/test_crc.c +0 -1
@@ -14,7 +14,6 @@#define CRC32_VEC_LEN2 348#define CRC16_VEC_LEN1 12#define CRC16_VEC_LEN2 2 -#define LINE_LEN 75/* CRC test vector */ static const uint8_t crc_vec[CRC_VEC_LEN ] = {
app/test/test_pmd_perf.c +5 -1
@@ -296,6 +296,7 @@ reset_count(void) idle =0 ; } +#ifndef RTE_EXEC_ENV_WINDOWS static void stats_display (uint16_t port_id) {
@@ -325,6 +326,7 @@ signal_handler(int signum)if (signum ==SIGUSR2 ) stats_display(0); } +#endif struct rte_mbuf **tx_burst;
@@ -638,7 +640,7 @@ exec_burst(uint32_t flags, int lcore) i = (i >= conf->nb_ports -1 ) ?0 : (i +1 ); } -sleep (5 ); +rte_delay_us (5 *US_PER_S );/* only when polling second */ if (flags ==SC_BURST_XMIT_FIRST )
@@ -669,8 +671,10 @@ test_pmd_perf(void)printf ("Start PMD RXTX cycles cost test.\n" ); +#ifndef RTE_EXEC_ENV_WINDOWS signal (SIGUSR1 , signal_handler);signal (SIGUSR2 , signal_handler); +#endif nb_ports =rte_eth_dev_count_avail ();if (nb_ports <NB_ETHPORTS_USED ) {
app/test/test_ring_stress_impl.h +1 -1
@@ -360,7 +360,7 @@ test_mt1(int (*test)(void *))/* signal worker to start test */ __atomic_store_n (&wrk_cmd,WRK_CMD_RUN , __ATOMIC_RELEASE); -usleep (run_time *US_PER_S ); +rte_delay_us (run_time *US_PER_S );/* signal worker to start test */ __atomic_store_n (&wrk_cmd,WRK_CMD_STOP , __ATOMIC_RELEASE);
app/test/test_telemetry_data.c +2 -0
@@ -4,7 +4,9 @@#include <string.h> #include <sys/socket.h> +#ifndef RTE_EXEC_ENV_WINDOWS #include <sys/un.h> +#endif #include <unistd.h> #include <limits.h>
Signature · 1 line
2.31.0.vfs.0.1
Re: [PATCH v10 2/9] app/test: remove POSIX-specific code
2021-12-01 10:43 (UTC-0800), Jie Zhou:
Quoted 1 line
- Remove header inclusion of
netinet/in.handterminos.h
Typo: "termios.h".
Quoted 2 lines
- Include
rte_os_shim.h
- Replace sleep and usleep withrte_delay_us_sleep
Instead of all the above I'd say:
"Replace POSIX-specific code with DPDK equivalents
or conditionally disable it on Windows."
Quoted 1 line
- Use NUL on Windows as
/dev/nullfor Linux
"Linux" -> "Unix"
Quoted 3 lines
- Exclude tests not supported on Windows yet, e.g. multi-process, and IP address parsing (the test cases use linux
netinet/in.hu6_addrand better have a sperate patch to add such tests on Windows)
Instead of "e.g." a complete list of missing tests is preferable:
* multi-process
* PMD performance statistics display on signal
* command-line IP address parsing
TBH, I don't understand the issue with test_cmdline_ipaddr--- it could be fixed with just a few lines:
#define IP4(a,b,c,d) {.s_addr = ... }
#ifdef RTE_EXEC_ENV_WINDOWS
#define s6_addr16 u.Word
#else
#define s6_addr16 __u6_addr.__u6_addr16
#endifWhy it should be a separate patch?
PATCH v10 3/9 app/test: fix incorrect errno variable
In reply to Jie ZhouFix incorrect errno variable used in memory autotest. Use rte_errno instead.
--- app/test/test_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test_memory.c +1 -1
@@ -63,7 +63,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,/* we're able to get memseg fd - try getting its offset */ ret =rte_memseg_get_fd_offset_thread_unsafe (ms, &offset);if (ret <0 ) { -if (errno ==ENOTSUP ) +if (rte_errno ==ENOTSUP )return 1 ;return -1 ; }
Signature · 1 line
2.31.0.vfs.0.1
PATCH v10 4/9 app/test: skip interrupt tests on Windows
In reply to Jie ZhouEven though test_interrupts.c can compile on Windows, skip interrupt tests for now since majority of eal_interrupt on Windows are stubs. Will remove the skip after interrupt being fully enabled on Windows.
--- app/test/test_interrupts.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
app/test/test_interrupts.c +10 -0
@@ -12,6 +12,15 @@#include "test.h" +#ifdef RTE_EXEC_ENV_WINDOWS +static int +test_interrupt (void ) +{ +printf ("Interrupt on Windows is not fully supported yet, skipping test\n" ); +return TEST_SKIPPED ; +} +#else +#define TEST_INTERRUPT_CHECK_INTERVAL 100/* ms */ /* predefined interrupt handle types */
@@ -590,5 +599,6 @@ test_interrupt(void) return ret; } +#endif /*ifdef RTE_EXEC_ENV_WINDOWS*/ REGISTER_TEST_COMMAND (interrupt_autotest, test_interrupt);
Signature · 1 line
2.31.0.vfs.0.1
PATCH v10 5/9 app/test: skip two logs_autotest cases on Windows
In reply to Jie ZhouDPDK logs_autotest on Windows failed at "dynamic log types" tests. The failures are on 2 test cases for rte_log_set_level_regexp API, due to regular expression is not supported on Windows in DPDK yet and regcomp/regexec are just stubs on Windows (in regex.h).
In app\test\test_logs.c, ifndef these two test cases, and for the rte_log_set_level_pattern validation case following these two cases, differentiate the expected log level passed into macro CHECK_LEVELS
Now logs_autotest completes for all dynamic log types and static log types.
--- app/test/test_logs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
app/test/test_logs.c +5 -1
@@ -113,6 +113,7 @@ test_logs(void)rte_log_set_level (logtype1,RTE_LOG_ERR );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR ); +#ifndef RTE_EXEC_ENV_WINDOWS rte_log_set_level_regexp ("type$" ,RTE_LOG_EMERG );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR );
@@ -121,7 +122,10 @@ test_logs(void)rte_log_set_level_pattern ("logtype" ,RTE_LOG_DEBUG );CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_EMERG ,RTE_LOG_EMERG ); - +#else + ret =rte_log_set_level_pattern ("logtype" ,RTE_LOG_DEBUG ); +CHECK_LEVELS (RTE_LOG_ERR ,RTE_LOG_INFO ,RTE_LOG_ERR ); +#endif /* set logtype level low to so we can test global level */ rte_log_set_level_pattern ("logtype*" ,RTE_LOG_DEBUG );CHECK_LEVELS (RTE_LOG_DEBUG ,RTE_LOG_DEBUG ,RTE_LOG_DEBUG );
Signature · 1 line
2.31.0.vfs.0.1
PATCH v10 6/9 app/test: differentiate a strerror on different OS
In reply to Jie ZhouOn Windows, strerror returns just "Unknown error" for errnum greater than MAX_ERRNO, while linux and freebsd returns "Unknown error <num>", which is the current expectation for errno_autotest. Differentiate the error string on Windows to remove a "duplicate error code" failure.
--- app/test/test_errno.c | 12 +++++++++++- lib/eal/common/eal_common_errno.c | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-)
app/test/test_errno.c +11 -1
@@ -18,13 +18,19 @@ test_errno(void) {const char *rte_retval;const char *libc_retval; + +#ifndef RTE_EXEC_ENV_WINDOWS #ifdef RTE_EXEC_ENV_FREEBSD /* BSD has a colon in the string, unlike linux */ const char unknown_code_result[] ="Unknown error: %d" ;#else const char unknown_code_result[] ="Unknown error %d" ;#endif -char expected_libc_retval[sizeof (unknown_code_result)+3 ]; +char expected_libc_retval[sizeof (unknown_code_result) +3 ]; +#else +/* Windows doesn't return error number for error greater than MAX_errno*/ +static const char expected_libc_retval[] ="Unknown error" ; +#endif /* use a small selection of standard errors for testing */ int std_errs[] = {EAGAIN ,EBADF ,EACCES ,EINTR ,EINVAL };
@@ -54,11 +60,13 @@ test_errno(void) rte_retval, libc_retval);if (strcmp (rte_retval, libc_retval) ==0 )return -1 ; +#ifndef RTE_EXEC_ENV_WINDOWS /* generate appropriate error string for unknown error number * and then check that this is what we got back. If not, we have * a duplicate error number that conflicts with errno.h */ snprintf (expected_libc_retval,sizeof (expected_libc_retval), unknown_code_result, rte_errs[i]); +#endif if ((strcmp (expected_libc_retval, libc_retval) !=0 ) && (strcmp ("" , libc_retval) !=0 )){printf ("Error, duplicate error code %d\n" , rte_errs[i]);
@@ -69,8 +77,10 @@ test_errno(void)/* ensure that beyond RTE_MAX_ERRNO, we always get an unknown code */ rte_retval =rte_strerror (RTE_MAX_ERRNO +1 ); libc_retval =strerror (RTE_MAX_ERRNO +1 ); +#ifndef RTE_EXEC_ENV_WINDOWS snprintf (expected_libc_retval,sizeof (expected_libc_retval), unknown_code_result,RTE_MAX_ERRNO +1 ); +#endif printf ("rte_strerror: '%s', strerror: '%s'\n" , rte_retval, libc_retval); if ((strcmp(rte_retval, libc_retval) != 0) ||
lib/eal/common/eal_common_errno.c +4 -0
@@ -37,7 +37,11 @@ rte_strerror(int errnum)/* since some implementations of strerror_r throw an error * themselves if errnum is too big, we handle that case here */ if (errnum >= RTE_MAX_ERRNO) +#ifdef RTE_EXEC_ENV_WINDOWS +snprintf (ret,RETVAL_SZ ,"Unknown error%s" , sep); +#else snprintf (ret,RETVAL_SZ ,"Unknown error%s %d" , sep, errnum); +#endif else switch (errnum){case E_RTE_SECONDARY :
Signature · 1 line
2.31.0.vfs.0.1
PATCH v10 7/9 app/test: remove two alarm_autotest cases
In reply to Jie ZhouRemove two alarm_autotest test cases which do bogus range check on Windows.
--- app/test/test_alarm.c | 4 ++++ 1 file changed, 4 insertions(+)
app/test/test_alarm.c +4 -0
@@ -10,6 +10,7 @@#include "test.h" +#ifndef RTE_EXEC_ENV_WINDOWS static volatile int flag; static void
@@ -18,6 +19,7 @@ test_alarm_callback(void *cb_arg) flag =1 ; printf("Callback setting flag - OK. [cb_arg = %p]\n", cb_arg); } +#endif static int test_alarm (void )
@@ -27,6 +29,7 @@ test_alarm(void)return 0 ;#endif +#ifndef RTE_EXEC_ENV_WINDOWS /* check if it will fail to set alarm with wrong us value */ printf ("check if it will fail to set alarm with wrong ms values\n" ); if (rte_eal_alarm_set(0, test_alarm_callback,
@@ -39,6 +42,7 @@ test_alarm(void)printf ("should not be successful with (UINT64_MAX-1) us value\n" ); return -1; } +#endif /* check if it will fail to set alarm with null callback parameter */ printf ("check if it will fail to set alarm with null callback parameter\n" );
Signature · 1 line
2.31.0.vfs.0.1