Skip to content

Commit

Permalink
fix: test case ut_lind_fs_rmdir_nowriteperm_child_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
lind committed Oct 24, 2024
1 parent 039978e commit b608a17
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 @@ -2237,14 +2237,18 @@ pub mod fs_tests {
//because the directory cannot be removed if it does not allow
//write permission
let path = "/parent_dir_nwchild/dir";
// Remove the directory if it already exists
let _ = cage.rmdir_syscall("/parent_dir_nwchild/dir");
let _ = cage.rmdir_syscall("/parent_dir_nwchild");
assert_eq!(cage.mkdir_syscall("/parent_dir_nwchild", S_IRWXA), 0);
assert_eq!(cage.mkdir_syscall(path, S_IRWXA), 0);
assert_eq!(
cage.chmod_syscall(path, 0o400 | 0o040 | 0o004),
0
);
// Clean up the directories for clean environment
assert_eq!(cage.rmdir_syscall(path), 0);

assert_eq!(cage.rmdir_syscall("/parent_dir_nwchild"), 0);
assert_eq!(cage.exit_syscall(libc::EXIT_SUCCESS), libc::EXIT_SUCCESS);
lindrustfinalize();
}
Expand Down

0 comments on commit b608a17

Please sign in to comment.