Skip to content

Commit

Permalink
Fix EEXIST Error in ut_lind_fs_dir_multiple Test by Removing Existi…
Browse files Browse the repository at this point in the history
…ng Directories Before Creation (#32)

* fix: test case ut_lind_fs_dir_multiple

* feat: updated to rmdir

---------

Co-authored-by: lind <[email protected]>
  • Loading branch information
ChinmayShringi and lind authored Sep 27, 2024
1 parent 197b681 commit 28a3346
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tests/fs_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,6 @@ pub mod fs_tests {
let _thelock = setup::lock_and_init();

let cage = interface::cagetable_getref(1);

assert_eq!(cage.mkdir_syscall("/subdirMultiple1", S_IRWXA), 0);
assert_eq!(
cage.mkdir_syscall("/subdirMultiple1/subdirMultiple2", S_IRWXA),
Expand Down Expand Up @@ -928,7 +927,10 @@ pub mod fs_tests {
0
);
assert_eq!(statdata.st_mode, S_IFDIR as u32);

// Cleanup: Remove the directories
assert_eq!(cage.rmdir_syscall("/subdirMultiple1/subdirMultiple2/subdirMultiple3"), 0);
assert_eq!(cage.rmdir_syscall("/subdirMultiple1/subdirMultiple2"), 0);
assert_eq!(cage.rmdir_syscall("/subdirMultiple1"), 0);
assert_eq!(cage.exit_syscall(libc::EXIT_SUCCESS), libc::EXIT_SUCCESS);
lindrustfinalize();
}
Expand Down

0 comments on commit 28a3346

Please sign in to comment.