mirror of
https://github.com/containers/youki
synced 2024-11-27 11:53:41 +01:00
add a unit test for the failed case of fork. (#402)
This commit is contained in:
parent
f98d415fc5
commit
017febada0
@ -41,4 +41,17 @@ mod test {
|
||||
_ => bail!("test failed"),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_container_err_fork() -> Result<()> {
|
||||
let pid = container_fork(|| bail!(""))?;
|
||||
match waitpid(pid, None).expect("wait pid failed.") {
|
||||
WaitStatus::Exited(p, status) => {
|
||||
assert_eq!(pid, p);
|
||||
assert_eq!(status, 255);
|
||||
Ok(())
|
||||
}
|
||||
_ => bail!("test failed"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user