Skip to content

[10384] Adding Zero Copy feature to the Latency performance tests #1742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 154 additions & 22 deletions test/performance/latency/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,39 @@ set(
interprocess_reliable_shm
)

###########################################################################
# List of tests supporting specific features #
# Each entry in this list means a specific test case added #
###########################################################################

set(
DATA_SHARING_LIST
intraprocess_best_effort
intraprocess_reliable
interprocess_best_effort_shm
interprocess_reliable_shm
)

set(
LOAN_SAMPLES_LIST
intraprocess_best_effort
intraprocess_reliable
interprocess_best_effort_shm
interprocess_reliable_shm
interprocess_best_effort_udp
interprocess_reliable_udp
interprocess_best_effort_tcp
interprocess_reliable_tcp
)

set(
DATA_SHARING_AND_LOAN_SAMPLES_LIST
intraprocess_best_effort
intraprocess_reliable
interprocess_best_effort_shm
interprocess_reliable_shm
)

###########################################################################
# Configure XML files #
###########################################################################
Expand All @@ -70,6 +103,16 @@ find_package(PythonInterp 3 REQUIRED)
if(PYTHONINTERP_FOUND)
# Loop over the test names
foreach(latency_test_name ${LATENCY_TEST_LIST})

# decide if add security testing
set(ADD_LATENCY_SECURITY OFF)
if(SECURITY AND (${latency_test_name} MATCHES "^interprocess"))
set(ADD_LATENCY_SECURITY ON)
endif()

# list of all the test cases generated in this iteration
set(test_cases_setup performance.latency.${latency_test_name})

# Set the interprocess flag
if(${latency_test_name} MATCHES "^interprocess")
set(interproces_flag "--interprocess")
Expand All @@ -88,16 +131,6 @@ if(PYTHONINTERP_FOUND)
${interproces_flag}
)

# Set test properties
set_property(
TEST performance.latency.${latency_test_name}
PROPERTY LABELS "NoMemoryCheck"
)
set_property(
TEST performance.latency.${latency_test_name}
APPEND PROPERTY ENVIRONMENT "LATENCY_TEST_BIN=$<TARGET_FILE:LatencyTest>"
)

# Add environment
if(WIN32)
set(WIN_PATH "$ENV{PATH}")
Expand All @@ -116,14 +149,16 @@ if(PYTHONINTERP_FOUND)
endforeach()
endif()
string(REPLACE ";" "\\;" WIN_PATH "${WIN_PATH}")
set_property(TEST performance.latency.${latency_test_name} APPEND PROPERTY ENVIRONMENT "PATH=${WIN_PATH}")
endif()

# If there is security, add a secure test as well
if(SECURITY AND (${latency_test_name} MATCHES "^interprocess"))
# Add the secure verison
if(ADD_LATENCY_SECURITY)

# Add the secure version
list(APPEND test_cases_setup performance.latency.${latency_test_name}.security)

add_test(
NAME performance.latency.${latency_test_name}_security
NAME performance.latency.${latency_test_name}.security
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/latency_tests.py
${LATENCY_TEST_BIN}
Expand All @@ -133,22 +168,119 @@ if(PYTHONINTERP_FOUND)
${interproces_flag}
)

# Hint certificates location
set_property(
TEST performance.latency.${latency_test_name}.security
APPEND PROPERTY ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs"
)

endif()

# Check if a data sharing test is required
if(latency_test_name IN_LIST DATA_SHARING_LIST)

# append to the list of cases
list(APPEND test_cases_setup performance.latency.${latency_test_name}.data_sharing)

add_test(
NAME performance.latency.${latency_test_name}.data_sharing
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/latency_tests.py
${LATENCY_TEST_BIN}
--xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${latency_test_name}.xml
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
${interproces_flag}
--data_sharing
)

endif()

# Check if a zero copy test is required
if(latency_test_name IN_LIST LOAN_SAMPLES_LIST)

# append to the list of cases
list(APPEND test_cases_setup performance.latency.${latency_test_name}.data_loans)

add_test(
NAME performance.latency.${latency_test_name}.data_loans
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/latency_tests.py
${LATENCY_TEST_BIN}
--xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${latency_test_name}.xml
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
${interproces_flag}
--data_loans
)

# If there is security, add a secure test as well with loans
if(ADD_LATENCY_SECURITY)

# Add the secure version
list(APPEND test_cases_setup performance.latency.${latency_test_name}.data_loans.security)

add_test(
NAME performance.latency.${latency_test_name}.data_loans.security
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/latency_tests.py
${LATENCY_TEST_BIN}
--xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${latency_test_name}.xml
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
--security
${interproces_flag}
--data_loans
)

# Hint certificates location
set_property(
TEST performance.latency.${latency_test_name}.data_loans.security
APPEND PROPERTY ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs"
)

endif()

endif()

# Check if a test using data sharing and zero copy is required
if(latency_test_name IN_LIST DATA_SHARING_AND_LOAN_SAMPLES_LIST)

# append to the list of cases
list(APPEND test_cases_setup performance.latency.${latency_test_name}.data_loans_and_sharing)

add_test(
NAME performance.latency.${latency_test_name}.data_loans_and_sharing
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/latency_tests.py
${LATENCY_TEST_BIN}
--xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${latency_test_name}.xml
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
${interproces_flag}
--data_loans
--data_sharing
)

endif()


# populate the properties for each test
foreach(latency_test_case ${test_cases_setup})

# Set test properties
set_property(
TEST performance.latency.${latency_test_name}_security
TEST ${latency_test_case}
PROPERTY LABELS "NoMemoryCheck"
)
set_property(
TEST performance.latency.${latency_test_name}_security
TEST ${latency_test_case}
APPEND PROPERTY ENVIRONMENT "LATENCY_TEST_BIN=$<TARGET_FILE:LatencyTest>"
)
set_property(
TEST performance.latency.${latency_test_name}_security
APPEND PROPERTY ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs"
)

if(WIN32)
set_property(TEST performance.latency.${latency_test_name}_security APPEND PROPERTY ENVIRONMENT "PATH=${WIN_PATH}")
set_property(
TEST ${latency_test_case}
APPEND PROPERTY ENVIRONMENT "PATH=${WIN_PATH}")
endif()
endif()

endforeach(latency_test_case)

endforeach(latency_test_name)
endif()
Loading