This is an automated email from the ASF dual-hosted git repository.

mssun pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave.git


The following commit(s) were added to refs/heads/develop by this push:
     new 826e11f  [tests] Reorganize test directory
826e11f is described below

commit 826e11fc2e77a5949a474051f978985ae5e5583a
Author: Mingshen Sun <[email protected]>
AuthorDate: Thu Feb 13 11:49:52 2020 -0800

    [tests] Reorganize test directory
---
 attestation/Cargo.toml                                         |  2 +-
 cmake/MesaTEEGenVars.cmake                                     |  1 +
 cmake/scripts/prep.sh                                          |  6 +-----
 cmake/tomls/Cargo.sgx_trusted_lib.toml                         |  6 +++---
 cmake/tomls/Cargo.sgx_untrusted_app.toml                       |  6 +++---
 config/build.config.toml                                       |  3 +++
 legacy/cli/Cargo.toml                                          |  2 +-
 legacy/mesatee_core/Cargo.toml                                 |  4 ++--
 legacy/mesatee_sdk/Cargo.toml                                  |  2 +-
 services/access_control/enclave/Cargo.toml                     |  2 +-
 services/access_control/enclave/src/lib.rs                     |  6 ++----
 services/authentication/enclave/Cargo.toml                     |  2 +-
 services/execution/enclave/Cargo.toml                          |  2 +-
 services/execution/enclave/src/lib.rs                          |  6 ++----
 services/frontend/enclave/Cargo.toml                           |  2 +-
 services/frontend/enclave/src/lib.rs                           |  6 ++----
 services/management/enclave/Cargo.toml                         |  2 +-
 services/management/enclave/src/lib.rs                         |  6 ++----
 services/storage/enclave/Cargo.toml                            |  2 +-
 services/storage/enclave/src/lib.rs                            |  6 ++----
 tests/README.md                                                | 10 +++++-----
 .../functions}/gbdt_prediction/expected_result.txt             |  0
 .../functions}/gbdt_prediction/model.txt                       |  0
 .../functions}/gbdt_prediction/test_data.txt                   |  0
 .../functions}/gbdt_training/expected_model.txt                |  0
 .../{test_cases => fixtures/functions}/gbdt_training/train.txt |  0
 tests/{test_cases => fixtures/functions}/mesapy/input.txt      |  0
 tests/{test_cases => fixtures/functions}/mesapy/output.txt     |  0
 tests/{functional_tests => functional}/app/Cargo.toml          |  0
 tests/{unit_tests => functional}/app/build.rs                  |  0
 tests/{unit_tests => functional}/app/src/main.rs               |  0
 tests/{functional_tests => functional}/enclave/Cargo.toml      |  2 +-
 tests/{unit_tests => functional}/enclave/Enclave.config.xml    |  0
 tests/{functional_tests => functional}/enclave/src/lib.rs      |  6 ++----
 .../enclave/src/teaclave_access_control_service.rs             |  0
 .../enclave/src/teaclave_authentication_service.rs             |  0
 .../enclave/src/teaclave_execution_service.rs                  |  6 +++---
 .../enclave/src/teaclave_frontend_service.rs                   |  0
 .../enclave/src/teaclave_management_service.rs                 |  0
 .../enclave/src/teaclave_storage_service.rs                    |  0
 tests/{integration_tests => integration}/app/Cargo.toml        |  2 +-
 tests/{integration_tests => integration}/app/build.rs          |  0
 tests/{integration_tests => integration}/app/src/main.rs       |  0
 .../app/src/teaclave_config_tests.rs                           |  0
 tests/{integration_tests => integration}/enclave/Cargo.toml    |  2 +-
 .../enclave/Enclave.config.xml                                 |  0
 tests/{integration_tests => integration}/enclave/src/lib.rs    |  0
 .../enclave/src/protected_fs_rs.rs                             |  0
 .../enclave/src/rusty_leveldb_sgx.rs                           |  0
 .../enclave/src/teaclave_rpc.rs                                |  0
 .../enclave/src/teaclave_worker.rs                             |  8 ++++----
 tests/{unit_tests => unit}/app/Cargo.toml                      |  0
 tests/{functional_tests => unit}/app/build.rs                  |  0
 tests/{functional_tests => unit}/app/src/main.rs               |  0
 tests/{unit_tests => unit}/enclave/Cargo.toml                  |  2 +-
 tests/{functional_tests => unit}/enclave/Enclave.config.xml    |  0
 tests/{unit_tests => unit}/enclave/src/lib.rs                  |  0
 tests/{test_utils => utils}/Cargo.toml                         |  0
 tests/{test_utils => utils}/src/lib.rs                         |  0
 types/Cargo.toml                                               |  2 +-
 worker/Cargo.toml                                              |  2 +-
 worker/src/function/context.rs                                 |  4 ++--
 worker/src/function/gbdt_prediction.rs                         |  8 ++++----
 worker/src/function/gbdt_training.rs                           |  6 +++---
 worker/src/function/mesapy.rs                                  |  4 ++--
 65 files changed, 63 insertions(+), 75 deletions(-)

diff --git a/attestation/Cargo.toml b/attestation/Cargo.toml
index 3b1be74..760e1de 100644
--- a/attestation/Cargo.toml
+++ b/attestation/Cargo.toml
@@ -38,7 +38,7 @@ url              = { version = "2.1.1" }
 yasna            = { version = "0.3.0", features = ["bit-vec", "num-bigint", 
"chrono"] }
 
 teaclave_types  = { path = "../types" }
-teaclave_test_utils = { path = "../tests/test_utils" }
+teaclave_test_utils = { path = "../tests/utils" }
 
 sgx_rand    = { version = "1.1.0", optional = true }
 sgx_tcrypto = { version = "1.1.0", optional = true }
