Skip to content

Commit

Permalink
Changed test_from temporal file size
Browse files Browse the repository at this point in the history
  • Loading branch information
okynos committed Apr 19, 2024
1 parent e879a3b commit 60e2e93
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/auditevent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,14 +629,18 @@ mod tests {
/*let parent = HashMap::<String, String>::from([
(String::from("name"), String::from("/tmp"))
]);*/

let mut test_file = fs::File::create("/tmp/auditevent_test_from.txt").unwrap();
test_file.write_all(b"Hello, world!").unwrap();

let paths = Vec::from([
HashMap::<String, String>::from([
(String::from("name"), String::from("/etc")),
(String::from("name"), String::from("/tmp")),
(String::from("nametype"), String::from("PARENT"))
]),
HashMap::<String, String>::from([
(String::from("nametype"), String::from("nametype")),
(String::from("name"), String::from("/etc")),
(String::from("name"), String::from("/tmp/auditevent_test_from.txt")),
(String::from("ogid"), String::from("ogid")),
(String::from("rdev"), String::from("rdev")),
(String::from("cap_fver"), String::from("cap_fver")),
Expand Down Expand Up @@ -680,9 +684,9 @@ mod tests {
assert_eq!(utils::get_hostname(), event.hostname);
assert_eq!(String::from("FIM"), event.node);
assert_eq!(String::from(config::VERSION), event.version);
assert_eq!(String::from("/etc"), event.path);
assert_eq!(String::from("etc"), event.file);
assert_eq!(4096, event.size);
assert_eq!(String::from("/tmp"), event.path);
assert_eq!(String::from("auditevent_test_from.txt"), event.file);
assert_eq!(13, event.size);
//assert_eq!(..., event.labels);
//assert_eq!(..., event.parent);
assert_eq!(String::from("nametype"), event.operation);
Expand Down Expand Up @@ -737,6 +741,8 @@ mod tests {
let event = Event::from(syscall, cwd, proctitle, paths.clone(), config.clone());
assert_eq!(String::from("bash"), event.proctitle);

remove_test_file("/tmp/auditevent_test_from.txt");

}
}

Expand Down

0 comments on commit 60e2e93

Please sign in to comment.