Skip to content

Commit

Permalink
Merge pull request #73 from Lind-Project/fix-ut-lind-fs-rmdir-nowrite…
Browse files Browse the repository at this point in the history
…perm-child-dir

fix: test case `ut_lind_fs_rmdir_nowriteperm_child_dir`
  • Loading branch information
JustinCappos authored Oct 24, 2024
2 parents 1a4d548 + b608a17 commit 709c4c1
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 @@ -2241,14 +2241,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 709c4c1

Please sign in to comment.