-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
Signed-off-by: Yusuke Sakurai <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mod process_oom_score_adj_test; | ||
pub use process_oom_score_adj_test::get_process_oom_score_adj_test; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use crate::utils::test_inside_container; | ||
Check warning on line 1 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, musl)
Check warning on line 1 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, musl)
Check warning on line 1 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, gnu)
Check warning on line 1 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, gnu)
Check warning on line 1 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, musl)
Check warning on line 1 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, musl)
Check warning on line 1 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, gnu)
Check warning on line 1 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, gnu)
|
||
use anyhow::{Context, Ok, Result}; | ||
use oci_spec::runtime::{ProcessBuilder, Spec, SpecBuilder}; | ||
use test_framework::{test_result, Test, TestGroup, TestResult}; | ||
|
||
Check warning on line 5 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, musl)
Check warning on line 5 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, musl)
Check warning on line 5 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, gnu)
Check warning on line 5 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, gnu)
Check warning on line 5 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, musl)
Check warning on line 5 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, musl)
Check warning on line 5 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, gnu)
Check warning on line 5 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, gnu)
|
||
fn create_spec() -> Result<Spec> { | ||
let spec = SpecBuilder::default().process( | ||
ProcessBuilder::default() | ||
.args(vec![ | ||
"runtimetest".to_string(), | ||
"process_oom_score_adj".to_string(), | ||
]) | ||
.oom_score_adj(500) | ||
.build() | ||
.expect("error in creating process config"), | ||
).build().context("failed to build spec")?; | ||
|
||
Ok(spec) | ||
} | ||
|
||
fn process_oom_score_adj_test() -> TestResult { | ||
let spec = test_result!(create_spec()); | ||
test_inside_container(spec, &|_| Ok(())) | ||
} | ||
|
||
pub fn get_process_oom_score_adj_test() -> TestGroup { | ||
Check warning on line 26 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, musl)
Check warning on line 26 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, musl)
Check warning on line 26 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, gnu)
Check warning on line 26 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (x86_64, gnu)
Check warning on line 26 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, musl)
Check warning on line 26 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, musl)
Check warning on line 26 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, gnu)
Check warning on line 26 in tests/contest/contest/src/tests/process_oom_score_adj/process_oom_score_adj_test.rs GitHub Actions / check (aarch64, gnu)
|
||
let mut process_oom_score_adj_test_group = TestGroup::new("process_oom_score_adj"); | ||
|
||
let test = Test::new("process_oom_score_adj", Box::new(process_oom_score_adj_test)); | ||
process_oom_score_adj_test_group.add(vec![Box::new(test)]); | ||
|
||
process_oom_score_adj_test_group | ||
} |