diff --git a/Cargo.lock b/Cargo.lock index 92cd7e510..cbecf5371 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -230,7 +230,7 @@ dependencies = [ "seccomp", "serde_json", "signal-hook", - "ssh2", + "test_infra", "thiserror", "vm-memory", "vmm", @@ -1098,6 +1098,18 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "test_infra" +version = "0.1.0" +dependencies = [ + "dirs", + "epoll", + "libc", + "ssh2", + "vmm-sys-util", + "wait-timeout", +] + [[package]] name = "textwrap" version = "0.11.0" diff --git a/Cargo.toml b/Cargo.toml index f21a1ea48..e831799e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ dirs = "3.0.1" lazy_static= "1.4.0" net_util = { path = "net_util" } serde_json = "1.0.64" -ssh2 = "0.9.1" +test_infra = { path = "test_infra" } wait-timeout = "0.2.0" [features] @@ -86,3 +86,4 @@ members = [ "vm-migration", "vm-virtio" ] +exclude = ["test_infra"] diff --git a/test_infra/Cargo.toml b/test_infra/Cargo.toml new file mode 100644 index 000000000..62d832242 --- /dev/null +++ b/test_infra/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "test_infra" +version = "0.1.0" +authors = ["The Cloud Hypervisor Authors"] +edition = "2018" + +[dependencies] +dirs = "3.0.1" +epoll = "4.3.1" +libc = "0.2.91" +ssh2 = "0.9.1" +vmm-sys-util = "0.8.0" +wait-timeout = "0.2.0" diff --git a/tests/test_infra/mod.rs b/test_infra/src/lib.rs similarity index 100% rename from tests/test_infra/mod.rs rename to test_infra/src/lib.rs diff --git a/tests/integration.rs b/tests/integration.rs index 9e2df520c..e8f5d2063 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -10,12 +10,11 @@ extern crate lazy_static; #[cfg(test)] #[cfg(feature = "integration_tests")] -mod test_infra; +extern crate test_infra; #[cfg(test)] #[cfg(feature = "integration_tests")] mod tests { - use crate::test_infra::*; use net_util::MacAddr; use std::collections::HashMap; use std::env; @@ -31,6 +30,7 @@ mod tests { use std::sync::mpsc::Receiver; use std::sync::{mpsc, Mutex}; use std::thread; + use test_infra::*; use vmm_sys_util::{tempdir::TempDir, tempfile::TempFile}; #[cfg_attr(target_arch = "aarch64", allow(unused_imports))] use wait_timeout::ChildExt;