1
0
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:
utam0k 2021-10-22 09:19:15 +09:00 committed by GitHub
parent f98d415fc5
commit 017febada0
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

@ -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"),
}
}
}