2019-04-26 18:27:27 +03:00
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
# Licensed under the Apache 2.0 License.
|
|
|
|
cmake_minimum_required(VERSION 3.11)
|
|
|
|
|
|
|
|
set(CCF_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
include(${CCF_DIR}/cmake/preproject.cmake)
|
2020-06-25 13:45:58 +03:00
|
|
|
include(${CCF_DIR}/cmake/version.cmake)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
project(
|
|
|
|
ccf
|
2020-06-25 13:45:58 +03:00
|
|
|
VERSION ${CCF_RELEASE_VERSION}
|
2020-01-28 21:09:42 +03:00
|
|
|
LANGUAGES C CXX
|
|
|
|
)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
|
|
|
set(ENV{BETTER_EXCEPTIONS} 1)
|
|
|
|
|
2020-06-25 13:45:58 +03:00
|
|
|
message(STATUS "CCF version=${CCF_VERSION}")
|
|
|
|
message(STATUS "CCF release version=${CCF_RELEASE_VERSION}")
|
2020-06-15 17:29:24 +03:00
|
|
|
|
2020-07-31 13:46:52 +03:00
|
|
|
include(${CCF_DIR}/cmake/cpack_settings.cmake)
|
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
# Set the default install prefix for CCF. Users may override this value with the
|
|
|
|
# cmake command. For example:
|
2020-01-21 18:14:27 +03:00
|
|
|
#
|
2020-01-28 21:09:42 +03:00
|
|
|
# $ cmake -DCMAKE_INSTALL_PREFIX=/opt/myplace ..
|
2020-01-21 18:14:27 +03:00
|
|
|
#
|
2020-01-28 21:09:42 +03:00
|
|
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
2020-01-21 18:14:27 +03:00
|
|
|
set(CMAKE_INSTALL_PREFIX
|
2020-06-30 17:46:23 +03:00
|
|
|
"/opt/${CCF_VERSION}"
|
2020-01-28 21:09:42 +03:00
|
|
|
CACHE PATH "Default install prefix" FORCE
|
|
|
|
)
|
2020-01-21 18:14:27 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
message(STATUS "CMAKE_INSTALL_PREFIX is '${CMAKE_INSTALL_PREFIX}'")
|
|
|
|
|
2020-01-29 18:09:28 +03:00
|
|
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/preproject.cmake
|
|
|
|
DESTINATION cmake
|
|
|
|
)
|
|
|
|
|
2019-12-16 14:55:33 +03:00
|
|
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/common.cmake)
|
2020-09-04 10:49:02 +03:00
|
|
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/aft.cmake)
|
2020-03-06 14:52:17 +03:00
|
|
|
|
2020-06-25 13:45:58 +03:00
|
|
|
configure_file(
|
|
|
|
${CCF_DIR}/src/host/version.h.in ${CCF_GENERATED_DIR}/version.h @ONLY
|
|
|
|
)
|
2020-08-03 15:12:34 +03:00
|
|
|
configure_file(${CCF_DIR}/python/setup.py.in ${CCF_DIR}/python/setup.py @ONLY)
|
2020-06-25 13:45:58 +03:00
|
|
|
|
2020-08-21 11:27:10 +03:00
|
|
|
set(CONSENSUSES raft)
|
2019-12-16 14:55:33 +03:00
|
|
|
|
2019-04-26 18:27:27 +03:00
|
|
|
option(BUILD_TESTS "Build tests" ON)
|
2020-03-26 18:30:06 +03:00
|
|
|
option(BUILD_UNIT_TESTS "Build unit tests" ON)
|
2020-04-07 13:05:24 +03:00
|
|
|
option(TLS_TEST "TLS Test using https://github.com/drwetter/testssl.sh" OFF)
|
2019-04-30 13:30:59 +03:00
|
|
|
option(BUILD_SMALLBANK "Build SmallBank sample app and clients" ON)
|
|
|
|
|
2020-01-28 17:06:12 +03:00
|
|
|
# Build common library for CCF enclaves
|
|
|
|
add_custom_target(ccf ALL)
|
|
|
|
|
2020-03-25 17:50:30 +03:00
|
|
|
if("sgx" IN_LIST COMPILE_TARGETS)
|
2020-01-28 17:06:12 +03:00
|
|
|
# enclave version
|
2020-01-28 21:09:42 +03:00
|
|
|
add_library(
|
|
|
|
ccf.enclave STATIC
|
|
|
|
${CCF_DIR}/src/enclave/main.cpp ${CCF_DIR}/src/enclave/thread_local.cpp
|
2020-01-28 17:06:12 +03:00
|
|
|
${CCF_GENERATED_DIR}/ccf_t.cpp
|
|
|
|
)
|
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
target_compile_definitions(
|
|
|
|
ccf.enclave PUBLIC INSIDE_ENCLAVE _LIBCPP_HAS_THREAD_API_PTHREAD
|
2020-01-28 17:06:12 +03:00
|
|
|
)
|
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
target_compile_options(ccf.enclave PUBLIC -nostdinc -nostdinc++)
|
2020-07-21 18:08:25 +03:00
|
|
|
add_warning_checks(ccf.enclave)
|
2020-01-28 17:06:12 +03:00
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
target_include_directories(
|
2020-01-29 18:09:28 +03:00
|
|
|
ccf.enclave SYSTEM
|
|
|
|
PUBLIC
|
2020-03-13 19:27:56 +03:00
|
|
|
"$<BUILD_INTERFACE:${EVERCRYPT_INC}>"
|
2020-01-29 18:09:28 +03:00
|
|
|
$<BUILD_INTERFACE:${CCF_GENERATED_DIR}>
|
2020-03-13 19:27:56 +03:00
|
|
|
$<INSTALL_INTERFACE:include/3rdparty/hacl-star/evercrypt>
|
|
|
|
$<INSTALL_INTERFACE:include/3rdparty/hacl-star/evercrypt/kremlin>
|
|
|
|
$<INSTALL_INTERFACE:include/3rdparty/hacl-star/evercrypt/kremlin/kremlib>
|
2020-01-28 17:06:12 +03:00
|
|
|
)
|
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
target_link_libraries(
|
|
|
|
ccf.enclave
|
2020-07-28 13:56:45 +03:00
|
|
|
PUBLIC ${OE_TARGET_ENCLAVE_AND_STD}
|
2020-05-06 16:03:17 +03:00
|
|
|
-static-libgcc
|
|
|
|
-lgcc
|
2020-01-28 21:09:42 +03:00
|
|
|
ccfcrypto.enclave
|
|
|
|
evercrypt.enclave
|
|
|
|
http_parser.enclave
|
|
|
|
lua.enclave
|
|
|
|
secp256k1.enclave
|
2020-09-04 10:49:02 +03:00
|
|
|
aft.enclave
|
2020-02-07 12:15:54 +03:00
|
|
|
sss.enclave
|
2020-01-28 17:06:12 +03:00
|
|
|
)
|
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
set_property(TARGET ccf.enclave PROPERTY POSITION_INDEPENDENT_CODE ON)
|
2020-01-28 17:06:12 +03:00
|
|
|
|
|
|
|
enable_quote_code(ccf.enclave)
|
|
|
|
|
2020-07-28 13:56:45 +03:00
|
|
|
add_lvi_mitigations(ccf.enclave)
|
|
|
|
|
2020-01-29 18:09:28 +03:00
|
|
|
install(
|
|
|
|
TARGETS ccf.enclave
|
|
|
|
EXPORT ccf
|
|
|
|
DESTINATION lib
|
|
|
|
)
|
2020-01-28 17:06:12 +03:00
|
|
|
|
|
|
|
add_dependencies(ccf ccf.enclave)
|
|
|
|
endif()
|
|
|
|
|
2020-03-25 17:50:30 +03:00
|
|
|
if("virtual" IN_LIST COMPILE_TARGETS)
|
2020-01-28 17:06:12 +03:00
|
|
|
# virtual version
|
2020-01-28 21:09:42 +03:00
|
|
|
add_library(
|
|
|
|
ccf.virtual STATIC ${CCF_DIR}/src/enclave/main.cpp
|
|
|
|
${CCF_DIR}/src/enclave/thread_local.cpp
|
2020-01-28 17:06:12 +03:00
|
|
|
)
|
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
target_compile_definitions(
|
|
|
|
ccf.virtual PUBLIC INSIDE_ENCLAVE VIRTUAL_ENCLAVE
|
|
|
|
_LIBCPP_HAS_THREAD_API_PTHREAD
|
2020-01-28 17:06:12 +03:00
|
|
|
)
|
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
target_compile_options(ccf.virtual PUBLIC -stdlib=libc++)
|
2020-07-21 18:08:25 +03:00
|
|
|
add_warning_checks(ccf.virtual)
|
2020-01-28 17:06:12 +03:00
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
target_include_directories(
|
2020-01-29 18:09:28 +03:00
|
|
|
ccf.virtual SYSTEM
|
|
|
|
PUBLIC
|
2020-03-13 19:27:56 +03:00
|
|
|
"$<BUILD_INTERFACE:${EVERCRYPT_INC}>"
|
2020-01-29 18:09:28 +03:00
|
|
|
$<BUILD_INTERFACE:${CCF_GENERATED_DIR}>
|
2020-03-13 19:27:56 +03:00
|
|
|
$<INSTALL_INTERFACE:include/3rdparty/hacl-star/evercrypt>
|
|
|
|
$<INSTALL_INTERFACE:include/3rdparty/hacl-star/evercrypt/kremlin>
|
|
|
|
$<INSTALL_INTERFACE:include/3rdparty/hacl-star/evercrypt/kremlin/kremlib>
|
2020-01-28 17:06:12 +03:00
|
|
|
)
|
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
target_link_libraries(
|
|
|
|
ccf.virtual
|
2020-05-28 11:39:05 +03:00
|
|
|
PUBLIC ${LINK_LIBCXX}
|
2020-05-06 16:03:17 +03:00
|
|
|
-static-libgcc
|
|
|
|
-lgcc
|
2020-01-28 21:09:42 +03:00
|
|
|
ccfcrypto.host
|
|
|
|
evercrypt.host
|
|
|
|
http_parser.host
|
|
|
|
lua.host
|
|
|
|
secp256k1.host
|
2020-09-04 10:49:02 +03:00
|
|
|
aft.virtual
|
2020-02-07 12:15:54 +03:00
|
|
|
sss.host
|
2020-09-02 12:46:17 +03:00
|
|
|
# TODO: replace with openenclave::oehostverify once OE 0.11 is
|
|
|
|
# released (OE#3312)
|
|
|
|
openenclave::oehost
|
2020-01-28 21:09:42 +03:00
|
|
|
${CMAKE_THREAD_LIBS_INIT}
|
2020-01-28 17:06:12 +03:00
|
|
|
)
|
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
set_property(TARGET ccf.virtual PROPERTY POSITION_INDEPENDENT_CODE ON)
|
2020-01-28 17:06:12 +03:00
|
|
|
|
|
|
|
enable_coverage(ccf.virtual)
|
|
|
|
use_client_mbedtls(ccf.virtual)
|
|
|
|
add_san(ccf.virtual)
|
2020-07-28 13:56:45 +03:00
|
|
|
add_lvi_mitigations(ccf.virtual)
|
2020-01-28 17:06:12 +03:00
|
|
|
|
2020-01-29 18:09:28 +03:00
|
|
|
install(
|
|
|
|
TARGETS ccf.virtual
|
|
|
|
EXPORT ccf
|
|
|
|
DESTINATION lib
|
|
|
|
)
|
2020-01-28 17:06:12 +03:00
|
|
|
|
|
|
|
add_dependencies(ccf ccf.virtual)
|
|
|
|
endif()
|
|
|
|
|
2020-01-29 18:09:28 +03:00
|
|
|
install(EXPORT ccf DESTINATION cmake)
|
|
|
|
|
|
|
|
# Install all 3rd-party library includes
|
|
|
|
install(
|
|
|
|
DIRECTORY 3rdparty
|
|
|
|
DESTINATION include
|
|
|
|
FILES_MATCHING
|
|
|
|
PATTERN "*.h"
|
|
|
|
PATTERN "*.hpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install all CCF headers
|
|
|
|
install(
|
|
|
|
DIRECTORY src/
|
|
|
|
DESTINATION include/ccf
|
|
|
|
FILES_MATCHING
|
|
|
|
PATTERN "*.h"
|
|
|
|
PATTERN "*/test*" EXCLUDE
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install CCF Python infrastructure
|
|
|
|
install(
|
|
|
|
DIRECTORY tests/infra/
|
2020-02-07 17:29:02 +03:00
|
|
|
DESTINATION bin/infra
|
2020-01-29 18:09:28 +03:00
|
|
|
FILES_MATCHING
|
|
|
|
PATTERN "*.py"
|
|
|
|
PATTERN "*/__pycache__*" EXCLUDE
|
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES tests/start_network.py DESTINATION bin)
|
2020-02-07 17:29:02 +03:00
|
|
|
install(FILES tests/requirements.txt DESTINATION bin)
|
2020-01-29 18:09:28 +03:00
|
|
|
|
2020-01-21 18:14:27 +03:00
|
|
|
# Create patched alternative of library, to test code version changes
|
|
|
|
function(create_patched_enclave_lib name app_oe_conf_path enclave_sign_key_path)
|
2020-01-28 17:06:12 +03:00
|
|
|
set(enc_name ${name}.enclave)
|
2020-01-28 21:09:42 +03:00
|
|
|
if(TARGET ${enc_name})
|
2020-01-28 17:06:12 +03:00
|
|
|
set(patched_name ${name}.patched.enclave)
|
2020-01-21 18:14:27 +03:00
|
|
|
set(patched_lib_name lib${patched_name}.so)
|
|
|
|
add_custom_command(
|
2020-01-28 21:09:42 +03:00
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${patched_lib_name}
|
|
|
|
COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/lib${enc_name}.so
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${patched_lib_name}
|
|
|
|
COMMAND PYTHONPATH=${CCF_DIR}/tests:$ENV{PYTHONPATH} python3
|
|
|
|
patch_binary.py -p ${CMAKE_CURRENT_BINARY_DIR}/${patched_lib_name}
|
|
|
|
WORKING_DIRECTORY ${CCF_DIR}/tests
|
|
|
|
DEPENDS ${enc_name}
|
2020-01-21 18:14:27 +03:00
|
|
|
)
|
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
add_custom_target(
|
|
|
|
${patched_name} ALL
|
2020-01-21 18:14:27 +03:00
|
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${patched_lib_name}
|
|
|
|
)
|
2020-01-28 21:09:42 +03:00
|
|
|
sign_app_library(
|
|
|
|
${patched_name} ${app_oe_conf_path} ${enclave_sign_key_path}
|
|
|
|
)
|
2020-01-21 18:14:27 +03:00
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
add_ccf_app(
|
|
|
|
logging SRCS src/apps/logging/logging.cpp
|
|
|
|
src/apps/logging/stub_for_code_signing.cpp
|
2020-01-28 17:06:12 +03:00
|
|
|
)
|
2020-01-28 21:09:42 +03:00
|
|
|
sign_app_library(
|
|
|
|
logging.enclave ${CMAKE_CURRENT_SOURCE_DIR}/src/apps/logging/oe_sign.conf
|
2020-01-28 17:06:12 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/apps/sample_key.pem
|
|
|
|
)
|
2020-01-28 21:09:42 +03:00
|
|
|
create_patched_enclave_lib(
|
|
|
|
logging ${CMAKE_CURRENT_SOURCE_DIR}/src/apps/logging/oe_sign.conf
|
2020-01-21 18:14:27 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/apps/sample_key.pem
|
|
|
|
)
|
|
|
|
|
|
|
|
set(OE_SIGN_PATH ${OE_BINDIR}/oesign)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
if(BUILD_TESTS)
|
2019-04-26 18:27:27 +03:00
|
|
|
enable_testing()
|
|
|
|
|
2019-10-15 17:09:54 +03:00
|
|
|
# Unit tests
|
2020-03-26 18:30:06 +03:00
|
|
|
if(BUILD_UNIT_TESTS)
|
|
|
|
add_unit_test(map_test ${CMAKE_CURRENT_SOURCE_DIR}/src/ds/test/map_test.cpp)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
json_schema ${CMAKE_CURRENT_SOURCE_DIR}/src/ds/test/json_schema.cpp
|
|
|
|
)
|
Json schema: Take 3 (#113)
* Add a getApi method, listing all installed RPC method names
* Sketch RecordParams struct
* WIP
* Broken WIP
* Partial macro
* Basic examples working
* Partial file separation
* Move, rename, and fix FOR macro
* Use json get
* Build to_json from RequiredJsonFields too
* Remove unneeded pair specialisation
* Add comments, collide required and optional
* REformat
* Use new macros everywhere
* Remove unused template
* Rename getApi to listMethods
* Move frontend-specific calltypes to /rpc
* Specify GetTxHist return type
* Pretty-print client responses by default
* Add a GetSchema RPC
* Other tools demand ugly formatting by default
* mins and maxes for numerics, map of schemas
* Support _FOR_JSON_0
* Fix support for std::optional optional fields
* Test std optionals
* Define schemas for GetCommit
* More definitions for existing RPCs
* Tidy schema generation, including for vectors
* Add proper unit test
* Initial test of schema generation
* Fix failing tests
* Formatting
* Add (currently failing) test of nested structs
* Add misleadingly passing test
* Set correct expected pointers, test currently fails
* Oops - deexpand
* Correctly build pointer path for erroneous array elements
* Demonstrate invalid, not just missing, valeus
* Skeleton of json_bench
* Fix typo
* WIP
* Compare manual json parsers vs macro-defined
* mumble mumble
* Add valijson, +basic test
* Add benchmark of valijson validation
* Benchmark simple and complex structs
* Additional broken schema test
* Include pointer to parse errors
* Restore old basic translator macro
* Restore simpler macro for translators that don't need schema
* Add auto schema for private logging methods
* Add manual schema + validation for PUBLIC logging RPCs
* Match RPC format
* More RPC format fixes
* Correct scenario test target
* Add documentation entry on API schema
* Initial schema retrieval test
* Correct URLs in generated schema
* Send schema to a flat folder
* Remove unnecessary size_t max restriction
* Report non-matching schema
* Add current schemas
* Tidying
* clang-format
* Remove schema generation e2e test
* fmtlib, remove $id from schema
* Fix pointer paths
2019-06-05 12:36:50 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
logger_json_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ds/test/logger_json_test.cpp
|
|
|
|
)
|
2019-09-04 14:03:33 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
2020-06-29 17:07:27 +03:00
|
|
|
kv_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/kv/test/kv_test.cpp
|
2020-03-26 18:30:06 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/kv/test/kv_contention.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/kv/test/kv_serialisation.cpp
|
2020-06-29 17:07:27 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/kv/test/kv_snapshot.cpp
|
2020-08-24 17:09:06 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/kv/test/kv_dynamic_tables.cpp
|
2020-03-26 18:30:06 +03:00
|
|
|
)
|
|
|
|
use_client_mbedtls(kv_test)
|
|
|
|
target_link_libraries(
|
|
|
|
kv_test PRIVATE ${CMAKE_THREAD_LIBS_INIT} secp256k1.host
|
|
|
|
)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
ds_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ds/test/ring_buffer.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ds/test/messaging.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ds/test/oversized.cpp
|
2020-06-09 12:25:26 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ds/test/typed_messages.cpp
|
2020-03-26 18:30:06 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ds/test/serializer.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ds/test/hash.cpp
|
2020-07-27 22:29:24 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ds/test/thread_messaging.cpp
|
2020-03-26 18:30:06 +03:00
|
|
|
)
|
|
|
|
target_link_libraries(ds_test PRIVATE ${CMAKE_THREAD_LIBS_INIT})
|
2020-01-28 21:09:42 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
ledger_test ${CMAKE_CURRENT_SOURCE_DIR}/src/host/test/ledger.cpp
|
|
|
|
)
|
2020-01-28 21:09:42 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
2020-09-04 10:49:02 +03:00
|
|
|
raft_test ${CMAKE_CURRENT_SOURCE_DIR}/src/consensus/aft/test/main.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/consensus/aft/test/term_history.cpp
|
2020-03-26 18:30:06 +03:00
|
|
|
)
|
|
|
|
target_link_libraries(raft_test PRIVATE ${CRYPTO_LIBRARY})
|
2020-01-28 21:09:42 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
raft_enclave_test
|
2020-09-04 10:49:02 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/consensus/aft/test/enclave.cpp
|
2020-03-26 18:30:06 +03:00
|
|
|
)
|
|
|
|
target_include_directories(raft_enclave_test PRIVATE ${CCFCRYPTO_INC})
|
|
|
|
target_link_libraries(
|
|
|
|
raft_enclave_test PRIVATE ${CRYPTO_LIBRARY} secp256k1.host
|
|
|
|
)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
crypto_test ${CMAKE_CURRENT_SOURCE_DIR}/src/crypto/test/crypto.cpp
|
|
|
|
)
|
|
|
|
target_include_directories(crypto_test PRIVATE ${CCFCRYPTO_INC})
|
|
|
|
target_link_libraries(crypto_test PRIVATE ${CRYPTO_LIBRARY})
|
2020-01-28 21:09:42 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
history_test ${CMAKE_CURRENT_SOURCE_DIR}/src/node/test/history.cpp
|
|
|
|
)
|
|
|
|
target_include_directories(history_test PRIVATE ${EVERCRYPT_INC})
|
|
|
|
target_link_libraries(
|
|
|
|
history_test PRIVATE ${CRYPTO_LIBRARY} evercrypt.host secp256k1.host
|
|
|
|
)
|
2020-01-28 21:09:42 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
secret_sharing_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/node/test/secret_share.cpp
|
|
|
|
)
|
|
|
|
target_link_libraries(secret_sharing_test PRIVATE sss.host)
|
2020-02-18 12:28:05 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
encryptor_test ${CMAKE_CURRENT_SOURCE_DIR}/src/node/test/encryptor.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/crypto/symmetric_key.cpp
|
|
|
|
)
|
|
|
|
use_client_mbedtls(encryptor_test)
|
|
|
|
target_link_libraries(encryptor_test PRIVATE secp256k1.host)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
2020-06-11 11:59:30 +03:00
|
|
|
add_unit_test(
|
2020-06-15 17:58:45 +03:00
|
|
|
historical_queries_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/node/test/historical_queries.cpp
|
2020-06-11 11:59:30 +03:00
|
|
|
)
|
|
|
|
target_link_libraries(historical_queries_test PRIVATE secp256k1.host)
|
|
|
|
|
2020-08-18 17:53:51 +03:00
|
|
|
add_unit_test(
|
|
|
|
snapshot_test ${CMAKE_CURRENT_SOURCE_DIR}/src/node/test/snapshot.cpp
|
|
|
|
)
|
|
|
|
target_link_libraries(snapshot_test PRIVATE secp256k1.host)
|
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
msgpack_serialization_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/node/test/msgpack_serialization.cpp
|
|
|
|
)
|
2019-07-16 21:44:05 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(tls_test ${CMAKE_CURRENT_SOURCE_DIR}/src/tls/test/main.cpp)
|
|
|
|
target_link_libraries(
|
|
|
|
tls_test PRIVATE ${CMAKE_THREAD_LIBS_INIT} secp256k1.host
|
|
|
|
)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
2020-09-01 19:35:05 +03:00
|
|
|
add_test_bin(cert_test ${CMAKE_CURRENT_SOURCE_DIR}/src/tls/test/cert.cpp)
|
|
|
|
target_link_libraries(
|
|
|
|
cert_test PRIVATE ${CMAKE_THREAD_LIBS_INIT} secp256k1.host
|
|
|
|
)
|
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
key_exchange_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/tls/test/key_exchange.cpp
|
|
|
|
)
|
|
|
|
use_client_mbedtls(key_exchange_test)
|
|
|
|
target_link_libraries(key_exchange_test PRIVATE secp256k1.host)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
channels_test ${CMAKE_CURRENT_SOURCE_DIR}/src/node/test/channels.cpp
|
|
|
|
)
|
|
|
|
use_client_mbedtls(channels_test)
|
|
|
|
target_link_libraries(channels_test PRIVATE secp256k1.host)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
http_test ${CMAKE_CURRENT_SOURCE_DIR}/src/http/test/http_test.cpp
|
|
|
|
)
|
2020-07-17 13:12:14 +03:00
|
|
|
target_link_libraries(http_test PRIVATE http_parser.host secp256k1.host)
|
2019-09-30 13:26:31 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
frontend_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/node/rpc/test/frontend_test.cpp
|
|
|
|
)
|
|
|
|
target_link_libraries(
|
|
|
|
frontend_test PRIVATE ${CMAKE_THREAD_LIBS_INIT} evercrypt.host lua.host
|
|
|
|
secp256k1.host http_parser.host sss.host
|
|
|
|
)
|
2020-01-28 21:09:42 +03:00
|
|
|
|
2020-05-01 15:55:20 +03:00
|
|
|
add_unit_test(
|
|
|
|
tx_status_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/node/rpc/test/tx_status_test.cpp
|
|
|
|
)
|
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
member_voting_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/node/rpc/test/member_voting_test.cpp
|
|
|
|
)
|
|
|
|
target_link_libraries(
|
|
|
|
member_voting_test
|
|
|
|
PRIVATE ${CMAKE_THREAD_LIBS_INIT} evercrypt.host lua.host secp256k1.host
|
|
|
|
http_parser.host sss.host
|
|
|
|
)
|
2020-01-28 21:09:42 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
node_frontend_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/node/rpc/test/node_frontend_test.cpp
|
|
|
|
)
|
|
|
|
target_link_libraries(
|
|
|
|
node_frontend_test
|
|
|
|
PRIVATE ${CMAKE_THREAD_LIBS_INIT} evercrypt.host lua.host secp256k1.host
|
|
|
|
http_parser.host sss.host
|
|
|
|
)
|
2019-07-19 15:56:29 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
if(NOT ENV{RUNTIME_CONFIG_DIR})
|
|
|
|
set_tests_properties(
|
|
|
|
member_voting_test
|
|
|
|
PROPERTIES ENVIRONMENT
|
|
|
|
RUNTIME_CONFIG_DIR=${CMAKE_SOURCE_DIR}/src/runtime_config
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_unit_test(
|
|
|
|
lua_generic_test
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/apps/lua_generic/test/lua_generic_test.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/apps/lua_generic/lua_generic.cpp
|
|
|
|
)
|
|
|
|
target_include_directories(lua_generic_test PRIVATE ${LUA_DIR})
|
|
|
|
target_link_libraries(
|
|
|
|
lua_generic_test PRIVATE lua.host secp256k1.host http_parser.host
|
2020-02-25 17:35:53 +03:00
|
|
|
)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
add_unit_test(
|
|
|
|
lua_test ${CMAKE_CURRENT_SOURCE_DIR}/src/lua_interp/test/lua_test.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/lua_interp/test/lua_kv.cpp
|
|
|
|
)
|
|
|
|
target_include_directories(lua_test PRIVATE ${LUA_DIR})
|
|
|
|
target_link_libraries(lua_test PRIVATE lua.host)
|
|
|
|
|
2020-06-11 15:50:24 +03:00
|
|
|
add_unit_test(
|
|
|
|
merkle_test ${CMAKE_CURRENT_SOURCE_DIR}/src/node/test/merkle_test.cpp
|
|
|
|
)
|
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
# Merkle Tree memory test
|
|
|
|
add_executable(merkle_mem src/node/test/merkle_mem.cpp)
|
|
|
|
target_link_libraries(
|
|
|
|
merkle_mem PRIVATE ccfcrypto.host evercrypt.host secp256k1.host
|
|
|
|
${CMAKE_THREAD_LIBS_INIT}
|
|
|
|
)
|
|
|
|
use_client_mbedtls(merkle_mem)
|
|
|
|
target_include_directories(merkle_mem PRIVATE ${EVERCRYPT_INC} src)
|
2020-03-06 14:52:17 +03:00
|
|
|
|
2020-03-26 18:30:06 +03:00
|
|
|
# Raft driver and scenario test
|
|
|
|
add_executable(
|
2020-09-04 10:49:02 +03:00
|
|
|
raft_driver ${CMAKE_CURRENT_SOURCE_DIR}/src/consensus/aft/test/driver.cpp
|
2020-03-26 18:30:06 +03:00
|
|
|
)
|
|
|
|
use_client_mbedtls(raft_driver)
|
2020-09-04 10:49:02 +03:00
|
|
|
target_include_directories(raft_driver PRIVATE src/aft)
|
2020-03-26 18:30:06 +03:00
|
|
|
|
|
|
|
add_test(
|
|
|
|
NAME raft_scenario_test
|
|
|
|
COMMAND
|
|
|
|
${PYTHON} ${CMAKE_SOURCE_DIR}/tests/raft_scenarios_runner.py
|
|
|
|
./raft_driver ${CMAKE_SOURCE_DIR}/tests/raft_scenarios
|
|
|
|
${CMAKE_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
set_property(TEST raft_scenario_test PROPERTY LABELS raft_scenario)
|
2020-09-01 19:35:05 +03:00
|
|
|
|
|
|
|
add_test(NAME csr_test COMMAND ${PYTHON} ${CMAKE_SOURCE_DIR}/tests/certs.py
|
|
|
|
./cert_test
|
|
|
|
)
|
|
|
|
set_property(
|
|
|
|
TEST csr_test
|
|
|
|
APPEND
|
|
|
|
PROPERTY LABELS unit_test
|
|
|
|
)
|
2020-03-26 18:30:06 +03:00
|
|
|
endif()
|
2020-01-28 21:09:42 +03:00
|
|
|
|
|
|
|
# Picobench benchmarks
|
|
|
|
add_picobench(map_bench SRCS src/ds/test/map_bench.cpp)
|
|
|
|
add_picobench(logger_bench SRCS src/ds/test/logger_bench.cpp)
|
|
|
|
add_picobench(json_bench SRCS src/ds/test/json_bench.cpp)
|
2020-03-25 19:02:04 +03:00
|
|
|
add_picobench(ring_buffer_bench SRCS src/ds/test/ring_buffer_bench.cpp)
|
2020-01-28 21:09:42 +03:00
|
|
|
add_picobench(
|
|
|
|
tls_bench
|
2019-10-14 13:23:15 +03:00
|
|
|
SRCS src/tls/test/bench.cpp
|
|
|
|
LINK_LIBS secp256k1.host
|
|
|
|
)
|
2020-01-28 21:09:42 +03:00
|
|
|
add_picobench(
|
|
|
|
merkle_bench
|
2019-10-14 13:23:15 +03:00
|
|
|
SRCS src/node/test/merkle_bench.cpp
|
|
|
|
LINK_LIBS ccfcrypto.host evercrypt.host secp256k1.host
|
|
|
|
INCLUDE_DIRS ${EVERCRYPT_INC}
|
|
|
|
)
|
2020-01-28 21:09:42 +03:00
|
|
|
add_picobench(
|
|
|
|
history_bench
|
2019-10-14 13:23:15 +03:00
|
|
|
SRCS src/node/test/history_bench.cpp
|
|
|
|
LINK_LIBS ccfcrypto.host evercrypt.host secp256k1.host
|
|
|
|
INCLUDE_DIRS ${EVERCRYPT_INC}
|
|
|
|
)
|
2020-02-06 16:54:00 +03:00
|
|
|
add_picobench(
|
2020-03-25 19:02:04 +03:00
|
|
|
kv_bench SRCS src/kv/test/kv_bench.cpp src/crypto/symmetric_key.cpp
|
2020-02-06 16:54:00 +03:00
|
|
|
src/enclave/thread_local.cpp
|
|
|
|
)
|
2020-06-15 17:58:45 +03:00
|
|
|
add_picobench(hash_bench SRCS src/ds/test/hash_bench.cpp)
|
2019-04-26 18:27:27 +03:00
|
|
|
|
2020-03-06 14:52:17 +03:00
|
|
|
# Storing signed governance operations
|
|
|
|
add_e2e_test(
|
|
|
|
NAME governance_history_test
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/governance_history.py
|
|
|
|
CONSENSUS raft
|
|
|
|
)
|
2019-09-30 13:26:31 +03:00
|
|
|
|
2020-03-06 14:52:17 +03:00
|
|
|
add_e2e_test(
|
2020-05-06 19:56:53 +03:00
|
|
|
NAME recovery_test
|
2020-03-06 14:52:17 +03:00
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/recovery.py
|
|
|
|
CONSENSUS raft
|
2020-05-28 11:39:05 +03:00
|
|
|
ADDITIONAL_ARGS
|
|
|
|
--recovery
|
|
|
|
2
|
|
|
|
# Shorten Raft election timeout to speed up test when it kills a node on
|
|
|
|
# purpose to check that a recovery network is robust to a view change.
|
|
|
|
--raft-election-timeout
|
|
|
|
4000
|
2020-03-11 11:39:20 +03:00
|
|
|
)
|
|
|
|
|
2020-03-06 14:52:17 +03:00
|
|
|
add_e2e_test(
|
2020-05-06 19:56:53 +03:00
|
|
|
NAME rekey_test
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/rekey.py
|
|
|
|
CONSENSUS raft
|
|
|
|
)
|
|
|
|
|
|
|
|
add_e2e_test(
|
|
|
|
NAME recovery_test_suite
|
2020-03-06 14:52:17 +03:00
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/e2e_suite.py
|
|
|
|
CONSENSUS raft
|
2020-04-07 15:59:49 +03:00
|
|
|
LABEL suite
|
2020-05-06 19:56:53 +03:00
|
|
|
ADDITIONAL_ARGS
|
|
|
|
--test-duration
|
|
|
|
150
|
|
|
|
--enforce-reqs
|
|
|
|
--test-suite
|
|
|
|
rekey_recovery
|
|
|
|
--test-suite
|
|
|
|
membership_recovery
|
2020-03-06 14:52:17 +03:00
|
|
|
)
|
2019-11-08 23:39:11 +03:00
|
|
|
|
2020-07-03 14:02:26 +03:00
|
|
|
add_e2e_test(
|
|
|
|
NAME reconfiguration_test_suite
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/e2e_suite.py
|
|
|
|
CONSENSUS raft
|
|
|
|
LABEL suite
|
|
|
|
ADDITIONAL_ARGS
|
|
|
|
--test-duration
|
|
|
|
150
|
|
|
|
--enforce-reqs
|
|
|
|
--test-suite
|
|
|
|
reconfiguration
|
|
|
|
--raft-election-timeout
|
|
|
|
4000
|
|
|
|
)
|
|
|
|
|
2020-08-27 14:13:40 +03:00
|
|
|
add_e2e_test(
|
|
|
|
NAME snapshots_test_suite
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/e2e_suite.py
|
|
|
|
CONSENSUS raft
|
|
|
|
LABEL suite
|
|
|
|
ADDITIONAL_ARGS
|
|
|
|
--test-duration
|
|
|
|
150
|
|
|
|
--enforce-reqs
|
|
|
|
--test-suite
|
|
|
|
snapshots
|
|
|
|
--raft-election-timeout
|
|
|
|
4000
|
|
|
|
--snapshot-tx-interval
|
|
|
|
5
|
|
|
|
)
|
|
|
|
|
2020-06-17 16:22:26 +03:00
|
|
|
add_e2e_test(
|
|
|
|
NAME full_test_suite
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/e2e_suite.py
|
|
|
|
CONSENSUS raft
|
|
|
|
LABEL suite
|
|
|
|
ADDITIONAL_ARGS
|
|
|
|
--ledger-recovery-timeout
|
|
|
|
20
|
|
|
|
--test-duration
|
|
|
|
200
|
|
|
|
--enforce-reqs
|
|
|
|
--test-suite
|
|
|
|
all
|
2020-07-03 14:02:26 +03:00
|
|
|
--raft-election-timeout
|
|
|
|
4000
|
2020-06-17 16:22:26 +03:00
|
|
|
)
|
2020-05-06 19:56:53 +03:00
|
|
|
|
2020-03-06 14:52:17 +03:00
|
|
|
add_e2e_test(
|
2020-07-10 11:54:04 +03:00
|
|
|
NAME lua_e2e_batched
|
2020-03-17 17:50:19 +03:00
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/e2e_batched.py
|
2020-03-06 14:52:17 +03:00
|
|
|
CONSENSUS raft
|
2020-03-17 17:50:19 +03:00
|
|
|
ADDITIONAL_ARGS --app-script
|
|
|
|
${CMAKE_SOURCE_DIR}/src/apps/batched/batched.lua
|
2020-03-06 14:52:17 +03:00
|
|
|
)
|
2019-07-19 15:56:29 +03:00
|
|
|
|
2020-08-07 16:57:49 +03:00
|
|
|
add_e2e_test(
|
|
|
|
NAME modules_test
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/modules.py
|
|
|
|
CONSENSUS raft
|
|
|
|
)
|
|
|
|
|
2020-09-04 16:55:50 +03:00
|
|
|
add_e2e_test(
|
|
|
|
NAME custom_authorization_test
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/custom_authorization.py
|
|
|
|
CONSENSUS raft
|
|
|
|
)
|
|
|
|
|
2020-03-06 14:52:17 +03:00
|
|
|
if(QUOTES_ENABLED)
|
2019-11-13 12:54:32 +03:00
|
|
|
add_e2e_test(
|
2020-03-06 14:52:17 +03:00
|
|
|
NAME reconfiguration_test
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/reconfiguration.py
|
|
|
|
CONSENSUS raft
|
2020-08-27 14:13:40 +03:00
|
|
|
ADDITIONAL_ARGS --raft-election-timeout 4000
|
2019-11-13 12:54:32 +03:00
|
|
|
)
|
|
|
|
|
2020-08-18 18:41:27 +03:00
|
|
|
add_e2e_test(
|
|
|
|
NAME reconfiguration_snapshot_test
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/reconfiguration.py
|
|
|
|
CONSENSUS raft
|
2020-08-27 14:13:40 +03:00
|
|
|
ADDITIONAL_ARGS --snapshot-tx-interval 10 --raft-election-timeout 4000
|
2020-08-18 18:41:27 +03:00
|
|
|
)
|
|
|
|
|
2020-02-15 01:51:30 +03:00
|
|
|
add_e2e_test(
|
2020-03-06 14:52:17 +03:00
|
|
|
NAME code_update_test
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/code_update.py
|
|
|
|
CONSENSUS raft
|
2020-03-31 17:31:44 +03:00
|
|
|
ADDITIONAL_ARGS --oesign ${OE_SIGN_PATH} --raft-election-timeout 20000
|
2020-02-15 01:51:30 +03:00
|
|
|
)
|
2020-03-23 17:02:01 +03:00
|
|
|
|
|
|
|
add_e2e_test(
|
2020-05-06 19:56:53 +03:00
|
|
|
NAME governance_test
|
2020-03-23 17:02:01 +03:00
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/governance.py
|
|
|
|
CONSENSUS raft
|
|
|
|
ADDITIONAL_ARGS --oesign ${OE_SIGN_PATH}
|
|
|
|
)
|
2020-09-02 12:46:17 +03:00
|
|
|
|
|
|
|
add_e2e_test(
|
|
|
|
NAME governance_ca_certs_test
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/governance_ca_certs.py GOV_SCRIPT
|
|
|
|
${CCF_DIR}/src/runtime_config/gov_ca_certs.lua
|
|
|
|
CONSENSUS raft
|
|
|
|
)
|
|
|
|
|
|
|
|
add_e2e_test(
|
|
|
|
NAME governance_ca_cert_mismatch_test
|
|
|
|
PYTHON_SCRIPT
|
|
|
|
${CMAKE_SOURCE_DIR}/tests/governance_ca_cert_mismatch.py GOV_SCRIPT
|
|
|
|
${CCF_DIR}/src/runtime_config/gov_ca_cert_mismatch.lua
|
|
|
|
CONSENSUS raft
|
|
|
|
)
|
2019-11-25 19:52:04 +03:00
|
|
|
endif()
|
2019-11-07 14:55:23 +03:00
|
|
|
|
2020-01-28 21:09:42 +03:00
|
|
|
if(BUILD_SMALLBANK)
|
2019-12-10 17:42:01 +03:00
|
|
|
include(${CMAKE_CURRENT_SOURCE_DIR}/samples/apps/smallbank/smallbank.cmake)
|
|
|
|
endif()
|
2019-11-25 19:52:04 +03:00
|
|
|
|
2020-04-07 13:05:24 +03:00
|
|
|
if(TLS_TEST)
|
|
|
|
add_custom_target(
|
|
|
|
testssl ALL
|
|
|
|
COMMAND
|
|
|
|
test -d testssl || git clone https://github.com/drwetter/testssl.sh
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/testssl
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-03-06 14:52:17 +03:00
|
|
|
foreach(CONSENSUS ${CONSENSUSES})
|
2020-04-29 20:19:51 +03:00
|
|
|
# Lua sample app (tx regulator) end to end test
|
|
|
|
add_e2e_test(
|
|
|
|
NAME lua_txregulator_test_${CONSENSUS}
|
|
|
|
PYTHON_SCRIPT
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/samples/apps/txregulator/tests/txregulatorclient.py
|
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
ADDITIONAL_ARGS
|
|
|
|
--app-script
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/samples/apps/txregulator/app/txregulator.lua
|
|
|
|
--datafile
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/samples/apps/txregulator/dataset/sample_data.csv
|
|
|
|
)
|
|
|
|
|
|
|
|
add_e2e_test(
|
2020-07-10 11:54:04 +03:00
|
|
|
NAME js_e2e_logging_${CONSENSUS}
|
2020-04-29 20:19:51 +03:00
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/e2e_logging.py
|
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
ADDITIONAL_ARGS --js-app-script
|
|
|
|
${CMAKE_SOURCE_DIR}/src/apps/logging/logging_js.lua
|
|
|
|
)
|
|
|
|
|
|
|
|
add_e2e_test(
|
2020-07-10 11:54:04 +03:00
|
|
|
NAME e2e_scenario_${CONSENSUS}
|
2020-04-29 20:19:51 +03:00
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/e2e_scenarios.py
|
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
ADDITIONAL_ARGS --scenario
|
|
|
|
${CMAKE_SOURCE_DIR}/tests/simple_logging_scenario.json
|
|
|
|
)
|
|
|
|
|
2020-05-20 13:57:55 +03:00
|
|
|
add_e2e_test(
|
|
|
|
NAME ws_scaffold_${CONSENSUS}
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/ws_scaffold.py
|
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
)
|
|
|
|
|
2020-04-29 20:19:51 +03:00
|
|
|
add_e2e_test(
|
2020-07-10 11:54:04 +03:00
|
|
|
NAME lua_e2e_logging_${CONSENSUS}
|
2020-04-29 20:19:51 +03:00
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/e2e_logging.py
|
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
ADDITIONAL_ARGS --app-script
|
|
|
|
${CMAKE_SOURCE_DIR}/src/apps/logging/logging.lua
|
|
|
|
)
|
|
|
|
|
2020-03-20 14:17:50 +03:00
|
|
|
add_e2e_test(
|
|
|
|
NAME member_client_test_${CONSENSUS}
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/memberclient.py
|
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
)
|
|
|
|
|
2020-03-17 17:50:19 +03:00
|
|
|
if(NOT SAN)
|
|
|
|
add_e2e_test(
|
|
|
|
NAME connections_${CONSENSUS}
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/connections.py
|
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_e2e_test(
|
|
|
|
NAME receipts_test_${CONSENSUS}
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/receipts.py
|
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
)
|
|
|
|
|
2020-04-07 13:05:24 +03:00
|
|
|
if(TLS_TEST AND ${CONSENSUS} STREQUAL raft)
|
|
|
|
add_e2e_test(
|
|
|
|
NAME tlstest_${CONSENSUS}
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/tlstest.py
|
2020-04-07 15:59:49 +03:00
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
LABEL tlstest
|
2020-04-07 13:05:24 +03:00
|
|
|
)
|
|
|
|
endif()
|
2020-04-01 15:30:41 +03:00
|
|
|
|
2020-03-17 17:50:19 +03:00
|
|
|
add_e2e_test(
|
2020-05-06 19:56:53 +03:00
|
|
|
NAME schema_test_${CONSENSUS}
|
2020-03-17 17:50:19 +03:00
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/schema.py
|
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
ADDITIONAL_ARGS -p liblogging --schema-dir
|
2020-04-30 23:48:29 +03:00
|
|
|
${CMAKE_SOURCE_DIR}/doc/schemas
|
2020-03-17 17:50:19 +03:00
|
|
|
)
|
|
|
|
|
2020-03-06 14:52:17 +03:00
|
|
|
add_e2e_test(
|
2020-07-10 11:54:04 +03:00
|
|
|
NAME cpp_e2e_logging_${CONSENSUS}
|
2020-03-06 14:52:17 +03:00
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/e2e_logging.py
|
|
|
|
CURL_CLIENT TRUE
|
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
)
|
2020-01-27 16:53:23 +03:00
|
|
|
|
2020-03-09 15:52:43 +03:00
|
|
|
if(${CONSENSUS} STREQUAL pbft)
|
2020-03-31 17:31:44 +03:00
|
|
|
set(ELECTION_TIMEOUT_ARG "--pbft-view-change-timeout" "4000")
|
2020-03-09 15:52:43 +03:00
|
|
|
else()
|
2020-03-31 17:31:44 +03:00
|
|
|
set(ELECTION_TIMEOUT_ARG "--raft-election-timeout" "4000")
|
2020-03-09 15:52:43 +03:00
|
|
|
endif()
|
|
|
|
|
2020-04-01 10:46:57 +03:00
|
|
|
add_e2e_test(
|
2020-05-06 19:56:53 +03:00
|
|
|
NAME election_test_${CONSENSUS}
|
2020-04-01 10:46:57 +03:00
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/election.py
|
|
|
|
CONSENSUS ${CONSENSUS}
|
|
|
|
ADDITIONAL_ARGS ${ELECTION_TIMEOUT_ARG}
|
2019-11-25 19:52:04 +03:00
|
|
|
)
|
2020-04-01 10:46:57 +03:00
|
|
|
|
2020-07-16 16:58:39 +03:00
|
|
|
if(${CONSENSUS} STREQUAL pbft)
|
|
|
|
add_e2e_test(
|
|
|
|
NAME suspend_nodes_pbft
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/suspend_nodes.py
|
|
|
|
CONSENSUS pbft
|
|
|
|
LABEL long_test
|
|
|
|
ADDITIONAL_ARGS --seed 42
|
|
|
|
)
|
|
|
|
|
|
|
|
add_e2e_test(
|
|
|
|
NAME replay_new_view_pbft
|
|
|
|
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/replay_new_view.py
|
|
|
|
CONSENSUS pbft
|
|
|
|
LABEL long_test
|
|
|
|
ADDITIONAL_ARGS --seed 42
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-03-06 14:52:17 +03:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_perf_test(
|
|
|
|
NAME logging_scenario_perf_test
|
2020-04-09 17:53:31 +03:00
|
|
|
PYTHON_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/tests/infra/perfclient.py
|
2020-03-06 14:52:17 +03:00
|
|
|
CONSENSUS raft
|
|
|
|
CLIENT_BIN ./scenario_perf_client
|
|
|
|
LABEL log_scenario
|
|
|
|
ADDITIONAL_ARGS
|
|
|
|
--package
|
|
|
|
liblogging
|
|
|
|
--scenario-file
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/tests/perf_logging_scenario_100txs.json
|
|
|
|
--max-writes-ahead
|
|
|
|
1000
|
|
|
|
--repetitions
|
|
|
|
1000
|
|
|
|
)
|
2020-05-22 19:48:34 +03:00
|
|
|
|
|
|
|
add_perf_test(
|
|
|
|
NAME logging_scenario_ws_perf_test
|
|
|
|
PYTHON_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/tests/infra/perfclient.py
|
|
|
|
CONSENSUS raft
|
|
|
|
CLIENT_BIN ./scenario_perf_client
|
|
|
|
LABEL log_scenario_ws
|
|
|
|
ADDITIONAL_ARGS
|
|
|
|
--package
|
|
|
|
liblogging
|
|
|
|
--scenario-file
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/tests/perf_logging_scenario_100txs.json
|
|
|
|
--max-writes-ahead
|
|
|
|
1000
|
|
|
|
--repetitions
|
|
|
|
10000
|
|
|
|
--use-websockets
|
|
|
|
)
|
2019-04-26 18:27:27 +03:00
|
|
|
endif()
|