mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-02 11:35:46 +00:00
tests: Move test_infra from a module to crate
It must be specified as excluded from the workspace as it must not be built on non-test targets due to issues with the ssh2 dependency and the musl toolchain. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
91145afa9b
commit
88c30764e0
14
Cargo.lock
generated
14
Cargo.lock
generated
@ -230,7 +230,7 @@ dependencies = [
|
|||||||
"seccomp",
|
"seccomp",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"signal-hook",
|
"signal-hook",
|
||||||
"ssh2",
|
"test_infra",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"vm-memory",
|
"vm-memory",
|
||||||
"vmm",
|
"vmm",
|
||||||
@ -1098,6 +1098,18 @@ dependencies = [
|
|||||||
"winapi-util",
|
"winapi-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "test_infra"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"dirs",
|
||||||
|
"epoll",
|
||||||
|
"libc",
|
||||||
|
"ssh2",
|
||||||
|
"vmm-sys-util",
|
||||||
|
"wait-timeout",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "textwrap"
|
name = "textwrap"
|
||||||
version = "0.11.0"
|
version = "0.11.0"
|
||||||
|
@ -43,7 +43,7 @@ dirs = "3.0.1"
|
|||||||
lazy_static= "1.4.0"
|
lazy_static= "1.4.0"
|
||||||
net_util = { path = "net_util" }
|
net_util = { path = "net_util" }
|
||||||
serde_json = "1.0.64"
|
serde_json = "1.0.64"
|
||||||
ssh2 = "0.9.1"
|
test_infra = { path = "test_infra" }
|
||||||
wait-timeout = "0.2.0"
|
wait-timeout = "0.2.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
@ -86,3 +86,4 @@ members = [
|
|||||||
"vm-migration",
|
"vm-migration",
|
||||||
"vm-virtio"
|
"vm-virtio"
|
||||||
]
|
]
|
||||||
|
exclude = ["test_infra"]
|
||||||
|
13
test_infra/Cargo.toml
Normal file
13
test_infra/Cargo.toml
Normal file
@ -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"
|
@ -10,12 +10,11 @@ extern crate lazy_static;
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[cfg(feature = "integration_tests")]
|
#[cfg(feature = "integration_tests")]
|
||||||
mod test_infra;
|
extern crate test_infra;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[cfg(feature = "integration_tests")]
|
#[cfg(feature = "integration_tests")]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::test_infra::*;
|
|
||||||
use net_util::MacAddr;
|
use net_util::MacAddr;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env;
|
use std::env;
|
||||||
@ -31,6 +30,7 @@ mod tests {
|
|||||||
use std::sync::mpsc::Receiver;
|
use std::sync::mpsc::Receiver;
|
||||||
use std::sync::{mpsc, Mutex};
|
use std::sync::{mpsc, Mutex};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
use test_infra::*;
|
||||||
use vmm_sys_util::{tempdir::TempDir, tempfile::TempFile};
|
use vmm_sys_util::{tempdir::TempDir, tempfile::TempFile};
|
||||||
#[cfg_attr(target_arch = "aarch64", allow(unused_imports))]
|
#[cfg_attr(target_arch = "aarch64", allow(unused_imports))]
|
||||||
use wait_timeout::ChildExt;
|
use wait_timeout::ChildExt;
|
||||||
|
Loading…
Reference in New Issue
Block a user