Skip to content

Commit 62230cd

Browse files
authored
Merge pull request #495 from egrimley-arm/pr-test-warn
Reduce the number of warnings.
2 parents 885f1f5 + 21b3537 commit 62230cd

File tree

5 files changed

+14
-19
lines changed

5 files changed

+14
-19
lines changed

tests/tests/common/event.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ use std::{
88
#[derive(Debug, Clone)]
99
pub(crate) enum TestEvent {
1010
// Check the policy and runtime hash
11+
#[allow(dead_code)] // FIXME
1112
CheckHash,
1213
// Write a remote file
1314
WriteFile(String, PathBuf),
1415
// Append a remote file
16+
#[allow(dead_code)] // FIXME
1517
AppendFile(String, PathBuf),
1618
// Execute a remote file
1719
Execute(String),
@@ -36,6 +38,7 @@ impl TestEvent {
3638

3739
/// Create a list of events for provisioning data files in the `local_dir_path`. The
3840
/// `local_dir_path` will be replaced by `remote_dir_path`.
41+
#[allow(dead_code)] // FIXME
3942
pub(crate) fn write_all<T: AsRef<Path>, K: AsRef<Path>>(
4043
dir_path: T,
4144
remote_dir_path: K,
@@ -60,6 +63,7 @@ impl TestEvent {
6063
/// Function produces a vec of input lists. Each list corresponds to a round
6164
/// and is a vec of pairs of remote (des) file and local (src) file path,
6265
/// which corresponds to provisioning/appending the content of the local file to the remote file.
66+
#[allow(dead_code)] // FIXME
6367
pub(crate) fn batch_process_events<T: AsRef<Path>, K: AsRef<str>, Q: AsRef<str>>(
6468
local_dir_path: T,
6569
program_filename: K,
@@ -113,6 +117,7 @@ impl TestEvent {
113117
/// Read all files and diretory in the path of 'dir_path' in the local machine and replace the prefix with 'remote_dir_path'.
114118
/// E.g. if call the function with '/local/path/' and '/remote/path/',
115119
/// the result could be [(/remote/path/a.txt, /local/path/a.txt), (/remote/path/b/c.txt, /local/path/b/c.txt), ... ].
120+
#[allow(dead_code)] // FIXME
116121
pub(crate) fn input_list<T: AsRef<Path>, K: AsRef<Path>>(
117122
dir_path: T,
118123
remote_dir_path: K,

tests/tests/common/util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ pub fn runtime_data_dir<T: AsRef<str>>(filename: T) -> String {
5656
///
5757
/// Note this is overrideable with the VERACRUZ_TEST_TIMEOUT environment
5858
/// variable, which provides a timeout in seconds
59+
#[allow(dead_code)] // FIXME
5960
pub fn timeout<R: Send + 'static, F: (FnOnce() -> R) + Send + 'static>(
6061
timeout: Duration,
6162
f: F,

tests/tests/integration_test.rs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const LINEAR_REGRESSION_DUAL_POLICY: &'static str = "dual_policy.json";
2424
const LINEAR_REGRESSION_TRIPLE_POLICY: &'static str = "triple_policy_1.json";
2525
const LINEAR_REGRESSION_PARALLEL_POLICY: &'static str = "dual_parallel_policy.json";
2626
const INTERSECTION_SET_SUM_TRIPLE_POLICY: &'static str = "triple_policy_2.json";
27-
const PERMUTED_INTERSECTION_SET_SUM_TRIPLE_POLICY: &'static str = "triple_policy_3.json";
2827
const STRING_EDIT_DISTANCE_TRIPLE_POLICY: &'static str = "triple_policy_4.json";
2928
const STRING_EDIT_DISTANCE_QUADRUPLE_POLICY: &'static str = "quadruple_policy.json";
3029

@@ -280,8 +279,7 @@ async fn veracruz_phase4_linear_regression_two_clients_parallel() {
280279
info!("### program provider read binary.");
281280
let program_data = read_local_file(prog_path).unwrap();
282281
info!("### program provider send binary.");
283-
client
284-
.write_file("/program/linear-regression.wasm", &program_data)?;
282+
client.write_file("/program/linear-regression.wasm", &program_data)?;
285283
Result::<()>::Ok(())
286284
};
287285
let data_provider_handle = async {
@@ -297,11 +295,9 @@ async fn veracruz_phase4_linear_regression_two_clients_parallel() {
297295
info!("### data provider read input.");
298296
let data = read_local_file(&data_filename).unwrap();
299297
info!("### data provider send input.");
300-
client
301-
.write_file("/input/linear-regression.dat", &data)?;
298+
client.write_file("/input/linear-regression.dat", &data)?;
302299
info!("### data provider read result.");
303-
client
304-
.request_compute("/program/linear-regression.wasm")?;
300+
client.request_compute("/program/linear-regression.wasm")?;
305301
client.read_file("/output/linear-regression.dat")?;
306302
info!("### data provider request shutdown.");
307303
client.request_shutdown()?;
@@ -366,9 +362,7 @@ impl TestExecutor {
366362
// start the proxy attestation server
367363
proxy_attestation_setup(policy.proxy_attestation_server_url().clone());
368364

369-
Ok(TestExecutor {
370-
policy_json,
371-
})
365+
Ok(TestExecutor { policy_json })
372366
}
373367

374368
/// Execute this test. Clients collectively execute as a block, driven by the `events`, in
@@ -408,11 +402,10 @@ impl TestExecutor {
408402
.ok_or(anyhow!("cannot find client of index {}", client_index))?;
409403
info!("Process client{} event {:?}.", client_index, event);
410404
let time_init = Instant::now();
411-
Self::process_event(&mut client, &event)
412-
.map_err(|e| {
413-
error!("Client of index {}: {:?}", client_index, e);
414-
e
415-
})?;
405+
Self::process_event(&mut client, &event).map_err(|e| {
406+
error!("Client of index {}: {:?}", client_index, e);
407+
e
408+
})?;
416409
info!(
417410
"The event {:?} finished in {:?}.",
418411
event,

tests/tests/server_test.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
1515
mod common;
1616

17-
use actix_rt::System;
1817
use anyhow::{anyhow, Result};
1918
use common::event::TestEvent;
2019
use common::proxy_attestation_server::*;
@@ -24,9 +23,7 @@ use log::{error, info};
2423
use mbedtls::{alloc::List, x509::Certificate};
2524
use policy_utils::{policy::Policy, Platform};
2625
use std::{
27-
convert::TryFrom,
2826
error::Error,
29-
fs::File,
3027
io::{Read, Write},
3128
path::Path,
3229
sync::{

workspaces/shared.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ POLICY_FILES ?= \
118118
dual_parallel_policy.json \
119119
triple_policy_1.json \
120120
triple_policy_2.json \
121-
triple_policy_3.json \
122121
triple_policy_4.json \
123122
quadruple_policy.json
124123

0 commit comments

Comments
 (0)