1
0
Fork 0
mirror of https://github.com/containers/youki synced 2024-05-08 00:26:14 +02:00

Move test framework and integration tests

This commit is contained in:
Furisto 2021-10-20 22:10:06 +02:00
parent 62f4dc5029
commit c77a71afd4
No known key found for this signature in database
GPG Key ID: 40C5F0E00523478B
52 changed files with 203 additions and 75 deletions

237
Cargo.lock generated
View File

@ -17,15 +17,6 @@ dependencies = [
"memchr",
]
[[package]]
name = "ansi_term"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
dependencies = [
"winapi",
]
[[package]]
name = "anyhow"
version = "1.0.43"
@ -107,7 +98,7 @@ name = "cgroups"
version = "0.1.0"
dependencies = [
"anyhow",
"clap 2.33.3",
"clap",
"dbus",
"env_logger 0.9.0",
"errno",
@ -115,7 +106,7 @@ dependencies = [
"libc",
"log",
"nix",
"oci-spec",
"oci-spec 0.5.2 (git+https://github.com/containers/oci-spec-rs?rev=d6fb1e91742313cd0d0085937e2d6df5d4669720)",
"procfs",
"quickcheck",
"rbpf",
@ -140,40 +131,28 @@ dependencies = [
[[package]]
name = "clap"
version = "2.33.3"
version = "3.0.0-beta.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
checksum = "4bd1061998a501ee7d4b6d449020df3266ca3124b941ec56cf2005c3779ca142"
dependencies = [
"ansi_term",
"atty",
"bitflags",
"strsim 0.8.0",
"textwrap 0.11.0",
"unicode-width",
"vec_map",
]
[[package]]
name = "clap"
version = "3.0.0-beta.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcd70aa5597dbc42f7217a543f9ef2768b2ef823ba29036072d30e1d88e98406"
dependencies = [
"bitflags",
"clap_derive",
"indexmap",
"lazy_static",
"os_str_bytes",
"strsim 0.10.0",
"textwrap 0.14.2",
"strsim",
"termcolor",
"textwrap",
"unicode-width",
"vec_map",
]
[[package]]
name = "clap_derive"
version = "3.0.0-beta.4"
version = "3.0.0-beta.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b5bb0d655624a0b8770d1c178fb8ffcb1f91cc722cb08f451e3dc72465421ac"
checksum = "370f715b81112975b1b69db93e0b56ea4cd4e5002ac43b2da8474106a54096a1"
dependencies = [
"heck",
"proc-macro-error",
@ -201,6 +180,20 @@ dependencies = [
"cfg-if 1.0.0",
]
[[package]]
name = "crossbeam"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-channel",
"crossbeam-deque",
"crossbeam-epoch",
"crossbeam-queue",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-channel"
version = "0.5.1"
@ -211,6 +204,40 @@ dependencies = [
"crossbeam-utils",
]
[[package]]
name = "crossbeam-deque"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-epoch",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-epoch"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-utils",
"lazy_static",
"memoffset",
"scopeguard",
]
[[package]]
name = "crossbeam-queue"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.5"
@ -251,7 +278,7 @@ dependencies = [
"ident_case",
"proc-macro2",
"quote",
"strsim 0.10.0",
"strsim",
"syn",
]
@ -308,6 +335,12 @@ dependencies = [
"syn",
]
[[package]]
name = "either"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]]
name = "env_logger"
version = "0.8.4"
@ -361,6 +394,18 @@ dependencies = [
"instant",
]
[[package]]
name = "filetime"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98"
dependencies = [
"cfg-if 1.0.0",
"libc",
"redox_syscall",
"winapi",
]
[[package]]
name = "flate2"
version = "1.0.21"
@ -591,6 +636,26 @@ dependencies = [
"cfg-if 1.0.0",
]
[[package]]
name = "integration_test"
version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"clap_derive",
"flate2",
"oci-spec 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"once_cell",
"procfs",
"rand",
"serde",
"serde_json",
"tar",
"test_framework",
"uuid",
"which",
]
[[package]]
name = "itoa"
version = "0.4.8"
@ -755,6 +820,19 @@ dependencies = [
"libc",
]
[[package]]
name = "oci-spec"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63f0f82a50257e72a6f13616dc093f3d0874294629bf8b7d0bc2a098e3db324f"
dependencies = [
"derive_builder",
"getset",
"serde",
"serde_json",
"thiserror",
]
[[package]]
name = "oci-spec"
version = "0.5.2"
@ -776,9 +854,9 @@ checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
[[package]]
name = "os_str_bytes"
version = "3.1.0"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6acbef58a60fe69ab50510a55bc8cdd4d6cf2283d27ad338f54cb52747a9cf2d"
checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85"
[[package]]
name = "parking_lot"
@ -839,6 +917,12 @@ version = "0.3.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb"
[[package]]
name = "ppv-lite86"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3ca011bd0129ff4ae15cd04c4eef202cadf6c51c21e47aba319b4e0501db741"
[[package]]
name = "prctl"
version = "1.0.0"
@ -935,6 +1019,19 @@ version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
dependencies = [
"libc",
"rand_chacha",
"rand_core",
"rand_hc",
]
[[package]]
name = "rand_chacha"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
"rand_core",
]
@ -947,6 +1044,15 @@ dependencies = [
"getrandom",
]
[[package]]
name = "rand_hc"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
dependencies = [
"rand_core",
]
[[package]]
name = "rbpf"
version = "0.1.0"
@ -1070,12 +1176,6 @@ version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
[[package]]
name = "strsim"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
[[package]]
name = "strsim"
version = "0.10.0"
@ -1117,6 +1217,17 @@ dependencies = [
"unicode-width",
]
[[package]]
name = "tar"
version = "0.4.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6f5515d3add52e0bbdcad7b83c388bb36ba7b754dda3b5f5bc2d38640cdba5c"
dependencies = [
"filetime",
"libc",
"xattr",
]
[[package]]
name = "termcolor"
version = "1.1.2"
@ -1127,19 +1238,21 @@ dependencies = [
]
[[package]]
name = "textwrap"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
name = "test_framework"
version = "0.1.0"
dependencies = [
"unicode-width",
"anyhow",
"crossbeam",
]
[[package]]
name = "textwrap"
version = "0.14.2"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80"
checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789"
dependencies = [
"unicode-width",
]
[[package]]
name = "thiserror"
@ -1195,6 +1308,12 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55bcbb425141152b10d5693095950b51c3745d019363fc2929ffd8f61449b628"
[[package]]
name = "uuid"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
[[package]]
name = "vec_map"
version = "0.8.2"
@ -1213,6 +1332,17 @@ version = "0.10.2+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
[[package]]
name = "which"
version = "4.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9"
dependencies = [
"either",
"lazy_static",
"libc",
]
[[package]]
name = "winapi"
version = "0.3.9"
@ -1244,6 +1374,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "xattr"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c"
dependencies = [
"libc",
]
[[package]]
name = "youki"
version = "0.0.1"
@ -1252,7 +1391,7 @@ dependencies = [
"caps",
"cgroups",
"chrono",
"clap 3.0.0-beta.4",
"clap",
"crossbeam-channel",
"dbus",
"fastrand",
@ -1261,7 +1400,7 @@ dependencies = [
"log",
"mio",
"nix",
"oci-spec",
"oci-spec 0.5.2 (git+https://github.com/containers/oci-spec-rs?rev=d6fb1e91742313cd0d0085937e2d6df5d4669720)",
"once_cell",
"path-clean",
"pentacle",

View File

@ -9,16 +9,13 @@ description = "A container runtime written in Rust"
members = [
"crates/*"
]
exclude = [
"youki_integration_test",
]
[features]
default = ["systemd_cgroups"]
systemd_cgroups = ["systemd"]
[dependencies.clap]
version = "3.0.0-beta.4"
version = "3.0.0-beta.2"
default-features = false
features = ["std", "suggestions", "derive", "cargo"]

View File

@ -26,7 +26,7 @@ libc = { version = "0.2.84", optional = true }
[dev-dependencies]
oci-spec = { git = "https://github.com/containers/oci-spec-rs", rev = "d6fb1e91742313cd0d0085937e2d6df5d4669720", features = ["proptests"] }
quickcheck = "1"
clap = "2"
clap = "3.0.0-beta.2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
env_logger = "0.9"

View File

@ -1,5 +1,5 @@
[package]
name = "youki_integration_test"
name = "integration_test"
version = "0.1.0"
edition = "2018"
@ -12,18 +12,13 @@ features = ["std", "suggestions", "derive"]
version = "=3.0.0-beta.2"
default-features = true
[workspace]
members = [
"test_framework",
]
[dependencies]
procfs = "0.11.0"
uuid = "0.8"
rand = "0.8.0"
tar = "0.4"
flate2 = "1.0"
test_framework = { path = "./test_framework"}
test_framework = { path = "../test_framework"}
anyhow = "1.0"
once_cell = "1.8.0"
oci-spec = { git = "https://github.com/containers/oci-spec-rs", rev = "3d5132a18c305be59d58187201429d8f0243b513" }

View File

@ -22,7 +22,7 @@ pub struct Create {
#[clap(long, default_value = "0")]
preserve_fds: i32,
/// name of the container instance to be started
#[clap(forbid_empty_values = true, required = true)]
#[clap(required = true)]
pub container_id: String,
}

View File

@ -6,7 +6,7 @@ use std::path::PathBuf;
/// Release any resources held by the container
#[derive(Clap, Debug)]
pub struct Delete {
#[clap(forbid_empty_values = true, required = true)]
#[clap(required = true)]
container_id: String,
/// forces deletion of the container if it is still running (using SIGKILL)
#[clap(short, long)]

View File

@ -15,7 +15,7 @@ pub struct Events {
#[clap(long)]
pub stats: bool,
/// Name of the container instance
#[clap(forbid_empty_values = true, required = true)]
#[clap(required = true)]
pub container_id: String,
}

View File

@ -31,7 +31,7 @@ pub struct Exec {
#[clap(short, long)]
pub detach: bool,
/// Identifier of the container
#[clap(forbid_empty_values = true, required = true)]
#[clap(required = true)]
pub container_id: String,
/// Command that should be executed in the container
#[clap(required = false)]

View File

@ -9,7 +9,7 @@ use crate::{commands::load_container, signal::Signal};
/// Send the specified signal to the container
#[derive(Clap, Debug)]
pub struct Kill {
#[clap(forbid_empty_values = true, required = true)]
#[clap(required = true)]
container_id: String,
signal: String,
}

View File

@ -8,7 +8,7 @@ use clap::Clap;
/// Suspend the processes within the container
#[derive(Clap, Debug)]
pub struct Pause {
#[clap(forbid_empty_values = true, required = true)]
#[clap(required = true)]
pub container_id: String,
}

View File

@ -10,7 +10,7 @@ pub struct Ps {
/// format to display processes: table or json (default: "table")
#[clap(short, long, default_value = "table")]
format: String,
#[clap(forbid_empty_values = true, required = true)]
#[clap(required = true)]
pub container_id: String,
/// options will be passed to the ps utility
#[clap(setting = clap::ArgSettings::Last)]

View File

@ -9,7 +9,7 @@ use crate::commands::load_container;
/// Resume the processes within the container
#[derive(Clap, Debug)]
pub struct Resume {
#[clap(forbid_empty_values = true, required = true)]
#[clap(required = true)]
pub container_id: String,
}

View File

@ -22,7 +22,7 @@ pub struct Run {
#[clap(long, default_value = "0")]
preserve_fds: i32,
/// name of the container instance to be started
#[clap(forbid_empty_values = true, required = true)]
#[clap(required = true)]
pub container_id: String,
}

View File

@ -10,7 +10,7 @@ use crate::commands::load_container;
/// Start a previously created container
#[derive(Clap, Debug)]
pub struct Start {
#[clap(forbid_empty_values = true, required = true)]
#[clap(required = true)]
pub container_id: String,
}

View File

@ -9,7 +9,7 @@ use crate::container::Container;
/// Show the container state
#[derive(Clap, Debug)]
pub struct State {
#[clap(forbid_empty_values = true, required = true)]
#[clap(required = true)]
pub container_id: String,
}

View File

@ -1,3 +0,0 @@
/target
youki_integration_test
*.log