Skip to content

Commit

Permalink
fix: test case ut_lind_fs_stat_file_complex (#77)
Browse files Browse the repository at this point in the history
Co-authored-by: lind <lind@nyu.edu>
  • Loading branch information
ChinmayShringi and lind authored Oct 25, 2024
1 parent 815991c commit 3fd6929
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tests/fs_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,8 @@ pub mod fs_tests {
let _thelock = setup::lock_and_init();

let cage = interface::cagetable_getref(1);
// Remove the file if it already exists
let _ = cage.unlink_syscall("/fooComplex");
let fd = cage.open_syscall("/fooComplex", O_CREAT | O_EXCL | O_WRONLY, S_IRWXA);

assert_eq!(cage.write_syscall(fd, str2cbuf("hi"), 2), 2);
Expand All @@ -2359,7 +2361,9 @@ pub mod fs_tests {
//check that they are the same and that the link count is 0
assert!(statdata == statdata2);
assert_eq!(statdata.st_nlink, 2);

// Clean up the file for a clean environment
assert_eq!(cage.unlink_syscall("/fooComplex"), 0);
assert_eq!(cage.unlink_syscall("/barComplex"), 0);
assert_eq!(cage.exit_syscall(libc::EXIT_SUCCESS), libc::EXIT_SUCCESS);
lindrustfinalize();
}
Expand Down

0 comments on commit 3fd6929

Please sign in to comment.