Compare commits
3 Commits
f4217cf8ad
...
1884469c9e
| Author | SHA1 | Date |
|---|---|---|
|
|
1884469c9e | |
|
|
406b199b09 | |
|
|
150bb87a41 |
|
|
@ -159,22 +159,22 @@ mod files_unittests {
|
|||
use super::*;
|
||||
#[tokio::test]
|
||||
async fn try_to_create_watcher() {
|
||||
let res = create_watcher("dep-file", "/home/user/monitor/runner-rs/tests/examples/").await;
|
||||
let res = create_watcher("dep-file", "./tests/examples/").await;
|
||||
assert!(res.is_ok());
|
||||
}
|
||||
#[tokio::test]
|
||||
async fn try_to_create_invalid_watcher() {
|
||||
let res = create_watcher("invalid-file", "/path/to/the/hell").await;
|
||||
let res = create_watcher("invalid-file", "/path/to/the/no/dir").await;
|
||||
assert!(res.is_err());
|
||||
}
|
||||
#[tokio::test]
|
||||
async fn check_existing_file() {
|
||||
let res = check_file("dep-file", "/home/user/monitor/runner-rs/tests/examples/").await;
|
||||
let res = check_file("dep-file", "./tests/examples/").await;
|
||||
assert!(res.is_ok());
|
||||
}
|
||||
#[tokio::test]
|
||||
async fn check_non_existing_file() {
|
||||
let res = check_file("invalid-file", "/path/to/the/hell").await;
|
||||
let res = check_file("invalid-file", "/path/to/the/no/dir").await;
|
||||
assert!(res.is_err());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,10 +233,10 @@ mod process_unittests {
|
|||
// rewrite, its a pipe
|
||||
#[tokio::test]
|
||||
async fn full_cycle_with_restart() {
|
||||
let res1 = start_process("temp-process", "/home/user/monitor/runner-rs/temp-process").await;
|
||||
let res1 = start_process("temp-process", "./temp-process").await;
|
||||
assert!(res1.is_ok());
|
||||
let res2 =
|
||||
restart_process("temp-process", "/home/user/monitor/runner-rs/temp-process").await;
|
||||
restart_process("temp-process", "./temp-process").await;
|
||||
assert!(res2.is_ok());
|
||||
let _ = terminate_process("temp-process").await;
|
||||
let res3 = is_active("temp-process").await;
|
||||
|
|
@ -249,7 +249,10 @@ mod process_unittests {
|
|||
}
|
||||
#[tokio::test]
|
||||
async fn is_active_check() {
|
||||
assert!(is_active("systemd").await);
|
||||
let res1 = start_process("tmp-prc", "./tests/examples/tmp-prc").await;
|
||||
assert!(res1.is_ok());
|
||||
assert!(is_active("tmp-prc").await);
|
||||
let _ = terminate_process("tmp-prc").await;
|
||||
}
|
||||
#[tokio::test]
|
||||
async fn isnt_active_check() {
|
||||
|
|
@ -257,7 +260,9 @@ mod process_unittests {
|
|||
}
|
||||
#[tokio::test]
|
||||
async fn is_frozen_check() {
|
||||
assert!(!is_frozen("systemd").await);
|
||||
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() {
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue