Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
Change-Id: I327f79f4b2f8008485e989156419d01de373078a
  • Loading branch information
jblebrun committed Jul 25, 2024
1 parent e4aa7a8 commit 7b6af53
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 43 deletions.
23 changes: 0 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion oak_functions_test_utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ rust_library(
"//oak_proto_rust",
"@oak_crates_index//:anyhow",
"@oak_crates_index//:command-group",
"@oak_crates_index//:duct",
"@oak_crates_index//:nix",
"@oak_crates_index//:once_cell",
"@oak_crates_index//:port_check",
Expand Down
1 change: 0 additions & 1 deletion oak_functions_test_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ license = "Apache-2.0"
[dependencies]
anyhow = "*"
command-group = "*"
duct = "*"
log = "*"
http = "*"
hyper = { version = "*", features = ["client", "http1", "runtime", "server"] }
Expand Down
19 changes: 1 addition & 18 deletions oak_functions_test_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ pub static OAK_RESTRICTED_KERNEL_WRAPPER_BIN: Lazy<PathBuf> = Lazy::new(|| {
])
});

use std::{
collections::HashMap, future::Future, io::Write, path::PathBuf, pin::Pin, task::Poll,
time::Duration,
};
use std::{collections::HashMap, future::Future, io::Write, path::PathBuf, pin::Pin, task::Poll};

use command_group::stdlib::CommandGroup;
use nix::unistd::Pid;
use oak_client::verifier::InsecureAttestationVerifier;
use oak_functions_abi::Response;
use oak_functions_client::OakFunctionsClient;
Expand Down Expand Up @@ -143,19 +139,6 @@ pub fn rust_crate_enclave_out_path(crate_name: &str) -> String {
)
}

/// Kills all the processes identified by the provided handle.
///
/// First tries to send them a `SIGINT` signal, then, if they are still running,
/// it sends them a `SIGKILL` signal.
pub fn kill_process(handle: duct::ReaderHandle) {
handle.pids().iter().for_each(|pid| {
nix::sys::signal::kill(Pid::from_raw(*pid as i32), nix::sys::signal::SIGINT).unwrap()
});
// Wait for the process to terminate cleanly, then forcefully kill it.
std::thread::sleep(Duration::from_secs(2));
handle.kill().unwrap();
}

/// A wrapper around a termination signal [`oneshot::Receiver`].
///
/// This type manually implements [`Future`] in order to be able to be passed to
Expand Down

0 comments on commit 7b6af53

Please sign in to comment.