pidof unitest fix

pull/15/head
prplV 2024-11-29 16:02:44 +03:00
parent 9b9b8d0b13
commit 363d38bdb6
2 changed files with 5 additions and 3 deletions

View File

@ -251,7 +251,6 @@ mod process_unittests {
}
#[tokio::test]
async fn is_active_check() {
// let _ = std::io::stdout().write_all(b"");
let res1 = start_process("tmp-prc", "./tests/examples/tmp-prc").await;
assert!(res1.is_ok());
assert!(is_active("tmp-prc").await);
@ -263,14 +262,17 @@ mod process_unittests {
}
#[tokio::test]
async fn is_frozen_check() {
// let _ = std::io::stdout().write_all(b"");
let res1 = start_process("freeze-check", "./tests/examples/freeze-check").await;
assert!(res1.is_ok());
assert!(!is_frozen("freeze-check").await);
}
#[tokio::test]
async fn pidof_active_process() {
assert!(get_pid("systemd").await.is_some());
assert!(get_pid("pidof-prc").await.is_none());
let res1 = start_process("pidof-prc", "./tests/examples/pidof-prc").await;
assert!(res1.is_ok());
assert!(get_pid("pidof-prc").await.is_some());
let _ = terminate_process("pidof-prc").await;
}
// broken mechanism need to check

BIN
tests/examples/pidof-prc Executable file

Binary file not shown.