diff --git a/cmake/MesaTEEGenVars.cmake b/cmake/MesaTEEGenVars.cmake
index a852e8b..3cbc624 100644
--- a/cmake/MesaTEEGenVars.cmake
+++ b/cmake/MesaTEEGenVars.cmake
@@ -146,4 +146,5 @@ set(TARGET_SGXLIB_ENVS
 message("SGX_SDK=${SGX_SDK}")
 message("SGX_MODE=${SGX_MODE}")
 message("RUSTUP_TOOLCHAIN=${RUSTUP_TOOLCHAIN}")
+message("DCAP=${DCAP}")
 message("BUILD TYPE=${TARGET}")
diff --git a/cmake/scripts/prep.sh b/cmake/scripts/prep.sh
index 5a30743..93148e3 100755
--- a/cmake/scripts/prep.sh
+++ b/cmake/scripts/prep.sh
@@ -28,12 +28,8 @@ fi
 cp -RT ${CMAKE_SOURCE_DIR}/keys/auditors/ ${MESATEE_AUDITORS_DIR}/
 cp ${CMAKE_SOURCE_DIR}/config/runtime.config.toml 
${MESATEE_SERVICE_INSTALL_DIR}
 cp ${CMAKE_SOURCE_DIR}/config/runtime.config.toml ${MESATEE_TEST_INSTALL_DIR}
-cp -r ${CMAKE_SOURCE_DIR}/tests/test_cases/ ${MESATEE_TEST_INSTALL_DIR}
-# temporary workaround for sharing test_cases directory between tests and 
services
-rm -rf ${MESATEE_SERVICE_INSTALL_DIR}/test_cases
-ln -s ${MESATEE_TEST_INSTALL_DIR}/test_cases 
${MESATEE_SERVICE_INSTALL_DIR}/test_cases
-cp -r ${CMAKE_SOURCE_DIR}/tests/fixtures/ ${MESATEE_SERVICE_INSTALL_DIR}
 cp -r ${CMAKE_SOURCE_DIR}/tests/fixtures/ ${MESATEE_TEST_INSTALL_DIR}
+ln -s ${MESATEE_TEST_INSTALL_DIR}/fixtures 
${MESATEE_SERVICE_INSTALL_DIR}/fixtures
 cp -r ${CMAKE_SOURCE_DIR}/tests/scripts/ ${MESATEE_TEST_INSTALL_DIR}
 # create the following symlinks to make remapped paths accessible and avoid 
repeated building
 mkdir -p /tmp/mesatee_symlinks
diff --git a/cmake/tomls/Cargo.sgx_trusted_lib.toml 
b/cmake/tomls/Cargo.sgx_trusted_lib.toml
index 33be7e8..3eb79e1 100644
--- a/cmake/tomls/Cargo.sgx_trusted_lib.toml
+++ b/cmake/tomls/Cargo.sgx_trusted_lib.toml
@@ -7,9 +7,9 @@ members = [
   "services/execution/enclave",
   "services/frontend/enclave",
   "services/management/enclave",
-  "tests/unit_tests/enclave",
-  "tests/functional_tests/enclave",
-  "tests/integration_tests/enclave",
+  "tests/unit/enclave",
+  "tests/functional/enclave",
+  "tests/integration/enclave",
 ]
 
 exclude = [
diff --git a/cmake/tomls/Cargo.sgx_untrusted_app.toml 
b/cmake/tomls/Cargo.sgx_untrusted_app.toml
index ab4268c..afeaa36 100644
--- a/cmake/tomls/Cargo.sgx_untrusted_app.toml
+++ b/cmake/tomls/Cargo.sgx_untrusted_app.toml
@@ -7,9 +7,9 @@ members = [
   "services/execution/app",
   "services/frontend/app",
   "services/management/app",
-  "tests/unit_tests/app",
-  "tests/functional_tests/app",
-  "tests/integration_tests/app",
+  "tests/unit/app",
+  "tests/functional/app",
+  "tests/integration/app",
 ]
 
 exclude = [
diff --git a/config/build.config.toml b/config/build.config.toml
index f23ce43..de66a81 100644
--- a/config/build.config.toml
+++ b/config/build.config.toml
@@ -23,6 +23,9 @@ rpc_max_message_size = 409600
 # client => frontend ----------> management --> storage <-- scheduler --> 
execution
 #                                    |
 #                                    +--> access_control
+#
+#                                                  =>      api endpoint 
connections
+#                                                  -> internal endpoint 
connections
 [inbound]
 access_control = ["teaclave_management_service"]
 authentication = ["teaclave_frontend_service"]
diff --git a/legacy/cli/Cargo.toml b/legacy/cli/Cargo.toml
index 99d63b0..3674279 100644
--- a/legacy/cli/Cargo.toml
+++ b/legacy/cli/Cargo.toml
@@ -17,4 +17,4 @@ serde_json = "1.0.39"
 tms_external_proto = { path = "../mesatee_services/tms/external/proto" }
 tdfs_external_proto = { path = "../mesatee_services/tdfs/external/proto" }
 fns_proto = { path = "../mesatee_services/fns/proto" }
-teaclave_utils = { path = "../teaclave_utils" }
+teaclave_test_utils = { path = "../teaclave_test_utils" }
diff --git a/legacy/mesatee_core/Cargo.toml b/legacy/mesatee_core/Cargo.toml
index 7aae459..65b7cb0 100644
--- a/legacy/mesatee_core/Cargo.toml
+++ b/legacy/mesatee_core/Cargo.toml
@@ -12,7 +12,7 @@ path = "src/lib.rs"
 
 [features]
 default = []
-mesalock_sgx = ["sgx_tstd", "sgx_tcrypto", "sgx_rand", "sgx_tse", "ipc", 
"teaclave_config/mesalock_sgx", "teaclave_utils/mesalock_sgx", 
"teaclave_attestation/mesalock_sgx"]
+mesalock_sgx = ["sgx_tstd", "sgx_tcrypto", "sgx_rand", "sgx_tse", "ipc", 
"teaclave_config/mesalock_sgx", "teaclave_test_utils/mesalock_sgx", 
"teaclave_attestation/mesalock_sgx"]
 ipc = []
 
 [dependencies]
@@ -45,6 +45,6 @@ sgx_rand  = { version = "1.1.0", optional = true }
 sgx_tse   = { version = "1.1.0", optional = true }
 
 teaclave_config = { path = "../teaclave_config" }
-teaclave_utils = { path = "../teaclave_utils" }
+teaclave_test_utils = { path = "../teaclave_test_utils" }
 ipc_attribute = { path = "./ipc_attribute" }
 teaclave_attestation = { path = "../teaclave_attestation" }
diff --git a/legacy/mesatee_sdk/Cargo.toml b/legacy/mesatee_sdk/Cargo.toml
index 36ab3d2..bfd9b6e 100644
--- a/legacy/mesatee_sdk/Cargo.toml
+++ b/legacy/mesatee_sdk/Cargo.toml
@@ -12,4 +12,4 @@ tms_external_client  = { path = 
"../mesatee_services/tms/external/client" }
 tms_external_proto   = { path = "../mesatee_services/tms/external/proto" }
 fns_client           = { path = "../mesatee_services/fns/client" }
 mesatee_core = { version = "0.1.0" }
-teaclave_utils = { path = "../teaclave_utils" }
\ No newline at end of file
+teaclave_test_utils = { path = "../teaclave_test_utils" }
\ No newline at end of file
diff --git a/services/access_control/enclave/Cargo.toml 
b/services/access_control/enclave/Cargo.toml
index bbef27a..5c34b48 100644
--- a/services/access_control/enclave/Cargo.toml
+++ b/services/access_control/enclave/Cargo.toml
@@ -42,7 +42,7 @@ teaclave_binder                = { path = "../../../binder" }
 teaclave_rpc                   = { path = "../../../rpc" }
 teaclave_service_enclave_utils = { path = 
"../../../utils/service_enclave_utils" }
 teaclave_types                 = { path = "../../../types" }
-teaclave_test_utils            = { path = "../../../tests/test_utils" }
+teaclave_test_utils            = { path = "../../../tests/utils" }
 
 sgx_tstd      = { version = "1.1.0", features = ["net", "thread", 
"backtrace"], optional = true }
 sgx_types     = { version = "1.1.0" }
diff --git a/services/access_control/enclave/src/lib.rs 
b/services/access_control/enclave/src/lib.rs
index 3f4e947..8a8bd58 100644
--- a/services/access_control/enclave/src/lib.rs
+++ b/services/access_control/enclave/src/lib.rs
@@ -106,15 +106,13 @@ fn handle_start_service(args: &StartServiceInput) -> 
TeeServiceResult<StartServi
 }
 
 #[handle_ecall]
-fn handle_init_enclave(_args: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
+fn handle_init_enclave(_: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
     ServiceEnclave::init(env!("CARGO_PKG_NAME"))?;
     Ok(InitEnclaveOutput::default())
 }
 
 #[handle_ecall]
-fn handle_finalize_enclave(
-    _args: &FinalizeEnclaveInput,
-) -> TeeServiceResult<FinalizeEnclaveOutput> {
+fn handle_finalize_enclave(_: &FinalizeEnclaveInput) -> 
TeeServiceResult<FinalizeEnclaveOutput> {
     ServiceEnclave::finalize()?;
     Ok(FinalizeEnclaveOutput::default())
 }
diff --git a/services/authentication/enclave/Cargo.toml 
b/services/authentication/enclave/Cargo.toml
index adea3c8..f84eaf1 100644
--- a/services/authentication/enclave/Cargo.toml
+++ b/services/authentication/enclave/Cargo.toml
@@ -46,7 +46,7 @@ teaclave_rpc                   = { path = "../../../rpc" }
 teaclave_binder                = { path = "../../../binder" }
 teaclave_service_enclave_utils = { path = 
"../../../utils/service_enclave_utils" }
 teaclave_types                 = { path = "../../../types" }
-teaclave_test_utils            = { path = "../../../tests/test_utils", 
optional = true }
+teaclave_test_utils            = { path = "../../../tests/utils", optional = 
true }
 
 sgx_tstd      = { version = "1.1.0", features = ["net", "thread", 
"backtrace"], optional = true }
 sgx_types     = { version = "1.1.0" }
diff --git a/services/execution/enclave/Cargo.toml 
b/services/execution/enclave/Cargo.toml
index 5d3d630..cb9d739 100644
--- a/services/execution/enclave/Cargo.toml
+++ b/services/execution/enclave/Cargo.toml
@@ -42,7 +42,7 @@ teaclave_rpc                   = { path = "../../../rpc" }
 teaclave_service_enclave_utils = { path = 
"../../../utils/service_enclave_utils" }
 teaclave_types                 = { path = "../../../types" }
 teaclave_worker                = { path = "../../../worker" }
-teaclave_test_utils            = { path = "../../../tests/test_utils", 
optional = true }
+teaclave_test_utils            = { path = "../../../tests/utils", optional = 
true }
 
 sgx_cov       = { version = "1.1.0", optional = true }
 sgx_tstd      = { version = "1.1.0", features = ["net", "thread", 
"backtrace"], optional = true }
diff --git a/services/execution/enclave/src/lib.rs 
b/services/execution/enclave/src/lib.rs
index 6fd4be0..3946432 100644
--- a/services/execution/enclave/src/lib.rs
+++ b/services/execution/enclave/src/lib.rs
@@ -80,16 +80,14 @@ fn handle_start_service(args: &StartServiceInput) -> 
TeeServiceResult<StartServi
 }
 
 #[handle_ecall]
-fn handle_init_enclave(_args: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
+fn handle_init_enclave(_: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
     ServiceEnclave::init(env!("CARGO_PKG_NAME"))?;
     info!("Worker started");
     Ok(InitEnclaveOutput::default())
 }
 
 #[handle_ecall]
-fn handle_finalize_enclave(
-    _args: &FinalizeEnclaveInput,
-) -> TeeServiceResult<FinalizeEnclaveOutput> {
+fn handle_finalize_enclave(_: &FinalizeEnclaveInput) -> 
TeeServiceResult<FinalizeEnclaveOutput> {
     ServiceEnclave::finalize()?;
     Ok(FinalizeEnclaveOutput::default())
 }
diff --git a/services/frontend/enclave/Cargo.toml 
b/services/frontend/enclave/Cargo.toml
index 06cc6cc..028899a 100644
--- a/services/frontend/enclave/Cargo.toml
+++ b/services/frontend/enclave/Cargo.toml
@@ -42,7 +42,7 @@ teaclave_binder                = { path = "../../../binder" }
 teaclave_rpc                   = { path = "../../../rpc" }
 teaclave_service_enclave_utils = { path = 
"../../../utils/service_enclave_utils" }
 teaclave_types                 = { path = "../../../types" }
-teaclave_test_utils            = { path = "../../../tests/test_utils" }
+teaclave_test_utils            = { path = "../../../tests/utils" }
 
 sgx_tstd      = { version = "1.1.0", features = ["net", "thread", 
"backtrace"], optional = true }
 sgx_types     = { version = "1.1.0" }
diff --git a/services/frontend/enclave/src/lib.rs 
b/services/frontend/enclave/src/lib.rs
index 42cae0d..495cde0 100644
--- a/services/frontend/enclave/src/lib.rs
+++ b/services/frontend/enclave/src/lib.rs
@@ -103,15 +103,13 @@ fn handle_start_service(args: &StartServiceInput) -> 
TeeServiceResult<StartServi
 }
 
 #[handle_ecall]
-fn handle_init_enclave(_args: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
+fn handle_init_enclave(_: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
     ServiceEnclave::init(env!("CARGO_PKG_NAME"))?;
     Ok(InitEnclaveOutput::default())
 }
 
 #[handle_ecall]
-fn handle_finalize_enclave(
-    _args: &FinalizeEnclaveInput,
-) -> TeeServiceResult<FinalizeEnclaveOutput> {
+fn handle_finalize_enclave(_: &FinalizeEnclaveInput) -> 
TeeServiceResult<FinalizeEnclaveOutput> {
     ServiceEnclave::finalize()?;
     Ok(FinalizeEnclaveOutput::default())
 }
diff --git a/services/management/enclave/Cargo.toml 
b/services/management/enclave/Cargo.toml
index 7c361af..d3230a0 100644
--- a/services/management/enclave/Cargo.toml
+++ b/services/management/enclave/Cargo.toml
@@ -44,7 +44,7 @@ teaclave_binder                = { path = "../../../binder" }
 teaclave_rpc                   = { path = "../../../rpc" }
 teaclave_service_enclave_utils = { path = 
"../../../utils/service_enclave_utils" }
 teaclave_types                 = { path = "../../../types" }
-teaclave_test_utils            = { path = "../../../tests/test_utils" }
+teaclave_test_utils            = { path = "../../../tests/utils" }
 
 sgx_tstd      = { version = "1.1.0", features = ["net", "thread", 
"backtrace"], optional = true }
 sgx_types     = { version = "1.1.0" }
diff --git a/services/management/enclave/src/lib.rs 
b/services/management/enclave/src/lib.rs
index 5851c39..ca42ea2 100644
--- a/services/management/enclave/src/lib.rs
+++ b/services/management/enclave/src/lib.rs
@@ -124,15 +124,13 @@ fn handle_start_service(args: &StartServiceInput) -> 
TeeServiceResult<StartServi
 }
 
 #[handle_ecall]
-fn handle_init_enclave(_args: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
+fn handle_init_enclave(_: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
     ServiceEnclave::init(env!("CARGO_PKG_NAME"))?;
     Ok(InitEnclaveOutput::default())
 }
 
 #[handle_ecall]
-fn handle_finalize_enclave(
-    _args: &FinalizeEnclaveInput,
-) -> TeeServiceResult<FinalizeEnclaveOutput> {
+fn handle_finalize_enclave(_: &FinalizeEnclaveInput) -> 
TeeServiceResult<FinalizeEnclaveOutput> {
     ServiceEnclave::finalize()?;
     Ok(FinalizeEnclaveOutput::default())
 }
diff --git a/services/storage/enclave/Cargo.toml 
b/services/storage/enclave/Cargo.toml
index 3aa7ac7..2bb077a 100644
--- a/services/storage/enclave/Cargo.toml
+++ b/services/storage/enclave/Cargo.toml
@@ -41,7 +41,7 @@ teaclave_binder                = { path = "../../../binder" }
 teaclave_rpc                   = { path = "../../../rpc" }
 teaclave_service_enclave_utils = { path = 
"../../../utils/service_enclave_utils" }
 teaclave_types                 = { path = "../../../types" }
-teaclave_test_utils            = { path = "../../../tests/test_utils", 
optional = true }
+teaclave_test_utils            = { path = "../../../tests/utils", optional = 
true }
 
 
 sgx_tstd      = { version = "1.1.0", features = ["net", "thread", 
"backtrace"], optional = true }
diff --git a/services/storage/enclave/src/lib.rs 
b/services/storage/enclave/src/lib.rs
index cddaba5..6bf8e2f 100644
--- a/services/storage/enclave/src/lib.rs
+++ b/services/storage/enclave/src/lib.rs
@@ -120,15 +120,13 @@ fn handle_start_service(args: &StartServiceInput) -> 
TeeServiceResult<StartServi
 }
 
 #[handle_ecall]
-fn handle_init_enclave(_args: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
+fn handle_init_enclave(_: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
     ServiceEnclave::init(env!("CARGO_PKG_NAME"))?;
     Ok(InitEnclaveOutput::default())
 }
 
 #[handle_ecall]
-fn handle_finalize_enclave(
-    _args: &FinalizeEnclaveInput,
-) -> TeeServiceResult<FinalizeEnclaveOutput> {
+fn handle_finalize_enclave(_: &FinalizeEnclaveInput) -> 
TeeServiceResult<FinalizeEnclaveOutput> {
     ServiceEnclave::finalize()?;
     Ok(FinalizeEnclaveOutput::default())
 }
diff --git a/tests/README.md b/tests/README.md
index b72aad3..8407b93 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -9,22 +9,22 @@ make run-functional-tests
 
 ## Directory Structure
 
-- `unit_tests`:
+- `unit`:
   Unit tests are small and more focused, testing one module in isolation at a
   time, and can test private interfaces. This directory contains test driver to
   test individual units/components or private interfaces. Test cases of unit
   tests are placed along with source code.
-- `integration_tests`:
+- `integration`:
   Integration tests are entirely external to libraries, using only the public
   interface and potentially exercising multiple modules per test. This 
directory
   contains test driver and tests cases to test public interfaces in common
   libraries.
-- `functional_tests`:
+- `functional`:
   Functional testing is a type of black-box testing. In Teaclave, the test 
cases
   are usually sent through RPC channel.
   This directory contains test driver and tests cases for Teaclave services. To
   run these tests, services need to be launched.
 - `fixtures`:
-  Testing fixtures are some files or databases for testing only.
-- `test_utils`:
+  Testing fixtures are some files and sample inputs/outputs for testing only.
+- `utils`:
   Common utilities for test drivers.
diff --git a/tests/test_cases/gbdt_prediction/expected_result.txt 
b/tests/fixtures/functions/gbdt_prediction/expected_result.txt
similarity index 100%
rename from tests/test_cases/gbdt_prediction/expected_result.txt
rename to tests/fixtures/functions/gbdt_prediction/expected_result.txt
diff --git a/tests/test_cases/gbdt_prediction/model.txt 
b/tests/fixtures/functions/gbdt_prediction/model.txt
similarity index 100%
rename from tests/test_cases/gbdt_prediction/model.txt
rename to tests/fixtures/functions/gbdt_prediction/model.txt
diff --git a/tests/test_cases/gbdt_prediction/test_data.txt 
b/tests/fixtures/functions/gbdt_prediction/test_data.txt
similarity index 100%
rename from tests/test_cases/gbdt_prediction/test_data.txt
rename to tests/fixtures/functions/gbdt_prediction/test_data.txt
diff --git a/tests/test_cases/gbdt_training/expected_model.txt 
b/tests/fixtures/functions/gbdt_training/expected_model.txt
similarity index 100%
rename from tests/test_cases/gbdt_training/expected_model.txt
rename to tests/fixtures/functions/gbdt_training/expected_model.txt
diff --git a/tests/test_cases/gbdt_training/train.txt 
b/tests/fixtures/functions/gbdt_training/train.txt
similarity index 100%
rename from tests/test_cases/gbdt_training/train.txt
rename to tests/fixtures/functions/gbdt_training/train.txt
diff --git a/tests/test_cases/mesapy/input.txt 
b/tests/fixtures/functions/mesapy/input.txt
similarity index 100%
rename from tests/test_cases/mesapy/input.txt
rename to tests/fixtures/functions/mesapy/input.txt
diff --git a/tests/test_cases/mesapy/output.txt 
b/tests/fixtures/functions/mesapy/output.txt
similarity index 100%
rename from tests/test_cases/mesapy/output.txt
rename to tests/fixtures/functions/mesapy/output.txt
diff --git a/tests/functional_tests/app/Cargo.toml 
b/tests/functional/app/Cargo.toml
similarity index 100%
rename from tests/functional_tests/app/Cargo.toml
rename to tests/functional/app/Cargo.toml
diff --git a/tests/unit_tests/app/build.rs b/tests/functional/app/build.rs
similarity index 100%
rename from tests/unit_tests/app/build.rs
rename to tests/functional/app/build.rs
diff --git a/tests/unit_tests/app/src/main.rs b/tests/functional/app/src/main.rs
similarity index 100%
rename from tests/unit_tests/app/src/main.rs
rename to tests/functional/app/src/main.rs
diff --git a/tests/functional_tests/enclave/Cargo.toml 
b/tests/functional/enclave/Cargo.toml
similarity index 95%
rename from tests/functional_tests/enclave/Cargo.toml
rename to tests/functional/enclave/Cargo.toml
index d545b3d..3a49dde 100644
--- a/tests/functional_tests/enclave/Cargo.toml
+++ b/tests/functional/enclave/Cargo.toml
@@ -40,7 +40,7 @@ teaclave_rpc                   = { path = "../../../rpc" }
 teaclave_service_enclave_utils = { path = 
"../../../utils/service_enclave_utils" }
 teaclave_types                 = { path = "../../../types" }
 teaclave_proto                 = { path = "../../../services/proto" }
-teaclave_test_utils            = { path = "../../../tests/test_utils" }
+teaclave_test_utils            = { path = "../../../tests/utils" }
 
 sgx_tstd      = { version = "1.1.0", features = ["net", "thread", 
"backtrace"], optional = true }
 sgx_types     = { version = "1.1.0" }
diff --git a/tests/unit_tests/enclave/Enclave.config.xml 
b/tests/functional/enclave/Enclave.config.xml
similarity index 100%
rename from tests/unit_tests/enclave/Enclave.config.xml
rename to tests/functional/enclave/Enclave.config.xml
diff --git a/tests/functional_tests/enclave/src/lib.rs 
b/tests/functional/enclave/src/lib.rs
similarity index 92%
rename from tests/functional_tests/enclave/src/lib.rs
rename to tests/functional/enclave/src/lib.rs
index 8702b16..108d669 100644
--- a/tests/functional_tests/enclave/src/lib.rs
+++ b/tests/functional/enclave/src/lib.rs
@@ -59,15 +59,13 @@ fn handle_run_test(_args: &RunTestInput) -> 
TeeServiceResult<RunTestOutput> {
 }
 
 #[handle_ecall]
-fn handle_init_enclave(_args: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
+fn handle_init_enclave(_: &InitEnclaveInput) -> 
TeeServiceResult<InitEnclaveOutput> {
     ServiceEnclave::init(env!("CARGO_PKG_NAME"))?;
     Ok(InitEnclaveOutput::default())
 }
 
 #[handle_ecall]
-fn handle_finalize_enclave(
-    _args: &FinalizeEnclaveInput,
-) -> TeeServiceResult<FinalizeEnclaveOutput> {
+fn handle_finalize_enclave(_: &FinalizeEnclaveInput) -> 
TeeServiceResult<FinalizeEnclaveOutput> {
     ServiceEnclave::finalize()?;
     Ok(FinalizeEnclaveOutput::default())
 }
diff --git 
a/tests/functional_tests/enclave/src/teaclave_access_control_service.rs 
b/tests/functional/enclave/src/teaclave_access_control_service.rs
similarity index 100%
rename from 
tests/functional_tests/enclave/src/teaclave_access_control_service.rs
rename to tests/functional/enclave/src/teaclave_access_control_service.rs
diff --git 
a/tests/functional_tests/enclave/src/teaclave_authentication_service.rs 
b/tests/functional/enclave/src/teaclave_authentication_service.rs
similarity index 100%
rename from 
tests/functional_tests/enclave/src/teaclave_authentication_service.rs
rename to tests/functional/enclave/src/teaclave_authentication_service.rs
diff --git a/tests/functional_tests/enclave/src/teaclave_execution_service.rs 
b/tests/functional/enclave/src/teaclave_execution_service.rs
similarity index 91%
rename from tests/functional_tests/enclave/src/teaclave_execution_service.rs
rename to tests/functional/enclave/src/teaclave_execution_service.rs
index 0c4e971..0633581 100644
--- a/tests/functional_tests/enclave/src/teaclave_execution_service.rs
+++ b/tests/functional/enclave/src/teaclave_execution_service.rs
@@ -46,9 +46,9 @@ fn test_invoke_success() {
         "training_optimization_level" => "2"
     ));
 
-    let enc_input = "test_cases/gbdt_training/train.enc";
-    let plain_input = "test_cases/gbdt_training/train.txt";
-    let enc_output = "test_cases/gbdt_training/model.enc.out";
+    let enc_input = "fixtures/functions/gbdt_training/train.enc";
+    let plain_input = "fixtures/functions/gbdt_training/train.txt";
+    let enc_output = "fixtures/functions/gbdt_training/model.enc.out";
 
     let input_info = convert_plaintext_file(plain_input, enc_input).unwrap();
     let input_files = TeaclaveWorkerFileRegistry::new(hashmap!(
diff --git a/tests/functional_tests/enclave/src/teaclave_frontend_service.rs 
b/tests/functional/enclave/src/teaclave_frontend_service.rs
similarity index 100%
rename from tests/functional_tests/enclave/src/teaclave_frontend_service.rs
rename to tests/functional/enclave/src/teaclave_frontend_service.rs
diff --git a/tests/functional_tests/enclave/src/teaclave_management_service.rs 
b/tests/functional/enclave/src/teaclave_management_service.rs
similarity index 100%
rename from tests/functional_tests/enclave/src/teaclave_management_service.rs
rename to tests/functional/enclave/src/teaclave_management_service.rs
diff --git a/tests/functional_tests/enclave/src/teaclave_storage_service.rs 
b/tests/functional/enclave/src/teaclave_storage_service.rs
similarity index 100%
rename from tests/functional_tests/enclave/src/teaclave_storage_service.rs
rename to tests/functional/enclave/src/teaclave_storage_service.rs
diff --git a/tests/integration_tests/app/Cargo.toml 
b/tests/integration/app/Cargo.toml
similarity index 90%
rename from tests/integration_tests/app/Cargo.toml
rename to tests/integration/app/Cargo.toml
index 010c5a9..6f92c83 100644
--- a/tests/integration_tests/app/Cargo.toml
+++ b/tests/integration/app/Cargo.toml
@@ -14,7 +14,7 @@ anyhow     = { version = "1.0.26" }
 
 teaclave_binder            = { path = "../../../binder", features = ["app"] }
 teaclave_config            = { path = "../../../config" }
-teaclave_test_utils        = { path = "../../test_utils" }
+teaclave_test_utils        = { path = "../../utils" }
 teaclave_types             = { path = "../../../types" }
 
 sgx_types = { version = "1.1.0" }
diff --git a/tests/integration_tests/app/build.rs 
b/tests/integration/app/build.rs
similarity index 100%
rename from tests/integration_tests/app/build.rs
rename to tests/integration/app/build.rs
diff --git a/tests/integration_tests/app/src/main.rs 
b/tests/integration/app/src/main.rs
similarity index 100%
rename from tests/integration_tests/app/src/main.rs
rename to tests/integration/app/src/main.rs
diff --git a/tests/integration_tests/app/src/teaclave_config_tests.rs 
b/tests/integration/app/src/teaclave_config_tests.rs
similarity index 100%
rename from tests/integration_tests/app/src/teaclave_config_tests.rs
rename to tests/integration/app/src/teaclave_config_tests.rs
diff --git a/tests/integration_tests/enclave/Cargo.toml 
b/tests/integration/enclave/Cargo.toml
similarity index 96%
rename from tests/integration_tests/enclave/Cargo.toml
rename to tests/integration/enclave/Cargo.toml
index 853d54a..80343a6 100644
--- a/tests/integration_tests/enclave/Cargo.toml
+++ b/tests/integration/enclave/Cargo.toml
@@ -48,7 +48,7 @@ teaclave_service_enclave_utils = { path = 
"../../../utils/service_enclave_utils"
 teaclave_types                 = { path = "../../../types" }
 teaclave_proto                 = { path = "../../../services/proto" }
 teaclave_worker                = { path = "../../../worker" }
-teaclave_test_utils            = { path = "../../../tests/test_utils" }
+teaclave_test_utils            = { path = "../../../tests/utils" }
 
 sgx_tstd      = { version = "1.1.0", features = ["net", "thread", 
"backtrace"], optional = true }
 sgx_types     = { version = "1.1.0" }
diff --git a/tests/integration_tests/enclave/Enclave.config.xml 
b/tests/integration/enclave/Enclave.config.xml
similarity index 100%
rename from tests/integration_tests/enclave/Enclave.config.xml
rename to tests/integration/enclave/Enclave.config.xml
diff --git a/tests/integration_tests/enclave/src/lib.rs 
b/tests/integration/enclave/src/lib.rs
similarity index 100%
rename from tests/integration_tests/enclave/src/lib.rs
rename to tests/integration/enclave/src/lib.rs
diff --git a/tests/integration_tests/enclave/src/protected_fs_rs.rs 
b/tests/integration/enclave/src/protected_fs_rs.rs
similarity index 100%
rename from tests/integration_tests/enclave/src/protected_fs_rs.rs
rename to tests/integration/enclave/src/protected_fs_rs.rs
diff --git a/tests/integration_tests/enclave/src/rusty_leveldb_sgx.rs 
b/tests/integration/enclave/src/rusty_leveldb_sgx.rs
similarity index 100%
rename from tests/integration_tests/enclave/src/rusty_leveldb_sgx.rs
rename to tests/integration/enclave/src/rusty_leveldb_sgx.rs
diff --git a/tests/integration_tests/enclave/src/teaclave_rpc.rs 
b/tests/integration/enclave/src/teaclave_rpc.rs
similarity index 100%
rename from tests/integration_tests/enclave/src/teaclave_rpc.rs
rename to tests/integration/enclave/src/teaclave_rpc.rs
diff --git a/tests/integration_tests/enclave/src/teaclave_worker.rs 
b/tests/integration/enclave/src/teaclave_worker.rs
similarity index 87%
rename from tests/integration_tests/enclave/src/teaclave_worker.rs
rename to tests/integration/enclave/src/teaclave_worker.rs
index 5a967f7..50f9c43 100644
--- a/tests/integration_tests/enclave/src/teaclave_worker.rs
+++ b/tests/integration/enclave/src/teaclave_worker.rs
@@ -26,11 +26,11 @@ fn test_start_worker() {
         "training_optimization_level" => "2"
     ));
 
-    let enc_input = "test_cases/gbdt_training/train.enc";
-    let plain_input = "test_cases/gbdt_training/train.txt";
+    let enc_input = "fixtures/functions/gbdt_training/train.enc";
+    let plain_input = "fixtures/functions/gbdt_training/train.txt";
 
-    let enc_output = "test_cases/gbdt_training/model.enc.out";
-    let expected_output = "test_cases/gbdt_training/expected_model.txt";
+    let enc_output = "fixtures/functions/gbdt_training/model.enc.out";
+    let expected_output = 
"fixtures/functions/gbdt_training/expected_model.txt";
 
     let input_info = convert_plaintext_file(plain_input, enc_input).unwrap();
 
diff --git a/tests/unit_tests/app/Cargo.toml b/tests/unit/app/Cargo.toml
similarity index 100%
rename from tests/unit_tests/app/Cargo.toml
rename to tests/unit/app/Cargo.toml
diff --git a/tests/functional_tests/app/build.rs b/tests/unit/app/build.rs
similarity index 100%
rename from tests/functional_tests/app/build.rs
rename to tests/unit/app/build.rs
diff --git a/tests/functional_tests/app/src/main.rs b/tests/unit/app/src/main.rs
similarity index 100%
rename from tests/functional_tests/app/src/main.rs
rename to tests/unit/app/src/main.rs
diff --git a/tests/unit_tests/enclave/Cargo.toml b/tests/unit/enclave/Cargo.toml
similarity index 97%
rename from tests/unit_tests/enclave/Cargo.toml
rename to tests/unit/enclave/Cargo.toml
index ec232e7..5d5cf13 100644
--- a/tests/unit_tests/enclave/Cargo.toml
+++ b/tests/unit/enclave/Cargo.toml
@@ -50,7 +50,7 @@ teaclave_execution_service_enclave = { path = 
"../../../services/execution/encla
 teaclave_management_service_enclave = { path = 
"../../../services/management/enclave" }
 teaclave_worker                 = { path = "../../../worker" }
 
-teaclave_test_utils            = { path = "../../test_utils" }
+teaclave_test_utils            = { path = "../../utils" }
 teaclave_attestation           = { path = "../../../attestation" }
 teaclave_config                = { path = "../../../config" }
 teaclave_binder                = { path = "../../../binder" }
diff --git a/tests/functional_tests/enclave/Enclave.config.xml 
b/tests/unit/enclave/Enclave.config.xml
similarity index 100%
rename from tests/functional_tests/enclave/Enclave.config.xml
rename to tests/unit/enclave/Enclave.config.xml
diff --git a/tests/unit_tests/enclave/src/lib.rs b/tests/unit/enclave/src/lib.rs
similarity index 100%
rename from tests/unit_tests/enclave/src/lib.rs
rename to tests/unit/enclave/src/lib.rs
diff --git a/tests/test_utils/Cargo.toml b/tests/utils/Cargo.toml
similarity index 100%
rename from tests/test_utils/Cargo.toml
rename to tests/utils/Cargo.toml
diff --git a/tests/test_utils/src/lib.rs b/tests/utils/src/lib.rs
similarity index 100%
rename from tests/test_utils/src/lib.rs
rename to tests/utils/src/lib.rs
diff --git a/types/Cargo.toml b/types/Cargo.toml
index 0fb3d53..0a11f0d 100644
--- a/types/Cargo.toml
+++ b/types/Cargo.toml
@@ -28,6 +28,6 @@ toml         = { version = "0.5.3" }
 ring         = { version = "0.16.5" }
 thiserror    = { version = "1.0.9" }
 
-teaclave_test_utils = { path = "../tests/test_utils", optional = true }
+teaclave_test_utils = { path = "../tests/utils", optional = true }
 
 sgx_tstd = { version = "1.1.0", features = ["net", "backtrace"], optional = 
true }
\ No newline at end of file
diff --git a/worker/Cargo.toml b/worker/Cargo.toml
index 1ca91fa..bc3b814 100644
--- a/worker/Cargo.toml
+++ b/worker/Cargo.toml
@@ -28,7 +28,7 @@ thiserror     = { version = "1.0.9" }
 gbdt          = { version = "0.1.0", features = ["input", "enable_training"] }
 itertools     = { version = "0.8.0", default-features = false }
 teaclave_types = { path = "../types" }
-teaclave_test_utils = { path = "../tests/test_utils", optional = true }
+teaclave_test_utils = { path = "../tests/utils", optional = true }
 
 sgx_cov       = { version = "1.1.0", optional = true }
 sgx_tstd      = { version = "1.1.0", features = ["net", "thread", 
"backtrace"], optional = true }
diff --git a/worker/src/function/context.rs b/worker/src/function/context.rs
index e2db011..01bb114 100644
--- a/worker/src/function/context.rs
+++ b/worker/src/function/context.rs
@@ -243,8 +243,8 @@ pub mod tests {
     }
 
     fn test_rtc_api() {
-        let input = PathBuf::from_str("test_cases/mesapy/input.txt").unwrap();
-        let output = 
PathBuf::from_str("test_cases/mesapy/output.txt.out").unwrap();
+        let input = 
PathBuf::from_str("fixtures/functions/mesapy/input.txt").unwrap();
+        let output = 
PathBuf::from_str("fixtures/functions/mesapy/output.txt.out").unwrap();
 
         let input_info = TeaclaveWorkerFileInfo {
             path: input,
diff --git a/worker/src/function/gbdt_prediction.rs 
b/worker/src/function/gbdt_prediction.rs
index a06fad1..7a23c83 100644
--- a/worker/src/function/gbdt_prediction.rs
+++ b/worker/src/function/gbdt_prediction.rs
@@ -116,10 +116,10 @@ pub mod tests {
     fn test_gbdt_prediction() {
         let func_args = TeaclaveFunctionArguments::default();
 
-        let plain_if_model = "test_cases/gbdt_prediction/model.txt";
-        let plain_if_data = "test_cases/gbdt_prediction/test_data.txt";
-        let plain_output = "test_cases/gbdt_prediction/result.txt.out";
-        let expected_output = "test_cases/gbdt_prediction/expected_result.txt";
+        let plain_if_model = "fixtures/functions/gbdt_prediction/model.txt";
+        let plain_if_data = "fixtures/functions/gbdt_prediction/test_data.txt";
+        let plain_output = "fixtures/functions/gbdt_prediction/result.txt.out";
+        let expected_output = 
"fixtures/functions/gbdt_prediction/expected_result.txt";
 
         let input_files = TeaclaveWorkerFileRegistry::new(hashmap!(
             IN_MODEL.to_string() =>
diff --git a/worker/src/function/gbdt_training.rs 
b/worker/src/function/gbdt_training.rs
index 6b67fe6..05fe9c5 100644
--- a/worker/src/function/gbdt_training.rs
+++ b/worker/src/function/gbdt_training.rs
@@ -158,9 +158,9 @@ pub mod tests {
             "training_optimization_level" => "2"
         ));
 
-        let plain_input = "test_cases/gbdt_training/train.txt";
-        let plain_output = "test_cases/gbdt_training/training_model.txt.out";
-        let expected_output = "test_cases/gbdt_training/expected_model.txt";
+        let plain_input = "fixtures/functions/gbdt_training/train.txt";
+        let plain_output = 
"fixtures/functions/gbdt_training/training_model.txt.out";
+        let expected_output = 
"fixtures/functions/gbdt_training/expected_model.txt";
 
         let input_files = TeaclaveWorkerFileRegistry::new(hashmap!(
             IN_DATA.to_string() =>
diff --git a/worker/src/function/mesapy.rs b/worker/src/function/mesapy.rs
index fb825a1..8f52305 100644
--- a/worker/src/function/mesapy.rs
+++ b/worker/src/function/mesapy.rs
@@ -164,8 +164,8 @@ def entrypoint(argv):
         assert e.message == "Teaclave Not Supported"
 "#;
 
-        let input = "test_cases/mesapy/input.txt";
-        let output = "test_cases/mesapy/output.txt";
+        let input = "fixtures/functions/mesapy/input.txt";
+        let output = "fixtures/functions/mesapy/output.txt";
 
         let input_info = TeaclaveWorkerFileInfo::new(input, 
TeaclaveFileCryptoInfo::default());
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to