Skip to content

Fix directory cleanup issue in ut_lind_fs_mmap_invalid_flags_both test case #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/tests/fs_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,10 @@ pub mod fs_tests {
assert_eq!(cage.getcwd_syscall(bufptr1, 9), 0);
assert_eq!(std::str::from_utf8(&buf1).unwrap(), "/subdir1\0");

// Cleanup: Remove the directories
assert_eq!(cage.rmdir_syscall("/subdir1/subdir2"), 0);
assert_eq!(cage.rmdir_syscall("/subdir1"), 0);

assert_eq!(cage.exit_syscall(libc::EXIT_SUCCESS), libc::EXIT_SUCCESS);
lindrustfinalize();
}
Expand All @@ -751,6 +755,8 @@ pub mod fs_tests {
assert_eq!(cage.chdir_syscall("/subdir2"), 0);
assert_eq!(cage.chdir_syscall("subdir1"), -(Errno::ENOENT as i32));

// Cleanup: Remove /subdir2
assert_eq!(cage.rmdir_syscall("/subdir2"), 0);
assert_eq!(cage.exit_syscall(libc::EXIT_SUCCESS), libc::EXIT_SUCCESS);
lindrustfinalize();
}
Expand Down Expand Up @@ -821,6 +827,10 @@ pub mod fs_tests {
assert_eq!(cage.getcwd_syscall(bufptr2, 17), 0);
assert_eq!(std::str::from_utf8(&buf2).unwrap(), "/subdir1/subdir2\0");

// Cleanup: Remove /subdir1/subdir2 and /subdir1 after the test
assert_eq!(cage.rmdir_syscall("/subdir1/subdir2"), 0);
assert_eq!(cage.rmdir_syscall("/subdir1"), 0);

assert_eq!(cage.exit_syscall(libc::EXIT_SUCCESS), libc::EXIT_SUCCESS);
lindrustfinalize();
}
Expand Down