proto/tests/dtpm-config_test.rs
Noor 291941667d
feat: add directory support on launch config
dtpm proto changed
upload files through grpc stream
seperated filesystem from dtpm config
tar zstd archiving directory to upload
test directory support on config
test archive directory
2025-04-03 19:01:51 +05:30

33 lines
795 B
Rust

use detee_shared::sgx::types::dtpm::{compress_directory, DtpmConfig};
#[test]
fn dtpm_config_dir_support_test() {
let file_path = "tests/fixtures/dtpm_config.yaml";
let unloaded_config = DtpmConfig::from_path(file_path).unwrap();
let loaded_config = unloaded_config.load_data().unwrap();
dbg!(&loaded_config);
}
#[test]
fn test_compression() {
// let file_path = "/Users/user/.cache/hunter/toolchain";
let file_path = "./tests";
let compressed_buff = compress_directory(file_path).unwrap();
let tmp_dir = tempfile::tempdir()
.unwrap()
.into_path()
.to_string_lossy()
.to_string();
dbg!(&tmp_dir);
std::fs::write(
format!("{}/{}", tmp_dir, "archive.tar.zst"),
&compressed_buff,
)
.unwrap();
}