diff --git a/src/runtime-rs/Cargo.lock b/src/runtime-rs/Cargo.lock index c35b1f6708..193c34feac 100644 --- a/src/runtime-rs/Cargo.lock +++ b/src/runtime-rs/Cargo.lock @@ -1788,7 +1788,6 @@ dependencies = [ "shim-interface", "slog", "slog-scope", - "tempdir", "test-utils", "tests_utils", "thiserror 1.0.69", @@ -3532,15 +3531,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "rend" version = "0.4.2" @@ -4426,16 +4416,6 @@ dependencies = [ "xattr", ] -[[package]] -name = "tempdir" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -dependencies = [ - "rand 0.4.6", - "remove_dir_all", -] - [[package]] name = "tempfile" version = "3.19.1" diff --git a/src/runtime-rs/crates/hypervisor/Cargo.toml b/src/runtime-rs/crates/hypervisor/Cargo.toml index dfb83e784c..d4348fa803 100644 --- a/src/runtime-rs/crates/hypervisor/Cargo.toml +++ b/src/runtime-rs/crates/hypervisor/Cargo.toml @@ -33,7 +33,6 @@ oci-spec = { workspace = true } futures = "0.3.25" safe-path = "0.1.0" crossbeam-channel = "0.5.6" -tempdir = "0.3.7" qapi = { version = "0.14", features = ["qmp", "async-tokio-all"] } qapi-spec = "0.3.1" qapi-qmp = "0.14.0" @@ -77,6 +76,7 @@ cloud-hypervisor = ["ch-config"] [dev-dependencies] serial_test = "2.0.0" +tempfile = { workspace = true } # Local dev-dependencies # Force the CH tests to run, even when the feature is not enabled for diff --git a/src/runtime-rs/crates/hypervisor/src/ch/inner_hypervisor.rs b/src/runtime-rs/crates/hypervisor/src/ch/inner_hypervisor.rs index 8ad61c56eb..768029608d 100644 --- a/src/runtime-rs/crates/hypervisor/src/ch/inner_hypervisor.rs +++ b/src/runtime-rs/crates/hypervisor/src/ch/inner_hypervisor.rs @@ -1093,7 +1093,7 @@ mod tests { use test_utils::{assert_result, skip_if_not_root}; use std::fs::File; - use tempdir::TempDir; + use tempfile::Builder; fn set_fake_guest_protection(protection: Option) { let existing_ref = FAKE_GUEST_PROTECTION.clone(); @@ -1486,7 +1486,7 @@ mod tests { let path_dir = "/tmp/proc"; let file_name = "1"; - let tmp_dir = TempDir::new(path_dir).unwrap(); + let tmp_dir = Builder::new().prefix("proc").tempdir().unwrap(); let file_path = tmp_dir.path().join(file_name); let _tmp_file = File::create(file_path.as_os_str()).unwrap(); let file_path_name = file_path.as_path().to_str().map(|s| s.to_string());