Skip to content

Commit

Permalink
Set default enclave type by env var, not Python arg (#1091)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Maffre <42961061+jumaffre@users.noreply.github.com>
  • Loading branch information
eddyashton and jumaffre authored Apr 22, 2020
1 parent f2132df commit 815450e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ if("sgx" IN_LIST COMPILE_TARGETS)
endif()

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(TEST_ENCLAVE_TYPE -e debug)
set(DEFAULT_ENCLAVE_TYPE debug)
endif()
else()
set(TEST_ENCLAVE_TYPE -e virtual)
set(DEFAULT_ENCLAVE_TYPE virtual)
endif()

# Lua module
Expand Down Expand Up @@ -312,13 +312,8 @@ set(WORKER_THREADS
)

set(CCF_NETWORK_TEST_ARGS
${TEST_ENCLAVE_TYPE}
-l
${TEST_HOST_LOGGING_LEVEL}
-g
${CCF_DIR}/src/runtime_config/gov.lua
--worker-threads
${WORKER_THREADS}
-l ${TEST_HOST_LOGGING_LEVEL} -g ${CCF_DIR}/src/runtime_config/gov.lua
--worker-threads ${WORKER_THREADS}
)

# SNIPPET_START: Lua generic application
Expand Down Expand Up @@ -402,6 +397,11 @@ function(add_e2e_test)
set_property(
TEST ${PARSED_ARGS_NAME} APPEND PROPERTY LABELS ${PARSED_ARGS_CONSENSUS}
)

set_property(
TEST ${PARSED_ARGS_NAME} APPEND
PROPERTY ENVIRONMENT "DEFAULT_ENCLAVE_TYPE=${DEFAULT_ENCLAVE_TYPE}"
)
endif()
endfunction()

Expand Down
2 changes: 1 addition & 1 deletion tests/infra/e2e_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def cli_args(add=lambda x: None, parser=None, accept_unknown=False):
"-e",
"--enclave-type",
help="Enclave type",
default=os.getenv("TEST_ENCLAVE", "release"),
default=os.getenv("TEST_ENCLAVE", os.getenv("DEFAULT_ENCLAVE_TYPE", "release")),
choices=("release", "debug", "virtual"),
)
parser.add_argument(
Expand Down

0 comments on commit 815450e

Please sign in to comment.