Skip to content
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

fix: test case ut_lind_fs_mkdir_using_symlink #79

Merged
merged 1 commit into from
Oct 25, 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
8 changes: 7 additions & 1 deletion src/tests/fs_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3218,7 +3218,9 @@ pub mod fs_tests {
let _thelock = setup::lock_and_init();

let cage = interface::cagetable_getref(1);

// Delete the files if it exists
let _ = cage.unlink_syscall("/symlinkFile");
let _ = cage.unlink_syscall("/originalFile");
// Create a file which will be referred to as originalFile
let fd = cage.open_syscall("/originalFile", O_CREAT | O_EXCL | O_WRONLY, S_IRWXA);
assert_eq!(cage.write_syscall(fd, str2cbuf("hi"), 2), 2);
Expand All @@ -3233,6 +3235,10 @@ pub mod fs_tests {
cage.mkdir_syscall("/symlinkFile", S_IRWXA),
-(Errno::EEXIST as i32)
);

// Clean up and finalize
assert_eq!(cage.unlink_syscall("/symlinkFile"), 0);
assert_eq!(cage.unlink_syscall("/originalFile"), 0);
assert_eq!(cage.exit_syscall(libc::EXIT_SUCCESS), libc::EXIT_SUCCESS);
lindrustfinalize();
}
Expand Down
Loading