Skip to content

Commit

Permalink
Adapted read_log test to new config
Browse files Browse the repository at this point in the history
  • Loading branch information
okynos committed Feb 7, 2025
1 parent 89c89e4 commit c5af171
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/logreader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ mod tests {
#[test]
fn test_read_log() {
if utils::get_os() == "linux" {
let cfg = AppConfig::new("linux", None);
let cfg = AppConfig::new("linux", Some("test/system/audit_config.yml"));
let (event, position) = read_log(String::from("test/unit/audit.log"),
cfg, 0, 0);

Expand Down Expand Up @@ -192,7 +192,7 @@ mod tests {
assert_eq!(event.paths[1]["cap_fe"], "0");
assert_eq!(event.paths[1]["cap_fver"], "0");
assert_eq!(event.paths[1]["cap_frootid"], "0");
assert_eq!(event.cwd, "/tmp");
assert_eq!(event.cwd, "/tmp/test");
assert_eq!(event.syscall, "257");
assert_eq!(event.ppid, "161880");
assert_eq!(event.comm, "sed");
Expand All @@ -218,7 +218,7 @@ mod tests {
assert_eq!(event.egid, "0");
assert_eq!(event.fsgid, "0");
assert_eq!(event.exe, "/usr/bin/sed");
assert_eq!(position, 845);
assert_eq!(position, 851);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/audit.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type=SYSCALL msg=audit(1659026449.689:6434): arch=c000003e syscall=257 success=yes exit=4 a0=ffffff9c a1=556150ee3c00 a2=c2 a3=180 items=2 ppid=161880 pid=161937 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=807 comm="sed" exe="/usr/bin/sed" key="fim"
type=CWD msg=audit(1659026449.689:6434): cwd="/tmp"
type=CWD msg=audit(1659026449.689:6434): cwd="/tmp/test"
type=PATH msg=audit(1659026449.689:6434): item=0 name="./" inode=1966138 dev=08:02 mode=040755 ouid=1000 ogid=0 rdev=00:00 nametype=PARENT cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(1659026449.689:6434): item=1 name="./sedTsutP7" inode=1972630 dev=08:02 mode=0100000 ouid=0 ogid=0 rdev=00:00 nametype=CREATE cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=PROCTITLE msg=audit(1659026449.689:6434): proctitle=736564002D6900737C68656C6C6F7C4849217C670066696C6531302E747874

0 comments on commit c5af171

Please sign in to comment.