You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by ms...@apache.org on 2020/01/15 04:59:56 UTC
[incubator-teaclave] branch develop updated (0d8e9ae -> c24bb93)
This is an automated email from the ASF dual-hosted git repository.
mssun pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave.git.
from 0d8e9ae [testsuite] Add leveldb_tests
new e4d0944 [testsuite] Add protected_fs_tests
new c24bb93 [ci] Enable basic testing
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.drone.yml | 172 ++++++++++-----------
cmake/UtilTargets.cmake | 6 +-
cmake/scripts/{sgx_test.sh => test.sh} | 10 +-
cmake/tomls/Cargo.sgx_trusted_lib.toml | 1 +
cmake/tomls/Cargo.sgx_untrusted_app.toml | 1 +
.../leveldb_tests/enclave/src/leveldb_tests.rs | 3 +-
.../app/Cargo.toml | 4 +-
.../app/build.rs | 0
.../app/src/main.rs | 0
.../enclave/Cargo.toml | 8 +-
.../enclave/Enclave.config.xml | 0
.../enclave/src/lib.rs | 4 +-
.../enclave/src/protected_fs_tests.rs | 11 +-
13 files changed, 117 insertions(+), 103 deletions(-)
rename cmake/scripts/{sgx_test.sh => test.sh} (70%)
copy testsuite/{enclave_unit_test => protected_fs_tests}/app/Cargo.toml (85%)
copy testsuite/{service_functional_test => protected_fs_tests}/app/build.rs (100%)
copy testsuite/{service_functional_test => protected_fs_tests}/app/src/main.rs (100%)
copy testsuite/{leveldb_tests => protected_fs_tests}/enclave/Cargo.toml (86%)
copy testsuite/{service_functional_test => protected_fs_tests}/enclave/Enclave.config.xml (100%)
copy testsuite/{leveldb_tests => protected_fs_tests}/enclave/src/lib.rs (97%)
copy legacy/tests/functional_test/sgx_trusted_lib/src/tests/protected_fs_test.rs => testsuite/protected_fs_tests/enclave/src/protected_fs_tests.rs (90%)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org
[incubator-teaclave] 01/02: [testsuite] Add protected_fs_tests
Posted by ms...@apache.org.
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
commit e4d09445a817786d2d6f8cc515941c6782fc7fcd
Author: Mingshen Sun <bo...@mssun.me>
AuthorDate: Tue Jan 14 20:25:45 2020 -0800
[testsuite] Add protected_fs_tests
---
cmake/tomls/Cargo.sgx_trusted_lib.toml | 1 +
cmake/tomls/Cargo.sgx_untrusted_app.toml | 1 +
.../leveldb_tests/enclave/src/leveldb_tests.rs | 3 +-
testsuite/protected_fs_tests/app/Cargo.toml | 19 ++++++
testsuite/protected_fs_tests/app/build.rs | 51 ++++++++++++++++
testsuite/protected_fs_tests/app/src/main.rs | 46 +++++++++++++++
testsuite/protected_fs_tests/enclave/Cargo.toml | 48 +++++++++++++++
.../protected_fs_tests/enclave/Enclave.config.xml | 12 ++++
testsuite/protected_fs_tests/enclave/src/lib.rs | 63 ++++++++++++++++++++
.../enclave/src/protected_fs_tests.rs | 68 ++++++++++++++++++++++
10 files changed, 311 insertions(+), 1 deletion(-)
diff --git a/cmake/tomls/Cargo.sgx_trusted_lib.toml b/cmake/tomls/Cargo.sgx_trusted_lib.toml
index bc01716..f8e85bb 100644
--- a/cmake/tomls/Cargo.sgx_trusted_lib.toml
+++ b/cmake/tomls/Cargo.sgx_trusted_lib.toml
@@ -5,6 +5,7 @@ members = [
"testsuite/enclave_unit_test/enclave",
"testsuite/service_functional_test/enclave",
"testsuite/leveldb_tests/enclave",
+ "testsuite/protected_fs_tests/enclave",
]
exclude = [
diff --git a/cmake/tomls/Cargo.sgx_untrusted_app.toml b/cmake/tomls/Cargo.sgx_untrusted_app.toml
index feca7e9..005d18e 100644
--- a/cmake/tomls/Cargo.sgx_untrusted_app.toml
+++ b/cmake/tomls/Cargo.sgx_untrusted_app.toml
@@ -5,6 +5,7 @@ members = [
"testsuite/enclave_unit_test/app",
"testsuite/service_functional_test/app",
"testsuite/leveldb_tests/app",
+ "testsuite/protected_fs_tests/app",
]
exclude = [
diff --git a/testsuite/leveldb_tests/enclave/src/leveldb_tests.rs b/testsuite/leveldb_tests/enclave/src/leveldb_tests.rs
index bea62ed..7b698a6 100644
--- a/testsuite/leveldb_tests/enclave/src/leveldb_tests.rs
+++ b/testsuite/leveldb_tests/enclave/src/leveldb_tests.rs
@@ -1,6 +1,5 @@
use rand::distributions::Alphanumeric;
use rand::Rng;
-use sgx_tunittest::*;
use std::iter;
use std::prelude::v1::*;
use std::string::String;
@@ -64,5 +63,7 @@ fn test_write_a_lot() {
}
pub fn run_tests() {
+ use sgx_tunittest::*;
+
rsgx_unit_tests!(test_write_a_lot);
}
diff --git a/testsuite/protected_fs_tests/app/Cargo.toml b/testsuite/protected_fs_tests/app/Cargo.toml
new file mode 100644
index 0000000..7dba439
--- /dev/null
+++ b/testsuite/protected_fs_tests/app/Cargo.toml
@@ -0,0 +1,19 @@
+[package]
+name = "teaclave_protected_fs_tests"
+version = "0.1.0"
+authors = ["Teaclave Contributors <de...@teaclave.apache.org>"]
+description = "Protected FS functional tests"
+license = "Apache-2.0"
+build = "build.rs"
+edition = "2018"
+
+[dependencies]
+log = { version = "0.4.6" }
+env_logger = { version = "0.7.1" }
+anyhow = { version = "1.0.26" }
+
+teaclave_ipc = { path = "../../../ipc" }
+teaclave_service_app_utils = { path = "../../../utils/service_app_utils" }
+teaclave_binder = { path = "../../../binder" }
+
+sgx_types = { version = "1.1.0" }
diff --git a/testsuite/protected_fs_tests/app/build.rs b/testsuite/protected_fs_tests/app/build.rs
new file mode 100644
index 0000000..b92afb5
--- /dev/null
+++ b/testsuite/protected_fs_tests/app/build.rs
@@ -0,0 +1,51 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::env;
+use std::path::PathBuf;
+
+fn choose_sgx_dylib(is_sim: bool) {
+ if is_sim {
+ println!("cargo:rustc-link-lib=dylib=sgx_urts_sim");
+ println!("cargo:rustc-link-lib=dylib=sgx_uae_service_sim");
+ } else {
+ println!("cargo:rustc-link-lib=dylib=sgx_urts");
+ println!("cargo:rustc-link-lib=dylib=sgx_uae_service");
+ }
+}
+
+fn main() {
+ let sdk_dir = env::var("SGX_SDK").unwrap_or("/opt/intel/sgxsdk".into());
+ println!("cargo:rustc-link-search=native={}/lib64", sdk_dir);
+
+ let out_path = env::var_os("ENCLAVE_OUT_DIR").unwrap_or("out".into());
+ let out_dir = &PathBuf::from(out_path);
+
+ println!("cargo:rustc-link-search=native={}", out_dir.display());
+ println!("cargo:rustc-link-lib=static=Enclave_u");
+
+ let is_sim = match env::var("SGX_MODE") {
+ Ok(ref v) if v == "SW" => true,
+ Ok(ref v) if v == "HW" => false,
+ Err(env::VarError::NotPresent) => false,
+ _ => {
+ panic!("Stop build process, wrong SGX_MODE env provided.");
+ }
+ };
+
+ choose_sgx_dylib(is_sim);
+}
diff --git a/testsuite/protected_fs_tests/app/src/main.rs b/testsuite/protected_fs_tests/app/src/main.rs
new file mode 100644
index 0000000..5f4fb60
--- /dev/null
+++ b/testsuite/protected_fs_tests/app/src/main.rs
@@ -0,0 +1,46 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use anyhow;
+use std::sync::Arc;
+use teaclave_binder::TeeBinder;
+use teaclave_ipc::protos::ecall::{RunFunctionalTestInput, RunFunctionalTestOutput};
+use teaclave_ipc::protos::ECallCommand;
+use teaclave_service_app_utils::ServiceEnclaveBuilder;
+
+fn main() -> anyhow::Result<()> {
+ let tee = ServiceEnclaveBuilder::init_tee_binder(env!("CARGO_PKG_NAME"))?;
+ run(tee)?;
+
+ Ok(())
+}
+
+fn start_enclave_unit_test_driver(tee: Arc<TeeBinder>) -> anyhow::Result<()> {
+ let cmd = ECallCommand::RunFunctionalTest;
+ let _ = tee.invoke::<RunFunctionalTestInput, RunFunctionalTestOutput>(
+ cmd.into(),
+ RunFunctionalTestInput,
+ );
+
+ Ok(())
+}
+
+fn run(tee: Arc<TeeBinder>) -> anyhow::Result<()> {
+ start_enclave_unit_test_driver(tee)?;
+
+ Ok(())
+}
diff --git a/testsuite/protected_fs_tests/enclave/Cargo.toml b/testsuite/protected_fs_tests/enclave/Cargo.toml
new file mode 100644
index 0000000..06fdcbc
--- /dev/null
+++ b/testsuite/protected_fs_tests/enclave/Cargo.toml
@@ -0,0 +1,48 @@
+[package]
+name = "teaclave_protected_fs_tests_enclave"
+version = "0.1.0"
+authors = ["Teaclave Contributors <de...@teaclave.apache.org>"]
+description = "Service Functional Test"
+license = "Apache-2.0"
+edition = "2018"
+
+[lib]
+name = "teaclave_protected_fs_tests_enclave"
+crate-type = ["staticlib"]
+
+[features]
+default = []
+mesalock_sgx = [
+ "sgx_tstd",
+ "teaclave_attestation/mesalock_sgx",
+ "teaclave_proto/mesalock_sgx",
+ "teaclave_ipc/mesalock_sgx",
+ "teaclave_rpc/mesalock_sgx",
+ "teaclave_service_config/mesalock_sgx",
+ "teaclave_service_enclave_utils/mesalock_sgx",
+ "teaclave_types/mesalock_sgx",
+ "protected_fs_rs/mesalock_sgx",
+]
+cov = ["teaclave_service_enclave_utils/cov"]
+
+[dependencies]
+log = { version = "0.4.6" }
+anyhow = { version = "1.0.26" }
+serde = { version = "1.0.92" }
+thiserror = { version = "1.0.9" }
+rand = { version = "0.7.0" }
+
+protected_fs_rs = { path = "../../../common/protected_fs_rs", default-features = false, optional = true }
+
+teaclave_attestation = { path = "../../../attestation" }
+teaclave_config = { path = "../../../config" }
+teaclave_ipc = { path = "../../../ipc" }
+teaclave_rpc = { path = "../../../rpc" }
+teaclave_service_config = { path = "../../../utils/service_config" }
+teaclave_service_enclave_utils = { path = "../../../utils/service_enclave_utils" }
+teaclave_types = { path = "../../../types" }
+teaclave_proto = { path = "../../../services/proto" }
+
+sgx_tstd = { version = "1.1.0", features = ["net", "thread", "backtrace"], optional = true }
+sgx_tunittest = { version = "1.1.0" }
+sgx_types = { version = "1.1.0" }
diff --git a/testsuite/protected_fs_tests/enclave/Enclave.config.xml b/testsuite/protected_fs_tests/enclave/Enclave.config.xml
new file mode 100644
index 0000000..705edcd
--- /dev/null
+++ b/testsuite/protected_fs_tests/enclave/Enclave.config.xml
@@ -0,0 +1,12 @@
+<!-- Please refer to User's Guide for the explanation of each field -->
+<EnclaveConfiguration>
+ <ProdID>0</ProdID>
+ <ISVSVN>0</ISVSVN>
+ <StackMaxSize>0x200000</StackMaxSize>
+ <HeapMaxSize>0x1000000</HeapMaxSize>
+ <TCSNum>22</TCSNum>
+ <TCSPolicy>0</TCSPolicy>
+ <DisableDebug>0</DisableDebug>
+ <MiscSelect>0</MiscSelect>
+ <MiscMask>0xFFFFFFFF</MiscMask>
+</EnclaveConfiguration>
diff --git a/testsuite/protected_fs_tests/enclave/src/lib.rs b/testsuite/protected_fs_tests/enclave/src/lib.rs
new file mode 100644
index 0000000..07c71a0
--- /dev/null
+++ b/testsuite/protected_fs_tests/enclave/src/lib.rs
@@ -0,0 +1,63 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#![cfg_attr(feature = "mesalock_sgx", no_std)]
+#[cfg(feature = "mesalock_sgx")]
+extern crate sgx_tstd as std;
+
+#[macro_use]
+extern crate log;
+
+use std::prelude::v1::*;
+
+use anyhow::Result;
+use teaclave_types;
+
+use teaclave_ipc::protos::ecall::{
+ FinalizeEnclaveInput, FinalizeEnclaveOutput, InitEnclaveInput, InitEnclaveOutput,
+ RunFunctionalTestInput, RunFunctionalTestOutput,
+};
+use teaclave_ipc::protos::ECallCommand;
+use teaclave_ipc::{handle_ecall, register_ecall_handler};
+use teaclave_service_enclave_utils::ServiceEnclave;
+
+mod protected_fs_tests;
+
+#[handle_ecall]
+fn handle_run_functional_test(_args: &RunFunctionalTestInput) -> Result<RunFunctionalTestOutput> {
+ protected_fs_tests::run_tests();
+ Ok(RunFunctionalTestOutput::default())
+}
+
+#[handle_ecall]
+fn handle_init_enclave(_args: &InitEnclaveInput) -> Result<InitEnclaveOutput> {
+ ServiceEnclave::init(env!("CARGO_PKG_NAME"))?;
+ Ok(InitEnclaveOutput::default())
+}
+
+#[handle_ecall]
+fn handle_finalize_enclave(_args: &FinalizeEnclaveInput) -> Result<FinalizeEnclaveOutput> {
+ ServiceEnclave::finalize()?;
+ Ok(FinalizeEnclaveOutput::default())
+}
+
+register_ecall_handler!(
+ type ECallCommand,
+ (ECallCommand::RunFunctionalTest, RunFunctionalTestInput, RunFunctionalTestOutput),
+ (ECallCommand::InitEnclave, InitEnclaveInput, InitEnclaveOutput),
+ (ECallCommand::FinalizeEnclave, FinalizeEnclaveInput, FinalizeEnclaveOutput),
+);
diff --git a/testsuite/protected_fs_tests/enclave/src/protected_fs_tests.rs b/testsuite/protected_fs_tests/enclave/src/protected_fs_tests.rs
new file mode 100644
index 0000000..228f263
--- /dev/null
+++ b/testsuite/protected_fs_tests/enclave/src/protected_fs_tests.rs
@@ -0,0 +1,68 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use protected_fs::{remove_protected_file, ProtectedFile};
+use rand::prelude::RngCore;
+use std::io::{Read, Write};
+use std::prelude::v1::*;
+
+pub fn read_write_large_file() {
+ const BLOCK_SIZE: usize = 2048;
+ const NBLOCKS: usize = 0x001_0000;
+
+ let key = [90u8; 16];
+
+ let mut write_data = [0u8; BLOCK_SIZE];
+ let mut read_data = [0u8; BLOCK_SIZE];
+ let mut write_size;
+ let mut read_size;
+
+ let mut rng = rand::thread_rng();
+ rng.fill_bytes(&mut write_data);
+ let fname = "/tmp/protect_fs_test_large_file";
+
+ {
+ let opt = ProtectedFile::create_ex(fname, &key);
+ assert_eq!(opt.is_ok(), true);
+ let mut file = opt.unwrap();
+ for _i in 0..NBLOCKS {
+ let result = file.write(&write_data);
+ assert_eq!(result.is_ok(), true);
+ write_size = result.unwrap();
+ assert_eq!(write_size, write_data.len());
+ }
+ }
+
+ {
+ let opt = ProtectedFile::open_ex(fname, &key);
+ assert_eq!(opt.is_ok(), true);
+ let mut file = opt.unwrap();
+ for _i in 0..NBLOCKS {
+ let result = file.read(&mut read_data);
+ assert_eq!(result.is_ok(), true);
+ read_size = result.unwrap();
+ assert_eq!(read_size, read_data.len());
+ }
+ }
+ assert_eq!(remove_protected_file(fname).is_ok(), true);
+}
+
+pub fn run_tests() {
+ use sgx_tunittest::*;
+
+ rsgx_unit_tests!(read_write_large_file);
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org
[incubator-teaclave] 02/02: [ci] Enable basic testing
Posted by ms...@apache.org.
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
commit c24bb93b95cfa22fab8965bb7f76e4bb3733096c
Author: Mingshen Sun <bo...@mssun.me>
AuthorDate: Tue Jan 14 20:38:56 2020 -0800
[ci] Enable basic testing
---
.drone.yml | 172 ++++++++++++++++-----------------
cmake/UtilTargets.cmake | 6 +-
cmake/scripts/{sgx_test.sh => test.sh} | 10 +-
3 files changed, 96 insertions(+), 92 deletions(-)
diff --git a/.drone.yml b/.drone.yml
index a0451b5..0fc508d 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -18,22 +18,22 @@ steps:
commands:
- . /root/.cargo/env
- cd build && make VERBOSE=1 -j2
-# - name: sgx-test
-# image: mesalocklinux/mesatee-build-ubuntu-1804:0.1.2
-# environment:
-# IAS_KEY:
-# from_secret: V5_KEY
-# IAS_SPID:
-# from_secret: V5_SPID
-# privileged: true
-# volumes:
-# - name: isgx
-# path: /dev/isgx
-# - name: aesmd
-# path: /var/run/aesmd/aesm.socket
-# commands:
-# - . /root/.cargo/env
-# - cd build && make sgx-test
+- name: test
+ image: mesalocklinux/mesatee-build-ubuntu-1804:0.1.2
+ environment:
+ IAS_KEY:
+ from_secret: V5_KEY
+ IAS_SPID:
+ from_secret: V5_SPID
+ privileged: true
+ volumes:
+ - name: isgx
+ path: /dev/isgx
+ - name: aesmd
+ path: /var/run/aesmd/aesm.socket
+ commands:
+ - . /root/.cargo/env
+ - cd build && make run-test
volumes:
- name: isgx
@@ -68,22 +68,22 @@ steps:
commands:
- . /root/.cargo/env
- cd build && make VERBOSE=1 -j2
-# - name: sgx-test
-# image: mesalocklinux/mesatee-build-ubuntu-1804:0.1.2
-# privileged: true
-# environment:
-# IAS_KEY:
-# from_secret: V5_KEY
-# IAS_SPID:
-# from_secret: V5_SPID
-# volumes:
-# - name: isgx
-# path: /dev/isgx
-# - name: aesmd
-# path: /var/run/aesmd/aesm.socket
-# commands:
-# - . /root/.cargo/env
-# - cd build && make sgx-test
+- name: test
+ image: mesalocklinux/mesatee-build-ubuntu-1804:0.1.2
+ privileged: true
+ environment:
+ IAS_KEY:
+ from_secret: V5_KEY
+ IAS_SPID:
+ from_secret: V5_SPID
+ volumes:
+ - name: isgx
+ path: /dev/isgx
+ - name: aesmd
+ path: /var/run/aesmd/aesm.socket
+ commands:
+ - . /root/.cargo/env
+ - cd build && make run-test
volumes:
- name: isgx
@@ -118,11 +118,11 @@ steps:
commands:
- . /root/.cargo/env
- cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DSGX_SIM_MODE=ON .. && make VERBOSE=1 -j2
-# - name: sgx-test
-# image: mesalocklinux/mesatee-build-ubuntu-1804:0.1.2
-# commands:
-# - . /root/.cargo/env
-# - cd build && make sgx-test
+- name: test
+ image: mesalocklinux/mesatee-build-ubuntu-1804:0.1.2
+ commands:
+ - . /root/.cargo/env
+ - cd build && make run-test
node:
instance: mesatee-sgx
@@ -149,11 +149,11 @@ steps:
commands:
- . /root/.cargo/env
- cd build && cmake -DSGX_SIM_MODE=ON .. && make VERBOSE=1 -j2
-# - name: sgx-test
-# image: mesalocklinux/mesatee-build-ubuntu-1804:0.1.2
-# commands:
-# - . /root/.cargo/env
-# - cd build && make sgx-test
+- name: test
+ image: mesalocklinux/mesatee-build-ubuntu-1804:0.1.2
+ commands:
+ - . /root/.cargo/env
+ - cd build && make run-test
node:
instance: mesatee-sgx
@@ -180,22 +180,22 @@ steps:
commands:
- . /root/.cargo/env
- cd build && make VERBOSE=1 -j2
-# - name: sgx-test
-# image: mesalocklinux/mesatee-build-ubuntu-1604:0.1.2
-# environment:
-# IAS_KEY:
-# from_secret: V5_KEY
-# IAS_SPID:
-# from_secret: V5_SPID
-# privileged: true
-# volumes:
-# - name: isgx
-# path: /dev/isgx
-# - name: aesmd
-# path: /var/run/aesmd/aesm.socket
-# commands:
-# - . /root/.cargo/env
-# - cd build && make sgx-test
+- name: test
+ image: mesalocklinux/mesatee-build-ubuntu-1604:0.1.2
+ environment:
+ IAS_KEY:
+ from_secret: V5_KEY
+ IAS_SPID:
+ from_secret: V5_SPID
+ privileged: true
+ volumes:
+ - name: isgx
+ path: /dev/isgx
+ - name: aesmd
+ path: /var/run/aesmd/aesm.socket
+ commands:
+ - . /root/.cargo/env
+ - cd build && make run-test
volumes:
- name: isgx
@@ -230,22 +230,22 @@ steps:
commands:
- . /root/.cargo/env
- cd build && make VERBOSE=1 -j2
-# - name: sgx-test
-# image: mesalocklinux/mesatee-build-ubuntu-1604:0.1.2
-# privileged: true
-# environment:
-# IAS_KEY:
-# from_secret: V5_KEY
-# IAS_SPID:
-# from_secret: V5_SPID
-# volumes:
-# - name: isgx
-# path: /dev/isgx
-# - name: aesmd
-# path: /var/run/aesmd/aesm.socket
-# commands:
-# - . /root/.cargo/env
-# - cd build && make sgx-test
+- name: test
+ image: mesalocklinux/mesatee-build-ubuntu-1604:0.1.2
+ privileged: true
+ environment:
+ IAS_KEY:
+ from_secret: V5_KEY
+ IAS_SPID:
+ from_secret: V5_SPID
+ volumes:
+ - name: isgx
+ path: /dev/isgx
+ - name: aesmd
+ path: /var/run/aesmd/aesm.socket
+ commands:
+ - . /root/.cargo/env
+ - cd build && make run-test
volumes:
- name: isgx
@@ -280,11 +280,11 @@ steps:
commands:
- . /root/.cargo/env
- cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DSGX_SIM_MODE=ON .. && make VERBOSE=1 -j2
-# - name: sgx-test
-# image: mesalocklinux/mesatee-build-ubuntu-1604:0.1.2
-# commands:
-# - . /root/.cargo/env
-# - cd build && make sgx-test
+- name: test
+ image: mesalocklinux/mesatee-build-ubuntu-1604:0.1.2
+ commands:
+ - . /root/.cargo/env
+ - cd build && make run-test
node:
instance: mesatee-sgx
@@ -311,11 +311,11 @@ steps:
commands:
- . /root/.cargo/env
- cd build && cmake -DSGX_SIM_MODE=ON -DTEST_MODE=ON .. && make VERBOSE=1 -j2
-# - name: sgx-test
-# image: mesalocklinux/mesatee-build-ubuntu-1604:0.1.2
-# commands:
-# - . /root/.cargo/env
-# - cd build && make sgx-test
+- name: test
+ image: mesalocklinux/mesatee-build-ubuntu-1604:0.1.2
+ commands:
+ - . /root/.cargo/env
+ - cd build && make run-test
node:
instance: mesatee-sgx
@@ -369,7 +369,7 @@ node:
# - . /root/.cargo/env
# - export RUSTFLAGS="-D warnings"
# - cd build && make VERBOSE=1 -j2
-# - name: sgx-test
+# - name: test
# image: mesalocklinux/mesatee-build-ubuntu-1804:0.1.2
# environment:
# IAS_KEY:
@@ -384,7 +384,7 @@ node:
# path: /var/run/aesmd/aesm.socket
# commands:
# - . /root/.cargo/env
-# - cd build && make sgx-test
+# - cd build && make run-test
# - name: coverage
# failure: ignore
# image: mesalocklinux/mesatee-build-ubuntu-1804:0.1.2
diff --git a/cmake/UtilTargets.cmake b/cmake/UtilTargets.cmake
index bcaa7e2..e174f72 100644
--- a/cmake/UtilTargets.cmake
+++ b/cmake/UtilTargets.cmake
@@ -24,10 +24,10 @@ add_custom_target(check
)
if(TEST_MODE)
- add_custom_target(sgx-test
- COMMAND ${MESATEE_COMMON_ENVS} ${MT_SCRIPT_DIR}/sgx_test.sh)
+ add_custom_target(run-test
+ COMMAND ${MESATEE_COMMON_ENVS} ${MT_SCRIPT_DIR}/test.sh)
else()
- add_custom_target(sgx-test
+ add_custom_target(run-test
COMMAND echo "Note: Testing is not enabled in this build. Run cmake again with -DTEST_MODE=ON")
endif()
diff --git a/cmake/scripts/sgx_test.sh b/cmake/scripts/test.sh
similarity index 70%
rename from cmake/scripts/sgx_test.sh
rename to cmake/scripts/test.sh
index f622629..9e4afa2 100755
--- a/cmake/scripts/sgx_test.sh
+++ b/cmake/scripts/test.sh
@@ -14,6 +14,10 @@ if [ "${SGX_MODE}" = "HW" ]; then
fi
fi
-cd ${MESATEE_PROJECT_ROOT}/tests && ./module_test.sh
-cd ${MESATEE_PROJECT_ROOT}/tests && ./functional_test.sh
-cd ${MESATEE_PROJECT_ROOT}/tests && ./integration_test.sh
+pushd ${MESATEE_TEST_INSTALL_DIR}
+
+./teaclave_enclave_unit_test
+./teaclave_leveldb_tests
+./teaclave_protected_fs_tests
+
+popd
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org