1
0
Fork 0
mirror of https://github.com/containers/youki synced 2024-05-11 18:16:12 +02:00

Compare commits

...

11 Commits

Author SHA1 Message Date
MarceloSpessoto abdd1cf667
Merge f04e246cee into cd9bfd8d79 2024-04-27 10:01:01 +02:00
dependabot[bot] cd9bfd8d79
Bump wasmtime and wasi-common from 19.0.2 to 20.0.0 (#2771)
* Bump wasi-common from 19.0.2 to 20.0.0

Bumps [wasi-common](https://github.com/bytecodealliance/wasmtime) from 19.0.2 to 20.0.0.
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-some-possible-changes.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/compare/v19.0.2...v20.0.0)

---
updated-dependencies:
- dependency-name: wasi-common
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump wasmtime from 19.0.2 to 20.0.0

Bumps [wasmtime](https://github.com/bytecodealliance/wasmtime) from 19.0.2 to 20.0.0.
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-some-possible-changes.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/compare/v19.0.2...v20.0.0)

---
updated-dependencies:
- dependency-name: wasmtime
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
2024-04-24 05:36:17 +00:00
github-actions[bot] 6422adc681
Merge pull request #2766 from containers/dependabot/cargo/rustls-0.21.11 2024-04-22 05:17:10 +00:00
Yashodhan f8ccba1eae
Merge pull request #2769 from containers/dependabot/cargo/serial_test-3.1.0
Bump serial_test from 3.0.0 to 3.1.0
2024-04-22 10:45:06 +05:30
github-actions[bot] 6139965e61
Merge pull request #2768 from containers/dependabot/cargo/patch-0895eb5417 2024-04-22 00:55:44 +00:00
dependabot[bot] 4046ed54e1
Bump serial_test from 3.0.0 to 3.1.0
Bumps [serial_test](https://github.com/palfrey/serial_test) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/palfrey/serial_test/releases)
- [Commits](https://github.com/palfrey/serial_test/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: serial_test
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-22 00:46:24 +00:00
dependabot[bot] 1d109fe115
Bump thiserror from 1.0.58 to 1.0.59 in the patch group
Bumps the patch group with 1 update: [thiserror](https://github.com/dtolnay/thiserror).


Updates `thiserror` from 1.0.58 to 1.0.59
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.58...1.0.59)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-22 00:45:31 +00:00
dependabot[bot] d64d9b3bcd
Bump rustls from 0.21.10 to 0.21.11
Bumps [rustls](https://github.com/rustls/rustls) from 0.21.10 to 0.21.11.
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.21.10...v/0.21.11)

---
updated-dependencies:
- dependency-name: rustls
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 19:50:27 +00:00
Marcelo Mendes Spessoto Junior f04e246cee fix lint warning
Signed-off-by: Marcelo Mendes Spessoto Junior <marcelomspessoto@gmail.com>
2024-03-17 09:50:06 -03:00
Marcelo Mendes Spessoto Junior dc4993e045 use oci test cases for relative_blkio
Signed-off-by: Marcelo Mendes Spessoto Junior <marcelomspessoto@gmail.com>
2024-03-04 21:05:36 -03:00
Marcelo Mendes Spessoto Junior 95d919ea0c implement cgroup_v1_relative_blkio test
Signed-off-by: Marcelo Mendes Spessoto Junior <marcelomspessoto@gmail.com>
2024-03-03 12:30:51 -03:00
7 changed files with 685 additions and 160 deletions

299
Cargo.lock generated
View File

@ -185,7 +185,7 @@ dependencies = [
"cfg-if",
"libc",
"miniz_oxide",
"object",
"object 0.32.2",
"rustc-demangle",
]
@ -610,11 +610,11 @@ dependencies = [
[[package]]
name = "cranelift-bforest"
version = "0.106.2"
version = "0.107.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b57d4f3ffc28bbd6ef1ca7b50b20126717232f97487efe027d135d9d87eb29c"
checksum = "79b27922a6879b5b5361d0a084cb0b1941bf109a98540addcb932da13b68bed4"
dependencies = [
"cranelift-entity 0.106.2",
"cranelift-entity 0.107.0",
]
[[package]]
@ -640,17 +640,17 @@ dependencies = [
[[package]]
name = "cranelift-codegen"
version = "0.106.2"
version = "0.107.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1f7d0ac7fd53f2c29db3ff9a063f6ff5a8be2abaa8f6942aceb6e1521e70df7"
checksum = "304c455b28bf56372729acb356afbb55d622f2b0f2f7837aa5e57c138acaac4d"
dependencies = [
"bumpalo",
"cranelift-bforest 0.106.2",
"cranelift-codegen-meta 0.106.2",
"cranelift-codegen-shared 0.106.2",
"cranelift-bforest 0.107.0",
"cranelift-codegen-meta 0.107.0",
"cranelift-codegen-shared 0.107.0",
"cranelift-control",
"cranelift-entity 0.106.2",
"cranelift-isle 0.106.2",
"cranelift-entity 0.107.0",
"cranelift-isle 0.107.0",
"gimli 0.28.1",
"hashbrown 0.14.3",
"log",
@ -670,11 +670,11 @@ dependencies = [
[[package]]
name = "cranelift-codegen-meta"
version = "0.106.2"
version = "0.107.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b40bf21460a600178956cb7fd900a7408c6587fbb988a8063f7215361801a1da"
checksum = "1653c56b99591d07f67c5ca7f9f25888948af3f4b97186bff838d687d666f613"
dependencies = [
"cranelift-codegen-shared 0.106.2",
"cranelift-codegen-shared 0.107.0",
]
[[package]]
@ -685,15 +685,15 @@ checksum = "278e52e29c53fcf32431ef08406c295699a70306d05a0715c5b1bf50e33a9ab7"
[[package]]
name = "cranelift-codegen-shared"
version = "0.106.2"
version = "0.107.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d792ecc1243b7ebec4a7f77d9ed428ef27456eeb1f8c780587a6f5c38841be19"
checksum = "f5b6a9cf6b6eb820ee3f973a0db313c05dc12d370f37b4fe9630286e1672573f"
[[package]]
name = "cranelift-control"
version = "0.106.2"
version = "0.107.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cea2808043df964b73ad7582e09afbbe06a31f3fb9db834d53e74b4e16facaeb"
checksum = "d9d06e6bf30075fb6bed9e034ec046475093392eea1aff90eb5c44c4a033d19a"
dependencies = [
"arbitrary",
]
@ -720,9 +720,9 @@ checksum = "9a59bcbca89c3f1b70b93ab3cbba5e5e0cbf3e63dadb23c7525cb142e21a9d4c"
[[package]]
name = "cranelift-entity"
version = "0.106.2"
version = "0.107.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1930946836da6f514da87625cd1a0331f3908e0de454628c24a0b97b130c4d4"
checksum = "29be04f931b73cdb9694874a295027471817f26f26d2f0ebe5454153176b6e3a"
dependencies = [
"serde",
"serde_derive",
@ -742,11 +742,11 @@ dependencies = [
[[package]]
name = "cranelift-frontend"
version = "0.106.2"
version = "0.107.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5482a5fcdf98f2f31b21093643bdcfe9030866b8be6481117022e7f52baa0f2b"
checksum = "a07fd7393041d7faa2f37426f5dc7fc04003b70988810e8c063beefeff1cd8f9"
dependencies = [
"cranelift-codegen 0.106.2",
"cranelift-codegen 0.107.0",
"log",
"smallvec",
"target-lexicon",
@ -760,34 +760,34 @@ checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb"
[[package]]
name = "cranelift-isle"
version = "0.106.2"
version = "0.107.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f6e1869b6053383bdb356900e42e33555b4c9ebee05699469b7c53cdafc82ea"
checksum = "f341d7938caa6dff8149dac05bb2b53fc680323826b83b4cf175ab9f5139a3c9"
[[package]]
name = "cranelift-native"
version = "0.106.2"
version = "0.107.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a91446e8045f1c4bc164b7bba68e2419c623904580d4b730877a663c6da38964"
checksum = "82af6066e6448d26eeabb7aa26a43f7ff79f8217b06bade4ee6ef230aecc8880"
dependencies = [
"cranelift-codegen 0.106.2",
"cranelift-codegen 0.107.0",
"libc",
"target-lexicon",
]
[[package]]
name = "cranelift-wasm"
version = "0.106.2"
version = "0.107.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8b17979b862d3b0d52de6ae3294ffe4d86c36027b56ad0443a7c8c8f921d14f"
checksum = "2766fab7284a914a7f17f90ebe865c86453225fb8637ac31f123f5028fee69cd"
dependencies = [
"cranelift-codegen 0.106.2",
"cranelift-entity 0.106.2",
"cranelift-frontend 0.106.2",
"cranelift-codegen 0.107.0",
"cranelift-entity 0.107.0",
"cranelift-frontend 0.107.0",
"itertools",
"log",
"smallvec",
"wasmparser 0.201.0",
"wasmparser 0.202.0",
"wasmtime-types",
]
@ -2351,6 +2351,15 @@ name = "object"
version = "0.32.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
dependencies = [
"memchr",
]
[[package]]
name = "object"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8dd6c0cdf9429bce006e1362bfce61fa1bfd8c898a643ed8d2b471934701d3d"
dependencies = [
"crc32fast",
"hashbrown 0.14.3",
@ -3178,9 +3187,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.21.10"
version = "0.21.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba"
checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4"
dependencies = [
"log",
"ring",
@ -3237,6 +3246,15 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "scc"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec96560eea317a9cc4e0bb1f6a2c93c09a19b8c4fc5cb3fcc0ec1c094cd783e2"
dependencies = [
"sdd",
]
[[package]]
name = "schannel"
version = "0.1.23"
@ -3268,6 +3286,12 @@ dependencies = [
"untrusted",
]
[[package]]
name = "sdd"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b84345e4c9bd703274a082fb80caaa99b7612be48dfaa1dd9266577ec412309d"
[[package]]
name = "seahash"
version = "4.1.0"
@ -3421,23 +3445,23 @@ dependencies = [
[[package]]
name = "serial_test"
version = "3.0.0"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "953ad9342b3aaca7cb43c45c097dd008d4907070394bd0751a0aa8817e5a018d"
checksum = "adb86f9315df5df6a70eae0cc22395a44e544a0d8897586820770a35ede74449"
dependencies = [
"dashmap",
"futures",
"lazy_static",
"log",
"once_cell",
"parking_lot",
"scc",
"serial_test_derive",
]
[[package]]
name = "serial_test_derive"
version = "3.0.0"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212"
checksum = "a9bb72430492e9549b0c4596725c0f82729bff861c45aa8099c0a8e67fc3b721"
dependencies = [
"proc-macro2",
"quote",
@ -3813,18 +3837,18 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.58"
version = "1.0.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297"
checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.58"
version = "1.0.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66"
dependencies = [
"proc-macro2",
"quote",
@ -4450,9 +4474,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasi-common"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce39d43366511a954708a80e9e2e1245bf2fed4e37385cc49f8686d7a9c094dc"
checksum = "63255d85e10627b07325d7cf4e5fe5a40fa4ff183569a0a67931be26d50ede07"
dependencies = [
"anyhow",
"bitflags 2.5.0",
@ -4563,15 +4587,6 @@ version = "0.2.84"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d"
[[package]]
name = "wasm-encoder"
version = "0.201.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9c7d2731df60006819b013f64ccc2019691deccf6e11a1804bc850cd6748f1a"
dependencies = [
"leb128",
]
[[package]]
name = "wasm-encoder"
version = "0.202.0"
@ -4884,9 +4899,9 @@ dependencies = [
[[package]]
name = "wasmparser"
version = "0.201.0"
version = "0.202.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84e5df6dba6c0d7fafc63a450f1738451ed7a0b52295d83e868218fa286bf708"
checksum = "d6998515d3cf3f8b980ef7c11b29a9b1017d4cf86b99ae93b546992df9931413"
dependencies = [
"bitflags 2.5.0",
"indexmap 2.2.6",
@ -4895,19 +4910,19 @@ dependencies = [
[[package]]
name = "wasmprinter"
version = "0.201.0"
version = "0.202.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a67e66da702706ba08729a78e3c0079085f6bfcb1a62e4799e97bbf728c2c265"
checksum = "ab1cc9508685eef9502e787f4d4123745f5651a1e29aec047645d3cac1e2da7a"
dependencies = [
"anyhow",
"wasmparser 0.201.0",
"wasmparser 0.202.0",
]
[[package]]
name = "wasmtime"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e300c0e3f19dc9064e3b17ce661088646c70dbdde36aab46470ed68ba58db7d"
checksum = "5a5990663c28d81015ddbb02a068ac1bf396a4ea296eba7125b2dfc7c00cb52e"
dependencies = [
"addr2line",
"anyhow",
@ -4922,7 +4937,7 @@ dependencies = [
"ittapi",
"libc",
"log",
"object",
"object 0.33.0",
"once_cell",
"paste",
"rayon",
@ -4932,8 +4947,8 @@ dependencies = [
"serde_derive",
"serde_json",
"target-lexicon",
"wasm-encoder 0.201.0",
"wasmparser 0.201.0",
"wasm-encoder",
"wasmparser 0.202.0",
"wasmtime-cache",
"wasmtime-component-macro",
"wasmtime-component-util",
@ -4951,18 +4966,18 @@ dependencies = [
[[package]]
name = "wasmtime-asm-macros"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "110aa598e02a136fb095ca70fa96367fc16bab55256a131e66f9b58f16c73daf"
checksum = "625ee94c72004f3ea0228989c9506596e469517d7d0ed66f7300d1067bdf1ca9"
dependencies = [
"cfg-if",
]
[[package]]
name = "wasmtime-cache"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4e660537b0ac2fc76917fb0cc9d403d2448b6983a84e59c51f7fea7b7dae024"
checksum = "98534bf28de232299e83eab33984a7a6c40c69534d6bd0ea216150b63d41a83a"
dependencies = [
"anyhow",
"base64",
@ -4980,9 +4995,9 @@ dependencies = [
[[package]]
name = "wasmtime-component-macro"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "091f32ce586251ac4d07019388fb665b010d9518ffe47be1ddbabb162eed6007"
checksum = "64f84414a25ee3a624c8b77550f3fe7b5d8145bd3405ca58886ee6900abb6dc2"
dependencies = [
"anyhow",
"proc-macro2",
@ -4995,72 +5010,55 @@ dependencies = [
[[package]]
name = "wasmtime-component-util"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0dd17dc1ebc0b28fd24b6b9d07638f55b82ae908918ff08fd221f8b0fefa9125"
checksum = "78580bdb4e04c7da3bf98088559ca1d29382668536e4d5c7f2f966d79c390307"
[[package]]
name = "wasmtime-cranelift"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e923262451a4b5b39fe02f69f1338d56356db470e289ea1887346b9c7f592738"
checksum = "b60df0ee08c6a536c765f69e9e8205273435b66d02dd401e938769a2622a6c1a"
dependencies = [
"anyhow",
"cfg-if",
"cranelift-codegen 0.106.2",
"cranelift-codegen 0.107.0",
"cranelift-control",
"cranelift-entity 0.106.2",
"cranelift-frontend 0.106.2",
"cranelift-entity 0.107.0",
"cranelift-frontend 0.107.0",
"cranelift-native",
"cranelift-wasm",
"gimli 0.28.1",
"log",
"object",
"object 0.33.0",
"target-lexicon",
"thiserror",
"wasmparser 0.201.0",
"wasmtime-cranelift-shared",
"wasmparser 0.202.0",
"wasmtime-environ",
"wasmtime-versioned-export-macros",
]
[[package]]
name = "wasmtime-cranelift-shared"
version = "19.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "508898cbbea0df81a5d29cfc1c7c72431a1bc4c9e89fd9514b4c868474c05c7a"
dependencies = [
"anyhow",
"cranelift-codegen 0.106.2",
"cranelift-control",
"cranelift-native",
"gimli 0.28.1",
"object",
"target-lexicon",
"wasmtime-environ",
]
[[package]]
name = "wasmtime-environ"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7e3f2aa72dbb64c19708646e1ff97650f34e254598b82bad5578ea9c80edd30"
checksum = "64ffc1613db69ee47c96738861534f9a405e422a5aa00224fbf5d410b03fb445"
dependencies = [
"anyhow",
"bincode",
"cpp_demangle",
"cranelift-entity 0.106.2",
"cranelift-entity 0.107.0",
"gimli 0.28.1",
"indexmap 2.2.6",
"log",
"object",
"object 0.33.0",
"rustc-demangle",
"serde",
"serde_derive",
"target-lexicon",
"thiserror",
"wasm-encoder 0.201.0",
"wasmparser 0.201.0",
"wasm-encoder",
"wasmparser 0.202.0",
"wasmprinter",
"wasmtime-component-util",
"wasmtime-types",
@ -5068,9 +5066,9 @@ dependencies = [
[[package]]
name = "wasmtime-fiber"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9235b643527bcbac808216ed342e1fba324c95f14a62762acfa6f2e6ca5edbd6"
checksum = "f043514a23792761c5765f8ba61a4aa7d67f260c0c37494caabceb41d8ae81de"
dependencies = [
"anyhow",
"cc",
@ -5083,11 +5081,11 @@ dependencies = [
[[package]]
name = "wasmtime-jit-debug"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92de34217bf7f0464262adf391a9950eba440f9dfc7d3b0e3209302875c6f65f"
checksum = "9c0ca2ad8f5d2b37f507ef1c935687a690e84e9f325f5a2af9639440b43c1f0e"
dependencies = [
"object",
"object 0.33.0",
"once_cell",
"rustix",
"wasmtime-versioned-export-macros",
@ -5095,9 +5093,9 @@ dependencies = [
[[package]]
name = "wasmtime-jit-icache-coherence"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c22ca2ef4d87b23d400660373453e274b2251bc2d674e3102497f690135e04b0"
checksum = "7a9f93a3289057b26dc75eb84d6e60d7694f7d169c7c09597495de6e016a13ff"
dependencies = [
"cfg-if",
"libc",
@ -5106,9 +5104,9 @@ dependencies = [
[[package]]
name = "wasmtime-runtime"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1806ee242ca4fd183309b7406e4e83ae7739b7569f395d56700de7c7ef9f5eb8"
checksum = "c6332a2b0af4224c3ea57c857ad39acd2780ccc2b0c99ba1baa01864d90d7c94"
dependencies = [
"anyhow",
"cc",
@ -5117,47 +5115,47 @@ dependencies = [
"indexmap 2.2.6",
"libc",
"log",
"mach",
"mach2",
"memfd",
"memoffset 0.9.1",
"paste",
"psm",
"rustix",
"sptr",
"wasm-encoder 0.201.0",
"wasm-encoder",
"wasmtime-asm-macros",
"wasmtime-environ",
"wasmtime-fiber",
"wasmtime-jit-debug",
"wasmtime-slab",
"wasmtime-versioned-export-macros",
"wasmtime-wmemcheck",
"windows-sys 0.52.0",
]
[[package]]
name = "wasmtime-slab"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20c58bef9ce877fd06acb58f08d003af17cb05cc51225b455e999fbad8e584c0"
checksum = "8b3655075824a374c536a2b2cc9283bb765fcdf3d58b58587862c48571ad81ef"
[[package]]
name = "wasmtime-types"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cebe297aa063136d9d2e5b347c1528868aa43c2c8d0e1eb0eec144567e38fe0f"
checksum = "b98cf64a242b0b9257604181ca28b28a5fcaa4c9ea1d396f76d1d2d1c5b40eef"
dependencies = [
"cranelift-entity 0.106.2",
"cranelift-entity 0.107.0",
"serde",
"serde_derive",
"thiserror",
"wasmparser 0.201.0",
"wasmparser 0.202.0",
]
[[package]]
name = "wasmtime-versioned-export-macros"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffaafa5c12355b1a9ee068e9295d50c4ca0a400c721950cdae4f5b54391a2da5"
checksum = "8561d9e2920db2a175213d557d71c2ac7695831ab472bbfafb9060cd1034684f"
dependencies = [
"proc-macro2",
"quote",
@ -5166,26 +5164,26 @@ dependencies = [
[[package]]
name = "wasmtime-winch"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d618b4e90d3f259b1b77411ce573c9f74aade561957102132e169918aabdc863"
checksum = "a06b573d14ac846a0fb8c541d8fca6a64acf9a1d176176982472274ab1d2fa5d"
dependencies = [
"anyhow",
"cranelift-codegen 0.106.2",
"cranelift-codegen 0.107.0",
"gimli 0.28.1",
"object",
"object 0.33.0",
"target-lexicon",
"wasmparser 0.201.0",
"wasmtime-cranelift-shared",
"wasmparser 0.202.0",
"wasmtime-cranelift",
"wasmtime-environ",
"winch-codegen",
]
[[package]]
name = "wasmtime-wit-bindgen"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c7a253c8505edd7493603e548bff3af937b0b7dbf2b498bd5ff2131b651af72"
checksum = "595bc7bb3b0ff4aa00fab718c323ea552c3034d77abc821a35112552f2ea487a"
dependencies = [
"anyhow",
"heck 0.4.1",
@ -5193,12 +5191,6 @@ dependencies = [
"wit-parser",
]
[[package]]
name = "wasmtime-wmemcheck"
version = "19.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9a8c62e9df8322b2166d2a6f096fbec195ddb093748fd74170dcf25ef596769"
[[package]]
name = "wast"
version = "35.0.2"
@ -5218,7 +5210,7 @@ dependencies = [
"leb128",
"memchr",
"unicode-width",
"wasm-encoder 0.202.0",
"wasm-encoder",
]
[[package]]
@ -5310,9 +5302,9 @@ dependencies = [
[[package]]
name = "wiggle"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "899d3fe5fbacd02f114cacdaa1cca9040280c4153c71833a77b9609c60ccf72b"
checksum = "1b6552dda951239e219c329e5a768393664e8d120c5e0818487ac2633f173b1f"
dependencies = [
"anyhow",
"async-trait",
@ -5325,9 +5317,9 @@ dependencies = [
[[package]]
name = "wiggle-generate"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2df5887f452cff44ffe1e1aba69b7fafe812deed38498446fa7a46b55e962cd5"
checksum = "da64cb31e0bfe8b1d2d13956ef9fd5c77545756a1a6ef0e6cfd44e8f1f207aed"
dependencies = [
"anyhow",
"heck 0.4.1",
@ -5340,9 +5332,9 @@ dependencies = [
[[package]]
name = "wiggle-macro"
version = "19.0.2"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acdb12de36507498abaa3a042f895a43ee00a2f6125b6901b9a27edf72bfdbe7"
checksum = "900b2416ef2ff2903ded6cf55d4a941fed601bf56a8c4874856d7a77c1891994"
dependencies = [
"proc-macro2",
"quote",
@ -5383,17 +5375,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "winch-codegen"
version = "0.17.2"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d15869abc9e3bb29c017c003dbe007a08e9910e8ff9023a962aa13c1b2ee6af"
checksum = "fb23450977f9d4a23c02439cf6899340b2d68887b19465c5682740d9cc37d52e"
dependencies = [
"anyhow",
"cranelift-codegen 0.106.2",
"cranelift-codegen 0.107.0",
"gimli 0.28.1",
"regalloc2 0.9.3",
"smallvec",
"target-lexicon",
"wasmparser 0.201.0",
"wasmparser 0.202.0",
"wasmtime-cranelift",
"wasmtime-environ",
]
@ -5627,9 +5620,9 @@ dependencies = [
[[package]]
name = "wit-parser"
version = "0.201.0"
version = "0.202.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "196d3ecfc4b759a8573bf86a9b3f8996b304b3732e4c7de81655f875f6efdca6"
checksum = "744237b488352f4f27bca05a10acb79474415951c450e52ebd0da784c1df2bcc"
dependencies = [
"anyhow",
"id-arena",
@ -5640,7 +5633,7 @@ dependencies = [
"serde_derive",
"serde_json",
"unicode-xid",
"wasmparser 0.201.0",
"wasmparser 0.202.0",
]
[[package]]

View File

@ -29,7 +29,7 @@ rbpf = { version = "0.2.0", optional = true }
libbpf-sys = { version = "1.4.0", optional = true }
errno = { version = "0.3.8", optional = true }
libc = { version = "0.2.153", optional = true }
thiserror = "1.0.58"
thiserror = "1.0.59"
tracing = { version = "0.1.40", features = ["attributes"] }
[dev-dependencies]
@ -41,5 +41,5 @@ clap = "4.1.6"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
env_logger = "0.11"
serial_test = "3.0.0"
serial_test = "3.1.0"
tempfile = "3"

View File

@ -50,7 +50,7 @@ serde_json = "1.0"
rust-criu = "0.4.0"
protobuf = "= 3.2.0" # https://github.com/checkpoint-restore/rust-criu/issues/19
regex = "1.10.4"
thiserror = "1.0.58"
thiserror = "1.0.59"
tracing = { version = "0.1.40", features = ["attributes"] }
safe-path = "0.1.0"
nc = "0.8.20"
@ -58,7 +58,7 @@ nc = "0.8.20"
[dev-dependencies]
oci-spec = { version = "~0.6.4", features = ["proptests", "runtime"] }
quickcheck = "1"
serial_test = "3.0.0"
serial_test = "3.1.0"
tempfile = "3"
anyhow = "1.0"
rand = { version = "0.8.5" }

View File

@ -44,14 +44,14 @@ caps = "0.5.5"
wasmer = { version = "4.0.0", optional = true }
wasmer-wasix = { version = "0.9.0", optional = true }
wasmedge-sdk = { version = "0.13.2", optional = true }
wasmtime = { version = "19.0.2", optional = true }
wasi-common = { version = "19.0.2", optional = true }
wasmtime = { version = "20.0.0", optional = true }
wasi-common = { version = "20.0.0", optional = true }
tracing = { version = "0.1.40", features = ["attributes"] }
tracing-subscriber = { version = "0.3.18", features = ["json", "env-filter"] }
tracing-journald = "0.3.0"
[dev-dependencies]
serial_test = "3.0.0"
serial_test = "3.1.0"
tempfile = "3"
scopeguard = "1.2.0"

View File

@ -99,6 +99,7 @@ fn main() -> Result<()> {
let cgroup_v1_memory = cgroups::memory::get_test_group();
let cgroup_v1_network = cgroups::network::get_test_group();
let cgroup_v1_blkio = cgroups::blkio::get_test_group();
let cgroup_v1_relative_blkio = cgroups::relative_blkio::get_test_group();
let seccomp = get_seccomp_test();
let seccomp_notify = get_seccomp_notify_test();
let ro_paths = get_ro_paths_test();
@ -122,6 +123,7 @@ fn main() -> Result<()> {
tm.add_test_group(Box::new(cgroup_v1_memory));
tm.add_test_group(Box::new(cgroup_v1_network));
tm.add_test_group(Box::new(cgroup_v1_blkio));
tm.add_test_group(Box::new(cgroup_v1_relative_blkio));
tm.add_test_group(Box::new(seccomp));
tm.add_test_group(Box::new(seccomp_notify));
tm.add_test_group(Box::new(ro_paths));

View File

@ -8,6 +8,7 @@ pub mod cpu;
pub mod memory;
pub mod network;
pub mod pids;
pub mod relative_blkio;
pub fn cleanup_v1() -> Result<()> {
for subsystem in list_subsystem_mount_points()? {

View File

@ -0,0 +1,529 @@
use std::{
fs,
path::{Path, PathBuf},
};
use anyhow::{bail, Context, Result};
use oci_spec::runtime::{
LinuxBlockIo, LinuxBlockIoBuilder, LinuxBuilder, LinuxResourcesBuilder,
LinuxThrottleDeviceBuilder, LinuxWeightDeviceBuilder, Spec, SpecBuilder,
};
use test_framework::{test_result, ConditionalTest, TestGroup, TestResult};
use crate::utils::{
test_outside_container,
test_utils::{check_container_created, CGROUP_ROOT},
};
#[derive(Debug, Default)]
struct WeightDevice {
major: i64,
minor: i64,
weight: Option<u16>,
leaf_weight: Option<u16>,
}
#[derive(Debug, Default)]
struct ThrottleDevice {
major: i64,
minor: i64,
rate: u64,
}
#[derive(Debug, Default)]
struct BlockIO {
weight: u16,
leaf_weight: u16,
weight_devices: Vec<WeightDevice>,
throttle_read_bps_devices: Vec<ThrottleDevice>,
throttle_write_bps_devices: Vec<ThrottleDevice>,
throttle_read_iops_devices: Vec<ThrottleDevice>,
throttle_write_iops_devices: Vec<ThrottleDevice>,
}
fn can_run() -> bool {
Path::new("/sys/fs/cgroup/blkio").exists()
}
fn supports_weight() -> bool {
Path::new("/sys/fs/cgroup/blkio/blkio.weight").exists()
}
fn supports_weight_devices() -> bool {
Path::new("/sys/fs/cgroup/blkio/blkio.weight_devices").exists()
}
fn supports_throttle_bps() -> bool {
Path::new("/sys/fs/cgroup/blkio/blkio.throttle.read_bps_device").exists()
}
fn supports_throttle_iops() -> bool {
Path::new("/sys/fs/cgroup/blkio/blkio.throttle.read_iops_device").exists()
}
fn parse_device_data<'a>(device_type: &'static str, line: &'a str) -> Result<(i64, i64, &'a str)> {
let (device_id, value) = line
.split_once(' ')
.with_context(|| format!("invalid {device_type} device format : found {line}"))?;
let (major_str, minor_str) = device_id.split_once(':').with_context(|| {
format!("invalid major-minor number format for {device_type} device : found {device_id}")
})?;
let major: i64 = major_str.parse().with_context(|| {
format!("Error in parsing {device_type} device major number : found {major_str}")
})?;
let minor: i64 = minor_str.parse().with_context(|| {
format!("Error in parsing {device_type} device minor number : found {minor_str}")
})?;
Ok((major, minor, value))
}
fn create_spec(cgroup_name: &str, block_io: LinuxBlockIo) -> Result<Spec> {
let spec = SpecBuilder::default()
.linux(
LinuxBuilder::default()
.cgroups_path(Path::new("testdir/runtime-test/container").join(cgroup_name))
.resources(
LinuxResourcesBuilder::default()
.block_io(block_io)
.build()
.context("failed to build resource spec")?,
)
.build()
.context("failed to build linux spec")?,
)
.build()
.context("failed to build spec")?;
Ok(spec)
}
fn get_blkio_data(path: &Path) -> Result<BlockIO> {
let mut device = BlockIO::default();
if supports_weight() {
let weight_path = path.join("blkio.weight");
let weight_string = fs::read_to_string(&weight_path)
.with_context(|| format!("error in reading block io weight from {weight_path:?}"))?;
device.weight = weight_string
.parse()
.with_context(|| format!("error in parsing block io weight : found {weight_string}"))?;
let leaf_weight_path = path.join("blkio.leaf_weight");
let leaf_weight_string = fs::read_to_string(&leaf_weight_path).with_context(|| {
format!("error in reading block io leaf weight from {leaf_weight_path:?}")
})?;
device.leaf_weight = leaf_weight_string.parse().with_context(|| {
format!("error in parsing block io weight : found {leaf_weight_string}")
})?;
}
if supports_weight_devices() {
let device_weight_path = path.join("blkio.weight_device");
let device_weight_string = fs::read_to_string(&device_weight_path).with_context(|| {
format!("error in reading block io weight device from {device_weight_path:?}")
})?;
let mut weight_devices = Vec::new();
for line in device_weight_string.lines() {
let (major, minor, weight_str) = parse_device_data("weight", line)?;
weight_devices.push(WeightDevice {
major,
minor,
weight: Some(weight_str.parse().with_context(|| {
format!("error in parsing weight of weight device, found {weight_str}")
})?),
leaf_weight: None,
});
}
let device_leaf_weight_path = path.join("blkio.leaf_weight_device");
let device_leaf_weight_string =
fs::read_to_string(&device_leaf_weight_path).with_context(|| {
format!(
"error in reading block io leaf weight device from {device_leaf_weight_path:?}"
)
})?;
for line in device_leaf_weight_string.lines() {
let (major, minor, weight_str) = parse_device_data("weight", line)?;
let leaf_weight: u16 = weight_str.parse().with_context(|| {
format!("error in parsing leaf weight of weight device : found {weight_str}")
})?;
let mut found = false;
for dev in &mut weight_devices {
if dev.major == major && dev.minor == minor {
dev.leaf_weight = Some(leaf_weight);
found = true;
}
}
if !found {
weight_devices.push(WeightDevice {
major,
minor,
weight: None,
leaf_weight: Some(leaf_weight),
});
}
}
device.weight_devices = weight_devices;
}
if supports_throttle_bps() {
let throttle_read_bps_path = path.join("blkio.throttle.read_bps_device");
let throttle_read_bps_string =
fs::read_to_string(&throttle_read_bps_path).with_context(|| {
format!(
"error in reading block io read bps device from {throttle_read_bps_path:?}"
)
})?;
let mut throttle_devices = Vec::new();
for line in throttle_read_bps_string.lines() {
let (major, minor, rate_str) = parse_device_data("throttle read bps", line)?;
throttle_devices.push(ThrottleDevice {
major,
minor,
rate: rate_str.parse().with_context(|| {
format!("error in parsing throttle read bps rate : found {rate_str}")
})?,
});
}
device.throttle_read_bps_devices = throttle_devices;
let throttle_write_bps_path = path.join("blkio.throttle.write_bps_device");
let throttle_write_bps_string =
fs::read_to_string(&throttle_write_bps_path).with_context(|| {
format!(
"error in reading block io write bps device from {throttle_write_bps_path:?}"
)
})?;
let mut throttle_devices = Vec::new();
for line in throttle_write_bps_string.lines() {
let (major, minor, rate_str) = parse_device_data("throttle write bps", line)?;
throttle_devices.push(ThrottleDevice {
major,
minor,
rate: rate_str.parse().with_context(|| {
format!("error in parsing throttle write bps rate : found {rate_str}")
})?,
});
}
device.throttle_write_bps_devices = throttle_devices;
}
if supports_throttle_iops() {
let throttle_read_iops_path = path.join("blkio.throttle.read_iops_device");
let throttle_read_iops_string =
fs::read_to_string(&throttle_read_iops_path).with_context(|| {
format!(
"error in reading block io read iops device from {throttle_read_iops_path:?}"
)
})?;
let mut throttle_devices = Vec::new();
for line in throttle_read_iops_string.lines() {
let (major, minor, rate_str) = parse_device_data("throttle read iops", line)?;
throttle_devices.push(ThrottleDevice {
major,
minor,
rate: rate_str.parse().with_context(|| {
format!("error in parsing throttle read iops rate : found {rate_str}")
})?,
});
}
device.throttle_read_iops_devices = throttle_devices;
let throttle_write_iops_path = path.join("blkio.throttle.write_iops_device");
let throttle_write_iops_string = fs::read_to_string(&throttle_write_iops_path)
.with_context(|| {
format!(
"error in reading block io write iops device from {throttle_write_iops_path:?}"
)
})?;
let mut throttle_devices = Vec::new();
for line in throttle_write_iops_string.lines() {
let (major, minor, rate_str) = parse_device_data("throttle write iop", line)?;
throttle_devices.push(ThrottleDevice {
major,
minor,
rate: rate_str.parse().with_context(|| {
format!("error in parsing throttle write iops rate : found {rate_str}")
})?,
});
}
device.throttle_write_iops_devices = throttle_devices;
}
Ok(device)
}
fn validate_block_io(cgroup_name: &str, spec: &Spec) -> Result<()> {
let cgroup_path = PathBuf::from(CGROUP_ROOT)
.join("blkio/runtime-test")
.join(cgroup_name);
let block_io = get_blkio_data(&cgroup_path)?;
let resources = spec.linux().as_ref().unwrap().resources().as_ref().unwrap();
let spec_block_io = resources.block_io().as_ref().unwrap();
if supports_weight() {
if spec_block_io.weight().is_none() {
bail!("spec block io weight is none");
}
if spec_block_io.weight().unwrap() != block_io.weight {
bail!(
"block io weight is set incorrectly, expected {}, actual {}",
spec_block_io.weight().unwrap(),
block_io.weight,
);
}
if spec_block_io.leaf_weight().is_none() {
bail!("spec block io leaf weight is none");
}
if spec_block_io.leaf_weight().unwrap() != block_io.leaf_weight {
bail!(
"block io leaf weight is set incorrectly, expected {}, actual {}",
spec_block_io.leaf_weight().unwrap(),
block_io.leaf_weight,
);
}
}
if supports_weight_devices() {
for spec_device in spec_block_io.weight_device().as_ref().unwrap() {
let spec_major = spec_device.major();
let spec_minor = spec_device.minor();
let mut found = false;
for device in &block_io.weight_devices {
if device.major == spec_major && device.minor == spec_minor {
found = true;
if device.weight != spec_device.weight() {
bail!(
"blkio weight is set incorrectly for device {}:{}, expected {:?}, found {:?}",
spec_major,
spec_minor,
spec_device.weight(),
device.weight
);
}
if device.leaf_weight != spec_device.leaf_weight() {
bail!(
"blkio leaf weight is set incorrectly for device {}:{}, expected {:?}, found {:?}",
spec_major,
spec_minor,
spec_device.leaf_weight(),
device.leaf_weight
);
}
break;
}
}
if !found {
bail!(
"blkio weight device {}:{} not found, exists in spec",
spec_major,
spec_minor
);
}
}
}
if supports_throttle_bps() {
for spec_device in spec_block_io.throttle_read_bps_device().as_ref().unwrap() {
let spec_major = spec_device.major();
let spec_minor = spec_device.minor();
let mut found = false;
for device in &block_io.throttle_read_bps_devices {
if device.major == spec_major && device.minor == spec_minor {
found = true;
if device.rate != spec_device.rate() {
bail!(
"blkio throttle read bps rate is set incorrectly for device {}:{}, expected {}, found {}",
spec_major,
spec_minor,
spec_device.rate(),
device.rate
);
}
break;
}
}
if !found {
bail!(
"blkio throttle read bps device {}:{} not found, exists in spec",
spec_major,
spec_minor
);
}
}
for spec_device in spec_block_io.throttle_write_bps_device().as_ref().unwrap() {
let spec_major = spec_device.major();
let spec_minor = spec_device.minor();
let mut found = false;
for device in &block_io.throttle_write_bps_devices {
if device.major == spec_major && device.minor == spec_minor {
found = true;
if device.rate != spec_device.rate() {
bail!(
"blkio throttle write bps rate is set incorrectly for device {}:{}, expected {}, found {}",
spec_major,
spec_minor,
spec_device.rate(),
device.rate
);
}
break;
}
}
if !found {
bail!(
"blkio throttle write bps device {}:{} not found, exists in spec",
spec_major,
spec_minor
);
}
}
}
if supports_throttle_iops() {
for spec_device in spec_block_io.throttle_read_iops_device().as_ref().unwrap() {
let spec_major = spec_device.major();
let spec_minor = spec_device.minor();
let mut found = false;
for device in &block_io.throttle_read_iops_devices {
if device.major == spec_major && device.minor == spec_minor {
found = true;
if device.rate != spec_device.rate() {
bail!(
"blkio throttle read iops rate is set incorrectly for device {}:{}, expected {}, found {}",
spec_major,
spec_minor,
spec_device.rate(),
device.rate
);
}
break;
}
}
if !found {
bail!(
"blkio throttle read iops device {}:{} not found, exists in spec",
spec_major,
spec_minor
);
}
}
for spec_device in spec_block_io.throttle_write_iops_device().as_ref().unwrap() {
let spec_major = spec_device.major();
let spec_minor = spec_device.minor();
let mut found = false;
for device in &block_io.throttle_write_iops_devices {
if device.major == spec_major && device.minor == spec_minor {
found = true;
if device.rate != spec_device.rate() {
bail!(
"blkio throttle write iops rate is set incorrectly for device {}:{}, expected {}, found {}",
spec_major,
spec_minor,
spec_device.rate(),
device.rate
);
}
break;
}
}
if !found {
bail!(
"blkio throttle write iops device {}:{} not found, exists in spec",
spec_major,
spec_minor
);
}
}
}
Ok(())
}
fn test_relative_blkio(test_name: &str, rate: u64, empty: bool) -> TestResult {
let weight: u16 = 500;
let leaf_weight: u16 = 300;
let major: i64 = 8;
let minor: i64 = 0;
let mut block_io_builder = LinuxBlockIoBuilder::default();
if !empty && supports_weight() {
block_io_builder = block_io_builder.weight(weight).leaf_weight(leaf_weight)
}
if supports_weight_devices() {
block_io_builder = block_io_builder.weight_device(vec![
LinuxWeightDeviceBuilder::default()
.major(major)
.minor(minor)
.weight(weight)
.build()
.unwrap(),
LinuxWeightDeviceBuilder::default()
.major(major)
.minor(minor)
.leaf_weight(leaf_weight)
.build()
.unwrap(),
])
}
if supports_throttle_bps() {
block_io_builder = block_io_builder
.throttle_read_bps_device(vec![LinuxThrottleDeviceBuilder::default()
.major(major)
.minor(minor)
.rate(rate)
.build()
.unwrap()])
.throttle_write_bps_device(vec![LinuxThrottleDeviceBuilder::default()
.major(major)
.minor(minor)
.rate(rate)
.build()
.unwrap()])
}
if supports_throttle_iops() {
block_io_builder = block_io_builder
.throttle_read_iops_device(vec![LinuxThrottleDeviceBuilder::default()
.major(major)
.minor(minor)
.rate(rate)
.build()
.unwrap()])
.throttle_write_iops_device(vec![LinuxThrottleDeviceBuilder::default()
.major(major)
.minor(minor)
.rate(rate)
.build()
.unwrap()]);
}
let spec = create_spec(
test_name,
block_io_builder
.build()
.context("failed to build block io spec")
.unwrap(),
)
.unwrap();
test_outside_container(spec.clone(), &|data| {
test_result!(check_container_created(&data));
test_result!(validate_block_io(test_name, &spec));
TestResult::Passed
})
}
pub fn get_test_group() -> TestGroup {
let mut test_group = TestGroup::new("cgroup_v1_relative_blkio");
let non_empty_100kb = ConditionalTest::new(
"non_empty_100kb",
Box::new(can_run),
Box::new(|| test_relative_blkio("non_empty_100kb", 102400, false)),
);
test_group.add(vec![Box::new(non_empty_100kb)]);
test_group
}